Voltar aos modelos
API ativaQwen Image
API ativaQwen ImageQwen2 Image
qwen2-imageReliable Qwen image route for text generation and image editing workflows with broad prompt and aspect-ratio support.
Visão geral do modelo
- Endpoint
- /api/v1/images/generations
- Custo em créditos
- 10 credits / image
- Latência típica
- 20-60 sec
- Entrada e saída
- Text or image → PNG or JPEG
Recursos
- Text-to-image
- Image editing
- Long prompts
- Common aspect ratios
Parâmetros da solicitação
| Parâmetro | Tipo | Requisito | Descrição |
|---|---|---|---|
| model | string | Obrigatório | Model identifier. Padrão: qwen2-image |
| prompt | string | Obrigatório | Generation or edit instruction, up to 5000 characters. |
| image_urls | string[] | Opcional | Source image URLs. Supplying an image activates edit mode. |
| aspect_ratio | string | Opcional | Output aspect ratio. Padrão: 16:9 |
| output_format | png | jpeg | Opcional | Generated file format. Padrão: png |
Exemplo de solicitação
curl https://qwenapi.org/api/v1/images/generations \
-H "Authorization: Bearer $QWEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen2-image",
"prompt": "A clean architectural model photographed in a daylight studio",
"aspect_ratio": "4:3",
"output_format": "png"
}'O endpoint de geração é assíncrono. Consulte GET /api/v1/tasks/ com a mesma chave Bearer.