> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Text to image

> Generate images from a Chinese or English prompt: prompt writing, common parameters and request samples.

For text-to-image, `input.messages` holds one `user` message whose `content` is a single `{"text": "..."}`. Prompts can be Chinese or English, ideally under 4,500 tokens; other languages may work but are not guaranteed.

## Writing prompts

* **Subject and scene**: say what is in the picture, where and what it is doing; specific counts and positions are followed more accurately.
* **Style and light**: photorealistic, watercolor, 3D render; early-morning backlight, soft natural light, neon night.
* **Composition and camera**: close-up, top-down, wide angle, where to leave empty space.
* **Text in the image**: put the words in quotes and give their position, font, color or material, e.g. "the words 'Full Moon, Family Reunion' in gold calligraphy in the center".
* **What to avoid**: put it in `parameters.negative_prompt`, e.g. "low resolution, misspelled text, blurry".

## Request

A 16:9 poster with Chinese text. The prompt is already detailed, so `prompt_extend` is off to follow it literally and save time. `$DREAMTO_API_KEY` is your API Key.

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/api/v1/services/aigc/multimodal-generation/generation" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-3.0",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "text": "A Mid-Autumn Festival poster: a golden full moon in a deep blue night sky above the eaves and stone bridge of a water town, the words \"Full Moon, Family Reunion\" in gold calligraphy in the center and a small line \"Mid-Autumn 2026\" at the bottom"
            }
          ]
        }
      ]
    },
    "parameters": {
      "negative_prompt": "low resolution, misspelled text, blurry, watermark",
      "size": "1664*928",
      "prompt_extend": false
    }
  }'
```

```python Python theme={null}
import os

import requests

URL = "https://api.dreamto.ai/api/v1/services/aigc/multimodal-generation/generation"
HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}

payload = {
    "model": "qwen-image-3.0",
    "input": {
        "messages": [
            {
                "role": "user",
                "content": [
                    {
                        "text": "A Mid-Autumn Festival poster: a golden full moon in a deep blue night sky above the eaves and stone bridge of a water town, the words \"Full Moon, Family Reunion\" in gold calligraphy in the center and a small line \"Mid-Autumn 2026\" at the bottom"
                    }
                ]
            }
        ]
    },
    "parameters": {
        "negative_prompt": "low resolution, misspelled text, blurry, watermark",
        "size": "1664*928",
        "prompt_extend": False
    }
}

result = requests.post(URL, headers=HEADERS, json=payload, timeout=300).json()
if "output" not in result:
    raise SystemExit(result)
for item in result["output"]["choices"][0]["message"]["content"]:
    print(item["image"])
```

`output.choices[0].message.content[].image` holds the image links (PNG, valid for 24 hours) and `usage` the billed quantities:

```json theme={null}
{
  "request_id": "req_7c1e9a4b2d3f5a6b8c9d0e1f",
  "output": {
    "choices": [
      {
        "finish_reason": "stop",
        "message": {
          "role": "assistant",
          "content": [
            {
              "type": "image",
              "image": "https://dashscope-463f.oss-accelerate.aliyuncs.com/1d/bd/20261117/2299ae9b/qwen_image3_serving_output_0.png?Expires=1794997226&Signature=..."
            }
          ]
        }
      }
    ],
    "rewrite_status": "not_use"
  },
  "usage": {
    "output_width": 1024,
    "output_height": 1024,
    "input_image_count": 0,
    "input_image_type": "qima_input_1k",
    "output_image_count": 1,
    "output_image_type": "qima_output_1k"
  }
}
```

## Common parameters

| Parameter | Description |
| - | - |
| `size` | `WIDTH*HEIGHT`, e.g. `1328*1328` or `1664*928`; when omitted the model picks a size from the prompt. See [Sizes and billing tiers](https://docs.dreamto.ai/en/image/models/qwen-image-3-0/size-and-billing.md) |
| `n` | Images per request, 1–6, default 1, billed per image |
| `negative_prompt` | Negative prompt: what should not appear |
| `prompt_extend` | Smart prompt rewriting, default `true`; see [Prompt rewriting](https://docs.dreamto.ai/en/image/models/qwen-image-3-0/prompt-rewriting.md) |
| `seed` | Random seed `0`–`2147483647`; the same parameters and seed give steadier results |
| `watermark` | Whether to add a watermark, default `false` |

See [Create image](https://docs.dreamto.ai/en/api-reference/qwen-image-3-0/create-image.md) for every field.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.