Docs / image / Qwen Image 2.1 Text to Image
Qwen Image 2.1 Text to Image online
Alibaba's Qwen Image 2.1 — the most affordable Qwen, with crisp in-image text at 1K or 2K and transparent backgrounds.
Rp Mulai Rp320 / gambar
qwen2-1/text-to-image model id
1 · Create a task
Kirim permintaan untuk membuat tugas generasi image. Wajib header Idempotency-Key. Saldo direservasi sebesar estimasi; task gagal tidak ditagih.
curl -X POST https://getrun.id/v1/tasks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: my-task-001" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen2-1/text-to-image",
"input": {
"prompt": "Create a horizontal 3:2 botanical art poster photographed directly from above. On a rich cobalt-blue matte surface, arrange fresh flowers into the exact readable phrase \"Kie AI\". The letters themselves are physical floral sculptures, not printed text and not typography placed over an image.\n\nBuild the letterforms from densely arranged coral-orange ranunculus, pale peach carnations, and small cream chrysanthemums. Use flower heads of different sizes to create deliberate thick and thin strokes while preserving clean, recognizable letter shapes. Preserve the exact capitalization: uppercase K, lowercase i and e, followed by a clear space, then uppercase A and I. Keep the counters and gaps open so the phrase reads immediately.\n\nMake the floral lettering the dominant central subject, occupying roughly two-thirds of the image width. Allow a few short stems and delicate leaves to extend naturally beyond the letter edges, with just three or four loose petals nearby. Maintain generous untouched blue space around the arrangement.\n\nUse directional morning sunlight from the upper left to reveal translucent petal edges, tightly layered blooms, and crisp but delicate shadows cast onto the blue surface. Combine the precision of a contemporary exhibition poster with the tactile beauty of real floral craftsmanship. Bold color contrast, elegant spacing, finely resolved botanical details.",
"background": "opaque",
"resolution": "1K",
"aspect_ratio": "3:2",
"output_format": "png"
}
}'const res = await fetch('https://getrun.id/v1/tasks', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Idempotency-Key': 'my-task-001',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "qwen2-1/text-to-image",
"input": {
"prompt": "Create a horizontal 3:2 botanical art poster photographed directly from above. On a rich cobalt-blue matte surface, arrange fresh flowers into the exact readable phrase \"Kie AI\". The letters themselves are physical floral sculptures, not printed text and not typography placed over an image.\n\nBuild the letterforms from densely arranged coral-orange ranunculus, pale peach carnations, and small cream chrysanthemums. Use flower heads of different sizes to create deliberate thick and thin strokes while preserving clean, recognizable letter shapes. Preserve the exact capitalization: uppercase K, lowercase i and e, followed by a clear space, then uppercase A and I. Keep the counters and gaps open so the phrase reads immediately.\n\nMake the floral lettering the dominant central subject, occupying roughly two-thirds of the image width. Allow a few short stems and delicate leaves to extend naturally beyond the letter edges, with just three or four loose petals nearby. Maintain generous untouched blue space around the arrangement.\n\nUse directional morning sunlight from the upper left to reveal translucent petal edges, tightly layered blooms, and crisp but delicate shadows cast onto the blue surface. Combine the precision of a contemporary exhibition poster with the tactile beauty of real floral craftsmanship. Bold color contrast, elegant spacing, finely resolved botanical details.",
"background": "opaque",
"resolution": "1K",
"aspect_ratio": "3:2",
"output_format": "png"
}
}),
});
const task = await res.json();import requests
res = requests.post(
"https://getrun.id/v1/tasks",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Idempotency-Key": "my-task-001",
},
json={
"model": "qwen2-1/text-to-image",
"input": {
"prompt": "Create a horizontal 3:2 botanical art poster photographed directly from above. On a rich cobalt-blue matte surface, arrange fresh flowers into the exact readable phrase \"Kie AI\". The letters themselves are physical floral sculptures, not printed text and not typography placed over an image.\n\nBuild the letterforms from densely arranged coral-orange ranunculus, pale peach carnations, and small cream chrysanthemums. Use flower heads of different sizes to create deliberate thick and thin strokes while preserving clean, recognizable letter shapes. Preserve the exact capitalization: uppercase K, lowercase i and e, followed by a clear space, then uppercase A and I. Keep the counters and gaps open so the phrase reads immediately.\n\nMake the floral lettering the dominant central subject, occupying roughly two-thirds of the image width. Allow a few short stems and delicate leaves to extend naturally beyond the letter edges, with just three or four loose petals nearby. Maintain generous untouched blue space around the arrangement.\n\nUse directional morning sunlight from the upper left to reveal translucent petal edges, tightly layered blooms, and crisp but delicate shadows cast onto the blue surface. Combine the precision of a contemporary exhibition poster with the tactile beauty of real floral craftsmanship. Bold color contrast, elegant spacing, finely resolved botanical details.",
"background": "opaque",
"resolution": "1K",
"aspect_ratio": "3:2",
"output_format": "png"
}
},
)
task = res.json()Input parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
seed |
integer | No | The same seed with the same prompt and parameters reproduces the same image on the same model version. The seed actually used is returned with the result. | 0 |
prompt |
string | Yes | Describe the image you want to generate. Any language is supported, up to 5000 characters. (max 5000 chars) | Create a horizontal 3:2 botanical art poster p |
background |
string | No | Background type. transparent outputs a PNG or WebP with a real alpha channel and cannot be used with JPEG. When using transparent, describe only the subject — prompts that mention a background, scene, surface, etc. may produce a non-transparent result. Opsi: opaque transparent |
opaque |
resolution |
string | No | Output resolution tier. Only 1K and 2K are supported. 2K takes noticeably longer to generate. Opsi: 1K 2K |
1K |
aspect_ratio |
string | No | Output aspect ratio. The actual pixel size also depends on the resolution tier. Opsi: 1:1 4:3 3:4 3:2 2:3 16:9 9:16 21:9 9:21 |
3:2 |
nsfw_checker |
boolean | No | A configurable parameter. Defaults to true in the Playground. | true |
output_format |
string | No | Output image format. JPEG has no alpha channel, so it cannot be combined with a transparent background. Opsi: png webp jpeg |
png |
enhance_prompt |
boolean | No | Rewrites the prompt into a fuller scene description before generating, which noticeably improves quality. Enabled by default (also when the parameter is omitted); pass false to turn it off. | true |
2 · Poll the result
Ambil status tugas hingga selesai — poll tiap 2–5 detik.
Respons saat sukses:
{
"id": "task_9f2c…",
"status": "succeeded",
"model": "qwen2-1/text-to-image",
"price": {
"currency": "IDR",
"estimated": 320,
"reserved": 320,
"final": 320
},
"output": {
"urls": [
"https://storage.getcore.id/outputs/task_9f2c…/0.png"
],
"expires_at": "(7 hari setelah selesai)"
}
}
Status values
| Status | Keterangan |
|---|---|
queued | Tugas sedang diantrikan. |
processing | Sedang diproses. |
succeeded | Berhasil. |
failed | Gagal — lihat error detail, tidak ditagih. |
image/png, dilayani dari CDN kami dan berlaku 7 hari — salin ke penyimpananmu sendiri untuk jangka panjang.Best practices
Bila generation gagal, task berstatus failed dengan error.code ternormalisasi (mis. moderation_blocked, upstream_error) dan price.final = 0 — saldo dikembalikan otomatis. Daftar lengkap kode error ada di Error handling. Selalu kirim Idempotency-Key unik per tugas agar retry aman.
Coba tanpa kode: jalankan model ini langsung dari Playground atau lihat di API Market.
