开放平台/开发文档
OpenAPI 3.0 Specification

API 接入与开发文档

标准化 RESTful 协议设计。支持服务端直接调用与 Webhook 异步回调通知,支持多语言快速接入。

BASE URLhttps://dhd.douhuiai.com

1. 接入概览

Base URL
https://dhd.douhuiai.com

接口路径从 /api/openapi/ 开始,拼在这个域名后面

鉴权
Authorization: Bearer dhk_...

只使用控制台创建的密钥

计费
1 元 = 100 积分

按模型规格扣 API 积分

核心接入流程

创建密钥

在 API 密钥页创建 dhk_ 密钥,放在请求头里。

上传图片

没有自己的图床时,先调用图片上传,拿到可访问地址再提交任务。

提交任务

图像任务异步受理,返回 uuid。提示词工具同步返回文案。

拿结果

给密钥配置回调地址,或用 uuid 轮询任务状态。

2. 鉴权方式

Authorization

请求头必须是 Authorization: Bearer dhk_ 开头的密钥。密钥在控制台创建,列表默认打码,登录后可再次查看完整密钥。请只放在服务端,不要写入前端、安装包或仓库。

Content-Type

业务接口使用 application/json。图片上传使用 multipart/form-data,文件字段名是 file。

回调地址

回调地址写在对应密钥上,不放在单次请求体里。任务完成时 POST 到该地址;密钥没填时,才使用账户上的回调地址。

安全建议

密钥只能放在服务端,不要写进浏览器、App 安装包或仓库。

HTTP Header Authorization Example
POST /api/openapi/smartimg HTTP/1.1
Host: dhd.douhuiai.com
Authorization: Bearer dhk_你的密钥
Content-Type: application/json

3. 公共响应规范

所有接口均采用标准 JSON 响应体,根据 status 字段判定执行状态:

响应字段数据类型说明与约束
status可选
int
200 表示成功。其他值表示失败,常见为 -200。
msg可选
string
结果说明或错误原因。
uuid可选
string
异步任务编号。图像创作成功时返回,用它轮询或对应回调。
wait_time可选
int
预估等待秒数,仅供参考。
task_uuid可选
string
一次提交被拆成多个子任务时返回的批次编号。
zh / en可选
string
提示词工具同步返回的中文或英文结果。
JSON Response (200 OK)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

4. Webhook 回调通知

触发时机

图片生成完成或最终失败时通知一次。排队中的进度不会回调。

请求方式

POST,Content-Type 为 application/json。请返回 HTTP 200。

地址

优先使用本次扣费密钥上的回调地址。该密钥没有填写时,使用账户回调地址。

幂等

同一 uuid 可能因重试再次通知。请按 uuid + code 去重。

Method:POSTContent-Type:application/json成功 code:200失败 code:500
回调通知字段数据类型说明与约束
code可选
int
200 出图完成,500 出图失败。
uuid可选
string
与提交接口返回的 uuid 一致。
msg可选
string
出图完成,或失败原因。
appid可选
string
账户 appid,便于区分账户。
grid可选
string
拼图地址。成功时返回,可能为空。
imglist可选
string[]
成图地址列表。失败时不返回。
生成成功推送示例
{
  "code": 200,
  "uuid": "a1b2c3d4e5",
  "msg": "出图完成",
  "appid": "your_appid",
  "grid": "https://img2.douhuiai.com/dhimg/2026/09/demo_grid.jpg",
  "imglist": [
    "https://img2.douhuiai.com/dhimg/2026/09/demo.png"
  ]
}
生成失败推送示例
{
  "code": 500,
  "uuid": "a1b2c3d4e5",
  "msg": "出图失败",
  "appid": "your_appid"
}

5. 图片上传接口

地址

POST /api/openapi/upload

格式

jpg、jpeg、png、webp,最大 15MB。字段名 file。

用法

返回的 filename 拼成 https://img2.douhuiai.com/dhimg/{filename},再填进 inputImg 或 inputImgs。

保留

上传的文件仅暂存7天,过期自动删除。

表单请求字段数据类型说明与约束
file可选
file
图片文件。form-data 字段名固定为 file。
上传响应字段数据类型说明与约束
status可选
int
200 表示上传成功。
filename可选
string
相对路径,例如 apiupd/20260930/xxxx.jpg。
width / height可选
int
处理后的宽高。
msg可选
string
上传的文件仅暂存7天,过期自动删除。
cURL 上传命令示例
curl -X POST "https://dhd.douhuiai.com/api/openapi/upload" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -F "file=@./product.jpg"
上传成功返回 JSON
{
  "status": 200,
  "filename": "apiupd/20260930/xxxx.jpg",
  "width": 1024,
  "height": 1024,
  "msg": "上传的文件仅暂存7天,过期自动删除"
}

6. 提示词 AI 润色

地址

POST /api/openapi/refine,同步返回,不产生图片任务。

作用

与站内「AI润色」同一套逻辑。按创作类型和参考图扩写描述词,成功字段是 result。

计费

2积分/次,从 API 积分扣除。

请求参数数据类型说明与约束
prompt可选
string
待润色的原文。没有参考图,且 type 不是 smartimg、kontext、nanoimg、blender 时必填。
type可选
string
创作类型,与站内一致。常见 smartimg、editimage、text2video、image2video、frames2video、reference2video、seedance2video。不传则按通用描述词润色。
imgurl可选
string
参考图 URL。也可传 inputImg,或把第一张放进 ctlImgs / images。
imgurl_2可选
string
第二张参考图。融合、首尾帧、换背景参考图使用。
imgurl_3可选
string
第三张参考图。
ctlImgs可选
string[]
多张参考图。也可传 images 或 inputImgs,服务端按同一列表处理。
subType可选
string
type=editimage 时的子功能,如 changebg、inpaint、smarteditimage。
tplid可选
int
视频运镜模板编号。没有模板时不传。
响应字段数据类型说明与约束
status可选
int
200 表示成功。
result可选
string
润色后的描述词。
润色请求示例
curl -X POST "https://dhd.douhuiai.com/api/openapi/refine" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "一条细链项链,几何吊坠,浅灰背景的电商主图",
  "type": "smartimg",
  "ctlImgs": [
    "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png"
  ]
}'
润色返回 JSON
{
  "status": 200,
  "result": "一条细链项链,几何吊坠居中,浅灰背景,柔和棚拍光,金属边缘清晰……"
}

7. 任务状态轮询

地址

POST /api/openapi/task

用法

没有回调,或需要主动核对结果时,用提交返回的 uuid 查询。

未就绪

uuid 还没有对应作品或批量任务时,status 为 -200,msg 为「任务未开始」。请稍后重试。

请求参数数据类型说明与约束
uuid必填
string
提交接口返回的 uuid。
响应字段数据类型说明与约束
status可选
int
200 表示读到了任务。-200 表示 uuid 为空、任务未开始或参数错误。
msg可选
string
获取成功,或任务未开始。
data可选
object
uuid、progress、state(running/success/failed)、total_count、done_count、fail_count、images。单图和多图都用这个结构。多图在生成中会返回已经完成的子图,fail_count 是失败张数。失败时可带 reason。
轮询请求示例
curl -X POST "https://dhd.douhuiai.com/api/openapi/task" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{"uuid":"a1b2c3d4e5"}'
轮询完成响应
{
  "status": 200,
  "msg": "获取成功",
  "data": {
    "uuid": "a1b2c3d4e5",
    "progress": 100,
    "state": "success",
    "total_count": 2,
    "done_count": 2,
    "fail_count": 0,
    "images": [
      "https://img2.douhuiai.com/dhimg/img/demo-1.png",
      "https://img2.douhuiai.com/dhimg/img/demo-2.png"
    ]
  }
}
排队或生成中响应
{
  "status": 200,
  "msg": "获取成功",
  "data": {
    "uuid": "a1b2c3d4e5",
    "progress": 50,
    "state": "running",
    "total_count": 2,
    "done_count": 1,
    "fail_count": 0,
    "images": [
      "https://img2.douhuiai.com/dhimg/img/demo-1.png"
    ]
  }
}

8. 查询账户余额

地址

POST /api/openapi/balance

单位

只返回积分。points 是当前可用积分,total 是累计充值积分。

响应字段数据类型说明与约束
data.points可选
int
当前 API 积分。
data.total可选
int
累计充值积分。
余额请求示例
curl -X POST "https://dhd.douhuiai.com/api/openapi/balance" \
  -H "Authorization: Bearer dhk_你的密钥"
余额响应 JSON
{
  "status": 200,
  "msg": "ok",
  "data": {
    "points": 1250,
    "total": 5000
  }
}

9. 模型、比例与分辨率对照

出图张数

智能出图、万能改图,以及文生图、N-banana、多图融合、白模、线稿、一键场景/卖点/试穿/细节、款式融合、文字出款、产品设计、概念图、彩平、毛坯、3D 渲染、线稿渲染这些接口,imgNum 为 1 到 20,默认 1。模型单次只能出更少张时,服务端拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号,用它轮询。图片编辑器的模型出图也是 1 到 20;裁剪、转线稿、标准去污和标准扩图仍是 1、2 或 4,不支持 3。商品图编辑、效果图后期、换发型是 1、2 或 4,不支持 3。Flux、相似图、风格更换、真人转漫画是 1、2、3 或 4。固定 1 张的接口没有 imgNum。

