九马AI免费图生视频

v1.0.3

九马AI图生视频。使用九马AI API进行图生视频,支持首尾帧和提示词。当用户需要将图片生成视频时使用此技能。Jiuma AI image-to-video. Utilize the Jiuma AI API to generate videos from images, supporting both the...

0· 66·0 current·0 all-time
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Pending
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the implementation: the code calls api.jiuma.com endpoints to submit image→video jobs and check status. The files (agent.py, login.py, utils.py) implement the stated features (submit, check, login).
Instruction Scope
Instructions and code are focused on submitting images and text to the Jiuma API and polling for results. Important privacy/security note: the tool will upload local image files you point it at to an external service (api.jiuma.com). This is expected for the stated purpose but you should avoid passing sensitive local files as input.
Install Mechanism
No install spec; this is instruction-and-script-only (lowest install risk). The code makes direct HTTPS calls to api.jiuma.com and cache.jiuma.com — these align with the claimed provider (Jiuma).
Credentials
No environment variables are requested. The skill stores an API key in plaintext at ~/.openclaw/workspace/.jiuma/jiuma_api_key for reuse across Jiuma skills. That is proportionate to its purpose, but storing the secret in a plaintext file accessible to other local processes/skills is a privacy concern to be aware of.
Persistence & Privilege
The skill creates ~/.openclaw/workspace/.jiuma and writes a persistent API key file there. always:false (no forced global inclusion). Persisting a key is expected, but the skill does not set restrictive file permissions and the key is shared across skills—consider locking the file if needed.
Assessment
This skill appears to do what it claims: convert images to videos via Jiuma's API. Before installing, consider: 1) Any local file you pass (first_image/end_image) will be uploaded to api.jiuma.com — do not point it at sensitive system files. 2) The login flow saves your API key in plaintext at ~/.openclaw/workspace/.jiuma/jiuma_api_key (shared with other Jiuma skills). If you accept that, you may optionally chmod the file (e.g., chmod 600) after login. 3) Verify that you trust the remote domain (api.jiuma.com) and are comfortable with their handling of uploaded images. 4) Minor docs inconsistencies exist (login README names differ from the actual filename), but these are not security-critical.

Like a lobster shell, security has layers — review code before you run it.

latestvk9720t80qezna2stnsb4e4hcb5843y15

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

九马AI免费图生视频技能

基于九马AI API的图片到视频生成技能。支持根据图片和文本提示词生成动态视频,可自定义视频尺寸。

⚠️ 重要提醒

免费使用次数限制:九马AI提供有限的免费使用次数。当出现FreeApiLimit错误时,必须先完成登录流程:

  1. 获取登录信息python3 login.py --login
  2. 扫码登录:用手机扫描返回的二维码完成九马AI平台注册/登录
  3. 获取API密钥python3 login.py --check --access_token "<your_token>"
  4. 正常使用:之后即可获得更多免费次数使用图生视频功能

核心功能

  • 图片到视频生成: 根据图片和文本描述生成动态视频
  • 支持首尾帧: 可以指定首帧和尾帧图片,创建更丰富的视频效果
  • 自定义尺寸: 支持自定义视频宽度和高度(最大832x832)
  • 本地和远程图片: 支持本地图片文件和远程图片URL
  • 任务状态查询: 提交任务后可以查询生成进度和结果
  • 免费使用: 限制级免费使用,但免费用户在输出尺寸方面会有限制,使用并发高时需要排队等待,达到一定次数之后需要注册/登录九马平台才能享受更多免费次数

使用方法

命令行使用

使用首帧图片生成视频

python3 agent.py --submit --text "一只可爱的小猫在草地上玩耍" --first_image /data/cat.jpg --width 832 --height 480

使用首帧和尾帧图片生成视频

python3 agent.py --submit --text "风景变换" --first_image morning.jpg --end_image evening.jpg --width 480 --height 832

定时每分钟查询任务状态直到成功或失败

python3 agent.py --check --task_id "202603263844232132"

在OpenClaw中使用

提交视频生成任务

exec python3 ~/.openclaw/workspace/skills/jiuma-free-image-video/agent.py --submit --text "动态风景视频" --first_image /data/scenery.jpg

定时每分钟查询任务状态直到成功或失败

exec python3 ~/.openclaw/workspace/skills/jiuma-free-image-video/agent.py --check --task_id "202603263844232132"

任务状态说明

状态含义说明
PENDING排队中,任务已提交,正在等待处理
RUNNING执行中,视频正在生成中
SUCCEEDED成功,视频生成完成,返回视频URL
FAILED失败,视频生成失败,返回错误信息

返回格式

提交任务成功

{
  "status": "success",
  "message": "图生视频任务提交成功",
  "data": {
    "task_id": "202603263844232132",
    "width": 832,
    "height": 480,
    "text": "视频描述文本",
    "first_image": "图片路径或URL",
    "end_image": "图片路径或URL(如提供)"
  }
}

