Skip to main content
POST
Submission returns a task_id. Retrieve the result through Query Task Status, or provide a callback_url to receive a completion notification.

Qwen Image 2.1 Generation

Use qwen-image-2.1 for text-to-image generation, multi-reference image editing, transparent assets, and local edits. Each request produces one image. Omit image_urls or pass an empty array for text-to-image. Provide 1–10 reference image URLs for image-to-image. Reference order matches references in your prompt, such as “the first image”. For stronger detail preservation, use four or fewer reference images.

Parameters

  • prompt is required, with non-empty text up to 5,000 characters.
  • image_urls accepts up to 10 publicly accessible HTTP(S) reference URLs. JPEG, PNG, and WebP are supported, up to 30MB and 25MP per image. Media limits are checked during generation.
  • size supports 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9, and 9:21. Reference-image requests also support auto. Defaults to 1:1 for text-to-image and auto for image-to-image.
  • resolution supports 1K (default) and 2K.
  • output_format supports png (default), webp, and jpeg.
  • prompt_extend controls prompt enhancement, enabled by default.
  • enable_safety_checker controls content safety checking, enabled by default.
  • background supports opaque (default) and transparent. Transparent output requires PNG or WebP.
  • mask_url accepts an HTTP(S) mask URL, used with exactly one reference image and an opaque background.
  • seed accepts an optional integer. Omit it to generate with a random seed.
Use size, prompt_extend, and enable_safety_checker as shown above. negative_prompt and multiple-image output parameters are not supported.

Text-to-Image

Multi-Reference Generation

Replace the example URLs with publicly accessible images.

Transparent Assets

Describe the subject only. Background, scene, or surface descriptions may prevent a transparent result. JPEG cannot carry transparency.

Mask Editing

White mask areas are edited; black areas stay unchanged. Use a mask with the same aspect ratio as the reference image; its dimensions are scaled to the reference. Exactly one reference image is required, and transparent backgrounds are unavailable in this mode. The output follows the reference image’s aspect ratio. size and prompt_extend are ignored when a mask is supplied.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required
Available options:
qwen-image-2.1
input
object
required
callback_url
string<uri>

Response

Task submitted successfully

code
integer
required
Example:

200

data
object
required