Qwen Image 3 — Text to image API
Text to image with Qwen Image 3: request parameters, examples and response handling.
Endpoint: POST https://api.higgsfield.ai/alibaba/qwen-image-3/text-to-image
Endpoint ID: alibaba/qwen-image-3/text-to-image
#Usage notes
- prompt must contain non-whitespace text. The schema imposes no character maximum; its 4,500-token guidance is advisory.
- enable_thinking defaults to true and requires prompt_extend=true. Set both to false to disable enhancement.
- prompt_extend_mode supports direct or agent. No reference images are accepted by this endpoint.
- resolution is a tier; 2k square maps to 1536 by 1536 pixels, not 2048 by 2048.
#Quick start
curl --request POST \
--url https://api.higgsfield.ai/alibaba/qwen-image-3/text-to-image \
--header "Authorization: Key ${HF_API_KEY_ID}:${HF_API_KEY_SECRET}" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY}" \
--data '{
"prompt": "A ceramic vase on a wooden table beside a sunlit window, soft natural shadows, editorial photograph.",
"resolution": "1k",
"aspect_ratio": "1:1"
}'
import higgsfield_client
arguments = (
{'prompt': 'A ceramic vase on a wooden table beside a sunlit window, soft '
'natural shadows, editorial photograph.',
'resolution': '1k',
'aspect_ratio': '1:1'}
)
result = higgsfield_client.subscribe(
"alibaba/qwen-image-3/text-to-image",
arguments=arguments,
)
print(result["images"][0]["url"])
import { config, higgsfield } from "@higgsfield/client/v2";
config({ credentials: process.env.HF_CREDENTIALS });
const result = await higgsfield.subscribe("alibaba/qwen-image-3/text-to-image", {
input:
{
"prompt": "A ceramic vase on a wooden table beside a sunlit window, soft natural shadows, editorial photograph.",
"resolution": "1k",
"aspect_ratio": "1:1"
},
withPolling: true,
});
if (result.status === "completed") {
console.log(result.images?.[0]?.url);
}
#Input schema
seed integer
Optional random seed for similar, reproducible results.
Minimum: 0.
Maximum: 2147483647.
prompt string required
Positive prompt or editing instruction in Chinese or English. Alibaba recommends at most 4,500 tokens.
Minimum characters: 1.
resolution string (default: 1k)
Output resolution tier. Both tiers produce PNG images.
Allowed values: "1k", "2k".
aspect_ratio string (default: 1:1)
Output aspect ratio. Exact provider-recommended dimensions are selected automatically.
Allowed values: "1:1", "2:3", "3:2", "3:4", "4:3", "7:9", "9:7", "9:16", "16:9", "21:9".
prompt_extend boolean (default: true)
Improve the prompt before generation. Required when thinking mode is enabled.
enable_thinking boolean (default: true)
Use model reasoning to improve image quality. Requires prompt enhancement.
negative_prompt string
Content, styles, or artifacts to avoid in the output.
prompt_extend_mode string (default: direct)
Direct enhancement is available for every request; agent enhancement is text-to-image only.
Allowed values: "direct", "agent".
Complete JSON schema
{
"type": "object",
"allOf": [
{
"if": {
"required": [
"enable_thinking"
],
"properties": {
"enable_thinking": {
"const": true
}
}
},
"then": {
"required": [
"prompt_extend"
],
"properties": {
"prompt_extend": {
"const": true
}
}
}
}
],
"title": "Qwen Image 3 Text to Image",
"required": [
"prompt"
],
"properties": {
"seed": {
"type": "integer",
"maximum": 2147483647,
"minimum": 0,
"description": "Optional random seed for similar, reproducible results."
},
"prompt": {
"type": "string",
"minLength": 1,
"description": "Positive prompt or editing instruction in Chinese or English. Alibaba recommends at most 4,500 tokens."
},
"resolution": {
"enum": [
"1k",
"2k"
],
"type": "string",
"default": "1k",
"description": "Output resolution tier. Both tiers produce PNG images."
},
"aspect_ratio": {
"enum": [
"1:1",
"2:3",
"3:2",
"3:4",
"4:3",
"7:9",
"9:7",
"9:16",
"16:9",
"21:9"
],
"type": "string",
"default": "1:1",
"description": "Output aspect ratio. Exact provider-recommended dimensions are selected automatically."
},
"prompt_extend": {
"type": "boolean",
"default": true,
"description": "Improve the prompt before generation. Required when thinking mode is enabled."
},
"enable_thinking": {
"type": "boolean",
"default": true,
"description": "Use model reasoning to improve image quality. Requires prompt enhancement."
},
"negative_prompt": {
"type": "string",
"description": "Content, styles, or artifacts to avoid in the output."
},
"prompt_extend_mode": {
"enum": [
"direct",
"agent"
],
"type": "string",
"default": "direct",
"description": "Direct enhancement is available for every request; agent enhancement is text-to-image only."
}
},
"additionalProperties": false
}
#Response
Submission returns a request handle. Poll status_url until status is completed, or use webhooks.
{
"status": "queued",
"request_id": "REQUEST_ID",
"status_url": "https://api.higgsfield.ai/requests/REQUEST_ID/status",
"cancel_url": "https://api.higgsfield.ai/requests/REQUEST_ID/cancel"
}
A completed response includes the following output fields:
{
"status": "completed",
"request_id": "REQUEST_ID",
"images": [
{
"url": "https://example.com/output.png"
}
]
}
See idempotent requests, polling, request errors and authentication for shared request handling.