比例

预设为 1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。qwen3 另支持 7:9、9:7、9:21,不支持 4:5、5:4。nano-banana、nano-banana-2、nano-banana-2.1、nano-banana-pro 只能传预设比例,不能传自定义宽高。

自定义比例

只有 gpt-image-2、gpt-image-2.5、Seedream、wan2.7、qwen3 可以自定义。sizeMode 必须传 custom,ratio 传宽x高,x 为小写,宽和高都是正整数,例如 1024x1536。最终出图像素就是这两个数,不会再按 resolution 放大或缩小。resolution 仍要传该模型允许的档位。

gpt-image-2 / gpt-image-2.5 自定义

宽和高都必须是 16 的倍数。单边不超过 3840。宽/高在 1/3 到 3 之间,也就是 1:3 到 3:1。总像素 655360 到 8294400。例如 1024x1536 可以,1000x1500 不行。

Seedream 自定义

宽/高在 1/16 到 16 之间。seedream4、seedream5Pro:总像素 921600 到 16777216。seedream4.5、seedream5:总像素 3686400 到 16777216。低于下限或高于 16777216 会直接拒绝。

wan2.7 自定义

宽和高都必须是 8 的倍数。宽/高在 1/8 到 8 之间。总像素至少 589824(768×768)。wan2.7:单边不超过 2048,总像素不超过 4194304(2048×2048)。wan2.7-pro 没有参考图:单边不超过 4096,总像素不超过 16777216(4096×4096)。wan2.7-pro 有参考图:单边不超过 2048,总像素不超过 4194304。

qwen3 自定义

qwen3 与 qwen3-pro 相同。宽和高都必须是 8 的倍数。宽/高在 1/8 到 8 之间。总像素 262144(512×512)到 4194304(2048×2048)。

原图比例

有参考图时,sizeMode 传 origin,ratio 传原图的宽x高。服务端按该模型的比例范围和所选 resolution 换算输出尺寸。原图宽高比超出该模型上限时会直接拒绝:gpt-image-2 与 2.5 为 1:3 到 3:1,Seedream 为 1:16 到 16:1,wan2.7 与 qwen3 为 1:8 到 8:1。

分辨率

gpt-image-2、gpt-image-2.5、nano-banana-2、nano-banana-2.1、nano-banana-pro 为 1K、2K、4K,按分辨率计费。nano-banana(1.0)按当前标价计费,未配置则拒绝。seedream4 与 seedream4.5 为 2K、4K。seedream5 为 2K、3K。seedream5Pro 与 qwen3 为 1K、2K。不支持的档位会直接报错。

模型 Identifier中文说明张数限制分辨率支持比例可选
gpt-image-2gpt21-201K / 2K / 4K16 的倍数;单边≤3840;1:3~3:1;总像素 655360~8294400
gpt-image-2.5version=flare 或 sunburst1-201K / 2K / 4K与 gpt-image-2 相同
nano-bananabanana1-201K / 2K / 4K仅预设,不支持自定义宽高
nano-banana-2banana21-201K / 2K / 4K仅预设,不支持自定义宽高
nano-banana-2.1banana2.11-201K / 2K / 4K仅预设,不支持自定义宽高
nano-banana-probananaPro1-201K / 2K / 4K仅预设,不支持自定义宽高
seedream-4 / 4.5 / 5 / 5-proseedream4、seedream4.5、seedream5、seedream5Pro1-204/4.5:2K、4K;5:2K、3K;5 Pro:1K、2K1:16~16:1。4 / 5 Pro:921600~16777216。4.5 / 5:3686400~16777216
wan2.7 / wan2.7-pro通义万相1-201K / 2K / 4K。有参考图时只传 1K 或 2K8 的倍数;1:8~8:1;总像素≥589824。2.7 单边≤2048。Pro 无参考图单边≤4096,有参考图单边≤2048
qwen3 / qwen3-pro通义千问图像1-201K / 2K8 的倍数;1:8~8:1;总像素 262144~4194304。参考图最多 3 张

图像

AI 智能出图

POST/api/openapi/smartimg
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
提示词。
model必填
string
gpt-image-2、gpt-image-2.5、nano-banana、nano-banana-2、nano-banana-2.1、nano-banana-pro、seedream-4、seedream-4.5、seedream-5、seedream-5-pro、wan2.7、wan2.7-pro、qwen3、qwen3-pro、normal。
version可选
string
仅 gpt-image-2.5:flare(默认)或 sunburst。
channel可选
string
仅 nano-banana-pro,默认 normal。
resolution可选
string
gpt-image-2、gpt-image-2.5、nano-banana、nano-banana-2、nano-banana-2.1、nano-banana-pro、wan2.7、wan2.7-pro:1K、2K、4K。seedream4、seedream4.5:2K、4K。seedream5:2K、3K。seedream5Pro、qwen3、qwen3-pro:1K、2K。默认 1K,Seedream 4/4.5 不传时按 2K。
imgNum可选
int
1 到 20。默认 1。gpt-image-2、gpt-image-2.5、nano-banana 单次只能出 1 张,Seedream 与 wan2.7 单次最多 4 张,qwen3 单次最多 6 张。超出后拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
ratio可选
string
预设比例,如 1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时传 1024x1536 这种宽x高。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
inputImgs可选
string[]
参考图 URL。多数模型最多 10 张;qwen3 最多 3 张;wan2.7 最多 9 张。
autoOptimize可选
bool
true 时先润色提示词再出图。
注意事项

imgNum 为 1 到 20。超过模型单次张数时返回批量任务 uuid,用任务查询看整批进度。

参考图请先上传,或传公网可访问的 URL。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/smartimg" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "以这双沙滩鞋为商品主体,生成电商主图:鞋子完整居中,浅灰渐变背景,柔和棚拍光,鞋面编织和厚底边缘清晰,不改变鞋型和配色。",
  "model": "gpt-image-2",
  "resolution": "1K",
  "imgNum": 1,
  "ratio": "1:1",
  "sizeMode": "smart",
  "inputImgs": [
    "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png"
  ]
}'
返回响应示例 (JSON)
{
  "status": 200,
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

图片编辑器

POST/api/openapi/editimage
请求参数 (Request Body)数据类型说明与约束
tool必填
string
upscale 高清放大、repainting 高清重绘、outpaint 扩图、ps 抠图、changebg 换背景、crop 裁剪、ratio 比例调整、aieraser 万物消除、inpaint 局部修改、repair 局部修复、replace 万物替换、changestyle 换风格、imgrefined 一键美化、photoclear 变清晰、phototoline 转线稿、img2lineart 提取线稿、discolor 去色、removewater 去水印、universaledit 万能改图。
inputImg必填
string
主图 URL。批量时也可只传 inputImgs,第一张会作为主图。
inputImgs可选
string[]
批量输入,1-24 张。传入多张时按批量处理。
imgNum可选
int
模型出图为 1 到 20,默认 1,超出单次张数会拆开分别扣费。裁剪、转线稿、标准去污和标准扩图为 1、2 或 4,不支持 3。
prompt可选
string
改图指令。扩图、消除、替换、换背景、万能改图等需要描述时填写。
maskImg可选
string
蒙版图 URL。局部修改、消除、替换等涂抹类功能使用。
model可选
string
子功能提供模型选择时填写,取值与智能出图的 model 相同。
resolution可选
string
该子功能提供分辨率时填写,如 1K、2K、4K。
ratio可选
string
比例调整、扩图或模型出图时的目标比例。自定义宽高传 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时传 custom。
version可选
string
model 为 gpt-image-2.5 时:flare 或 sunburst。
channel可选
string
仅 nano-banana-pro,默认 normal。
注意事项

裁剪、抠图、去色、去水印等本地处理类功能不需要模型参数。

局部修改、万物消除、万物替换需要 maskImg 标出区域。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/editimage" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "tool": "upscale",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
  "imgNum": 1,
  "resolution": "2K"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "uuid": "b2c3d4e5f6",
  "wait_time": 20
}

万能改图

POST/api/openapi/smartedit
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
改图指令,例如「把背景换成浅灰色棚拍」。
inputImg必填
string
要修改的图片 URL。批量时可改传 inputImgs。
inputImgs可选
string[]
批量改图,1-24 张。每张使用同一个 prompt 和 imgNum。
model可选
string
gpt-image-2、gpt-image-2.5、nano-banana、nano-banana-2、nano-banana-2.1、nano-banana-pro、kontext、normal。默认 gpt-image-2。
version可选
string
gpt-image-2.5 的 flare 或 sunburst。
resolution可选
string
1K、2K、4K。默认 1K。
imgNum可选
int
1 到 20。默认 1。这些模型单次只能出 1 张,多张会拆成子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
ratio可选
string
目标比例。自定义时传宽x高,并设 sizeMode=custom。
sizeMode可选
string
smart、origin、custom。
refImg可选
string
额外参考图 URL。
channel可选
string
仅 nano-banana-pro,默认 normal。
注意事项

imgNum 为 1 到 20。超过 1 张时按子任务拆开。

