---
title: "Steps: Controlling refinement in image generation | Runware Docs"
url: https://runware.ai/docs/learn/steps
description: How the steps parameter controls the iterative refinement process, with architecture-specific ranges and speed vs quality tradeoffs.
relatedDocuments:
  - https://runware.ai/docs/learn/text-to-image
  - https://runware.ai/docs/learn/schedulers
  - https://runware.ai/docs/learn/denoising
---
## Introduction

The `steps` parameter defines **how many iterations the model performs** during generation. Each step is one pass of the [denoising](https://runware.ai/docs/learn/denoising) loop, gradually turning noise into a coherent image. More steps generally mean more detail, but with diminishing returns and longer generation times.

This parameter appears across all generation tasks (text-to-image, image-to-image, inpainting, and outpainting) and its behavior is consistent: higher step counts produce more refined output at the cost of speed.

## How steps work

In diffusion-based models, each step removes a portion of noise from the image. In flow-matching models (like FLUX and Z-Image), each step moves the output along a learned trajectory from noise to data. Regardless of the internal mechanism, the progression follows the same pattern:

> **Prompt**: A giant jellyfish floats through a sunlit canyon, its tendrils trailing softly across the rock walls as dust dances in the air

**Steps: 1**

![A barely visible jellyfish shape in a sunlit canyon at 1 step](https://runware.ai/docs/assets/steps-1.DvZdIYg__Z1ouNTt.jpg)

*Generation time: 0.884s The structure can barely be seen*

**Steps: 5**

![A rough jellyfish shape in a sunlit canyon at 5 steps](https://runware.ai/docs/assets/steps-5.B885sxPq_U4b9N.jpg)

*Generation time: 0.945s Structure completed but overall very poor quality*

**Steps: 10**

![A jellyfish in a sunlit canyon at 10 steps, improving but with artifacts](https://runware.ai/docs/assets/steps-10.BMMoLgqS_22n4LM.jpg)

*Generation time: 1.631s Better, but still with artifacts*

**Steps: 15**

![A jellyfish in a sunlit canyon at 15 steps, nearly complete](https://runware.ai/docs/assets/steps-15.BpHwY2ee_OHPkB.jpg)

*Generation time: 1.817s It's almost there. This image can be used*

**Steps: 20**

![A detailed jellyfish in a sunlit canyon at 20 steps](https://runware.ai/docs/assets/steps-20.C1LV8y8T_Dc1Ia.jpg)

*Generation time: 2.140s Small details are appearing and turning the image into a high-quality one*

**Steps: 50**

![A highly detailed jellyfish in a sunlit canyon at 50 steps with refined lighting](https://runware.ai/docs/assets/steps-50.CkHePuKI_1eSwTk.jpg)

*Generation time: 3.092s Details such as lighting are better achieved at the cost of longer inference time*

The generation process follows these phases:

- **Early steps** (1-5): Establish basic composition, rough shapes, and color distribution.
- **Middle steps** (5-15): Form recognizable objects, define spatial relationships, and develop textures.
- **Later steps** (15-30): Refine details, enhance coherence, and develop subtle lighting.
- **Final steps** (30+): Polish fine details and smooth transitions, with increasingly subtle changes.

## Request structure

The `steps` parameter is a number passed at the top level of your generation request.

**TypeScript**:

```typescript
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: 'A giant jellyfish floating through a sunlit canyon',
  steps: 30,
  width: 1024,
  height: 1024
})
```

**Python**:

```python
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": "A giant jellyfish floating through a sunlit canyon",
            "steps": 30,
            "width": 1024,
            "height": 1024
        })

asyncio.run(main())
```

**cURL**:

```bash
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "imageInference",
      "model": "<model-air>",
      "positivePrompt": "A giant jellyfish floating through a sunlit canyon",
      "steps": 30,
      "width": 1024,
      "height": 1024
    }
  ]'
```

**CLI**:

```bash
runware run "<model-air>" \
  positivePrompt="A giant jellyfish floating through a sunlit canyon" \
  steps=30 \
  width=1024 \
  height=1024
```

**JSON**:

```json
{
  "taskType": "imageInference",
  "model": "<model-air>",
  "positivePrompt": "A giant jellyfish floating through a sunlit canyon",
  "steps": 30,
  "width": 1024,
  "height": 1024
}
```

## Recommended ranges by architecture

Different model architectures have different sweet spots for step count:

| Architecture | Steps | Notes |
| --- | --- | --- |
| **Krea 2 Raw** | 1–100 |  |
| **Krea 2 Turbo** | 1–100 |  |
| **Z Image** | 1–50 | Flow-matching architecture, 20 to 30 steps |
| **Z Image Turbo** | 1–50 | Speed-optimized variant, 4 to 8 steps |
| **FLUX.1 \[dev\]** | 1–100 | Diminishing returns above 30 |
| **FLUX.1 \[schnell\]** | 1–100 | Guidance-distilled for fast generation, 4 to 8 steps |
| **FLUX.1 Kontext \[dev\]** | 1–100 |  |
| **Stable Diffusion XL** | 1–100 | Good results around 25 steps with DPM++ 2M Karras |
| **Stable Diffusion XL Lightning** | 1–12 | Distilled for speed, and the ceiling is low because of it |
| **Stable Diffusion XL Turbo** | 1–100 |  |
| **Stable Diffusion 1.5** | 1–100 | Trained at 512px. Benefits from higher steps for detail, 20 to 40 in practice |
| **Illustrious XL** | 1–100 |  |
| **NoobAI XL** | 1–100 |  |
| **Pony Diffusion XL** | 1–100 |  |

> [!NOTE]
> Model distillation
> 
> Some models are created through **knowledge distillation**, where a smaller, faster model is trained to mimic a larger one. Distilled architectures like LCM (Latent Consistency Model) or FLUX Schnell can produce high-quality images in **4-8 steps** compared to the 20-30 steps their non-distilled counterparts need. This makes them ideal for **real-time or batch applications** where speed is critical, though they may occasionally trade some detail quality for this efficiency.

## Steps in image-to-image tasks

In [image-to-image](https://runware.ai/docs/learn/image-to-image), [inpainting](https://runware.ai/docs/learn/image-inpainting), and [outpainting](https://runware.ai/docs/learn/image-outpainting), the `steps` parameter interacts with `strength`. The model doesn't run all the steps. It starts partway through the [denoising](https://runware.ai/docs/learn/glossary#denoising) schedule based on the strength value.

For example, with `steps: 40` and `strength: 0.5`, the model only performs the last 20 steps. This means **higher step counts become more important at lower strengths**, since fewer actual steps are used for refinement.

## Scheduler interaction

The choice of [scheduler](https://runware.ai/docs/learn/schedulers) affects how much value you get from additional steps:

- **Fast-converging schedulers** (Euler, UniPC, LCM): Reach good quality at 15-25 steps. Extra steps add little.
- **Detail-oriented schedulers** (DPM++ 3M, DPM++ 2M SDE): Continue refining up to 40-50 steps.
- **Stochastic schedulers** (Euler Ancestral, DPM++ SDE): Don't converge. More steps produce different results, not necessarily better ones.

## Tips

1. **Start at 25-30 steps for standard models.** This hits the sweet spot for most SD 1.5, SDXL, and FLUX models. Only go higher if you see visible improvement.
2. **Use 4-8 steps for distilled models.** LCM, Lightning, Schnell, and similar architectures are designed for low step counts. Running them at 30 steps wastes compute.
3. **Increase steps when using low strength.** In image-to-image at `strength: 0.3`, a step count of 50 gives you ~15 actual refinement steps, while 20 would give you only ~6.
4. **Match steps to your scheduler.** A fast scheduler like Euler at 15 steps is great for prototyping. Switch to DPM++ 2M Karras at 30 steps for final renders.
5. **Profile your use case.** In batch processing, cutting from 30 to 20 steps can halve your costs with minimal quality loss. Test and find your acceptable threshold.