Skip to content
EN

outpainting智能扩图

方法: POST路径: /volcv/v1

智能扩图支持多种扩展类型,包括:等比扩展、画幅扩展、四边扩展、画布扩展,用户prompt可选输入,不输入则按照算法默认逻辑进行扩展。 考虑到效果更佳,建议选择较小的扩展比例,建议一次性给客户返回3-4个效果供客户进行挑选。 1

https://www.volcengine.com/docs/6791/1279296详情请看官方对接文档

请求参数

Query 参数

text
Action
string
必需
示例:
CVProcess
Version
string
必需
示例:
2022-08-31

Header 参数

text
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}

Body 参数 application/json

text
object
示例
// 使用比例
{
"req_key"
:
"i2i_outpainting"
,
"prompt"
:
"蓝色的海洋"
,
"binary_data_base64"
:
[
"原图base64"
]
,
"scale"
:
7
,
"seed"
:
-1
,
"steps"
:
30
,
"strength"
:
0.8
,
"top"
:
0.1
"bottom"
:
0.1
,
"left"
:
1
,
"right"
:
1
,
"max_height"
:
1920
,
"max_width"
:
1920
}
// 使用画布
{
"req_key"
:
"i2i_outpainting"
,
"prompt"
:
"蓝色的海洋"
,
"binary_data_base64"
:
[
"延边图base64"
,
"延边图mask"
]
,
"scale"
:
7
,
"seed"
:
-1
,
"steps"
:
30
,
"strength"
:
0.8
"max_height"
:
1920
,
"max_width"
:
1920
,
}

请求示例代码

Shell

bash
curl --location --request POST '/volcv/v1?Action=CVProcess&Version=2022-08-31' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '// 使用比例
{
    "req_key": "i2i_outpainting",
    "prompt": "蓝色的海洋",
    "binary_data_base64": ["原图base64"],
    "scale": 7,
    "seed": -1,
    "steps": 30,
    "strength": 0.8,
    "top": 0.1
    "bottom": 0.1,
    "left": 1,
    "right": 1,
    "max_height": 1920,
    "max_width": 1920
}
// 使用画布
{
    "req_key": "i2i_outpainting",
    "prompt": "蓝色的海洋",
    "binary_data_base64": ["延边图base64", "延边图mask"],
    "scale": 7,
    "seed": -1,
    "steps": 30,
    "strength": 0.8
    "max_height": 1920,
    "max_width": 1920,
}'

返回响应

🟢 200 成功

内容类型: application/json

响应结构

text
object

示例

json
{
    "code": 10000,
    "data": {
        "algorithm_base_resp": {
            "status_code": 0,
            "status_message": "Success"
        },
        "binary_data_base64": [
            "扩展图base64"
        ],
        "image_urls": [
            "扩展图url"
        ],
        "request_id": "977202e694283d9e430e6d91d3e0bc6540077ea26de523ba7dfd3856409db693"
    },
    "message": "Success",
    "request_id": "20240314153408C09A6A1651795D028F5A",
    "status": 10000,
    "time_elapsed": "3.9405467s"
}