批量时每张输入图单独成任务,完成时各自回调。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/smartedit" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "保持这双沙滩鞋的鞋型、编织鞋面和配色不变,把背景换成干净的浅灰色棚拍背景,地面保留柔和投影。",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
  "model": "gpt-image-2",
  "resolution": "1K",
  "imgNum": 1,
  "ratio": "1:1",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "uuid": "c3d4e5f6a7",
  "wait_time": 40
}

提示词

POST/api/openapi/prompt
请求参数 (Request Body)数据类型说明与约束
tool必填
string
reverse 图片反推,refine 站内 AI 润色,instruct 按图片和指令生成提示词,video 视频反推。
inputImg可选
string
reverse、instruct 使用的图片 URL。reverse 必填。
inputImgs可选
string[]
instruct 可传多张参考图。
prompt可选
string
refine 的待润色原文,或 instruct 的指令。instruct 必填。refine 没图时必填,其余参数与 POST /api/openapi/refine 相同,成功读 result。
videoUrl可选
string
video 必填,可访问的视频地址。
videoMode可选
string
视频反推方式,默认 natural。
注意事项

反推、指令和视频反推成功时读 zh 或 en,没有 uuid。

tool=refine 与 POST /api/openapi/refine 相同,成功字段是 result。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/prompt" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "tool": "reverse",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "zh": "一条细链项链,几何吊坠,浅灰背景,柔和棚拍",
  "en": "a fine-chain necklace with a geometric pendant, light gray background, soft studio light"
}

PSD 图层导出

POST/api/openapi/layereditor
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
tool可选
string
固定传 layersplit。不传时服务端按拆层处理。
resolution可选
string
1K 或 2K。默认 1K。
prompt可选
string
拆层补充说明。
splitMode可选
string
auto 自动拆层,custom 按框拆层。
boxes可选
object[]
自定义框,元素含位置和大小。有框时按 custom 处理。
注意事项

结果通过任务 uuid 查询。导出 PSD 在拆层完成后进行。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/layereditor" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
  "tool": "layersplit",
  "resolution": "1K",
  "splitMode": "auto",
  "prompt": "按帆布包的包身、提手和印花拆层"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

模型与应用

Midjourney

POST/api/openapi/text2imgpro
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
提示词或改图说明。
ratio可选
string
比例,如 1:1、3:4。自定义时传宽:高。
inputImg可选
string
垫图 URL。
styleRef1可选
string
风格参考图 1。
styleRef2可选
string
风格参考图 2。
faceImg可选
string
人脸参考图。仅部分版本可用。
mode可选
string
6.1、7、8.1、niji6、niji7。不传时默认 7。
resolution可选
string
仅 8.1 使用。传 1K 或 2K。
speed可选
string
fast 或 relax。不传时按 fast。
channel可选
string
线路,默认 dedicated。
注意事项

固定出 4 张,没有 imgNum。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/text2imgpro" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "一只家猫坐在窗边,午后侧光,毛发细节清楚,背景虚化,摄影感",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202603/69b52ea4e1303.jpg",
  "mode": "7",
  "ratio": "3:4",
  "speed": "fast",
  "channel": "dedicated"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

N-banana创作

POST/api/openapi/nanoimg
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
提示词或改图说明。
inputImgs可选
string[]
参考图,最多 10 张。
model可选
string
banana、banana2、bananaPro。默认 bananaPro。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
1K、2K、4K。默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
channel可选
string
仅 bananaPro,默认 normal。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/nanoimg" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "参考这张帆布包设计图,生成正面产品图:包身图案和配色保持一致,纯白背景,底部有轻微投影。",
  "inputImgs": [
    "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png"
  ],
  "model": "bananaPro",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "1:1",
  "channel": "normal"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

图片重绘

POST/api/openapi/repainting
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
要重绘的图片 URL。必填。
prompt可选
string
改图需求或指令。万能改图页必填。
refImg可选
string
参考图 URL。
imgNum可选
int
1、2、3 或 4。默认 1。
resolution可选
string
万能改图页:gpt2、gpt2.5、bananaPro 用 1K、2K、4K,不传默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
model可选
string
万能改图页的模型。不传按页面默认 gpt2、1K。可选:normal 基础模式,bananaPro(Pro模式),Kontext,fast 快速改图,gpt2,gpt2.5。图片重绘(原版)是检查点、重绘强度和主题模板,不使用这组模型。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/repainting" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
  "prompt": "保持清洗机的机身结构和按键布局,提高清晰度和材质质感,背景仍为浅色棚拍。",
  "model": "gpt2",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "1:1"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

文生图

POST/api/openapi/txt2img
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
画面描述。必填。
model可选
string
页面模型。不传按页面默认 gpt2(GPT image-2,1K)。可选:normal 基础模式,banana2.1(N-banana 2.1),bananaPro(Pro模式),seedream5Pro、seedream5、seedream4.5、seedream4(Seedream 5.0 Pro / 5.0 / 4.5 / 4.0),wan2_7_image、wan2_7_image_pro(Wan 2.7),zimage(Z-Image),flux(Flux 原版),mj(Midjourney),gpt2,gpt2.5。
mode可选
string
仅 text2imgpro 使用版本号。本接口不要传 mj。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
refImg可选
string
部分模型支持单张参考图。
channel可选
string
MJ 线路,默认 dedicated。
speed可选
string
MJ 速度:fast 或 relax。
注意事项

不传 model 时按页面默认 GPT image-2、1K。

model=flux 是页面的 Flux(原版),每张 8 积分。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/txt2img" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "女赛车手半身肖像,赛车头盔夹在臂弯,赛道灯光虚化,电影感侧光",
  "model": "gpt2",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "3:4",
  "sizeMode": "smart",
  "refImg": "https://img2.douhuiai.com/dhimg/img/202607/6a58a216b92d6.png"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

SDXL创作

POST/api/openapi/sd
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
画面描述。
modelId可选
int
底模编号,对应页面「模型选择」。不传时使用 6875。
inputImg可选
string
控制图 URL,对应页面「上传图片」。不传则只按画面描述出图。
ctlId可选
int
控制方式编号,对应上传图片后的控制类型。没有控制图时不用传。
ctlSth可选
string
控制强度,0 到 1。页面默认 0.6。
loraIds可选
string
模板 JSON 数组,最多 4 个。每项含 id、recsth。对应页面「模板(Lora)」。
paintStyle可选
int
画风编号。不传则不指定画风。
refImg可选
string
第 1 张参考图 URL。
refSth可选
string
第 1 张参考图强度,0.1 到 1。页面默认 0.6。
refImg2可选
string
第 2 张参考图 URL。
refSth2可选
string
第 2 张参考图强度,0.1 到 1。页面默认 0.5。
faceImg可选
string
脸部参考图 URL,需包含清晰人脸。
faceSth可选
string
脸部参考强度,0.3 到 1。页面默认 0.6。
ratio可选
string
出图比例,如 1:1、3:4、9:16、16:9。自定义传宽:高,例如 3:4。有控制图时按控制图尺寸出图。
imgNum可选
int
1、2、3 或 4。不传默认 1。按张计费。
注意事项

每张 8 积分。

底模、控制图、模板、画风、参考图和脸部参考都与网站 SDXL 创作页一致。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/sd" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "白色棚拍背景,帆布包居中,保留包身印花和提手",
  "imgNum": 1,
  "ratio": "1:1"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

Flux创作

POST/api/openapi/flux
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
画面描述。
modelId可选
int
底模编号,对应页面「模型选择」。不传时使用 12153。
inputImg可选
string
控制图 URL,对应页面「上传图片」。不传则只按画面描述出图。
ctlId可选
int
控制方式编号,对应上传图片后的控制类型。没有控制图时不用传。
ctlSth可选
string
控制强度,0 到 1。页面默认 0.6。
loraIds可选
string
模板 JSON 数组,最多 4 个。每项含 id、recsth。对应页面「模板(Lora)」。
paintStyle可选
int
画风编号。不传则不指定画风。
refImg可选
string
第 1 张参考图 URL。
refSth可选
string
第 1 张参考图强度,0.3 到 1。页面默认 0.8。
refImg2可选
string
第 2 张参考图 URL。
refSth2可选
string
第 2 张参考图强度,0.3 到 1。页面默认 0.6。
faceImg可选
string
脸部参考图 URL,需包含清晰人脸。
faceSth可选
string
脸部参考强度,0.6 到 1。页面默认 0.9。
ratio可选
string
出图比例,如 1:1、3:4、9:16、16:9。自定义传宽:高,例如 3:4。有控制图时按控制图尺寸出图。
imgNum可选
int
1、2、3 或 4。不传默认 1。按张计费。
注意事项

每张 8 积分。

底模、控制图、模板、画风、参考图和脸部参考都与网站 Flux 创作页一致。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/flux" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "白色棚拍背景,帆布包居中,保留包身印花和提手",
  "imgNum": 1,
  "ratio": "1:1"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

图片精修

POST/api/openapi/imgrefined
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
prompt可选
string
提示词或改图说明。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/imgrefined" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
  "prompt": "保留瓶身logo和膏体,提升瓶身高光和标签清晰度"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

多图融合

