PopNowДокументация API
Основное содержимое

Qwen Image 2.1 Pro: справочник по API

До шести детальных картинок 2K по одному промпту

С одним ключом PopNow API вы вызываете Qwen Image 2.1 Pro прямо из своего кода. Здесь собраны ID модели, которые нужно передать, все поля, которые она принимает, стоимость запроса в кредитах и готовый запрос — его можно вставить в терминал и запустить.

Описания параметров взяты из входной схемы модели и пока доступны только на английском.

Кратко

Разработчик
Alibaba
Результат
Изображение
От
5.4 кр. за изображение ($0.054)
Обычное время
около 53 с

1 кредит = 0,01 $. При приёме задачи резервируется максимально возможная сумма, а после завершения списывается фактический расход с округлением вверх до целого кредита; остаток возвращается. За задачи, завершившиеся ошибкой, плата не взимается. Точную сумму до запуска покажет POST /api/v1/jobs/quote.

Создать картинку

alibaba/qwen-image-2.1-pro/text-to-image

Цена

ВариантКредиты (за изображение)Доллары США
По умолчанию5.4$0.054

Параметры

ПолеТипПо умолчаниюДопустимые значенияНазначение
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Необязательноstring1:11: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Необязательноstring2k1k, 1.5k, 2kOutput resolution tier. Every tier costs the same.
num_outputsНеобязательноinteger1от 1 до 6How many images to generate in one request (1 to 6). Billed per image returned.
enable_prompt_expansionНеобязательноbooleanfalse—Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word.
enable_thinkingНеобязательноbooleantrue—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Необязательноstringdirectdirect, agentHow 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 до 2147483647Random seed for controlled comparisons.

Пример запроса

Запрос работает как есть; поля, которые вы не указали, берут значения по умолчанию. Сначала положите ключ в переменную POPNOW_API_KEY.

POST /api/v1/jobs/createTask
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
  }
}'

В ответе сразу приходит taskId. Результат забирайте через GET /api/v1/jobs/recordInfo или передайте callBackUrl, чтобы получить уведомление.

GET /api/v1/jobs/recordInfo
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-pro/edit

Цена

ВариантКредиты (за изображение)Доллары США
По умолчанию5.4$0.054

Параметры

ПолеТипПо умолчаниюДопустимые значенияНазначение
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Необязательноstring2k1k, 1.5k, 2kOutput resolution tier. Every tier costs the same.
num_outputsНеобязательноinteger1от 1 до 6How many images to generate in one request (1 to 6). Billed per image returned.
enable_prompt_expansionНеобязательноbooleanfalse—Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word.
enable_thinkingНеобязательноbooleantrue—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 до 2147483647Random seed for controlled comparisons.

Пример запроса

Запрос работает как есть; поля, которые вы не указали, берут значения по умолчанию. Сначала положите ключ в переменную POPNOW_API_KEY.

В примере в image_urls стоят демонстрационные файлы PopNow. Замените их своими публичными HTTPS-ссылками, загруженными файлами или сохранёнными ассетами.

POST /api/v1/jobs/createTask
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
  }
}'

В ответе сразу приходит taskId. Результат забирайте через GET /api/v1/jobs/recordInfo или передайте callBackUrl, чтобы получить уведомление.

GET /api/v1/jobs/recordInfo
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Что дальше

На этой странице