---
title: Prompt extension — Qwen-Image-2.1-Pro | Runware Docs
url: https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompt-extension
description: "How promptExtend works on Qwen-Image-2.1-Pro: what the LLM rewrite adds, how direct and agent differ, where thinking fits, and why an extended prompt breaks seeds."
---
### [Introduction](https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompt-extension#introduction)

Qwen-Image-2.1-Pro runs your prompt through an LLM before it generates, expanding a short description into a full one. The rewrite is **on unless you turn it off**, so the prompt in your request is usually not the prompt the model rendered.

The hero below came from six words, `a rooftop yoga class at sunrise`. Everything else in it was written by the rewrite:

![A yoga class on a city rooftop at sunrise, with an instructor holding her arms out and about a dozen students in different poses on mats, yoga blocks and water bottles beside them, and a skyline of brick buildings and water towers behind](https://runware.ai/docs/assets/output-hero.BR_Ozxp2_11Uw.jpg)

> **Prompt**: a rooftop yoga class at sunrise

The water-tower skyline, the size of the class, the yoga blocks, and the bottles beside the mats were never in the request. You get a finished scene from a one-line brief, and **every choice in it belongs to the rewrite**.

### [Request shape](https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompt-extension#request-shape)

Three settings control the rewrite. `promptExtend` **defaults to on**, `promptExtendMode` picks between `direct` and `agent`, and `thinking` lets the rewriting LLM **reason before it writes**:

**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: 'alibaba:qwen-image@2.1-pro',
  positivePrompt: 'a rooftop yoga class at sunrise',
  width: 2496,
  height: 1664,
  settings: {
    promptExtend: true,
    promptExtendMode: 'agent',
    thinking: true
  }
})
```

**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": "alibaba:qwen-image@2.1-pro",
            "positivePrompt": "a rooftop yoga class at sunrise",
            "width": 2496,
            "height": 1664,
            "settings": {
                "promptExtend": True,
                "promptExtendMode": "agent",
                "thinking": True
            }
        })

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",
      "taskUUID": "d9e826f2-de4f-4183-a787-eaeaa8169192",
      "model": "alibaba:qwen-image@2.1-pro",
      "positivePrompt": "a rooftop yoga class at sunrise",
      "width": 2496,
      "height": 1664,
      "settings": {
        "promptExtend": true,
        "promptExtendMode": "agent",
        "thinking": true
      }
    }
  ]'
```

**CLI**:

```bash
runware run alibaba:qwen-image@2.1-pro \
  positivePrompt="a rooftop yoga class at sunrise" \
  width=2496 \
  height=1664 \
  settings.promptExtend=true \
  settings.promptExtendMode=agent \
  settings.thinking=true
```

**JSON**:

```json
{
  "taskType": "imageInference",
  "taskUUID": "d9e826f2-de4f-4183-a787-eaeaa8169192",
  "model": "alibaba:qwen-image@2.1-pro",
  "positivePrompt": "a rooftop yoga class at sunrise",
  "width": 2496,
  "height": 1664,
  "settings": {
    "promptExtend": true,
    "promptExtendMode": "agent",
    "thinking": true
  }
}
```

> [!WARNING]
> Two combinations are rejected. `thinking` belongs to the rewrite, so sending it with `promptExtend: false` fails. And `agent` is text-to-image only: a request that carries `inputs.referenceImages` must use `direct`.

### [What the rewrite adds](https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompt-extension#what-the-rewrite-adds)

Both images below came from `a hotel lobby`. The only difference is whether the rewrite ran:

