Replace Background 3.0(背景替换)
方法: POST路径: /ideogram/v1/ideogram-v3/replace-background
使用 Ideogram 3.0 的提示同步替换给定图像的背景。将识别并保留前景主题,而背景将根据提示和所选样式进行替换。支持的图像格式包括 JPEG、PNG 和 WebP。图片链接在有限的时间内可用;如果您想保留图像,则必须下载它。。 具体参数请看官方文档:https://developer.ideogram.ai/api-reference/api-reference/replace-background-v3
返回的图像 URL 在 24 小时内有效,超过该时间将无法访问图像。 已反代图片
请求参数
Header 参数
text
accept
string
必需
示例:
application/json
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}Body 参数 multipart/form-data
text
prompt
string
必需
rendering_speed
string
可选
image
file
必需请求示例代码
Shell
bash
curl --location --request POST '/ideogram/v1/ideogram-v3/replace-background' \
--header 'accept: application/json' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--form 'prompt=""' \
--form 'rendering_speed=""' \
--form 'image=@""'返回响应
🔴 500 成功
内容类型: application/json
响应结构
text
code
string
必需
message
string
必需
data
null
必需示例
json
{
"created": "2000-01-23 04:56:07+00:00",
"data": [
{
"prompt": "Add a forest in the background",
"resolution": "1280x800",
"is_image_safe": true,
"seed": 12345,
"url": "https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89",
"style_type": "GENERAL"
}
]
}