模型市场支持← 返回应用

Qwen

Qwen 模型通过一个统一的异步任务 API 调用。用 POST /api/generate 发起任务,再轮询 GET /api/generate/{taskId} 直到完成。本系列提供 9 个端点。

概览

每个端点共享相同的外层结构 —— 只有 modelinput 字段不同。可在模型市场的 playground 中运行任意一个。

Qwen Image 3.0
支持复杂版式、准确文字、多语言视觉内容和真实材质细节。标准版文生图/图生图为 1K、2K 均 5.04 积分/张;Pro 版为 1K 6.72、2K 12.6 积分/张。图生图输入图片按 0.53 积分/张计费,最多 3 张。

认证

/api-keys 创建 API 密钥,然后作为 Bearer token 发送。已登录时从浏览器发起的请求也可通过会话 cookie 生效。

Authorization: Bearer <YOUR_API_KEY>

创建任务

POST
POST https://api.lithovas.com/api/generate

请求体:{ "model": "<slug>", "input": { … } }

响应:{ "taskId": "<id>", "state": "waiting" }

查询结果

GET
GET https://api.lithovas.com/api/generate/<taskId>

响应:{ "taskId", "state": "waiting" | "success" | "fail", "resultUrls": [ … ], "creditsConsumed", "failMsg", "balance" }

异步
创建任务返回 200 只表示任务已被接受 —— 并非已完成。请轮询此端点,直到 state 变为 successfail。失败任务不计费。

端点

模型任务model slug
QwenText to Imageqwen/text-to-image
QwenImage to Imageqwen/image-to-image
Image EditImage Editingqwen/image-edit
Image EditImage Editingqwen2/image-edit
Qwen2Text to Imageqwen2/text-to-image
Qwen Image 3.0Text to Imageqwen3/text-to-image
Qwen Image 3.0Image to Imageqwen3/image-to-image
Qwen Image 3.0 ProText to Imageqwen3/pro-text-to-image
Qwen Image 3.0 ProImage to Imageqwen3/pro-image-to-image

Qwen · Text to Image

POSTText to Imageqwen/text-to-image
input 字段
promptstring必填

The prompt to generate the image with (max 5000 chars)

image_sizeenum<string>可选

Size of the generated image

num_inference_stepsnumber可选

Number of inference steps (min 2, max 250)

seedinteger可选

Seed value for reproducible outputs

guidance_scalenumber可选

CFG scale for prompt adherence (min 0, max 20)

enable_safety_checkerboolean可选

Enable safety content filtering

output_formatenum<string>可选

Image output format

negative_promptstring可选

Negative prompt for generation (max 500 chars)

accelerationenum<string>可选

Speed/quality tradeoff for generation

nsfw_checkerboolean可选

Disable content filtering when set to false

示例
cURL
curl -X POST https://api.lithovas.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen/text-to-image",
  "input": {
    "prompt": "A cinematic red panda surfing through neon rain at dusk.",
    "image_size": "square_hd",
    "num_inference_steps": 30,
    "seed": 42,
    "guidance_scale": 2.5,
    "enable_safety_checker": false,
    "output_format": "png",
    "negative_prompt": "example",
    "acceleration": "none",
    "nsfw_checker": false
  }
}'

Qwen · Image to Image

POSTImage to Imageqwen/image-to-image
input 字段
promptstring必填

Text prompt to guide image generation (max 5000 chars)

image_urlstring必填

Reference image URL to guide generation (max 10MB)

strengthnumber可选

Denoising strength: 1.0 fully remakes, 0.0 preserves original

output_formatenum<string>可选

Output image format

accelerationenum<string>可选

Speed vs quality tradeoff for generation

negative_promptstring可选

What to exclude from generation (max 500 chars)

seedinteger可选

Fixed seed produces consistent results with same prompt

num_inference_stepsnumber可选

Generation iterations (2-250 steps)

guidance_scalenumber可选

CFG scale controlling adherence to prompt (0-20)

enable_safety_checkerboolean可选

Enable safety content filtering

nsfw_checkerboolean可选

Disable content filtering when set to false

