lianfan.huiwa.task.image.expand.submit (提交扩图任务)

提交扩图任务

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
image_repaint_top_request ImageRepaintTopReq 必须 修图请求
  • image_expand_request
  • ImageExpandReq
  • 必须
  • 扩图请求,参考文档https://huiwa.yuque.com/org-wiki-huiwa-kpqu3p/huiwa/lgkaqxdgen5gr93x
  • └ action
  • Number
  • 可选
  • 2
  • 修图行为类型,2:扩图
  • └ image_url
  • String
  • 必须
  • https://img.alicdn.com/imgextra/i2/O1CN01KdHxgs1q379pTbGz2_!!6000000005439-2-tps-768-1024.png
  • 原图URL
  • └ pass_through
  • String
  • 可选
  • {}
  • 扩展字段
  • └ canvas_width
  • Number
  • 必须
  • 1024
  • 目标图片宽度
  • └ canvas_height
  • Number
  • 必须
  • 1024
  • 目标图片高度
  • └ horizontal_axis
  • Number
  • 必须
  • 128
  • 原图左上角在目标图片中的横坐标
  • └ vertical_axis
  • Number
  • 必须
  • 0
  • 原图左上角在目标图片中的纵坐标
  • └ image_native_width
  • Number
  • 可选
  • 768
  • 原图宽度
  • └ image_native_height
  • Number
  • 可选
  • 1024
  • 原图高度
  • └ output_size
  • Number
  • 可选
  • 2
  • 出图张数

响应参数

名称 类型 示例值 描述
result Result result
  • └ success
  • Boolean
  • false
  • success
  • error_codes
  • ErrorCodes []
  • errorCodes
  • └ code
  • String
  • AIGC_NVWA_PARAM_INVALID_COMMON
  • code
  • └ message
  • String
  • 参数不合法。
  • message
  • error_code
  • ErrorCode
  • errorCode
  • └ code
  • String
  • AIGC_NVWA_PARAM_INVALID_COMMON
  • code
  • └ message
  • String
  • 参数不合法。
  • message
  • model
  • Model
  • model
  • └ task_id
  • Number
  • 1234
  • taskId

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
LianfanHuiwaTaskImageExpandSubmitRequest req = new LianfanHuiwaTaskImageExpandSubmitRequest();
LianfanHuiwaTaskImageExpandSubmitRequest.ImageRepaintTopReq obj1 = new LianfanHuiwaTaskImageExpandSubmitRequest.ImageRepaintTopReq();
LianfanHuiwaTaskImageExpandSubmitRequest.ImageExpandReq obj2 = new LianfanHuiwaTaskImageExpandSubmitRequest.ImageExpandReq();
obj2.setAction(2L);
obj2.setImageUrl("https://img.alicdn.com/imgextra/i2/O1CN01KdHxgs1q379pTbGz2_!!6000000005439-2-tps-768-1024.png");
obj2.setPassThrough("{}");
obj2.setCanvasWidth(1024L);
obj2.setCanvasHeight(1024L);
obj2.setHorizontalAxis(128L);
obj2.setVerticalAxis(0L);
obj2.setImageNativeWidth(768L);
obj2.setImageNativeHeight(1024L);
obj2.setOutputSize(2L);
obj1.setImageExpandRequest(obj2);
req.setImageRepaintTopRequest(obj1);
LianfanHuiwaTaskImageExpandSubmitResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<lianfan_huiwa_task_image_expand_submit_response>
    <result>
        <success>false</success>
        <error_codes>
            <error_codes>
                <code>AIGC_NVWA_PARAM_INVALID_COMMON</code>
                <message>参数不合法。</message>
            </error_codes>
        </error_codes>
        <error_code>
            <code>AIGC_NVWA_PARAM_INVALID_COMMON</code>
            <message>参数不合法。</message>
        </error_code>
        <model>
            <task_id>1234</task_id>
        </model>
    </result>
</lianfan_huiwa_task_image_expand_submit_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部