Tomoviee AI Text-to-Video
Overview
Generate 5-second videos from text descriptions.
- - API capability: INLINECODE0
- Supported resolutions:
720p, INLINECODE2 - Supported aspect ratios:
16:9, 9:16, 4:3, 3:4, INLINECODE7 - Optional camera control:
camera_move_index (1-46)
Provider and Endpoints
Use the following provider and endpoint mapping to keep credentials and routing consistent:
- - Vendor portals:
https://www.tomoviee.ai and INLINECODE10 - API gateway host used by this skill: INLINECODE11
- Create-task endpoint pattern: INLINECODE12
- Result endpoint: INLINECODE13
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): Text description (subject + action + scene + camera + lighting) - INLINECODE16 :
720p or 1080p (default: 720p) - INLINECODE20 : duration in seconds (currently
5) - INLINECODE22 :
16:9, 9:16, 4:3, 3:4, INLINECODE27 - INLINECODE28 : camera movement type (
1-46, optional) - INLINECODE30 : callback URL (optional)
- INLINECODE31 : transparent passthrough params (optional)
Async Workflow
- 1. Create task: call
text_to_video() and get INLINECODE33 - Poll status: call INLINECODE34
- Parse result: read video URL from returned JSON
Status codes:
- -
1 queued - INLINECODE36 processing
- INLINECODE37 success
- INLINECODE38 failed
- INLINECODE39 cancelled
- INLINECODE40 timeout
Typical generation time is 1-5 minutes per 5-second video.
Resources
scripts/
- -
tomoviee_text2video_client.py - Text-to-Video API client - INLINECODE42 - auth token generator
references/
- -
video_apis.md - detailed video API documentation - INLINECODE44 - camera movement index reference
- INLINECODE45 - prompt writing best practices
External Resources
- - Developer portal (global): INLINECODE46
- API docs (global): INLINECODE47
- Developer portal (mainland): INLINECODE48
- API docs (mainland): INLINECODE49
- API host used by this skill: INLINECODE50
Tomoviee AI 文本转视频
概述
根据文本描述生成5秒视频。
- - API能力:tmtext2videob
- 支持分辨率:720p、1080p
- 支持宽高比:16:9、9:16、4:3、3:4、1:1
- 可选镜头控制:cameramoveindex(1-46)
提供商与端点
使用以下提供商和端点映射以保持凭证和路由一致:
- - 供应商门户:https://www.tomoviee.ai 和 https://www.tomoviee.cn
- 本技能使用的API网关主机:https://openapi.wondershare.cc
- 创建任务端点模式:https://openapi.wondershare.cc/v1/open/capacity/application/
- 结果端点: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.tomovieetext2videoclient import TomovieeText2VideoClient
client = TomovieeText2VideoClient(appkey, appsecret)
API使用
基本示例
python
taskid = client.textto_video(
prompt=金毛犬在阳光照耀的草地上奔跑,慢动作,电影感,
resolution=720p,
aspect_ratio=16:9,
cameramoveindex=5,
)
result = client.polluntilcomplete(task_id)
import json
videourl = json.loads(result[result])[videopath][0]
print(video_url)
参数
- - prompt(必填):文本描述(主体+动作+场景+镜头+光照)
- resolution:720p 或 1080p(默认:720p)
- duration:视频时长(秒),当前为 5
- aspectratio:16:9、9:16、4:3、3:4、1:1
- cameramove_index:镜头运动类型(1-46,可选)
- callback:回调URL(可选)
- params:透明透传参数(可选)
异步工作流
- 1. 创建任务:调用 texttovideo() 获取 taskid
- 轮询状态:调用 polluntilcomplete(taskid)
- 解析结果:从返回的JSON中读取视频URL
状态码:
- - 1 排队中
- 2 处理中
- 3 成功
- 4 失败
- 5 已取消
- 6 超时
每段5秒视频的典型生成时间为1-5分钟。
资源
scripts/
- - tomovieetext2videoclient.py - 文本转视频API客户端
- generateauthtoken.py - 身份验证令牌生成器
references/
- - videoapis.md - 视频API详细文档
- cameramovements.md - 镜头运动索引参考
- 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/
- 本技能使用的API主机:https://openapi.wondershare.cc