![A hotel lobby with beige marble floors and walls, a wooden reception desk, a sofa with two armchairs, and a gold ceiling fixture](https://runware.ai/docs/assets/output-extend-off.DTssmsXS_vajIL.jpg)

*Extension off*

> **Prompt**: a hotel lobby

![A hotel lobby with a dark marble reception desk under a wall sign reading THE GRANDVIEW HOTEL, a crystal chandelier, a curved staircase, a large potted tree, and a lounge by tall windows](https://runware.ai/docs/assets/output-extend-on.DoUsdj-M_ZlQoMi.jpg)

*Extension on*

> **Prompt**: a hotel lobby

Both are lobbies. With the rewrite on you get **a scene the rewrite decided you meant**, with its own materials, lighting, furniture, and time of day.

The rewrite adds subjects, and added subjects can carry **text and branding nobody requested**. The extended render has a hotel name and a crest on the wall behind the desk. Check for that before an extended image goes anywhere commercial.

### [`direct` and `agent`](https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompt-extension#direct-and-agent)

`promptExtendMode` picks the rewriting strategy: `direct`, the default, or `agent`. Both images came from `a launch ad for wireless headphones`:

![A headphone ad with the headline BEYOND SOUND beside black over-ear headphones on a rock at sunset, four feature icons, and a PRE-ORDER NOW bar](https://runware.ai/docs/assets/output-mode-direct.ggd7BE4O_1yfxky.jpg)

*direct*

> **Prompt**: a launch ad for wireless headphones

![A headphone ad titled AURA PRO with silver and black over-ear headphones in the center, six feature callouts, three color swatches, a PRE-ORDER NOW button, and a $399 price](https://runware.ai/docs/assets/output-mode-agent.BwPk3rnd_Z1q0Bxq.jpg)

*agent*

> **Prompt**: a launch ad for wireless headphones

Both modes turned six words into a finished ad, and **every word in both ads was invented by the rewrite**: a brand, a headline, feature claims, a pre-order button. The `agent` render goes further into specifics, with a model name, a $399 price, a ship date, and certification badges.

Treat an extended ad as a layout proposal. When the image is meant to ship, **put the real name and price in the prompt**, in quotes, so the rewrite has nothing left to make up.

### [Thinking](https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompt-extension#thinking)

This setting gives the rewriting LLM a reasoning pass before it writes the expanded prompt, at the cost of **longer generation time**. Both images below used `agent` on `an infographic showing the five steps to repot a houseplant`:

![An infographic titled 5 Steps to Repot a Houseplant with five numbered illustrated steps from removing the plant to watering it, and a Pro Tips sidebar](https://runware.ai/docs/assets/output-thinking-off.CK3YxW6D_2mR8JY.jpg)

*agent without thinking*

> **Prompt**: an infographic showing the five steps to repot a houseplant

![An infographic titled How to Repot a Houseplant with five numbered illustrated steps, a Signs It's Time to Repot panel, a Tools You Need panel, and a Post-Repotting Care strip](https://runware.ai/docs/assets/output-thinking-on.CRpVVOg3_Z1Blvmn.jpg)

*agent with thinking*

> **Prompt**: an infographic showing the five steps to repot a houseplant

Both renders deliver five numbered steps in a workable order, plus side panels neither request asked for. On a brief like this one, `agent` **already plans the content without the thinking pass**, so the extra time buys little. Compare a pair on your own prompts before paying for it on every call.

### [Extension on an edit](https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompt-extension#extension-on-an-edit)

The rewrite also runs on edits. The source below is a summer listing photo, and both edits used the instruction `make it winter`:

![A white two-story house with a red front door, a covered porch, a green lawn, and leafy maple trees under a blue sky](https://runware.ai/docs/assets/source-house.BNMEBnp2_Z17oBSn.jpg)

*Source*

> **Prompt**: A real estate listing photograph of a two-story suburban family house in summer. White painted wood siding, a dark gray shingle roof, black window frames, a covered front porch with two wooden rocking chairs, and a red front door. A neatly mowed green lawn and a paved driveway lead to the house, with leafy green maple trees on either side. Bright midday sun, clear blue sky. Straight-on exterior shot from the sidewalk, photoreal real estate photography, no people, no text.

![The same house under snow with bare trees, a snow-covered roof and lawn, and the front path still visible](https://runware.ai/docs/assets/output-edit-extend-off.Bw7FDn8T_Z1gY6Sk.jpg)

*Extension off*

> **Prompt**: make it winter

![The same house under heavier snow that also covers the front path and the street, with bare trees](https://runware.ai/docs/assets/output-edit-extend-on.j_K-3wNy_6DKD3.jpg)

*Extension on*

> **Prompt**: make it winter

Both edits changed the season and kept the house. With extension on, the snow also buries the path and the road: **the rewrite decided how much winter you meant**. On an edit the source image holds the subject in place, so what the rewrite changes is degree. State the degree in the instruction when it matters, or turn extension off.

### [Extension and reproducibility](https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompt-extension#extension-and-reproducibility)

With extension off, a fixed `seed` returns the same image on every call, as [Prompting](https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompting#seeds-and-repeatability) shows. Turn extension on, keep the seed and the prompt identical, and two calls diverge:

![A woman with short silver hair and tortoiseshell glasses in a black sweater, photographed head and shoulders against a light gray backdrop](https://runware.ai/docs/assets/output-seed-extended-a.DcUYtyO8_1dMki7.jpg)

*seed 52817 with extension, first call*

> **Prompt**: A professional headshot of an architect in her forties for a firm's team page. Short silver-gray hair, round tortoiseshell glasses, a black crew-neck sweater. Head and shoulders, turned slightly to the left, relaxed confident smile, looking at the camera. Plain light gray backdrop, soft window light from the left. Photoreal corporate portrait photography, shallow depth of field, no text.

![A different silver-haired woman in tortoiseshell glasses and a black sweater, wearing a gold pendant and standing beside a window](https://runware.ai/docs/assets/output-seed-extended-b.BFgjZB-N_ELyoA.jpg)

*seed 52817 with extension, second call*

> **Prompt**: A professional headshot of an architect in her forties for a firm's team page. Short silver-gray hair, round tortoiseshell glasses, a black crew-neck sweater. Head and shoulders, turned slightly to the left, relaxed confident smile, looking at the camera. Plain light gray backdrop, soft window light from the left. Photoreal corporate portrait photography, shallow depth of field, no text.

Same brief, two different people. **The rewrite is not covered by your seed**, so it writes a fresh prompt on every call, and the seed then locks the noise for a description that keeps moving. For a team page that needs a retake of one person, that makes the seed useless.

```json
"settings": {
  "promptExtend": false
}
```

That block is the whole fix. Anything that has to be repeatable, whether a regression test or a client revision, **needs extension off**.

### [Tips](https://runware.ai/docs/models/alibaba-qwen-image-2-1-pro/guides/prompt-extension#tips)

1. **Leave it on for exploration.** A short prompt with `agent` is a fast way to find a direction you would not have written.
    
2. **Turn it off before you commit.** Once the composition matters, extension is a second author working from a copy of your brief.
    
3. **Test the thinking pass before you rely on it.** On a structured brief, `agent` produced the same five-step layout with and without it, and the pass adds generation time.
    
4. **Check extended outputs for invented copy.** The rewrite adds brand names and prices on its own, which is a problem for anything meant to ship.
    
5. **Keep the default mode on anything with references.** `agent` is rejected as soon as the request carries `inputs.referenceImages`.