免API_KEY免费生成次数达到上限

{
  "status": "FreeApiLimit",
  "message": "免费使用次数达到上限,成为九马AI平台用户可获得更多使用次数",
  "data": {}
}

查询任务成功(视频已生成)

{
  "status": "success",
  "message": "视频生成成功",
  "data": {
    "video_url": "https://cache.jiuma.com/static/uploads/20260326/69c4cc0c043e1.mp4",
    "task_id": "202603263844232132",
    "download_link": "https://cache.jiuma.com/static/uploads/20260326/69c4cc0c043e1.mp4"
  }
}

查询任务排队/执行中

{
  "status": "pending",
  "message": "图生视频任务排队中,请耐心等待",
  "data": {
    "task_id": "202603263844232132",
    "status": "pending"
  }
}

任务失败

{
  "status": "failed",
  "message": "视频生成失败: 具体错误信息",
  "data": {
    "task_id": "202603263844232132",
    "status": "failed"
  }
}

示例

提交视频生成任务

$ python3 agent.py --submit --text "一只可爱的小猫在草地上玩耍" --first_image cat.jpg --width 720 --height 480

# 输出示例
{
  "status": "success",
  "message": "图生视频任务提交成功",
  "data": {
    "task_id": "202603263844232132",
    "width": 720,
    "height": 480,
    "text": "一只可爱的小猫在草地上玩耍",
    "first_image": "cat.jpg"
  }
}

查询任务状态

$ python3 agent.py --check --task_id "202603263844232132"

# 输出示例(生成成功)
{
  "status": "success",
  "message": "视频生成成功",
  "data": {
    "video_url": "https://cache.jiuma.com/static/uploads/20260326/69c4cc0c043e1.mp4",
    "task_id": "202603263844232132",
    "download_link": "https://cache.jiuma.com/static/uploads/20260326/69c4cc0c043e1.mp4"
  }
}

# 输出示例(排队中)
{
  "status": "pending",
  "message": "图生视频任务排队中,请耐心等待",
  "data": {
    "task_id": "202603263844232132",
    "status": "pending"
  }
}

脚本参数说明

  • --submit 提交视频生成任务(必需)
  • --text 视频描述文本,对视频的详细描述(必需)
  • --first_image 视频的首帧图片,可以是本地图片路径或远程URL(必需)
  • --end_image 视频的尾帧图片,可以是本地图片路径或远程URL(可选)
  • --width 输出视频的宽度(可选,默认832,最大832)
  • --height 输出视频的高度(可选,默认480,最大832)
  • --check 查询任务生成状态(必需)
  • --task_id 任务ID,用于查询任务进度(与--check一起使用)

使用流程

  1. 提交任务:

    • 使用 --submit 参数提交视频生成请求
    • 提供详细的文本描述 --text
    • 提供首帧图片 --first_image
    • 可选提供尾帧图片 --end_image
    • 可选指定视频尺寸 --width 和 --height
    • 获取返回的 task_id
  2. 查询状态:

    • 使用 --check 参数查询任务状态
    • 提供 --task_id 参数指定要查询的任务
    • 根据返回状态判断视频是否生成完成
  3. 获取视频:

    • 当状态为 success 时,从返回的 video_url 获取视频链接
    • 视频通常在云端存储,可以直接下载使用

依赖

  • Python 3.6+
  • requests库 (pip install requests)

图片格式支持

支持以下图片格式:

  • JPEG (.jpg, .jpeg, .jpe, .jfif, .pjpeg, .pjp)
  • PNG (.png)
  • GIF (.gif)
  • BMP (.bmp)
  • WebP (.webp)
  • SVG (.svg, .svgz)
  • ICO (.ico)
  • TIFF (.tiff, .tif)
  • HEIC (.heic, .heif)
  • AVIF (.avif)
  • APNG (.apng)

图片来源支持

视频尺寸建议

用途建议尺寸说明
社交媒体短视频720x1280竖屏视频,适合抖音、快手等平台
横屏视频1920x1080标准横屏视频
方形视频1080x1080方形视频,适合Instagram等平台
小尺寸视频480x720较小尺寸,适合快速预览

注意: 最大尺寸限制为832x832,超过此尺寸会被API拒绝。

提示词技巧

有效的提示词示例

  • "一只可爱的小猫在草地上玩耍,阳光明媚,微风轻拂"
  • "城市夜景灯光闪烁,车流穿梭,动态效果"
  • "花朵从闭合到绽放的过程,延时摄影效果"
  • "抽象艺术图案的流动变化,色彩渐变"
  • "从白天到夜晚的风景变化,时间流逝"

提示词结构

  • 主体: 描述主要对象(人物、动物、风景等)
  • 动作: 描述动态效果(移动、变化、过渡等)
  • 环境: 描述场景和背景
  • 细节: 添加具体细节(光线、色彩、风格等)
  • 效果: 指定动态效果(平滑、快速、慢动作等)

