Riferimento API di Qwen Image 2.1 Turbo
Render veloci in 8 passaggi, fino a sei per prompt
Con una sola chiave API di PopNow chiami Qwen Image 2.1 Turbo dal tuo codice. Qui trovi gli ID del modello da inviare, ogni campo di input accettato, quanto costa ogni richiesta in USD e una richiesta da incollare nel terminale così com’è.
Le descrizioni dei parametri provengono dallo schema di input del modello e sono disponibili solo in inglese.
In sintesi
- Sviluppato da
- Alibaba
- Risultato
- Immagine
- Da
- $0.0144 USD per immagine
- Tempo tipico
- circa 20 s
I prezzi sono indicati in USD e gli importi vengono addebitati sul tuo saldo PopNow. Alla ricezione viene riservato il massimo importo; al termine viene addebitato il consumo effettivo e il resto viene sbloccato. Le attività fallite non vengono addebitate. Per un preventivo esatto prima di eseguire, usa POST /api/v1/jobs/quote.
Crea immagine
alibaba/qwen-image-2.1-turbo/text-to-image
Prezzo
| Opzione | USD |
|---|---|
Predefinito | $0.0144 per immagine |
Parametri
| Campo | Tipo | Predefinito | Valori ammessi | A cosa serve |
|---|---|---|---|---|
promptObbligatorio | string | — | fino a 5000 caratteri | Describe the subject, composition, lighting, and any wording to render. There is no negative prompt: write what to leave out directly in the prompt. |
aspect_ratioFacoltativo | string | 1:1 | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21, 2:1, 1:2, 3:1, 1:3, 5:4, … (+1) | Output aspect ratio. |
resolutionFacoltativo | string | 2k | 1k, 1.5k, 2k | Output resolution tier. Every tier costs the same. |
num_outputsFacoltativo | integer | 1 | da 1 a 6 | How many images to generate in one request (1 to 6). Billed per image returned. |
enable_prompt_expansionFacoltativo | boolean | false | — | Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word. |
enable_thinkingFacoltativo | boolean | true | — | Spend extra reasoning on the rewrite for better images, at the cost of a longer wait. Only works while prompt expansion is on. |
prompt_optimization_modeFacoltativo | string | direct | direct, agent | How prompt expansion rewrites the brief: direct is a single pass that suits most prompts; agent is a multi-step rewrite with finer detail. |
seedFacoltativo | integer | — | da 0 a 2147483647 | Random seed for controlled comparisons. |
Richiesta di esempio
Questa richiesta funziona così com’è; i campi omessi usano il valore predefinito. Prima salva la tua chiave in POPNOW_API_KEY.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask?wait=60" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "alibaba/qwen-image-2.1-turbo/text-to-image",
"input": {
"prompt": "A cozy reading nook beside a rain-streaked window, warm lamp light, a sleeping orange cat on a knitted blanket, soft film grain",
"num_outputs": 1
}
}'La risposta contiene subito un taskId. Recupera il risultato con GET /api/v1/jobs/recordInfo, oppure aggiungi callBackUrl per ricevere una notifica.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"Modifica immagine
alibaba/qwen-image-2.1-turbo/edit
Prezzo
| Opzione | USD |
|---|---|
Predefinito | $0.0144 per immagine |
Parametri
| Campo | Tipo | Predefinito | Valori ammessi | A cosa serve |
|---|---|---|---|---|
promptObbligatorio | string | — | fino a 5000 caratteri | Describe the subject, composition, lighting, and any wording to render. There is no negative prompt: write what to leave out directly in the prompt. |
image_urlsObbligatorio | array<string (uri)> | — | fino a 10 elementi | One to ten source images, in the order you refer to them in the prompt (Image 1, Image 2 and so on). |
aspect_ratioFacoltativo | string | — | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21, 2:1, 1:2, 3:1, 1:3, 5:4, … (+1) | Output aspect ratio. Omit it to let the model choose a size from the source images. |
resolutionFacoltativo | string | 2k | 1k, 1.5k, 2k | Output resolution tier. Every tier costs the same. |
num_outputsFacoltativo | integer | 1 | da 1 a 6 | How many images to generate in one request (1 to 6). Billed per image returned. |
enable_prompt_expansionFacoltativo | boolean | false | — | Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word. |
enable_thinkingFacoltativo | boolean | true | — | Spend extra reasoning on the rewrite for better images, at the cost of a longer wait. Only works while prompt expansion is on. |
seedFacoltativo | integer | — | da 0 a 2147483647 | Random seed for controlled comparisons. |
Richiesta di esempio
Questa richiesta funziona così com’è; i campi omessi usano il valore predefinito. Prima salva la tua chiave in POPNOW_API_KEY.
L’esempio usa file di prova di PopNow in image_urls. Sostituiscili con i tuoi link HTTPS pubblici, file caricati o asset salvati.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask?wait=60" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "alibaba/qwen-image-2.1-turbo/edit",
"input": {
"prompt": "Change the orange jacket to deep forest green and add soft golden-hour light; keep the face, pose and background unchanged",
"image_urls": [
"https://media.popnow.ai/influencer/examples/marco.webp"
],
"num_outputs": 1
}
}'La risposta contiene subito un taskId. Recupera il risultato con GET /api/v1/jobs/recordInfo, oppure aggiungi callBackUrl per ricevere una notifica.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
