Tomoviee AI Image Redrawing
Overview
Redraw image content with optional mask control.
- - API capability: INLINECODE0
- White mask area: redraw
- Black mask area: keep unchanged
Provider and Endpoint Provenance
Use this mapping to verify credential and endpoint provenance before production usage:
- - Vendor portals:
https://www.tomoviee.ai and INLINECODE2 - Gateway host used by this skill: INLINECODE3
- Redrawing endpoint: INLINECODE4
- Task result endpoint: INLINECODE5
This skill sends API requests only to openapi.wondershare.cc.
Quick Start
Install dependencies
CODEBLOCK0
Authentication
CODEBLOCK1
Python Client
CODEBLOCK2
API Usage
Basic Example
CODEBLOCK3
Parameters
- -
prompt (required): positive prompt text - INLINECODE8 (required): source image URL
- supported format:
jpg/png
- width and height:
>512 and
<2048
- aspect ratio:
<3
- -
mask_url (optional): mask image URL
- should have same resolution as
init_image
- supported format:
jpg/png
- width and height:
>512 and
<2048
- aspect ratio:
<3
- -
callback: callback URL (optional) - INLINECODE20 : transparent passthrough params (optional)
Async Workflow
- 1. Create task and get INLINECODE21
- Poll task status with INLINECODE22
- Parse output image URLs from INLINECODE23
Status codes:
- -
1 queued - INLINECODE25 processing
- INLINECODE26 success
- INLINECODE27 failed
- INLINECODE28 cancelled
- INLINECODE29 timeout
Resources
- -
scripts/tomoviee_redrawing_client.py - main redrawing client - INLINECODE31 - compatibility import shim
- INLINECODE32 - auth token helper
- INLINECODE33 - endpoint and workflow references
- INLINECODE34 - prompt writing guidance
External Resources
- - Developer portal (global): INLINECODE35
- API docs (global): INLINECODE36
- Developer portal (mainland): INLINECODE37
- API docs (mainland): INLINECODE38
- Gateway host used by this package: INLINECODE39
技能名称: tomoviee-image-redraw
详细描述:
Tomoviee AI 图像重绘
概述
通过可选的遮罩控制,对图像内容进行重绘。
- - API 能力:tm_redrawing
- 白色遮罩区域:重绘
- 黑色遮罩区域:保持不变
提供商与端点来源
在生产环境使用前,请使用以下映射验证凭证和端点来源:
- - 供应商门户:https://www.tomoviee.ai 和 https://www.tomoviee.cn
- 此技能使用的网关主机:https://openapi.wondershare.cc
- 重绘端点:https://openapi.wondershare.cc/v1/open/capacity/application/tm_redrawing
- 任务结果端点:https://openapi.wondershare.cc/v1/open/pub/task
此技能仅向 openapi.wondershare.cc 发送 API 请求。
快速开始
安装依赖
bash
pip install -r requirements.txt
身份验证
bash
python scripts/generateauthtoken.py YOURAPPKEY YOURAPPSECRET
Python 客户端
python
from scripts.tomovieeredrawingclient import TomovieeRedrawingClient
client = TomovieeRedrawingClient(appkey, appsecret)
API 使用
基本示例
python
taskid = client.imageredrawing(
prompt=晴朗的蓝天,飘着蓬松的云朵,
init_image=https://example.com/photo.jpg,
mask_url=https://example.com/mask.png,
)
result = client.polluntilcomplete(task_id)
import json
output = json.loads(result[result])
print(output[images_path][0])
参数
- - prompt(必填):正向提示文本
- init_image(必填):源图像 URL
- 支持格式:jpg/png
- 宽度和高度:>512 且 <2048
- 宽高比:<3
- 应与 init_image 分辨率相同
- 支持格式:jpg/png
- 宽度和高度:>512 且 <2048
- 宽高比:<3
- - callback:回调 URL(可选)
- params:透明透传参数(可选)
异步工作流
- 1. 创建任务并获取 taskid
- 使用 polluntilcomplete(taskid) 轮询任务状态
- 从 result 中解析输出图像 URL
状态码:
- - 1 已排队
- 2 处理中
- 3 成功
- 4 失败
- 5 已取消
- 6 超时
资源
- - scripts/tomovieeredrawingclient.py - 主要重绘客户端
- scripts/tomovieeimageredrawingclient.py - 兼容性导入适配层
- scripts/generateauthtoken.py - 身份验证令牌辅助工具
- references/imageapis.md - 端点与工作流参考
- references/prompt_guide.md - 提示词编写指南
外部资源
- - 开发者门户(全球):https://www.tomoviee.ai/developers.html
- API 文档(全球):https://www.tomoviee.ai/doc/
- 开发者门户(中国大陆):https://www.tomoviee.cn/developers.html
- API 文档(中国大陆):https://www.tomoviee.cn/doc/
- 此包使用的网关主机:https://openapi.wondershare.cc