POST/api/openapi/blender
请求参数 (Request Body)数据类型说明与约束
inputImgs必填
string[]
待融合图片,至少 2 张。
prompt可选
string
提示词或改图说明。
model可选
string
normal、strict、Flux、banana、bananaPro、kontext、chinese、gpt2、gpt2.5、seedream4、seedream4.5、seedream5、seedream5Pro。不传时按页面默认 gpt2、1K。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/blender" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImgs": [
    "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
    "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png"
  ],
  "prompt": "让女性模特佩戴这条项链,项链造型和人物五官都保持原样,棚拍半身构图",
  "model": "Flux",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "3:4",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

相似图生成

POST/api/openapi/imagevariants
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
prompt可选
string
提示词或改图说明。
imgNum可选
int
1、2、3 或 4。默认 1。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/imagevariants" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202603/69b52ea4e1303.jpg",
  "prompt": "同一只猫,改成坐姿侧脸,窗边自然光,不改变花色",
  "imgNum": 2,
  "ratio": "1:1"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

PS场景融合

POST/api/openapi/productblend
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
商品图 URL。
refImg可选
string
场景图 URL。
prompt可选
string
提示词或改图说明。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/productblend" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
  "prompt": "把清洗机放进整洁的家用清洁场景,机器外形和配色不变,地面有真实接触阴影"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

图片视角调整

POST/api/openapi/multiangle
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
prompt可选
string
提示词或改图说明。
mode可选
string
视角编号,整数。不传为 0,只按 prompt 出图。传了编号时 prompt 要写成该视角的描述。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/multiangle" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
  "prompt": "同一条项链,改为45度斜上方视角,吊坠完整可见",
  "resolution": "1K",
  "ratio": "1:1"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

批量抠图

POST/api/openapi/productrmbg
请求参数 (Request Body)数据类型说明与约束
inputImgs必填
string[]
待抠图片 URL。1 到 24 张,传数组或逗号分隔。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/productrmbg" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImgs": [
    "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
    "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
    "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png"
  ]
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

3d模型渲染

POST/api/openapi/whitemodel
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
3D模型截图 URL。必填。
prompt可选
string
细节补充,可以不填。
mode可选
string
传 smart。页面现在是智能出图,底图仍然必填。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
model可选
string
页面上的模型。不传按页面默认 gpt2(GPT image-2,1K)。可选:normal 通用模式,strict 通用模式 +,seedream5Pro、seedream5、seedream4.5、seedream4(对应 Seedream 5.0 Pro / 5.0 / 4.5 / 4.0),banana2.1(N-banana 2.1),bananaPro(Pro模式),gpt2,gpt2.5。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/whitemodel" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
  "prompt": "按这台清洗机的结构生成白模产品渲染,保留机身比例和手柄位置,浅灰背景",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "1:1"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

线稿渲染

POST/api/openapi/line
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
手绘或软件线稿 URL。必填。
prompt可选
string
细节补充,可以不填。
mode可选
string
传 smart。页面现在是智能出图,底图仍然必填。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
model可选
string
页面上的模型。不传按页面默认 gpt2(GPT image-2,1K)。可选:normal 通用模式,strict 通用模式 +,seedream5Pro、seedream5、seedream4.5、seedream4(对应 Seedream 5.0 Pro / 5.0 / 4.5 / 4.0),banana2.1(N-banana 2.1),bananaPro(Pro模式),gpt2,gpt2.5。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/line" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
  "prompt": "把帆布包设计图渲染成彩色产品图,保留包型和印花轮廓",
  "mode": "smart",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "1:1"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

风格材质更换

POST/api/openapi/styletransform
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
照片或效果图 URL。必填。
prompt可选
string
创意描述。必填。
refImg可选
string
风格参考图。
imgNum可选
int
1、2、3 或 4。默认 1。
resolution可选
string
这一页是线条控制、景深控制和主题模板,没有 GPT / Seedream 分辨率。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/styletransform" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
  "prompt": "保持鞋型,把鞋面材质改成帆布印花,配色参考第二张设计图",
  "refImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "1:1"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

PNG素材生成

POST/api/openapi/text2transimg
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
提示词或改图说明。
inputImg可选
string
主图 URL。
imgNum可选
int
1、2 或 4。不支持 3。默认 1。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/text2transimg" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "把这条项链做成透明背景的电商素材,只保留项链本身,边缘干净",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
  "imgNum": 1,
  "ratio": "1:1"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

人物多姿势

POST/api/openapi/aimultipose
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
人物原图。
refImg可选
string
姿势参考图。mode 为姿势参考时必填。
prompt可选
string
mode 为描述姿势时必填。
mode可选
string
1 随机姿势,2 按描述,3 按参考图。
model可选
string
normal、banana、bananaPro、gpt2、gpt2.5。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/aimultipose" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "prompt": "同一位女性模特,改为自然站立、双手轻搭身前的半身姿势",
  "mode": "2",
  "model": "bananaPro",
  "resolution": "2K",
  "ratio": "3:4"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

产品电商

电商套图策划

POST/api/openapi/productgalleryplan
请求参数 (Request Body)数据类型说明与约束
imageUrls必填
string[]
商品图 URL,最多 10 张。须可公网访问,不能传 blob 或 data URL。
sellingPoints可选
string
核心卖点。多行文本直接传字符串。
extraRequirement可选
string
补充分析要求,例如希望强调的场景、风格或卖点。
platform可选
string
目标电商平台,例如 Amazon、TikTok。不传时由模型结合图片判断。
desMarket可选
string
目标市场,例如 北美、东南亚。
desLang可选
string
文案语种,例如 中文、英语。
visualStyle可选
string
视觉风格,例如 极简商业摄影、轻奢生活方式。
planDirections可选
object[]
指定出图方向。每项含 name,可选 id、detail。不传时由模型自行规划。最多 50 个。
planDirectionNames可选
string[]
出图方向名称。与 planDirections 同时传时,以这里的名称列表为准。
dhModel可选
string
默认出图模型,仅作为策划上下文。banana、bananaPro、seedream5、gpt2。
dhMode可选
string
模型子版本。banana 对应 banana2,bananaPro 对应 bananaPro,seedream5 对应 seedream5,gpt2 对应 gpt2。
dhResolution可选
string
默认分辨率,例如 1K、2K、4K。只作为策划上下文,不按出图张数扣费。
dhNum可选
int
每个方向默认张数,1 到 10。
dhImgRatio可选
string
默认比例。预设为 auto、1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。不传时结果里的 imgRatio 回退为 -2。
dhSizeMode可选
string
smart、origin、custom。默认 smart。
注意事项

开发者接口是 POST /api/openapi/productgalleryplan,请求头带 Authorization: Bearer dhk_。响应是 SSE,请用 curl -N 或按事件流读取。

按当前标价计费。计费项未配置时拒绝调用,不使用默认积分。策划失败、超时或未返回 result 时,已扣积分自动退回。成功只扣这一次,后面的出图再按电商套图单独计费。

事件为 thinking、result、error、done。result 的 data 是 JSON,items 里有 cateName、name、prompt、imgRatio。

不创建出图任务,也不返回 uuid。把 items 整理成下方电商套图的 tasks 后,再单独提交出图。

imageUrls 至少 1 张,最多 10 张。方向超过 50 个会直接拒绝,这种参数错误不会扣费。

请求参数示例 (JSON)
curl -N -X POST "https://dhd.douhuiai.com/api/openapi/productgalleryplan" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "imageUrls": [
    "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png"
  ],
  "sellingPoints": "1. 瓶身标识清楚,膏体可见\n2. 质地轻薄,适合日常保湿\n3. 适合作为面霜主图、质地细节图和梳妆台场景图",
  "extraRequirement": "优先规划白底主图、膏体质地特写、梳妆台使用场景",
  "platform": "天猫",
  "desMarket": "中国",
  "desLang": "中文",
  "visualStyle": "干净棚拍,浅色背景",
  "dhModel": "bananaPro",
  "dhMode": "bananaPro",
  "dhResolution": "2K",
  "dhNum": 1,
  "dhImgRatio": "1:1",
  "dhSizeMode": "smart"
}'
SSE 返回示例
event: thinking
data: 正在分析面霜包装和适合的电商图类型...

event: result
data: {"items":[{"cateName":"白底主图","name":"白底主图","prompt":"面霜瓶身完整居中直立,纯白背景,底部保留柔和投影,logo和膏体颜色不变。","imgRatio":"1:1"},{"cateName":"细节材质图","name":"膏体质地","prompt":"近景展示面霜膏体的光泽和细腻质地,瓶身logo仍可辨认,背景干净,不改变包装颜色。","imgRatio":"4:5"}]}

event: done
data: ok

电商套图