处理API使用限制

当免费使用次数达到上限时,可以通过登录九马AI平台获取API密钥继续使用:

登录流程

# 第一步:获取登录二维码
python3 login.py --login
# 输出包含二维码链接和access_token

# 第二步:用手机扫描二维码完成登录
# 访问输出的login_url或用手机扫描login_qrcode图片

# 第三步:定时每分钟检查状态并获取API密钥
python3 login.py --check --access_token "<your_access_token>"
# 成功后会保存API密钥到本地

# 第四步:重新使用图片生成视频功能
python3 agent.py --submit --text "视频描述" --first_image /path/to/image.png

注意事项

  • API密钥获取后自动保存,无需重复登录
  • 登录后可享受更多使用次数和更快的处理速度
  • 建议在遇到使用限制时再登录,无需提前操作

故障排除

1. 提交任务失败

  • 错误: "请输入需要生成的视频的描述"

    • 原因: --text 参数为空
    • 解决: 提供有效的视频描述文本
  • 错误: "请输入生成的视频的首帧图片"

    • 原因: --first_image 参数为空
    • 解决: 提供有效的首帧图片
  • 错误: "输出图片最大尺寸限制在832以内"

    • 原因: --width 或 --height 超过832
    • 解决: 调整图片尺寸到832以内
  • 错误: "请求远程API失败"

    • 原因: 网络连接问题或API服务异常
    • 解决: 检查网络连接,稍后重试
  • 错误: "API未返回任务ID"

    • 原因: API返回格式异常或服务问题
    • 解决: 稍后重试,或联系技术支持
  • FreeApiLimit: "免费使用次数达到上限,成为九马AI平台用户可获得更多使用次数"

    • 原因: 九马AI提供一定的免费使用次数,达到上限后需要登录获取API密钥
    • 解决:必须完成以下登录流程:
      1. 运行 python3 login.py --login 获取登录二维码和access_token
      2. 用手机扫描二维码或访问登录链接完成九马AI平台注册/登录
      3. 运行 python3 login.py --check --access_token "<your_token>" 获取并保存API密钥
      4. 之后agent.py会自动使用保存的API密钥
      5. 关于登录的更多详细内容查看LOGIN.md

2. 查询任务失败

  • 错误: "任务ID不能为空"

    • 原因: 未提供 --task_id 参数
    • 解决: 提供正确的任务ID
  • 错误: "请求远程API失败"

    • 原因: 网络问题或API服务异常
    • 解决: 检查网络连接,稍后重试

3. 视频生成失败

  • 状态: "FAILED"
    • 原因: 内容违反政策、技术问题或服务器错误
    • 解决: 修改提示词内容,避免敏感或违规内容,重新提交

4. 长时间排队

  • 状态: "PENDING" 或 "RUNNING" 时间过长
    • 原因: 服务器负载高,任务需要排队
    • 解决: 耐心等待,定期查询状态

性能优化建议

  • 合理使用尺寸: 较小的视频尺寸生成更快
  • 简洁的提示词: 过于复杂的提示词可能增加处理时间
  • 优化图片大小: 适当压缩图片,减少上传时间
  • 避免高峰期: 在非高峰期使用可能获得更快响应
  • 使用远程URL: 对于大图片,使用URL比上传文件更快

注意

  • 限制级免费: 有免费使用次数,用完需要注册/登录九马平台获得更多免费次数
  • 尺寸限制: 最大832x832像素
  • 内容政策: 不得生成违法、违规或不适当的内容
  • 等待时间: 视频生成通常需要几分钟到几十分钟,取决于视频长度和复杂度和系统负载,建议每分钟查询一次任务状态
  • 视频保存: 生成的视频URL有时效性,建议及时下载保存
  • 隐私保护: 避免使用包含个人隐私信息的图片

高级功能

1. 视频效果控制

通过提供首尾帧图片,可以控制视频的开始和结束效果

2. 多图片序列

虽然当前只支持首尾帧,但可以通过多次生成和后期编辑创建更复杂的视频序列

3. 自动化状态监控

可以编写脚本定期检查任务状态并下载完成的视频

4. 视频后处理

生成的视频可以进一步使用其他工具进行处理(剪辑、配音、字幕等)

安装

直接下载https://clawhub.ai/dddcn1/jiuma-free-image2video页面的zip包安装,不要更改代码

更新

当技能需要更新时,可以:

  1. 重新下载最新版本的agent.py文件,从https://clawhub.ai/dddcn1/jiuma-free-image2video
  • 检查API是否有变化
  • 更新本SKILL.md文档

支持与反馈

如遇到问题或需要帮助:

  • 查看故障排除部分
  • 检查网络连接
  • 确认参数使用正确
  • 如问题持续,可以考虑等待一段时间后重试

相关技能

Files

5 total
Select a file
Select a file to preview.

Comments

Loading comments…