К обзору модели

API-документация

Подробное подключение Task API для Qwen Edit Multi-Angle

API-документация

Эндпоинт

Базовый URLhttps://api.mashagpt.ru/v1
Эндпоинт
POST
/v1/tasks/qwen-edit-multiangle
Авторизация
x-api-key: YOUR_API_KEY
илиAuthorization: Bearer YOUR_API_KEY

Как прикрепить изображение

В запрос модели файл не отправляется напрямую. Сначала загрузите файл в MashaGPT storage, получите публичный URL и передайте его в параметр image.

Не передавайте в JSON blob:, file://, data:, base64 или сырые байты. Storage принимает multipart/form-data с одним полем file. Подробный контракт: /v1/storage/upload.

1. Загрузить файл
curl -X POST "https://api.mashagpt.ru/v1/storage/upload" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "file=@./reference.png"

Ответ вернет URL вида https://static.mashagpt.ru/...

2. Передать URL в модель
curl -X POST "https://api.mashagpt.ru/v1/tasks/qwen-edit-multiangle" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "image": "https://static.mashagpt.ru/dl/mashagpt/reference.webp"
}'

Если файл уже доступен по публичному URL, его можно передать сразу. Загрузка через MashaGPT storage надежнее для файлов с компьютера.

Параметры запроса

ПараметрТипОписание
image*
stringURL of the image to edit (JPEG, PNG, GIF, or WEBP). Пример — https://example.com/image.jpg.
rotateDegrees
integerCamera rotation in degrees. Positive rotates left, negative rotates right. Диапазон -90–90.
moveForward
integerMove the camera forward (zoom in). Higher values push toward a close-up framing. Диапазон 0–10.
verticalTilt
integerVertical camera tilt. -1 = bird's-eye, 0 = level, 1 = worm's-eye. Диапазон -1–1.
useWideAngle
booleanSwitch to a wide-angle lens.
prompt
stringOptional text instruction appended after the camera directive.
aspectRatio
stringAspect ratio for generated images.
loraWeights
stringLoRA weights to apply. Defaults to the Replicate multi-angle LoRA.
loraScale
numberStrength applied to the selected LoRA. Диапазон 0–4.
goFast
booleanIf numInferenceSteps is omitted, true runs the fast preset and false runs the detailed preset.
numInferenceSteps
integerExplicit denoising step count. Диапазон 1–40.
trueGuidanceScale
numberTrue classifier-free guidance scale passed to the pipeline. Диапазон 0–10.
seed
integerRandom seed. Set for reproducible generation.
outputQuality
integerQuality when saving the output images, from 0 to 100. Диапазон 0–100.

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

Запрос
curl -X POST https://api.mashagpt.ru/v1/tasks/qwen-edit-multiangle \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "image": "https://example.com/image.jpg"
}'
Ответ
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "550e8400-e29b-41d4-a716-446655440000",
    "state": "queued"
  }
}

Асинхронная обработка

Модель работает асинхронно. После запроса вы получите taskId задачи для отслеживания статуса.

GET
/v1/tasks/{id}статус задачи
Проверка статуса задачи:
curl -X GET "https://api.mashagpt.ru/v1/tasks/{task_id}" \
  -H "x-api-key: YOUR_API_KEY"

Жизненный цикл задачи:

queuedprocessingcompleted|failed