# 图像生成图像
**Base URL:** `https://openapi.tripo3d.ai/v3`
**Endpoint:** `POST /generation/image-to-image`
根据参考图像生成或编辑图像。支持编辑、风格迁移和多图融合。
## Request Parameters
### model
- **Type:** string
- **Required:** 可选
- **Default:** `seedream_v5`
图像编辑模型。
- `seedream_v5` — 最强编辑、风格迁移与多图融合能力。
- `banana` — 快速编辑。
- `banana_pro` — 更高质量编辑。
- `banana2` — 最新快速编辑。
- `chat_image_1` — 基础图像编辑。
- `chat_image_1.5` — 更高质量编辑。
- `chat_image_2` — 最新,质量最佳编辑。
### input
- **Type:** string
- **Required:** 必选
主要参考图像。接受公开 URL、`file_token` 或 `task_id`。**以上三种方式任选其一**,不可同时传入多种类型。
- Formats: `jpeg`, `png` (recommended); `webp` is rejected on some provider routes
- Max file size: **20 MB**
- Max total pixels: **6000 × 6000 = 36 MP**
- Min width/height: 14 px
- Aspect ratio (W/H): **[1/3, 3]**
- URL images must be publicly accessible. Private files require `/v3/files` first.
### inputs
- **Type:** string[]
- **Required:** 可选
多张参考图像。每张图像的格式与 `input` 相同。
- 最多:**4** 张(seedream),**10** 张(banana),**16** 张(chat_image)
- 引用方式:`image[1]`、`image[2]` 等。
### prompt
- **Type:** string
- **Required:** 条件必填
编辑指令。**未指定模板时必填。**
### size
- **Type:** string
- **Required:** 可选
- **Default:** `2048x2048`
输出图像尺寸。可传语义关键字(如 2K / 4K)或精确像素(如 2048x2048);不同模型支持的取值不同,见下方分模型。
### aspect_ratio
- **Type:** string
- **Required:** 可选
- **Default:** `1:1`
输出宽高比。不传时默认 `1:1`(仅 banana 系列;当 `size` 与 `aspect_ratio` 均未传时由 gateway 填充)。
- `banana` / `banana_pro`:`1:1`、`2:3`、`3:2`、`3:4`、`4:3`、`4:5`、`5:4`、`9:16`、`16:9`、`21:9`。
- `banana2` 额外支持 `1:8`、`1:4`、`4:1`、`8:1`。
仅 **banana** 系列支持此字段;seedream / chat_image 按 `size` 出图,请改用 `size` 参数。
### template
- **Type:** string
- **Required:** 可选
编辑模板。设置后 `prompt` 变为可选。
- `t_pose`:转换为 T-pose。
- `character_completion`:补全不完整的角色。
- `3d_enhance`:增强以用于 3D 生成。
- `variants`:生成设计变体。
- `figure`:生成全身人物。
### output_format
- **Type:** string
- **Required:** 可选
- **Default:** `png`
输出图像格式。
- `png`:无损,支持透明度。
- `jpeg`:文件体积更小,不支持透明度。
## Request Example
### 单图示例
```bash
curl --request POST \
--url https://openapi.tripo3d.ai/v3/generation/image-to-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input": "https://example.com/reference.png",
"prompt": "Change the silver outfit into transparent glass.",
"model": "seedream_v5",
"size": "2K"
}'
```
### 多图示例
```bash
curl --request POST \
--url https://openapi.tripo3d.ai/v3/generation/image-to-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"inputs": [
"https://example.com/photo1.png",
"https://example.com/photo2.png"
],
"prompt": "Use character from image[1] and outfit from image[2].",
"model": "seedream_v5"
}'
```
## Response Example
### 创建任务
```json
{
"code": 0,
"data": {
"task_id": "task_abc123"
}
}
```
### 任务结果
```json
{
"code": 0,
"data": {
"task_id": "task_abc123",
"type": "generate_image",
"status": "success",
"progress": 100,
"output": {
"generated_image": "https://cdn.tripo3d.ai/output/image.png",
"size": "2048x2048"
},
"credits_consumed": 20,
"created_at": "2026-04-28T12:00:00Z",
"completed_at": "2026-04-28T12:00:08Z"
}
}
```
请求参数 请求体 model string 默认值: seedream_v5
图像编辑模型。
seedream_v5 — 最强编辑、风格迁移与多图融合能力。banana — 快速编辑。banana_pro — 更高质量编辑。banana2 — 最新快速编辑。chat_image_1 — 基础图像编辑。chat_image_1.5 — 更高质量编辑。chat_image_2 — 最新,质量最佳编辑。seedream banana chat_image
seedream: seedream_v5 — 最强编辑、风格迁移与多图融合能力。banana: banana — 快速。banana_pro — 更高质量。banana2 — 最新快速选项。chat_image: chat_image_1 — 基础图像编辑。chat_image_1.5 — 更高质量。chat_image_2 — 最新,质量最佳。input string 必选
主要参考图像。接受公开 URL、
file_token 或
task_id。
以上三种方式任选其一 ,不可同时传入多种类型。
seedream banana chat_image
seedream: 单张:input。多张:inputs,最多 4 张。 接受:公开 URL、file_token 或图像任务输出。 banana: 最多 10 张参考图像。 引用方式:image[1]、image[2] 等。 chat_image: 最多 16 张参考图像。 引用方式:image[1]、image[2] 等。 Formats: jpeg, png (recommended); webp is rejected on some provider routes Max file size: 20 MB Max total pixels: 6000 × 6000 = 36 MP Min width/height: 14 px Aspect ratio (W/H): [1/3, 3] URL images must be publicly accessible. Private files require /v3/files first. inputs string[]
多张参考图像。每张图像的格式与 input 相同。
seedream banana chat_image
seedream: 单张:input。多张:inputs,最多 4 张。 接受:公开 URL、file_token 或图像任务输出。 banana: 最多 10 张参考图像。 引用方式:image[1]、image[2] 等。 chat_image: 最多 16 张参考图像。 引用方式:image[1]、image[2] 等。 最多:4 张(seedream),10 张(banana),16 张(chat_image) 引用方式:image[1]、image[2] 等。 prompt string 条件必选
编辑指令。未指定模板时必填。
size string 默认值: 2048x2048
输出图像尺寸。可传语义关键字(如 2K / 4K)或精确像素(如 2048x2048);不同模型支持的取值不同,见下方分模型。
seedream_v5 banana chat_image
seedream_v5: 以下两种方式二选一,不可同时传。
分辨率档位 :2K / 3K。在 prompt 里描述宽高比/形状,由模型决定具体尺寸。精确像素 :宽x高(默认 2048x2048)。总像素 3.69–10.40 MP,宽高比 [1:16, 16:1]。banana: banana:仅固定像素 —— 1024x1024、832x1248、1248x832、864x1184、1184x864、896x1152、1152x896、768x1344、1344x768、1536x672。不传时默认 2048x2048(=2K)。
banana_pro:语义关键字 1K / 2K / 4K,或精确像素 宽x高。默认 2K(2048x2048)。
banana2:仅语义关键字 0.5K / 1K / 2K / 4K(0.5K 仅 banana2 支持)。默认 2K。
chat_image: chat_image_1 / chat_image_1.5:固定尺寸 1024x1024、1024x1536、1536x1024、auto。默认 auto。
chat_image_2:固定尺寸 1024x1024、1536x1024、1024x1536、2048x2048、2048x1152、3840x2160、2160x3840、auto。默认 2048x2048。
aspect_ratio string 默认值: 1:1
输出宽高比。不传时默认
1:1(仅 banana 系列;当
size 与
aspect_ratio 均未传时由 gateway 填充)。
banana / banana_pro:1:1、2:3、3:2、3:4、4:3、4:5、5:4、9:16、16:9、21:9。banana2 额外支持 1:8、1:4、4:1、8:1。仅 banana 系列支持此字段;seedream / chat_image 按 size 出图,请改用 size 参数。
template string
编辑模板。设置后
prompt 变为可选。
t_pose:转换为 T-pose。character_completion:补全不完整的角色。3d_enhance:增强以用于 3D 生成。variants:生成设计变体。figure:生成全身人物。output_format string 默认值: png
输出图像格式。
png:无损,支持透明度。jpeg:文件体积更小,不支持透明度。示例 {
"input" : "https://example.com/reference.png" ,
"prompt" : "Change the silver outfit into transparent glass." ,
"model" : "seedream_v5" ,
"size" : "2K" }{
"inputs" : [
"https://example.com/photo1.png" ,
"https://example.com/photo2.png" ],
"prompt" : "Use character from image[1] and outfit from image[2]." ,
"model" : "seedream_v5" }{
"code" : 0 ,
"data" : {
"task_id" : "task_abc123" }
}{
"code" : 0 ,
"data" : {
"task_id" : "task_abc123" ,
"type" : "generate_image" ,
"status" : "success" ,
"progress" : 100 ,
"output" : {
"generated_image" : "https://cdn.tripo3d.ai/output/image.png" ,
"size" : "2048x2048" },
"credits_consumed" : 20 ,
"created_at" : "2026-04-28T12:00:00Z" ,
"completed_at" : "2026-04-28T12:00:08Z" }
}单图示例 多图示例
curl --request POST \
--url https://openapi.tripo3d.ai/v3/generation/image-to-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input" : "https://example.com/reference.png" ,
"prompt" : "Change the silver outfit into transparent glass." ,
"model" : "seedream_v5" ,
"size" : "2K" }'创建任务 任务结果
{
"code" : 0 ,
"data" : {
"task_id" : "task_abc123" }
}