POSThttps://dhd.douhuiai.com/api/aiart/doBatchTask
请求参数 (Request Body)数据类型说明与约束
dhAiType必填
string
固定 labbatchimg。
parentAiType必填
string
固定 productgallery。
sourceMode必填
string
固定 productgallery_agent。
pathname必填
string
固定 /ai-image/productgallery。这三个字段一起用来识别电商套图。
createMode必填
string
固定 agent。
executorType必填
string
固定 labbatchimg。
parentToolKey必填
string
固定 productgallery。
subcatename必填
string
固定 labbatchimg。
dhInputImgs必填
string[]
商品图 URL,最多 6 张。任务未单独传图时,子任务使用这里的图。
tasks必填
object[]
出图任务,1 到 50 个。每项需要 prompt、dhModel、dhMode、dhResolution、dhImgNum、dhImgRatio、dhSizeMode。建议同时传 title、taskName、directionName、dhInputImgs、scene。
tasks[].dhModel必填
string
banana、bananaPro、seedream5、gpt2。
tasks[].dhMode必填
string
banana 传 banana2,bananaPro 传 bananaPro,seedream5 传 seedream5,gpt2 传 gpt2。
tasks[].dhImgNum必填
int
该任务出图张数,1 到 10。
tasks[].dhImgRatio必填
string
auto、1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义尺寸时 dhSizeMode 传 custom,比例传宽x高,例如 1024x1536。
tasks[].dhSizeMode可选
string
smart、origin、custom。默认 smart。origin 时传 source_ratio_index;custom 时再传 image_width、image_height。
tasks[].dhResolution必填
string
该模型允许的档位,例如 1K、2K、4K。seedream5 为 2K、3K。
sellingPoints可选
string
核心卖点,多行文本。只写入任务记录,不替代 tasks[].prompt。
marketConfig可选
object
市场配置。键为 platform、desMarket、desLang、visualStyle。
globalConfig可选
object
整组默认输出。键为 dhModel、dhMode、dhResolution、dhImgNum、dhImgRatio、dhSizeMode、dhChannel。单任务字段优先。
planDirections可选
object[]
策划方向,每项含 id、name、detail。用于回看方案,不单独触发出图。
dhDesignMode可选
string
整组默认模型,与 tasks[].dhModel 使用同一套取值。
注意事项

出图地址是 POST https://dhd.douhuiai.com/api/aiart/doBatchTask。请求体是任务数组 tasks,不要传 groups 或 aiTypeId。

parentAiType、sourceMode、pathname 必须分别是 productgallery、productgallery_agent、/ai-image/productgallery,否则不会按电商套图处理。

鉴权可用已登录网站会话,或请求头 Authorization: Bearer dhk_密钥。带密钥时按 API 账户扣积分。

成功时读 uuid 或 task_uuid,再用任务轮询接口查进度。每个任务按自己的模型和张数分别扣费。

策划接口返回的 items 需要调用方补上模型和张数:name 写入 title 与 taskName,cateName 写入 directionName,prompt 原样放入 tasks[].prompt。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/aiart/doBatchTask" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "dhAiType": "labbatchimg",
  "parentAiType": "productgallery",
  "parentToolKey": "productgallery",
  "createMode": "agent",
  "executorType": "labbatchimg",
  "sourceMode": "productgallery_agent",
  "subcatename": "labbatchimg",
  "pathname": "/ai-image/productgallery",
  "dhDesignMode": "bananaPro",
  "dhInputImgs": [
    "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png"
  ],
  "sellingPoints": "1. 瓶身标识清楚,膏体可见\n2. 质地轻薄,适合日常保湿",
  "marketConfig": {
    "platform": "天猫",
    "desMarket": "中国",
    "desLang": "中文",
    "visualStyle": "干净棚拍,浅色背景"
  },
  "tasks": [
    {
      "title": "白底主图",
      "taskName": "白底主图",
      "directionName": "白底主图",
      "prompt": "基于这瓶面霜生成白底主图:瓶身完整居中直立,纯白背景,底部保留柔和投影,logo和膏体颜色不变。",
      "dhModel": "bananaPro",
      "dhMode": "bananaPro",
      "dhResolution": "2K",
      "dhImgNum": 1,
      "dhImgRatio": "1:1",
      "dhSizeMode": "smart",
      "dhInputImgs": [
        "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png"
      ],
      "scene": "productgallery"
    },
    {
      "title": "膏体质地",
      "taskName": "膏体质地",
      "directionName": "细节材质图",
      "prompt": "近景展示面霜膏体的光泽和细腻质地,瓶身logo仍可辨认,背景干净,不改变包装颜色。",
      "dhModel": "bananaPro",
      "dhMode": "bananaPro",
      "dhResolution": "2K",
      "dhImgNum": 1,
      "dhImgRatio": "4:5",
      "dhSizeMode": "smart",
      "dhInputImgs": [
        "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png"
      ],
      "scene": "productgallery"
    }
  ],
  "globalConfig": {
    "dhModel": "bananaPro",
    "dhMode": "bananaPro",
    "dhResolution": "2K",
    "dhImgNum": 1,
    "dhImgRatio": "1:1",
    "dhSizeMode": "smart"
  }
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "任务已入队",
  "uuid": "task_a1b2c3d4e5",
  "task_uuid": "task_a1b2c3d4e5",
  "data": {
    "task_uuid": "task_a1b2c3d4e5",
    "task_id": 123456,
    "total_count": 2
  }
}

一键场景图

POST/api/openapi/genscene
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
产品图 URL。必填。
prompt可选
string
细节补充,可以不填。
options可选
object
JSON。可用键:producttype、scenetype、scenestyle、deslang、producttitle、sellpoint、fonttype。不传或传 {} 时按智能文案生成。
refImg可选
string
参考图 URL,不能和主图相同。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
model可选
string
页面模型。不传按页面默认 gpt2、1K。可选:strict 基础模式一,consistent 基础模式二,banana2.1(N-banana 2.1),bananaPro(Pro模式),seedream5Pro、seedream5、seedream4.5、seedream4,gpt2,gpt2.5。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
inputImgs可选
string[]
批量商品图,最多 24 张。传入后按批量处理。
注意事项

传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/genscene" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
  "prompt": "家用地板清洁场景,机器放在光洁地砖上",
  "options": {
    "producttype": "家用清洗机",
    "producttitle": "手持清洗机",
    "scenetype": "家庭清洁",
    "scenestyle": "明亮现代家居",
    "deslang": "中文",
    "sellpoint": "轻便手持,适合地面缝隙清洁"
  },
  "model": "gpt2",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "1:1",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

AI试穿试戴

POST/api/openapi/virtualtryon
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
商品主图 URL。
prompt可选
string
补充说明,会拼进生成文案。不传则只按 options 或默认文案。
options可选
object
JSON。可用键:producttype、scenetype、scenestyle、deslang、producttitle、sellpoint、fonttype。不传或传 {} 时按智能文案生成。
refImg可选
string
参考图 URL,不能和主图相同。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
model可选
string
strict、gpt2、gpt2.5、consistent、bananaPro、seedream4、seedream4.5、seedream5、seedream5Pro。不传时按 gpt-image-2 计费。
resolution可选
string
gpt2.5、bananaPro:1K、2K、4K。seedream4、seedream4.5:2K、4K。seedream5:2K、3K。seedream5Pro:1K、2K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
inputImgs可选
string[]
批量商品图,最多 24 张。传入后按批量处理。
注意事项

传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/virtualtryon" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
  "refImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "prompt": "女性模特佩戴这条项链,半身棚拍,项链大小和吊坠造型不变",
  "options": {
    "producttype": "项链",
    "producttitle": "几何吊坠项链",
    "deslang": "中文"
  },
  "model": "bananaPro",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "3:4",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

一键卖点图

POST/api/openapi/sellingpoint
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
商品主图 URL。
prompt可选
string
补充说明,会拼进生成文案。不传则只按 options 或默认文案。
options可选
object
JSON。可用键:producttype、scenetype、scenestyle、deslang、producttitle、sellpoint、fonttype。不传或传 {} 时按智能文案生成。
refImg可选
string
参考图 URL,不能和主图相同。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
model可选
string
strict、gpt2、gpt2.5、consistent、bananaPro、seedream4、seedream4.5、seedream5、seedream5Pro。不传时按 gpt-image-2 计费。
resolution可选
string
gpt2.5、bananaPro:1K、2K、4K。seedream4、seedream4.5:2K、4K。seedream5:2K、3K。seedream5Pro:1K、2K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
inputImgs可选
string[]
批量商品图,最多 24 张。传入后按批量处理。
注意事项

传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/sellingpoint" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
  "prompt": "面霜卖点图,突出瓶身和膏体,旁边留出售点文字区",
  "options": {
    "producttype": "面霜",
    "producttitle": "HR面霜",
    "sellpoint": "深层保湿,质地清爽",
    "deslang": "中文",
    "fonttype": "简约无衬线"
  },
  "model": "gpt2",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "3:4",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

一键白底图

POST/api/openapi/ecommerce
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
商品主图 URL。
prompt可选
string
补充说明,会拼进生成文案。不传则只按 options 或默认文案。
options可选
object
JSON。可用键:producttype、scenetype、scenestyle、deslang、producttitle、sellpoint、fonttype。不传或传 {} 时按智能文案生成。
refImg可选
string
参考图 URL,不能和主图相同。
imgNum可选
int
固定 1 张。
model可选
string
strict、gpt2、gpt2.5、consistent、bananaPro、seedream4、seedream4.5、seedream5、seedream5Pro。不传时按 gpt-image-2 计费。
resolution可选
string
gpt2.5、bananaPro:1K、2K、4K。seedream4、seedream4.5:2K、4K。seedream5:2K、3K。seedream5Pro:1K、2K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
inputImgs可选
string[]
批量商品图,最多 24 张。传入后按批量处理。
注意事项

