How to Use the Qwen Image 2.1 Pro Text to Image API: text to image integration guide (2026)
Learn how to call the Qwen Image 2.1 Pro Text to Image API on NamiFusion: parameters, pricing (from ≈$0.040) and runnable copy-paste code — try it in the playground first.
Qwen Image 2.1 Pro Text to Image is a text to image model by Alibaba: Generate 1–6 images from a text prompt, with optional prompt expansion and thinking mode. On NamiFusion you can try it in the playground (exact quote shown before you submit), then call it through one unified REST API — about $0.040 per typical run.
TL;DR
· Task type: text to image, provided by Alibaba
· Pricing: about $0.040 per typical run ($1 = 100 credits), pay-as-you-go
· Getting started: playground (exact quote before submit) → create an API key → one POST request
· Tunable parameters: 7 (see the table below)
· No platform watermark; commercial use allowed (per the Terms of Service)
What can you build with Qwen Image 2.1 Pro Text to Image?
Social media visuals and covers: batch-generate on-theme images and schedule them straight away.
E-commerce and ad creatives: product scenes, banner backgrounds, and multi-variant visuals for A/B tests.
Concept art and ideation: characters, environments and style boards, iterated cheaply and fast.
Pipeline chaining: outputs feed directly into image-to-video or face swap as source material.
How do you call this API?
- Sign up on NamiFusion and create a key on the API Keys page (signup bonus credits can only be used on selected models).
- Submit a task with the cURL example below, passing your key as a Bearer token.
- Poll the task status with the returned task_uuid and read the output URLs when completed.
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/alibaba/qwen-image-2.1-pro/text-to-image" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "A cinematic portrait of a young woman standing in a neon-lit rainy street in Shanghai at night, wearing a modern black trench coat and holding a transparent umbrella, realistic skin texture, dramatic reflections on wet pavement, soft rim lighting, detailed background signage, no text in the image, ultra-detailed, high contrast, professional photography style",
"n": 1,
"size": "2048*2048",
"prompt_extend": true,
"prompt_extend_mode": "direct",
"enable_thinking": true,
"seed": 12345
}
}'
# 2) Poll until status is "completed", then read the output URLs
curl "https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID" \
-H "Authorization: Bearer YOUR_API_KEY"What parameters does it take?
prompt (Prompt): required
n (Number of Images): optional, default 1
size (Size): optional
prompt_extend (Prompt Extend): optional, default true
prompt_extend_mode (Prompt Extend Mode): optional, default "direct"
enable_thinking (Thinking Mode): optional, default true
seed (Seed): optional
How do you write prompts for Qwen Image 2.1 Pro Text to Image?
- Subject first: lead with the actor and action, then add environment, lighting and style ("an astronaut sprinting through a neon street in the rain, cinematic, shallow depth of field").
- Concrete nouns beat stacked adjectives: "85mm portrait lens, golden-hour backlight" works far better than "very beautiful, ultra high quality".
- Change one variable per iteration: pin the seed to reproduce a result, tweak a single phrase at a time so you know what actually moved the output.
- State negatives positively: instead of "no blur", ask for "sharp focus, crisp details".
How much does it cost?
Pay-per-use in credits. About $0.040 per typical run ($1 = 100 credits); the exact price varies with parameters like resolution or duration, and the playground shows the exact quote before you submit.
Qwen Image 2.1 Pro Text to Image
alibaba/qwen-image-2.1-pro/text-to-image
Generate 1–6 images from a text prompt, with optional prompt expansion and thinking mode.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | true | — | Text prompt describing the desired image, supports Chinese and English; up to about 4500 tokens is recommended. Negative prompts are not supported, so state anything to avoid directly in the prompt (e.g. "no text in the image"). Ask for a transparent background, sticker or cutout and the model outputs a PNG with an alpha channel.; max 5000 characters |
n | integer | false | 1 | Generate 1-6 images per request, billed per successfully generated image [1, 6] |
size | string | false | — | Widthheight format. Total pixels from 512512 to 20482048, aspect ratio between 1:8 and 8:1. Recommended: 20482048 (1:1), 26881536 (16:9), 15362688 (9:16), 23681728 (4:3), 17282368 (3:4). Leave empty to let the model auto-select a resolution.; max 16 characters |
prompt_extend | boolean | false | true | Automatically expands and optimizes the prompt. Recommended; most useful for short prompts. |
prompt_extend_mode | string | false | "direct" | direct: direct prompt enhancement, suitable for most cases; agent: agent-based enhancement with finer rewriting direct, agent |
enable_thinking | boolean | false | true | Enhances reasoning to improve image quality at the cost of longer generation time. Only takes effect when Prompt Extend is on. |
seed | integer | false | — | For reproducibility, 0-2147483647. Leave empty for random. [0, 2.14748e+09] |
Pricing
$0.04 per successfully generated image (4 credits). Precharge = unit price × requested n; settlement uses the actual successful output image count. Input reference images, output size and prompt expansion add no charge. Default n=1.
size uses width*height; total pixels 512²–2048², aspect ratio 1:8–8:1. Omit size for automatic selection. Omit seed for random generation. enable_thinking only applies when prompt_extend=true.
Alibaba International standard USD list prices. USD 1 = 100 credits. Account discounts are applied separately.
API
curl -X POST https://www.namifusion.com/api/v1/marketplace/run/alibaba/qwen-image-2.1-pro/text-to-image \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"input": {
"n": 1,
"seed": 12345,
"size": "2048*2048",
"prompt": "A cinematic portrait of a young woman standing in a neon-lit rainy street in Shanghai at night, wearing a modern black trench coat and holding a transparent umbrella, realistic skin texture, dramatic reflections on wet pavement, soft rim lighting, detailed background signage, no text in the image, ultra-detailed, high contrast, professional photography style",
"prompt_extend": true,
"enable_thinking": true,
"prompt_extend_mode": "direct"
}
}'
curl 'https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID' \
-H "Authorization: Bearer $API_KEY"
Poll task_uuid until completed or failed. On success, output.images contains output URL strings.
FAQ
Can I try it for free first?+
Signup bonus credits can only be used on selected models, and eligibility may change. The playground shows the exact quote before submission.
Can I use the output commercially? Is there a watermark?+
Yes, outputs are yours to use commercially, and NamiFusion adds no platform watermark — subject to the Terms of Service and applicable law.
What is the content policy?+
Pornographic content, sexualized content involving a minor, unauthorized use of real people, deceptive impersonation, fraud and false endorsements are prohibited. Lawful, consensual, non-explicit adult themes may be permitted; see the Terms of Service.
How long does a Qwen Image 2.1 Pro Text to Image task take?+
It depends on parameters — images usually take seconds, videos tens of seconds to minutes. The API returns a task_uuid for polling.
What are the resolution and duration limits?+
See the parameter table above — each model lists its available resolution and duration options there and in the playground.