Image GenerationQwen Image
Qwen Image
Qwen's v1 image generation with text-to-image, image-to-image, and image editing via task types.
POST /v2/images/generate — model: "qwen-image"
Qwen Image generates images from text prompts, transforms existing images, or edits images using the task_type parameter.
See Image Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Description |
|---|---|---|
qwenImageParams.task_type | string | Task type. Values: "text-to-image" (default), "image-to-image", "image-edit" |
qwenImageParams.image_url | string | Input image URL (required for image-to-image and image-edit) |
qwenImageParams.image_size | string | Output image size. Values: "square", "square_hd", "portrait_4_3", "portrait_16_9", "landscape_4_3", "landscape_16_9" |
qwenImageParams.negative_prompt | string | Negative text prompt, max 500 characters |
qwenImageParams.output_format | string | Output format. Values: "png", "jpeg" |
qwenImageParams.seed | integer | Seed for reproducibility |
qwenImageParams.num_inference_steps | integer | Number of inference steps (2–250) |
qwenImageParams.guidance_scale | number | Guidance scale (0–20) |
qwenImageParams.acceleration | string | Acceleration mode (Kie provider only). Values: "none", "regular", "high" |
qwenImageParams.strength | number | Image-to-image strength (0–1, image-to-image only) |
qwenImageParams.num_images | integer | Number of images (1–4, image-edit only, Kie provider only) |
Credit cost
| Credits per image |
|---|
| 6 |
The unit cost is multiplied by num_images (for image-edit task type) — e.g. requesting 4 images costs 6 × 4 = 24 credits.
Example result
Once the job is COMPLETED, the result object on GET /v2/jobs/:id looks like:
{
"images": [
"https://cdn2.apiframe.ai/images/a1b2c3d4-e5f6-7890-abcd-ef1234567890-1.png"
]
}images contains one URL per generated image when qwenImageParams.num_images is greater than 1.
See Result format for field details.
Code examples
curl -X POST https://api.apiframe.ai/v2/images/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic cityscape at sunset with flying vehicles",
"model": "qwen-image",
"qwenImageParams": {
"image_size": "landscape_16_9"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "A futuristic cityscape at sunset with flying vehicles",
"model": "qwen-image",
"qwenImageParams": {
"image_size": "landscape_16_9",
},
},
)
print(response.json())const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "A futuristic cityscape at sunset with flying vehicles",
model: "qwen-image",
qwenImageParams: { image_size: "landscape_16_9" },
}),
});
console.log(await response.json());Try it
POST
/v2/images/generateTry it