传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/ecommerce" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
  "prompt": "沙滩鞋白底主图,鞋子完整、底部有轻微真实投影",
  "options": {
    "producttype": "沙滩鞋",
    "producttitle": "编织沙滩鞋",
    "deslang": "中文"
  },
  "model": "gpt2",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "1:1",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

一键细节特写

POST/api/openapi/detailenhance
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
商品主图 URL。
prompt可选
string
补充说明,会拼进生成文案。不传则只按 options 或默认文案。
options可选
object
JSON。可用键:producttype、scenetype、scenestyle、deslang、producttitle、sellpoint、fonttype。不传或传 {} 时按智能文案生成。
refImg可选
string
参考图 URL,不能和主图相同。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
model可选
string
strict、gpt2、gpt2.5、consistent、bananaPro、seedream4、seedream4.5、seedream5、seedream5Pro。不传时按 gpt-image-2 计费。
resolution可选
string
gpt2.5、bananaPro:1K、2K、4K。seedream4、seedream4.5:2K、4K。seedream5:2K、3K。seedream5Pro:1K、2K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
inputImgs可选
string[]
批量商品图,最多 24 张。传入后按批量处理。
注意事项

传入 inputImgs 时按批量提交,最多 24 张。options 的键见字段说明。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/detailenhance" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
  "prompt": "项链吊坠和链节的近景细节,突出金属质感",
  "options": {
    "producttype": "项链",
    "producttitle": "几何吊坠项链",
    "sellpoint": "链节细腻,吊坠轮廓清楚",
    "deslang": "中文"
  },
  "model": "gpt2",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "1:1",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

商品图编辑

POST/api/openapi/productedit
请求参数 (Request Body)数据类型说明与约束
tool必填
string
ps、photoclear、imgrefined、upscale、changebg、img2lineart、smarteditimage、ecommerce、enhancement、colorchange、imgtranslate、universaledit。
inputImg必填
string
主图 URL。
prompt可选
string
提示词或改图说明。
maskImg可选
string
需要涂抹时的蒙版 URL。
imgNum可选
int
1、2 或 4。不支持 3。默认 1。 供应商单次只能出 1 张时会拆开,分别扣费。
model可选
string
gpt2、gpt2.5、bananaPro、seedream4.5。工具没有模型选择时不传。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/productedit" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "tool": "universaledit",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
  "prompt": "保留瓶身和logo,把背景换成纯白,瓶底保留柔和投影",
  "model": "gpt2",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "1:1",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

电商换背景

POST/api/openapi/replacebg
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
refImg可选
string
场景参考图。纯色背景时不传。
sceneMode可选
string
参考图场景或 color。color 时传 bgColor 和 refMode。
refMode可选
int
纯色背景效果。1 自动填充,2 纯色渐变。sceneMode 为 color 时必填。
bgColor可选
string
纯色背景,7 位色值,如 #ffffff。sceneMode 为 color 时必填。
prompt可选
string
提示词或改图说明。
model可选
string
normal、strict、bananaPro、gpt2、gpt2.5。默认 normal。
resolution可选
string
1K、2K、4K。gpt2.5 只接受这三档。默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
注意事项

固定出 1 张,没有 imgNum。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/replacebg" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
  "sceneMode": "color",
  "refMode": 1,
  "bgColor": "#ffffff",
  "model": "normal",
  "resolution": "1K",
  "ratio": "1:1",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

商品替换

POST/api/openapi/itemreplace
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
refImg可选
string
要放入的模特、家具或商品参考图。
maskImg可选
string
涂抹区域蒙版 URL。替换模式需要。
prompt可选
string
描述要替换成什么。smart 模式必填,replace 模式可不传。
mode可选
string
smart 或 replace。不传按 smart,此时 prompt 必填。replace 可不传 prompt,但必须传 maskImg,且张数固定为 1。
imgNum可选
int
smart:1 或 2,默认 1。replace:固定 1 张。
resolution可选
string
1K、2K、4K。仅 smart 模式使用。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/itemreplace" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "refImg": "https://img2.douhuiai.com/dhimg/img/202608/6a8e6c8ede5a5.jpg",
  "prompt": "把人物胸前的饰品替换成参考图中的这条项链,人物脸和服装不变",
  "mode": "smart",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "3:4"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

模特试衣

POST/api/openapi/modelfitting
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
模特图 URL。
inputImgs必填
string[]
服装或商品图,至少 1 张。
prompt可选
string
提示词或改图说明。
mode可选
string
默认 smart。
model可选
string
normal、strict、bananaPro、gpt2、gpt2.5。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
generationMode可选
string
single、batch 或 multiple。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/modelfitting" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "inputImgs": [
    "https://img2.douhuiai.com/dhimg/img/202607/6a65733626019.jpg"
  ],
  "prompt": "让这位女性模特穿上这套赛车服,服装版型、徽章和配色保持不变,自然站立",
  "mode": "smart",
  "model": "bananaPro",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "3:4",
  "generationMode": "single"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

AI换模特

POST/api/openapi/replacemodel
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
refImg可选
string
目标模特参考图。
prompt可选
string
提示词或改图说明。
options可选
object
JSON。键为选项名,值为选项文案。prompt、refImg、options 至少填一项。固定出 1 张。
model可选
string
gpt2、gpt2.5、bananaPro、seedream4.5。默认 gpt2。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/replacemodel" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a65733626019.jpg",
  "refImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "prompt": "保留赛车服,把穿着者换成参考图中的女性模特",
  "model": "gpt2",
  "resolution": "1K",
  "ratio": "3:4"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

场景加模特

POST/api/openapi/addmodel
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
refImg可选
string
要放入的模特、家具或商品参考图。
maskImg可选
string
涂抹区域蒙版 URL。替换模式需要。
prompt可选
string
描述要替换成什么。smart 模式必填,replace 模式可不传。
mode可选
string
smart 或 replace。不传按 smart,此时 prompt 必填。replace 可不传 prompt,但必须传 maskImg,且张数固定为 1。
imgNum可选
int
smart:1 或 2,默认 1。replace:固定 1 张。
resolution可选
string
1K、2K、4K。仅 smart 模式使用。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/addmodel" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a50970114c62.png",
  "refImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "prompt": "在清洗机旁边加入参考图中的女性,她单手扶住机器介绍产品,机器外形不变",
  "mode": "smart",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "3:4"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

图片翻译

POST/api/openapi/imgtranslate
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
单张时的原图。批量时改传 inputImgs。
inputImgs可选
string[]
批量原图,最多 24 张。
lang必填
string
英语、繁体中文、简体中文、西班牙语、法语、阿拉伯语、葡萄牙语、俄语、德语、日语、印尼语、越南语、韩语、意大利语、泰语。只能传这些值。
mode可选
string
seedream 版本,仅 model 为 chinese 或 seedream 时使用:seedream4、seedream4.5、seedream5、seedream5Pro。其他模型不传。
model必填
string
normal、fast、bananaPro、gpt2、gpt2.5、seedream4、seedream4.5、seedream5、seedream5Pro。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
注意事项

传入 inputImgs 时按批量翻译。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/imgtranslate" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
  "lang": "英语",
  "model": "gpt2",
  "resolution": "1K",
  "ratio": "1:1",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

款式融合

POST/api/openapi/stylefusion
请求参数 (Request Body)数据类型说明与约束
inputImgs必填
string[]
款式图 URL,最多 4 张。
prompt可选
string
细节补充,可以不填。
model可选
string
页面上的模型。不传按页面默认 gpt2(GPT image-2,1K)。可选:normal 通用模式,strict 通用模式 +,seedream5Pro、seedream5、seedream4.5、seedream4(对应 Seedream 5.0 Pro / 5.0 / 4.5 / 4.0),banana2.1(N-banana 2.1),bananaPro(Pro模式),gpt2,gpt2.5。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
sizeMode可选
string
smart、origin、custom。自定义宽高时必须传 custom。默认 smart。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/stylefusion" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImgs": [
    "https://img2.douhuiai.com/dhimg/img/202605/6a1688d2e6bdb.png",
    "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png"
  ],
  "prompt": "保留沙滩鞋的鞋型,把鞋面改成第二张帆布包设计图的印花和配色",
  "model": "bananaPro",
  "imgNum": 1,
  "resolution": "1K",
  "ratio": "1:1",
  "sizeMode": "smart"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

文字出款

POST/api/openapi/textimage
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
提示词或改图说明。
inputImg可选
string
主图 URL。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/textimage" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "根据这张帆布包设计图,生成一款同系列托特包,正面居中,白底,保留原有图形语言",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
  "imgNum": 1,
  "ratio": "1:1",
  "resolution": "1K"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

AI产品设计