示例
cURL
curl -X POST https://api.lithovas.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen/image-to-image",
  "input": {
    "prompt": "A cinematic red panda surfing through neon rain at dusk.",
    "image_url": "https://example.com/input.jpg",
    "strength": 0.8,
    "output_format": "png",
    "acceleration": "none",
    "negative_prompt": "example",
    "seed": 42,
    "num_inference_steps": 30,
    "guidance_scale": 2.5,
    "enable_safety_checker": false,
    "nsfw_checker": false
  }
}'

Image Edit · Image Editing

POSTImage Editingqwen/image-edit
input 字段
promptstring必填

The prompt to generate the image with (max 2000 chars)

image_urlstring必填

URL of image to edit (jpeg/png/webp, max 10MB)

accelerationenum<string>可选

Acceleration level balancing speed and quality

image_sizeenum<string>可选

The size of the generated image

num_inference_stepsnumber可选

Number of inference steps (min 2, max 49)

seedinteger可选

Same seed with same prompt outputs identical image

guidance_scalenumber可选

CFG scale controls prompt adherence (min 0, max 20)

sync_modeboolean可选

Wait for generation completion before returning response

num_imagesenum<string>可选

Number of images to generate

enable_safety_checkerboolean可选

Enable safety checker for content filtering

output_formatenum<string>可选

Format of the generated image

negative_promptstring可选

Negative prompt for generation (max 500 chars)

nsfw_checkerboolean可选

Disable content filtering; returns unfiltered results

示例
cURL
curl -X POST https://api.lithovas.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen/image-edit",
  "input": {
    "prompt": "A cinematic red panda surfing through neon rain at dusk.",
    "image_url": "https://example.com/input.jpg",
    "acceleration": "none",
    "image_size": "landscape_4_3",
    "num_inference_steps": 25,
    "seed": 42,
    "guidance_scale": 4,
    "sync_mode": false,
    "num_images": "1",
    "enable_safety_checker": true,
    "output_format": "png",
    "negative_prompt": "example",
    "nsfw_checker": false
  }
}'

Image Edit · Image Editing

POSTImage Editingqwen2/image-edit
input 字段
promptstring必填

Text instruction for image editing (max 800 chars)

image_urlstring必填

URL of image to edit (JPEG/PNG/WebP, max 10MB)

image_sizeenum<string>可选

Output image aspect ratio

seedinteger可选

Reproducible generation seed for consistent outputs

output_formatenum<string>可选

Generated image file format

nsfw_checkerboolean可选

Enable/disable content filtering on results

示例
cURL
curl -X POST https://api.lithovas.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen2/image-edit",
  "input": {
    "prompt": "A cinematic red panda surfing through neon rain at dusk.",
    "image_url": "https://example.com/input.jpg",
    "image_size": "16:9",
    "seed": 42,
    "output_format": "png",
    "nsfw_checker": false
  }
}'

Qwen2 · Text to Image

POSTText to Imageqwen2/text-to-image
input 字段
promptstring必填

The prompt to generate the image with (max 800 chars)

image_sizeenum<string>可选

The size of the generated image

seedinteger可选

Same seed with same prompt outputs identical image

output_formatenum<string>可选

The format of the generated image

nsfw_checkerboolean可选

Disable content filtering when set to false

示例
cURL
curl -X POST https://api.lithovas.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen2/text-to-image",
  "input": {
    "prompt": "A cinematic red panda surfing through neon rain at dusk.",
    "image_size": "16:9",
    "seed": 42,
    "output_format": "png",
    "nsfw_checker": false
  }
}'

Qwen Image 3.0 · Text to Image

POSTText to Imageqwen3/text-to-image
input 字段
promptstring必填

Positive prompt in Chinese or English, up to 800 characters.

resolutionenum<string>可选

Output resolution tier.

image_sizeenum<string>可选

Output aspect ratio.

output_formatenum<string>可选

Generated image format.

prompt_extendboolean可选

Enable intelligent prompt rewriting.

negative_promptstring可选

Content that should not appear in the image, up to 5000 characters.

seedinteger可选

