Qwen Image 2.1 Turbo: справочник по API
Быстрый рендер за 8 шагов, до шести за раз
С одним ключом PopNow API вы вызываете Qwen Image 2.1 Turbo прямо из своего кода. Здесь собраны ID модели, которые нужно передать, все поля, которые она принимает, стоимость запроса в кредитах и готовый запрос — его можно вставить в терминал и запустить.
Описания параметров взяты из входной схемы модели и пока доступны только на английском.
Кратко
- Разработчик
- Alibaba
- Результат
- Изображение
- От
- 2.16 кр. за изображение ($0.0216)
- Обычное время
- около 28 с
1 кредит = 0,01 $. При приёме задачи резервируется максимально возможная сумма, а после завершения списывается фактический расход с округлением вверх до целого кредита; остаток возвращается. За задачи, завершившиеся ошибкой, плата не взимается. Точную сумму до запуска покажет POST /api/v1/jobs/quote.
Создать картинку
alibaba/qwen-image-2.1-turbo/text-to-image
Цена
| Вариант | Кредиты (за изображение) | Доллары США |
|---|---|---|
По умолчанию | 2.16 | $0.0216 |
Параметры
| Поле | Тип | По умолчанию | Допустимые значения | Назначение |
|---|---|---|---|---|
promptОбязательно | string | — | до 5 000 символов | 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_ratioНеобязательно | 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. |
resolutionНеобязательно | string | 2k | 1k, 1.5k, 2k | Output resolution tier. Every tier costs the same. |
num_outputsНеобязательно | integer | 1 | от 1 до 6 | How many images to generate in one request (1 to 6). Billed per image returned. |
enable_prompt_expansionНеобязательно | boolean | false | — | Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word. |
enable_thinkingНеобязательно | 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_modeНеобязательно | 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. |
seedНеобязательно | integer | — | от 0 до 2147483647 | Random seed for controlled comparisons. |
Пример запроса
Запрос работает как есть; поля, которые вы не указали, берут значения по умолчанию. Сначала положите ключ в переменную 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
}
}'В ответе сразу приходит taskId. Результат забирайте через GET /api/v1/jobs/recordInfo или передайте callBackUrl, чтобы получить уведомление.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"Редактировать картинку
alibaba/qwen-image-2.1-turbo/edit
Цена
| Вариант | Кредиты (за изображение) | Доллары США |
|---|---|---|
По умолчанию | 2.16 | $0.0216 |
Параметры
| Поле | Тип | По умолчанию | Допустимые значения | Назначение |
|---|---|---|---|---|
promptОбязательно | string | — | до 5 000 символов | 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_urlsОбязательно | array<string (uri)> | — | до 10 элементов | One to ten source images, in the order you refer to them in the prompt (Image 1, Image 2 and so on). |
aspect_ratioНеобязательно | 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. |
resolutionНеобязательно | string | 2k | 1k, 1.5k, 2k | Output resolution tier. Every tier costs the same. |
num_outputsНеобязательно | integer | 1 | от 1 до 6 | How many images to generate in one request (1 to 6). Billed per image returned. |
enable_prompt_expansionНеобязательно | boolean | false | — | Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word. |
enable_thinkingНеобязательно | 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. |
seedНеобязательно | integer | — | от 0 до 2147483647 | Random seed for controlled comparisons. |
Пример запроса
Запрос работает как есть; поля, которые вы не указали, берут значения по умолчанию. Сначала положите ключ в переменную POPNOW_API_KEY.
В примере в image_urls стоят демонстрационные файлы PopNow. Замените их своими публичными HTTPS-ссылками, загруженными файлами или сохранёнными ассетами.
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
}
}'В ответе сразу приходит taskId. Результат забирайте через GET /api/v1/jobs/recordInfo или передайте callBackUrl, чтобы получить уведомление.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