POST/api/openapi/goodsdesign
请求参数 (Request Body)数据类型说明与约束
prompt可选
string
细节补充,可以不填。
inputImg必填
string
产品图 URL。必填。
refImg可选
string
参考图 URL,可以不传。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
mode可选
string
传 smart。页面没有只靠提示词、不传产品图的出图方式。
resolution可选
string
gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
model可选
string
页面模型。不传按页面默认 gpt2(GPT image-2,1K)。可选:normal 通用模式,strict 通用模式 +,banana2.1(N-banana 2.1),bananaPro(Pro模式),gpt2,gpt2.5。
subType可选
string
功能选择。product_modify 产品修改,model_render 产品模型渲染,line_render 产品线稿渲染,material_modify 产品材质修改。不传按产品修改。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/goodsdesign" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "在这张帆布包设计图的基础上,做一款深蓝配色的新配色,包型和图案结构不变",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a5740aee6ccd.png",
  "imgNum": 2,
  "ratio": "1:1",
  "resolution": "1K"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

建筑室内

彩平图

POST/api/openapi/colorcad
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
原平面图 URL。必填。
prompt可选
string
细节补充,可以不填。
mode可选
string
传 smart。页面现在是智能出图,底图仍然必填。
refImg可选
string
参考图 URL。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
model可选
string
页面上的模型。不传按页面默认 gpt2(GPT image-2,1K)。可选:normal 通用模式,strict 通用模式 +,seedream5Pro、seedream5、seedream4.5、seedream4(对应 Seedream 5.0 Pro / 5.0 / 4.5 / 4.0),banana2.1(N-banana 2.1),bananaPro(Pro模式),gpt2,gpt2.5。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/colorcad" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "prompt": "按这张平面图纸填充墙体、家具和地面材质,保留原始户型墙线,输出彩色平面图",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "4:3"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

3D渲染

POST/api/openapi/idmodel
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
3dmax、SU 等三维场景截图 URL。必填。
prompt可选
string
细节补充,可以不填。
mode可选
string
传 smart。页面现在是智能出图,底图仍然必填。
refImg可选
string
参考图 URL。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
model可选
string
页面上的模型。不传按页面默认 gpt2(GPT image-2,1K)。可选:normal 通用模式,strict 通用模式 +,seedream5Pro、seedream5、seedream4.5、seedream4(对应 Seedream 5.0 Pro / 5.0 / 4.5 / 4.0),banana2.1(N-banana 2.1),bananaPro(Pro模式),gpt2,gpt2.5。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/idmodel" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "prompt": "按平面图的房间关系生成日光室内效果图,现代简约,保留门窗和墙体位置",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "16:9"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

毛坯房精装

POST/api/openapi/roughcast
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
毛坯现场照片 URL,正视角。必填。
prompt可选
string
细节补充,可以不填。
mode可选
string
传 smart。页面现在是智能出图,底图仍然必填。
refImg可选
string
参考图 URL。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
model可选
string
页面上的模型。不传按页面默认 gpt2(GPT image-2,1K)。可选:normal 通用模式,strict 通用模式 +,seedream5Pro、seedream5、seedream4.5、seedream4(对应 Seedream 5.0 Pro / 5.0 / 4.5 / 4.0),banana2.1(N-banana 2.1),bananaPro(Pro模式),gpt2,gpt2.5。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/roughcast" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "prompt": "把这张户型转成已精装的客厅视角,浅木地板,白色墙面,保留房间比例",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "16:9"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

AI概念图

POST/api/openapi/concept
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
画面描述。必填。
inputImg可选
string
概念图页面不以上传底图为必填。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
model可选
string
页面模型。可选:normal 基础模式,strict 通用模式 +,seedream5Pro、seedream5、seedream4.5、seedream4,banana2.1(N-banana 2.1),bananaPro(Pro模式),gpt2,gpt2.5。不传按页面默认 gpt2、1K。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/concept" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "根据这张平面图做一张建筑概念效果图,白天,玻璃和浅色石材,低层建筑",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "imgNum": 1,
  "ratio": "16:9",
  "resolution": "2K"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

效果图后期

POST/api/openapi/postprocess
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
prompt可选
string
提示词或改图说明。
tool可选
string
upscale、aiwash、repainting、photoclear、daynight、styletransfer、aieraser、repair、inpaint、replace、img2lineart、chateditimage、smarteditimage、universaledit。不传时按 upscale。
imgNum可选
int
1、2 或 4。不支持 3。默认 1。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/postprocess" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "tool": "photoclear",
  "prompt": "提高线条和色块清晰度,不改户型",
  "imgNum": 1,
  "resolution": "2K"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

效果图增强

POST/api/openapi/renderenhance
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
tool必填
string
upscale、denoise、render、detail、material、lighting、saturation、depth、beautify。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/renderenhance" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "tool": "detail",
  "resolution": "2K"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

软硬装替换

POST/api/openapi/furnishreplace
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
refImg可选
string
要放入的模特、家具或商品参考图。
maskImg可选
string
涂抹区域蒙版 URL。替换模式需要。
prompt可选
string
描述要替换成什么。smart 模式必填,replace 模式可不传。
mode可选
string
smart 或 replace。不传按 smart,此时 prompt 必填。replace 可不传 prompt,但必须传 maskImg,且张数固定为 1。
imgNum可选
int
smart:1 或 2,默认 1。replace:固定 1 张。
resolution可选
string
1K、2K、4K。仅 smart 模式使用。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/furnishreplace" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "prompt": "保留户型墙线,把客厅家具换成浅色布艺沙发和原木茶几",
  "mode": "smart",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "4:3"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

风格转换

POST/api/openapi/idtransform
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
空间照片或效果图 URL。必填。
prompt可选
string
创意描述。必填。
mode可选
string
传 smart 走智能模式。底图仍然必填,提示词可以不填。不传或其他值时走原版,必须再选控制网络。
refImg可选
string
参考图 URL。
imgNum可选
int
1、2、3 或 4。默认 1。
resolution可选
string
这一页是线条控制、景深控制和主题模板,没有 GPT / Seedream 分辨率。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/idtransform" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "prompt": "同一户型,改成北欧风格彩色平面,墙线位置不变",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "4:3"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

线稿渲染

POST/api/openapi/idline
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
线稿或手绘图 URL。必填。
prompt可选
string
细节补充,可以不填。
mode可选
string
传 smart。页面现在是智能出图,底图仍然必填。
refImg可选
string
参考图 URL。
imgNum可选
int
1 到 20。默认 1。超过该模型单次张数时拆成多个子任务,分别扣费、分别回调。返回的 uuid 是这批任务的编号。
resolution可选
string
跟所选模型走。gpt2、gpt2.5、bananaPro、banana2.1 用 1K、2K、4K,不传默认 1K。seedream5Pro 用 1K、2K。seedream5 用 2K、3K。seedream4.5、seedream4 用 2K、4K。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
model可选
string
页面上的模型。不传按页面默认 gpt2(GPT image-2,1K)。可选:normal 通用模式,strict 通用模式 +,seedream5Pro、seedream5、seedream4.5、seedream4(对应 Seedream 5.0 Pro / 5.0 / 4.5 / 4.0),banana2.1(N-banana 2.1),bananaPro(Pro模式),gpt2,gpt2.5。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/idline" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "prompt": "依据这张线稿平面,渲染成带家具图例的彩色平面图,不移动墙体",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "4:3"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

场景加模特

POST/api/openapi/addcharacter
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
refImg可选
string
要放入的模特、家具或商品参考图。
maskImg可选
string
涂抹区域蒙版 URL。替换模式需要。
prompt可选
string
描述要替换成什么。smart 模式必填,replace 模式可不传。
mode可选
string
smart 或 replace。不传按 smart,此时 prompt 必填。replace 可不传 prompt,但必须传 maskImg,且张数固定为 1。
imgNum可选
int
smart:1 或 2,默认 1。replace:固定 1 张。
resolution可选
string
1K、2K、4K。仅 smart 模式使用。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/addcharacter" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202609/6a962ebce5456.jpg",
  "refImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "prompt": "在客厅活动区加入参考图中的女性,比例符合室内空间,不挡住主要家具",
  "mode": "smart",
  "imgNum": 1,
  "resolution": "2K",
  "ratio": "16:9"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

人像写真

AI证件照

POST/api/openapi/idphoto
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
人像图 URL。
prompt可选
string
提示词或改图说明。
bgColor可选
string
背景色。
resolution可选
string
1K、2K、4K。gpt2.5 这三档都可用。seedream4.5 只支持 2K、4K,不传时默认 2K。seedream5 只支持 2K、3K。seedream5Pro 只支持 1K、2K,不传时默认 1K。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/idphoto" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "prompt": "标准证件照,正面,露出双耳,白色背景",
  "bgColor": "#ffffff",
  "resolution": "1K"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

老照片修复

POST/api/openapi/fixphoto
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
blurLevel可选
int
模糊程度 0-5,默认 2。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/fixphoto" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202603/69b52ea4e1303.jpg",
  "blurLevel": 2
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

人像换脸

POST/api/openapi/swapface
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
模板底图。
faceImg必填
string
人脸图 URL。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/swapface" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a58a216b92d6.png",
  "faceImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

人像变清晰

POST/api/openapi/photoclear
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
模糊照片 URL。必填。
resolution可选
string
人像变清晰页面没有分辨率和模型选择。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/photoclear" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "resolution": "2K"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

照片上色

POST/api/openapi/recolor
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/recolor" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202603/69b52ea4e1303.jpg"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

AI写真/形象照

