Video Generation Toolkit
Generate AI videos from text prompts or images using 40+ models including Veo 3.1, Veo 3, Seedance 1.5 Pro, Wan 2.5, Grok Imagine Video, etc.
Prerequisites
IMPORTANT: This skill requires the inference.sh CLI to be installed and available in your PATH. The CLI provides access to 40+ AI video generation models.
To install inference.sh:
CODEBLOCK0
Or visit https://inference.sh for installation instructions.
Constraints
- - Always output absolute paths for generated files so the web UI can render them.
- Web UI auto-renders local paths: output
.mp4/.mov paths as plain text (NOT in code blocks or markdown links), so the UI can render a video player inline. Same for .jpg/.png → inline image. - Uploaded files arrive as
[附件: /absolute/path/to/file] in the message. - For image-to-video, images must be accessible via public URL. Provide your own API key for ImgBB/SM.MS, or ensure images are already publicly accessible.
Tool 1 — texttovideo.py (Text to Video)
Generate video from text prompt.
CODEBLOCK1
| Flag | Description |
|---|
| INLINECODE3 | (required) Video description in English |
| INLINECODE4 |
Model name, default
veo-3.1 |
|
--duration N | Video duration in seconds, default 5 |
|
--width N | Video width, default 1280 |
|
--height N | Video height, default 720 |
|
--fps N | Frames per second, default 24 |
|
--save-dir DIR | Output dir, default
./outputs/videos |
|
--timeout N | Request timeout in seconds, default 600 |
|
--dry-run | Print request and exit |
Available models:
- -
veo-3.1 - Google Veo 3.1 (recommended) - INLINECODE15 - Google Veo 3
- INLINECODE16 - Seedance 1.5 Pro
- INLINECODE17 - Wan 2.5
- INLINECODE18 - Grok Imagine Video
- INLINECODE19 - OmniHuman
Output JSON example:
CODEBLOCK2
Tool 2 — imagetovideo.py (Image to Video)
Generate video from input image.
CODEBLOCK3
| Flag | Description |
|---|
| INLINECODE20 | (required) Input image path |
| INLINECODE21 |
(required) Video description in English |
|
--model NAME | Model name, default
veo-3.1 |
|
--duration N | Video duration in seconds, default 5 |
|
--save-dir DIR | Output dir, default
./outputs/videos |
|
--upload-service | Image upload service (smms/imgbb), default imgbb |
|
--api-token | API token for image upload (REQUIRED for ImgBB, optional for SM.MS) |
|
--timeout N | Request timeout in seconds, default 1000 |
|
--dry-run | Print request and exit |
Process:
- 1. Upload local image to cloud storage (SM.MS or ImgBB) OR use a publicly accessible image URL
- Generate video using the image URL
- Download and save locally
IMPORTANT: For ImgBB, you must provide an API token via --api-token or set IMGBB_API_KEY environment variable. Get your free API key at https://api.imgbb.com/
Output JSON example:
CODEBLOCK4
视频生成工具包
使用40多种模型(包括Veo 3.1、Veo 3、Seedance 1.5 Pro、Wan 2.5、Grok Imagine Video等)从文本提示或图像生成AI视频。
前置条件
重要提示:此技能需要安装inference.sh CLI并将其添加到PATH环境变量中。该CLI提供了40多种AI视频生成模型的访问权限。
安装inference.sh:
bash
npm install -g @inference.sh/cli
或访问https://inference.sh查看安装说明。
约束条件
- - 始终输出生成文件的绝对路径,以便Web UI能够渲染它们。
- Web UI自动渲染本地路径:以纯文本形式输出.mp4/.mov路径(不要在代码块或Markdown链接中),以便UI内联渲染视频播放器。.jpg/.png同理 → 内联显示图片。
- 上传的文件在消息中以[附件: /绝对/路径/到/文件]的形式呈现。
- 对于图生视频,图像必须通过公共URL可访问。提供您自己的ImgBB/SM.MS API密钥,或确保图像已可公开访问。
工具1 — texttovideo.py(文生视频)
从文本提示生成视频。
python nanobot/skills/VideoGeneration/scripts/texttovideo.py [选项]
| 标志 | 描述 |
|---|
| --prompt TEXT | (必需)英文视频描述 |
| --model NAME |
模型名称,默认为veo-3.1 |
| --duration N | 视频时长(秒),默认为5 |
| --width N | 视频宽度,默认为1280 |
| --height N | 视频高度,默认为720 |
| --fps N | 每秒帧数,默认为24 |
| --save-dir DIR | 输出目录,默认为./outputs/videos |
| --timeout N | 请求超时时间(秒),默认为600 |
| --dry-run | 打印请求并退出 |
可用模型:
- - veo-3.1 - Google Veo 3.1(推荐)
- veo-3 - Google Veo 3
- seedance-1.5-pro - Seedance 1.5 Pro
- wan-2.5 - Wan 2.5
- grok-imagine-video - Grok Imagine Video
- omnihuman - OmniHuman
输出JSON示例:
json
{
ok: true,
downloadedfiles: [D:/project/.../outputs/videos/video20260315_1.mp4]
}
工具2 — imagetovideo.py(图生视频)
从输入图像生成视频。
python nanobot/skills/VideoGeneration/scripts/imagetovideo.py [选项]
| 标志 | 描述 |
|---|
| --image PATH | (必需)输入图像路径 |
| --prompt TEXT |
(必需)英文视频描述 |
| --model NAME | 模型名称,默认为veo-3.1 |
| --duration N | 视频时长(秒),默认为5 |
| --save-dir DIR | 输出目录,默认为./outputs/videos |
| --upload-service | 图像上传服务(smms/imgbb),默认为imgbb |
| --api-token | 图像上传的API令牌(ImgBB必需,SM.MS可选) |
| --timeout N | 请求超时时间(秒),默认为1000 |
| --dry-run | 打印请求并退出 |
处理流程:
- 1. 将本地图像上传到云存储(SM.MS或ImgBB)或使用可公开访问的图像URL
- 使用图像URL生成视频
- 下载并保存到本地
重要提示:对于ImgBB,您必须通过--api-token提供API令牌或设置IMGBBAPIKEY环境变量。在https://api.imgbb.com/获取免费API密钥。
输出JSON示例:
json
{
ok: true,
downloadedfiles: [D:/project/.../outputs/videos/video20260315_1.mp4]
}