Selected models are free to useView free models
Docs Center/lanox-image-2 API

lanox-image-2 图片异步生成与编辑 API 文档

本文档说明 lanox-image-2 的异步文生图、图片编辑和任务查询接口。

基础信息

本文档说明 lanox-image-2 的异步文生图、图片编辑和任务查询接口。


接口一览

Base URL: https://api.lanox.ai

鉴权方式: Authorization: Bearer <API_KEY>

调用方式: 创建任务后,通过任务 ID 轮询查询结果

模型: lanox-image-2

单次输入图片数量: 图片编辑固定为 1 张

单次结果数量: 1 张,格式 PNG

图片规格

文生图和图片编辑都必须使用 aspect_ratio + resolution 指定最终图片规格。


支持的画幅

1:1

4:3

3:4

16:9

9:16

支持的分辨率

resolution 支持 1080p、2k、4k,表示最终图片的长边档位。

1080p → 1920 px, 2k → 2560 px, 4k → 3840 px

注意事项

为了适配目标画幅,图片边缘可能被裁剪。建议在提示词中说明构图要求,并将主体放在画面中央的安全区域。

创建文生图任务

POST /api/v2/lanox-images/generations,Content-Type 为 application/json; charset=utf-8


请求参数

model (string, 选填): 如传入必须为 lanox-image-2

prompt (string, 必填): 图片内容、风格和构图描述

aspect_ratio (string, 必填): 最终画幅

resolution (string, 必填): 最终分辨率

cURL 示例

curl -X POST "https://api.lanox.ai/api/v2/lanox-images/generations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{
    "model": "lanox-image-2",
    "prompt": "一只坐在窗边看雨的橘猫,主体居中,柔和自然光,电影感构图",
    "aspect_ratio": "9:16",
    "resolution": "4k"
  }'

创建图片编辑任务

POST /api/v2/lanox-images/edits,使用 multipart/form-data,一次只接受一张输入图片。


表单参数

image (file, 必填): 待编辑图片,单个文件最大 20 MiB;支持 PNG、JPEG、WebP

model (string, 选填): 如传入必须为 lanox-image-2

prompt (string, 必填): 对图片的编辑要求

aspect_ratio (string, 必填)

resolution (string, 必填)

cURL 示例

curl -X POST "https://api.lanox.ai/api/v2/lanox-images/edits" \
  -H "Authorization: Bearer $API_KEY" \
  -F "image=@./input.png;type=image/png" \
  -F "model=lanox-image-2" \
  -F "prompt=保留主体造型,把背景改为雨夜霓虹街道" \
  -F "aspect_ratio=16:9" \
  -F "resolution=2k"

查询任务

GET /api/v2/lanox-images/tasks/{taskId},文生图和图片编辑使用同一个查询接口。建议每隔 2–5 秒轮询一次。


任务状态

queued — 已创建等待执行(非终态)

processing — 正在处理(非终态)

succeeded — 成功,可读取图片地址(终态)

failed — 失败,可读取错误信息(终态)