POST/api/openapi/aiportrait
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
人脸图 URL。
prompt必填
string
提示词或改图说明。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/aiportrait" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "prompt": "同一位女性的棚拍形象照,浅灰背景,自然妆容,半身正面",
  "ratio": "3:4"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

AI换发型

POST/api/openapi/changehair
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
prompt可选
string
提示词或改图说明。
refImg可选
string
发型参考图。
maskImg可选
string
头发区域蒙版。
imgNum可选
int
1、2 或 4。不支持 3。默认 1。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/changehair" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "prompt": "保持五官和服装,把发型改成低马尾,发色仍为深色",
  "imgNum": 1
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

真人转漫画

POST/api/openapi/people2cartoon
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
主图 URL。
prompt可选
string
提示词或改图说明。
imgNum可选
int
1、2、3 或 4。默认 1。
ratio可选
string
1:1、2:3、3:4、4:5、9:16、3:2、4:3、5:4、16:9、21:9。自定义时 sizeMode 传 custom,ratio 传宽x高,例如 1024x1536。
请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/people2cartoon" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a58a216b92d6.png",
  "prompt": "把这位女赛车手转成干净的日系漫画半身像,保留头盔和赛车服配色",
  "imgNum": 1,
  "ratio": "3:4"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

3D

图转3D模型

POST/api/openapi/img2model
请求参数 (Request Body)数据类型说明与约束
mode可选
string
single 单图,multi 多图。不传按 single。
inputImg可选
string
单图模式的图片 URL。单图模式必填。
frontImg可选
string
多图模式正视图,必填。
backImg可选
string
多图模式后视图,可选。
leftImg可选
string
多图模式左视图,可选。
rightImg可选
string
多图模式右视图,可选。
faceCount可选
int
模型面数:1500000 超高、1000000 高、500000 中、50000 低。不传为 1500000。面数不改变价格。
注意事项

按网站图转3D的豆点折算积分,与面数、单图或多图无关。

图片需可公网访问,单张不超过 10MB,宽高都不小于 128。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/img2model" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "single",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202512/6952504193bf6.png",
  "faceCount": 1500000
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 180
}

视频创作

AI视频创作

POST/api/openapi/videoaio
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
视频描述。多帧时还要给每一段写 transitionPrompt。
model可选
string
seedance2、seedance25、wan26、wan27、happyhorse、minimaxh3、klingv3、veo3、geminiomni、basic。默认 seedance2。
version可选
string
子模型。Seedance 2.0 为 seedance2_0、seedance2_0_fast、seedance2_0_mini。可灵为 kling-video-o1。Veo 为 veo3.1fast 或 veo3.1pro。
creationMode可选
string
free 自由创作,frames 首尾帧,multiFrames 智能多帧。默认 free。
inputImg可选
string
首帧,或单张参考图。参考生视频会并入参考图列表。frames 时作为首帧。
endImg可选
string
尾帧图。frames 时按模型要求填写。
inputImgs可选
string[]
多张参考图。
videos可选
object[]
参考视频,元素含 url,Gemini Omni 还可带 start、ends。
audios可选
object[]
参考音频,元素含 url。
frames可选
object[]
智能多帧。每段含 img、duration、transitionPrompt,至少两帧。
resolution可选
string
清晰度。不传时 Seedance 为 480p,MiniMax 为 768P,其余为 720p。
duration可选
int
秒数。不传时 Seedance、Veo、Gemini、HappyHorse 为 4 秒,Wan 2.6、MiniMax、可灵 O1 和基础模型为 5 秒。
ratio可选
string
画面比例,如 16:9、9:16、1:1。不传时按 16:9。
audio可选
int
1 生成声音,0 不生成。Seedance 2.0、Seedance 2.5、Veo 支持。Wan、HappyHorse、可灵、MiniMax、基础模型传了也会被忽略。
注意事项

creationMode=multiFrames 时传 frames。任务异步返回 uuid,成片用任务查询或回调获取。

提交时会同时带上 dhAioSource=videoaio。

视频创作模式、时长、比例和分辨率会按模型补默认值。单张参考图传 inputImg 即可。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/videoaio" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "女赛车手看向镜头,头发被风轻轻吹起,背景是虚化的赛道灯光,镜头缓慢推进",
  "model": "seedance2",
  "version": "seedance2_0",
  "creationMode": "free",
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202607/6a58a216b92d6.png",
  "resolution": "720p",
  "duration": 4,
  "ratio": "9:16",
  "audio": 1
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

视频编辑器

POST/api/openapi/videoeditor
请求参数 (Request Body)数据类型说明与约束
tool必填
string
edit、upscale、ratio、extend、replace、erase、filter、style、motion、background、subtitle、concat、translate。
sourceVideo必填
string
原视频 URL。
inputVideo可选
string
实际处理的片段地址。不传时使用 sourceVideo。
prompt可选
string
edit 等需要描述的工具必填。
mode可选
string
seedance2_0、seedance2_0_fast、seedance2_0_mini、happyhorse。放大工具可不传。
params可选
object
当前工具的参数。例如 ratio 的 editRatio,extend 的 editExtendSeconds、editExtendDirection,translate 的 editTranslateLang。
output可选
object
输出选项,可含 audio、resolution、duration、ratio。
referenceImages可选
string[]
参考图。replace 等工具使用。
注意事项

edit、replace、erase、style、motion、background 必须传 prompt。upscale 可不传 mode。mode 只支持 seedance2_0、seedance2_0_fast、seedance2_0_mini、happyhorse。费用按实际输入视频时长计算,不是固定秒数。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/videoeditor" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "tool": "edit",
  "sourceVideo": "https://img2.douhuiai.com/dhimg/video/20260721/6a5ec8522c8bc.mp4",
  "prompt": "保持原视频主体,把画面调得更清晰,运动更顺",
  "mode": "seedance2_0",
  "output": {
    "resolution": "720p",
    "audio": 1
  }
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

数字人口播

POST/api/openapi/aipresenter
请求参数 (Request Body)数据类型说明与约束
inputImg必填
string
数字人形象图 URL。
prompt必填
string
口播文案。
voicePath必填
string
口播音频 URL,必须是 http(s) 地址,且为 mp3。
duration必填
int
视频时长,只能是 5、10、15、20、30 秒。不传会直接拒绝。
resolution可选
string
如 1080p。
mode可选
string
默认 presenter。
注意事项

duration 必填,只能是 5、10、15、20、30 秒。

示例 voicePath 是音色库「甜美桃子」的公开试听 mp3。口播以这段音频为准,duration 决定成片时长。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/aipresenter" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "inputImg": "https://img2.douhuiai.com/dhimg/img/202606/6a3e4ae4999b9.png",
  "prompt": "这款面霜质地轻薄,涂开后很快吸收,适合每天保湿。",
  "voicePath": "https://img2.douhuiai.com/dhimg/audio/exps/audio/91bd95685132270530acc637159f24cc.mp3",
  "resolution": "1080p",
  "mode": "presenter",
  "duration": 5
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}

音色库

POST/api/openapi/voices
注意事项

无请求体。需要 Authorization: Bearer dhk_。不扣积分。

data 是音色列表。把 id 填到文生音频的 voiceId。audio 是该音色的公开试听地址。

下面的返回示例只摘了两条。实际会返回当前全部可用音色,按 id 升序。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/voices" \
  -H "Authorization: Bearer dhk_你的密钥"
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "ok",
  "data": [
    {
      "id": 321,
      "name": "甜美桃子",
      "gender": "女",
      "age": "青年",
      "emotion": "通用",
      "cate1": "通用场景",
      "cate2": "",
      "cate3": "",
      "audio": "https://img2.douhuiai.com/dhimg/audio/exps/audio/91bd95685132270530acc637159f24cc.mp3"
    },
    {
      "id": 323,
      "name": "Tina老师",
      "gender": "女",
      "age": "青年",
      "emotion": "通用",
      "cate1": "教学场景",
      "cate2": "",
      "cate3": "通用场景",
      "audio": "https://img2.douhuiai.com/dhimg/audio/exps/audio/cd02acdeb71cc0aa87bcb37414de8c82.mp3"
    }
  ]
}

文生音频

POST/api/openapi/voiceclone
请求参数 (Request Body)数据类型说明与约束
prompt必填
string
朗读文本,400 字以内。
voiceId必填
string
音色库返回的 id。例如 321 是「甜美桃子」。不要传「编号|works」。
emotion可选
string
情绪英文或中文标签,原样传给语音供应商。不传则不指定情绪。
lang可选
string
语种,如 中文、英语。不传则由音色模板决定。
注意事项

按文本长度从 API 积分扣费。返回的是音频任务 uuid。

先调用音色库拿到 id,再填到 voiceId。321 是「甜美桃子」。不要传「编号|works」。

请求参数示例 (JSON)
curl -X POST "https://dhd.douhuiai.com/api/openapi/voiceclone" \
  -H "Authorization: Bearer dhk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "这款面霜质地轻薄,涂开后很快吸收,适合每天保湿。",
  "voiceId": "321",
  "lang": "中文"
}'
返回响应示例 (JSON)
{
  "status": 200,
  "msg": "",
  "uuid": "a1b2c3d4e5",
  "wait_time": 40
}