Tomoviee AI Image-to-Video
Overview
Generate a 5-second video from a still image and prompt.
- - API capability: INLINECODE0
- Create endpoint: INLINECODE1
- Result endpoint: INLINECODE2
Provider and Endpoint Provenance
Use this mapping to verify provider identity and endpoint provenance:
- - Vendor portals:
https://www.tomoviee.ai and INLINECODE4 - Runtime gateway host used by this skill: INLINECODE5
- Compatible gateway alias: INLINECODE6
This skill sends runtime API calls only to openapi.wondershare.cc.
Credential Handling
- - Sensitive credentials required:
app_key and app_secret. - Credentials are only used to build
Authorization: Basic <base64(app_key:app_secret)>. - Credentials are kept in process memory and are not written to disk by this skill.
- Do not hardcode credentials in source files or commit them to git.
Dependencies
- - Runtime dependency: INLINECODE11
- Install with: INLINECODE12
Quick Start
Authentication helper
CODEBLOCK0
Python Client
CODEBLOCK1
API Usage
Basic Example
CODEBLOCK2
Parameters
- -
prompt (required): motion and scene guidance text. - INLINECODE14 (required): source image URL (
JPG/JPEG/PNG/WEBP, <200M). - INLINECODE17 (optional):
720p or 1080p, default 720p. - INLINECODE21 (optional): only
5 supported. - INLINECODE23 (optional):
16:9, 9:16, 4:3, 3:4, 1:1, original. - INLINECODE30 (optional): camera movement type
1-46. - INLINECODE32 (optional): callback URL.
- INLINECODE33 (optional): transparent callback parameter.
Async Workflow
- 1. Create task and get INLINECODE34
- Poll with INLINECODE35
- Parse video URL from INLINECODE36
Status codes:
- -
1 queued - INLINECODE38 processing
- INLINECODE39 success
- INLINECODE40 failed
- INLINECODE41 cancelled
- INLINECODE42 timeout
Resources
- -
scripts/tomoviee_img2video_client.py - main API client - INLINECODE44 - compatibility import shim
- INLINECODE45 - auth token helper
- INLINECODE46 - API reference and constraints
- INLINECODE47 - camera movement index reference
- INLINECODE48 - prompt writing guidance
External Resources
- - Developer portal (global): INLINECODE49
- API docs (global): INLINECODE50
- Developer portal (mainland): INLINECODE51
- API docs (mainland): INLINECODE52
Tomoviee AI 图像转视频
概述
从静态图像和提示词生成一段5秒的视频。
- - API能力:tmimg2videob
- 创建端点:https://openapi.wondershare.cc/v1/open/capacity/application/tmimg2videob
- 结果端点:https://openapi.wondershare.cc/v1/open/pub/task
提供商与端点来源
使用此映射验证提供商身份和端点来源:
- - 供应商门户:https://www.tomoviee.ai 和 https://www.tomoviee.cn
- 本技能使用的运行时网关主机:https://openapi.wondershare.cc
- 兼容网关别名:https://open-api.wondershare.cc
本技能仅向 openapi.wondershare.cc 发送运行时API调用。
凭证处理
- - 所需敏感凭证:appkey 和 appsecret。
- 凭证仅用于构建 Authorization: Basic key:appsecret)>。
- 凭证保存在进程内存中,本技能不会将其写入磁盘。
- 请勿在源文件中硬编码凭证或将其提交到git。
依赖项
- - 运行时依赖:requests>=2.31.0,<3.0.0
- 安装方式:pip install -r requirements.txt
快速开始
身份验证辅助工具
bash
python scripts/generateauthtoken.py YOURAPPKEY YOURAPPSECRET
Python客户端
python
from scripts.tomovieeimg2videoclient import TomovieeImg2VideoClient
client = TomovieeImg2VideoClient(appkey, appsecret)
API使用
基本示例
python
taskid = client.imageto_video(
prompt=镜头缓慢推进,场景中轻柔运动,电影级布光,
image=https://example.com/landscape.jpg,
resolution=720p,
duration=5,
aspect_ratio=original,
)
result = client.polluntilcomplete(task_id)
import json
videourl = json.loads(result[result])[videopath][0]
print(video_url)
参数
- - prompt(必填):运动和场景引导文本。
- image(必填):源图像URL(JPG/JPEG/PNG/WEBP,小于200M)。
- resolution(可选):720p 或 1080p,默认为 720p。
- duration(可选):仅支持 5。
- aspectratio(可选):16:9、9:16、4:3、3:4、1:1、original。
- cameramove_index(可选):镜头运动类型 1-46。
- callback(可选):回调URL。
- params(可选):透明回调参数。
异步工作流
- 1. 创建任务并获取 taskid
- 使用 polluntilcomplete(taskid) 轮询
- 从 result 解析视频URL
状态码:
- - 1 排队中
- 2 处理中
- 3 成功
- 4 失败
- 5 已取消
- 6 超时
资源
- - scripts/tomovieeimg2videoclient.py - 主API客户端
- scripts/tomovieeimagetovideoclient.py - 兼容性导入适配层
- scripts/generateauthtoken.py - 身份验证令牌辅助工具
- references/videoapis.md - API参考和约束
- references/cameramovements.md - 镜头运动索引参考
- references/prompt_guide.md - 提示词编写指南
外部资源
- - 开发者门户(全球):https://www.tomoviee.ai/developers.html
- API文档(全球):https://www.tomoviee.ai/doc/ai-video/image-to-video.html
- 开发者门户(中国大陆):https://www.tomoviee.cn/developers.html
- API文档(中国大陆):https://www.tomoviee.cn/doc/ai-video/image-to-video.html