Random seed from 0 to 2147483647.

nsfw_checkerboolean可选

Enable content safety checking.

示例
cURL
curl -X POST https://api.lithovas.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen3/text-to-image",
  "input": {
    "prompt": "Create a realistic editorial visual with accurate typography, detailed materials, and a clear structured layout.",
    "resolution": "1K",
    "image_size": "16:9",
    "output_format": "png",
    "prompt_extend": true,
    "negative_prompt": "example",
    "seed": 1,
    "nsfw_checker": true
  }
}'

Qwen Image 3.0 · Image to Image

POSTImage to Imageqwen3/image-to-image
input 字段
image_urlsarray<string>必填

Source image URLs. Supports JPEG, PNG, WEBP, BMP, GIF, and TIFF; up to 3 images, 10 MB each.

promptstring必填

Positive prompt in Chinese or English, up to 800 characters.

resolutionenum<string>可选

Output resolution tier.

image_sizeenum<string>可选

Output aspect ratio.

output_formatenum<string>可选

Generated image format.

prompt_extendboolean可选

Enable intelligent prompt rewriting.

negative_promptstring可选

Content that should not appear in the image, up to 5000 characters.

seedinteger可选

Random seed from 0 to 2147483647.

nsfw_checkerboolean可选

Enable content safety checking.

示例
cURL
curl -X POST https://api.lithovas.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen3/image-to-image",
  "input": {
    "image_urls": [
      "https://example.com/input.jpg"
    ],
    "prompt": "Transform the source image into a polished editorial visual while preserving the subject and composition.",
    "resolution": "1K",
    "image_size": "16:9",
    "output_format": "png",
    "prompt_extend": true,
    "negative_prompt": "example",
    "seed": 1,
    "nsfw_checker": true
  }
}'

Qwen Image 3.0 Pro · Text to Image

POSTText to Imageqwen3/pro-text-to-image
input 字段
promptstring必填

Positive prompt in Chinese or English, up to 800 characters.

resolutionenum<string>可选

Output resolution tier.

image_sizeenum<string>可选

Output aspect ratio.

output_formatenum<string>可选

Generated image format.

prompt_extendboolean可选

Enable intelligent prompt rewriting.

negative_promptstring可选

Content that should not appear in the image, up to 5000 characters.

seedinteger可选

Random seed from 0 to 2147483647.

nsfw_checkerboolean可选

Enable content safety checking.

示例
cURL
curl -X POST https://api.lithovas.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen3/pro-text-to-image",
  "input": {
    "prompt": "Create a realistic editorial visual with accurate typography, detailed materials, and a clear structured layout.",
    "resolution": "1K",
    "image_size": "16:9",
    "output_format": "png",
    "prompt_extend": true,
    "negative_prompt": "example",
    "seed": 1,
    "nsfw_checker": true
  }
}'

Qwen Image 3.0 Pro · Image to Image

POSTImage to Imageqwen3/pro-image-to-image
input 字段
image_urlsarray<string>必填

Source image URLs. Supports JPEG, PNG, WEBP, BMP, GIF, and TIFF; up to 3 images, 10 MB each.

promptstring必填

Positive prompt in Chinese or English, up to 800 characters.

resolutionenum<string>可选

Output resolution tier.

image_sizeenum<string>可选

Output aspect ratio.

output_formatenum<string>可选

Generated image format.

prompt_extendboolean可选

Enable intelligent prompt rewriting.

negative_promptstring可选

Content that should not appear in the image, up to 5000 characters.

seedinteger可选

Random seed from 0 to 2147483647.

nsfw_checkerboolean可选

Enable content safety checking.

示例
cURL
curl -X POST https://api.lithovas.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen3/pro-image-to-image",
  "input": {
    "image_urls": [
      "https://example.com/input.jpg"
    ],
    "prompt": "Transform the source image into a polished editorial visual while preserving the subject and composition.",
    "resolution": "1K",
    "image_size": "16:9",
    "output_format": "png",
    "prompt_extend": true,
    "negative_prompt": "example",
    "seed": 1,
    "nsfw_checker": true
  }
}'