Build with Qwen 2.1
Make your first request
Use your Sorceress API key on your server. The playground uses your signed-in account; your application uses the same model with an API key.
curl -X POST 'https://sorceress.games/api/v1/jobs' \
-H 'Authorization: Bearer $SORCERESS_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "qwen2-1-image-to-image",
"input": {
"background": "opaque",
"resolution": "1K",
"aspect_ratio": "auto",
"output_format": "png",
"enhance_prompt": true,
"image_urls": "<image_urls>",
"prompt": "<prompt>"
}
}'Inputs & settings
seedintegerThe random seed. Omit it to generate with a random seed. Passing the same seed together with the same prompt and parameters reproduces the same image within the same service version.
promptstringRequiredThe prompt describing the result you want. Required. Any language is supported, up to 5000 characters; if it is longer, the request is rejected. When `mask_url` is supplied, use it to describe what should be generated inside the white area of the mask.
mask_urlstringInpainting mask that switches the request into local-edit mode. A black and white image where **white marks the area to change and black is kept unchanged**, with a few pixels of feathering along the boundary. It must be used with exactly one entry in `image_urls`, otherwise the request is rejected. The mask should have the same aspect ratio as that reference image; a mask of a different size is scaled to it. In local-edit mode the output ratio follows the reference image, so `aspect_ratio` and `enhance_prompt` are ignored. It cannot be combined with `background: transparent`; such a request is rejected.
backgroundstringBackground 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.
Options: opaque, transparent
image_urlsarrayRequiredReference images, given as an array of 1 to 10 http(s) URLs. Required. The order of the array is the order the prompt refers to ("the first image", "the second image"). JPEG, PNG and WebP are supported, up to 30MB and 25MP each, and every URL must be directly retrievable with a GET. If an image URL cannot be fetched, the task fails with failCode 400. With more than 10 entries the request is rejected. The more references you supply the less detail each individual one keeps, so stay within 4 when fidelity matters. When combining several people or objects into a single picture, a landscape ratio such as `3:2` or `16:9` usually gives better results.
resolutionstringOutput resolution tier. `1K` is the faster option; `2K` produces four times the pixels and takes considerably longer, up to about 3 minutes with reference images. Only `1K` and `2K` are accepted — with any other value, including `4K`, the request is rejected.
Options: 1K, 2K
aspect_ratiostringOutput aspect ratio. Defaults to `auto`, which takes the aspect ratio of the first reference image and snaps it to the nearest supported ratio. The actual pixel size also depends on `resolution`. Ignored in local-edit mode.
Options: auto, 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9, 9:21
nsfw_checkerbooleanDefaults to false. When false, no additional content filtering is applied and results are returned directly by the model.
output_formatstringOutput image format. `png` (default) and `webp` both carry an alpha channel and can be used with `background: transparent`. `jpeg` has no alpha channel and cannot be combined with a transparent background.
Options: png, webp, jpeg
enhance_promptbooleanRewrites 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.
Full input schema
{
"type": "object",
"required": [
"image_urls",
"prompt"
],
"properties": {
"seed": {
"type": "integer",
"title": "Seed",
"description": "The random seed. Omit it to generate with a random seed. Passing the same seed together with the same prompt and parameters reproduces the same image within the same service version."
},
"prompt": {
"type": "string",
"title": "Prompt",
"maxLength": 5000,
"minLength": 1,
"description": "The prompt describing the result you want. Required. Any language is supported, up to 5000 characters; if it is longer, the request is rejected. When `mask_url` is supplied, use it to describe what should be generated inside the white area of the mask."
},
"mask_url": {
"type": "string",
"title": "Mask URL",
"format": "uri",
"x-media": "image",
"description": "Inpainting mask that switches the request into local-edit mode. A black and white image where **white marks the area to change and black is kept unchanged**, with a few pixels of feathering along the boundary. It must be used with exactly one entry in `image_urls`, otherwise the request is rejected. The mask should have the same aspect ratio as that reference image; a mask of a different size is scaled to it. In local-edit mode the output ratio follows the reference image, so `aspect_ratio` and `enhance_prompt` are ignored. It cannot be combined with `background: transparent`; such a request is rejected."
},
"background": {
"enum": [
"opaque",
"transparent"
],
"type": "string",
"title": "Background",
"default": "opaque",
"description": "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."
},
"image_urls": {
"type": "array",
"items": {
"type": "string",
"format": "uri"
},
"title": "Image URLs",
"x-media": "image",
"maxItems": 10,
"minItems": 1,
"description": "Reference images, given as an array of 1 to 10 http(s) URLs. Required. The order of the array is the order the prompt refers to (\"the first image\", \"the second image\"). JPEG, PNG and WebP are supported, up to 30MB and 25MP each, and every URL must be directly retrievable with a GET. If an image URL cannot be fetched, the task fails with failCode 400. With more than 10 entries the request is rejected. The more references you supply the less detail each individual one keeps, so stay within 4 when fidelity matters. When combining several people or objects into a single picture, a landscape ratio such as `3:2` or `16:9` usually gives better results."
},
"resolution": {
"enum": [
"1K",
"2K"
],
"type": "string",
"title": "Resolution",
"default": "1K",
"description": "Output resolution tier. `1K` is the faster option; `2K` produces four times the pixels and takes considerably longer, up to about 3 minutes with reference images. Only `1K` and `2K` are accepted — with any other value, including `4K`, the request is rejected."
},
"aspect_ratio": {
"enum": [
"auto",
"1:1",
"4:3",
"3:4",
"3:2",
"2:3",
"16:9",
"9:16",
"21:9",
"9:21"
],
"type": "string",
"title": "Aspect ratio",
"default": "auto",
"description": "Output aspect ratio. Defaults to `auto`, which takes the aspect ratio of the first reference image and snaps it to the nearest supported ratio. The actual pixel size also depends on `resolution`. Ignored in local-edit mode."
},
"nsfw_checker": {
"type": "boolean",
"title": "NSFW checker",
"description": "Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model."
},
"output_format": {
"enum": [
"png",
"webp",
"jpeg"
],
"type": "string",
"title": "Output format",
"default": "png",
"description": "Output image format. `png` (default) and `webp` both carry an alpha channel and can be used with `background: transparent`. `jpeg` has no alpha channel and cannot be combined with a transparent background."
},
"enhance_prompt": {
"type": "boolean",
"title": "Enhance prompt",
"default": true,
"description": "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."
}
}
}Results, saved runs & billing
Media requests return a job ID. Poll GET /api/v1/jobs/:id until it succeeds or fails; keep the same ID while it is processing. Long chat requests can also return a saved job to poll. Completed outputs are stored in your account, and successful work is billed using your model's current rates.
A multi-step workflow may include separately billed successful actions. If a connection drops, check your saved run before submitting it again.






