Text to image: Turning words into pictures with AI
The foundational pipeline: generate images from text prompts using diffusion models, with control over every step of the process.
Introduction
Text-to-image generation transforms textual descriptions into visual content, allowing you to create images from just words. While the concept is simple, understanding the various parameters and how they interact gives you precise control over your results.

A floating island with waterfalls, pink trees, and a glowing button in front of a dark screen, surrounded by clouds. Fantasy digital art, cinematic lighting, vibrant colors
This page covers the core pipeline, how text becomes an image, how to structure requests, and how to choose the right model. For deep dives into individual parameters, each one has its own concept page linked below.
Basic request example
Here's a simple text-to-image request to get you started:
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: '<model-air>',
positivePrompt: 'An astronaut floating inside a giant hourglass in space, surrounded by stars and glowing dust, with galaxies swirling faintly above and golden sand below. Dreamy, surreal, cinematic',
width: 1024,
height: 1024,
steps: 30
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "<model-air>",
"positivePrompt": "An astronaut floating inside a giant hourglass in space, surrounded by stars and glowing dust, with galaxies swirling faintly above and golden sand below. Dreamy, surreal, cinematic",
"width": 1024,
"height": 1024,
"steps": 30
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "imageInference",
"taskUUID": "a770f077-f413-47de-9dac-be0b26a35da6",
"model": "<model-air>",
"positivePrompt": "An astronaut floating inside a giant hourglass in space, surrounded by stars and glowing dust, with galaxies swirling faintly above and golden sand below. Dreamy, surreal, cinematic",
"width": 1024,
"height": 1024,
"steps": 30
}
]'runware run "<model-air>" \
positivePrompt="An astronaut floating inside a giant hourglass in space, surrounded by stars and glowing dust, with galaxies swirling faintly above and golden sand below. Dreamy, surreal, cinematic" \
width=1024 \
height=1024 \
steps=30{
"taskType": "imageInference",
"taskUUID": "a770f077-f413-47de-9dac-be0b26a35da6",
"model": "<model-air>",
"positivePrompt": "An astronaut floating inside a giant hourglass in space, surrounded by stars and glowing dust, with galaxies swirling faintly above and golden sand below. Dreamy, surreal, cinematic",
"width": 1024,
"height": 1024,
"steps": 30
}Response
{
"data": [
{
"taskType": "imageInference",
"imageUUID": "ca6b2d39-5f83-47b9-b22b-71f9afc935e8",
"taskUUID": "a770f077-f413-47de-9dac-be0b26a35da6",
"seed": 9202427981074766178,
"imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/ca6b2d39-5f83-47b9-b22b-71f9afc935e8.jpg"
}
]
}How text-to-image works
Text-to-image generation converts textual descriptions into visual content through a multi-stage process where the model gradually constructs an image based on your prompt. At its core, the process involves three key phases:
-
Text understanding: The input prompt is processed by a text encoder that converts natural language into a numerical representation called embeddings. These embeddings capture the semantic meaning, conceptual relationships, and stylistic cues present in your text.
-
Latent space generation: Rather than manipulating raw pixels, modern systems operate in a latent space, which is an abstract, compressed representation of images. Most advanced models use a diffusion process, which begins with random noise and gradually refines it into a meaningful image. This denoising is guided by your text embeddings and carried out by a neural network, typically a U-Net or a Transformer-based architecture like DiT. Some models follow an autoregressive approach generating images token by token.
-
Image decoding: The final latent representation is converted into a pixel-based image using a decoder, often part of a Variational Autoencoder (VAE). This step handles texture, color, and fine detail, producing the full-resolution image you see.
Together, these phases enable AI to generate images that closely match the meaning and style of your original prompt.
Model selection
The model parameter specifies which model generates the image, and it is the single choice that changes the result most. It sets the aesthetic, how your prompt is read, and which of the parameters below have any effect at all.
Models are grouped into architecture families, and a family decides more than a fine-tune does. Two models in the same family respond to the same steps and CFGScale ranges, while two models in different families often do not share a parameter at all. Each model's API reference lists what it accepts.
Browse the catalog in the model finder, which stays current as models ship.

A fierce female warrior with intricate silver armor reflecting warm sunset light, holding a glowing sword with runes carved into the blade, standing on a rocky cliff overlooking a vast fantasy valley, wind blowing through her dark hair, cinematic atmosphere

A fierce female warrior with intricate silver armor reflecting warm sunset light, holding a glowing sword with runes carved into the blade, standing on a rocky cliff overlooking a vast fantasy valley, wind blowing through her dark hair, cinematic atmosphere
The same prompt, the same parameters, two different models. Nothing changed except the model field.
You can also search the catalog programmatically with the Model Search API.
Generation parameters
Every parameter in the request controls a different aspect of the generation process. Each one has its own concept page with visual examples and detailed guidance:
| Parameter | What it controls | Concept page |
|---|---|---|
positivePrompt / negativePrompt | What to generate and what to avoid | Prompts |
width / height | Canvas size and aspect ratio | Dimensions |
steps | Number of refinement iterations | Steps |
CFGScale | How strictly the model follows your prompt | CFG Scale |
scheduler | Denoising algorithm (speed vs quality) | Schedulers |
seed | Deterministic starting point for reproducibility | Seed |
vae | Visual decoder for the final image | VAE |
clipSkip | Text encoder layer selection | CLIP Skip |
Advanced features
These features extend text-to-image with additional conditioning and control:
| Feature | What it does | Concept page |
|---|---|---|
| LoRAs | Lightweight style/subject adapters that modify a base model | LoRAs |
| ControlNet | Structural guidance via edge maps, depth maps, and pose detection | ControlNet |
| IP Adapters | Reference image conditioning for style transfer and subject consistency | IP Adapters |
| Embeddings | Custom text tokens for specialized concepts | Embeddings |
| Refiner | Two-stage generation for enhanced detail | Refiner |