Referencia de la API de Qwen Image 2.1 Pro
Hasta seis imágenes 2K detalladas con un solo prompt
Con una sola clave de API de PopNow puedes llamar a Qwen Image 2.1 Pro desde tu propio código. Aquí tienes los ID de modelo que debes enviar, cada campo de entrada que acepta, cuántos créditos cuesta cada solicitud y una petición que puedes pegar tal cual en la terminal.
Las descripciones de los parámetros vienen del esquema de entrada del modelo y solo están en inglés.
De un vistazo
- Creado por
- Alibaba
- Resultado
- Imagen
- Desde
- 5.4 créditos por imagen ($0.054)
- Tiempo habitual
- unos 53 s
1 crédito = 0,01 US$. Al aceptarse, la tarea retiene el cargo máximo posible y al terminar cobra el uso real, redondeado al crédito superior; el resto se libera. Las tareas fallidas no se cobran. Para saber la cifra exacta antes de ejecutar, llama a POST /api/v1/jobs/quote.
Crear imagen
alibaba/qwen-image-2.1-pro/text-to-image
Precio
| Opción | Créditos (por imagen) | Dólares |
|---|---|---|
Predeterminado | 5.4 | $0.054 |
Parámetros
| Campo | Tipo | Valor predeterminado | Valores admitidos | Para qué sirve |
|---|---|---|---|---|
promptObligatorio | string | — | hasta 5000 caracteres | 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_ratioOpcional | 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. |
resolutionOpcional | string | 2k | 1k, 1.5k, 2k | Output resolution tier. Every tier costs the same. |
num_outputsOpcional | integer | 1 | de 1 a 6 | How many images to generate in one request (1 to 6). Billed per image returned. |
enable_prompt_expansionOpcional | boolean | false | — | Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word. |
enable_thinkingOpcional | 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_modeOpcional | 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. |
seedOpcional | integer | — | de 0 a 2147483647 | Random seed for controlled comparisons. |
Solicitud de ejemplo
Esta solicitud funciona tal cual; los campos que no envíes usan su valor predeterminado. Antes, guarda tu clave en POPNOW_API_KEY.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "alibaba/qwen-image-2.1-pro/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 respuesta trae un taskId al instante. Consulta el resultado con GET /api/v1/jobs/recordInfo o añade callBackUrl para recibir un aviso.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"Editar imagen
alibaba/qwen-image-2.1-pro/edit
Precio
| Opción | Créditos (por imagen) | Dólares |
|---|---|---|
Predeterminado | 5.4 | $0.054 |
Parámetros
| Campo | Tipo | Valor predeterminado | Valores admitidos | Para qué sirve |
|---|---|---|---|---|
promptObligatorio | string | — | hasta 5000 caracteres | 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_urlsObligatorio | array<string (uri)> | — | hasta 10 elementos | One to ten source images, in the order you refer to them in the prompt (Image 1, Image 2 and so on). |
aspect_ratioOpcional | 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. |
resolutionOpcional | string | 2k | 1k, 1.5k, 2k | Output resolution tier. Every tier costs the same. |
num_outputsOpcional | integer | 1 | de 1 a 6 | How many images to generate in one request (1 to 6). Billed per image returned. |
enable_prompt_expansionOpcional | boolean | false | — | Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word. |
enable_thinkingOpcional | 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. |
seedOpcional | integer | — | de 0 a 2147483647 | Random seed for controlled comparisons. |
Solicitud de ejemplo
Esta solicitud funciona tal cual; los campos que no envíes usan su valor predeterminado. Antes, guarda tu clave en POPNOW_API_KEY.
El ejemplo usa archivos de muestra de PopNow en image_urls. Cámbialos por tus propios enlaces HTTPS públicos, archivos subidos o recursos guardados.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "alibaba/qwen-image-2.1-pro/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 respuesta trae un taskId al instante. Consulta el resultado con GET /api/v1/jobs/recordInfo o añade callBackUrl para recibir un aviso.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
