← 返回
内容创作 Key 中文

magic-image2video

Generate a video task based on user-provided text and images (supports image URLs and local file paths), and submit it to a remote video service using an API...
根据用户提供的文本和图片(支持URL和本地路径)生成视频任务,并通过API提交至远程视频服务...
zhangyuangao
内容创作 clawhub v1.0.1 2 版本 99815.5 Key: 需要
★ 2
Stars
📥 501
下载
💾 16
安装
2
版本
#latest

概述

Text and Image to Video Skill

Create a video generation task based on provided text content and images. The task is submitted immediately; the system will automatically poll the task status and retrieve the video link.

Usage Scenarios

Recommended for these situations:

  • "Turn this image into a video as I describe"
  • "Please help me make a video from this image according to my requirements"
  • "Use this image to generate a video as requested"
  • "Generate a video based on text and an image"

Not for These Scenarios

Do not use for the following cases:

  • The user asks for video editing, trimming, or adding special effects → Please use a video editing tool
  • The user requests screen recording or capture → Please use a screen recording tool
  • The user only wants to check the progress of an existing video task → Please guide them to check in the related file or system

Prerequisites

export MAGIC_API_KEY="your-key"

MAGIC_API_KEY is the required environment variable for the remote video service client.


Overall Workflow (Agent Guide)

  1. Extract the full text (TEXT) and image address or path (IMAGE) from the user's message.
  2. Use the video-create subcommand to create the task, read the stdout JSON output, and extract the task_id.
  3. Clearly inform the user of the task_id in the chat by outputting "Video generation task has been created, task ID: task_id. I will keep checking the task status and inform you when the video link is ready."
  4. Use the video-wait subcommand with --task-id to poll the task until completion. Task status equal to 2 means success.
  5. Extract the video_url from the video-wait command's stdout.
  6. Clearly inform the user of the final video link video_url in the chat. If timeout occurs, report it as well.

Python Client (Step-by-Step Example & Chat Output)

Step 1: Create the Video Task and Show the task_id in Chat

  1. Obtain the desired video text from the user and store it in TEXT; get the image address and store it in IMAGE.
    • If the text contains double quotes ", be sure to escape them (e.g., replace " with \") to prevent command parsing errors.
  1. Run the following command (invoked by the agent tool; {baseDir} will be replaced with the skill directory):
python3 {baseDir}/scripts/media_gen_client.py video-create \
  --text  "TEXT" --image "IMAGE"
  1. Read the command's standard output (stdout), which is JSON, for example:
  2.    {
        "biz_code": 10000,
        "msg": "Success",
        "data": {
            "task_id": "2032443088023777280"
        },
        "trace_id": "664c6e22-1edd-11f1-bf4c-8262dce7d13f"
      }
    
  1. Parse the task_id from the JSON (e.g. "abc-123"), and inform the user in the chat:
    • Output: "Video generation task has been created, task ID: task_id. I will keep checking the task status and inform you when the video link is ready."

Step 2: Poll Task Status and Output the Final video_url in Chat

  1. Use the task_id obtained in the previous step.
  1. Execute this command (poll every 10 seconds, wait up to 600 seconds; if timeout, please try again later):
python3 {baseDir}/scripts/media_gen_client.py video-wait --task-id YOUR_TASK_ID --poll 10 --timeout 600
  1. Read the standard output. On success, the JSON output looks like:
   {
    "biz_code": 10000,
    "msg": "Success",
    "data": {
        "task_id": "1234567890",
        "task_status": 2,
        "video_url": "https://www.magiclight.com/examplevideo.mp4"
    },
    "trace_id": "c89aeca8-1edd-11f1-bf4c-8262dce7d13f"
}
  1. Parse the key fields from the output:
    • Task status (e.g., task_status: 2), where status 2 means success
    • Video link (e.g., video_url: "https://example.com/path/to/video.mp4")
  1. Recommended chat reply flow:
    • Summarize the key info in plain language, for example:

> "Task complete ✅

> task_id: abc-123

> Video link: https://example.com/path/to/video.mp4"

  1. If the result shows task failure or timeout (e.g., success is false, video_url is empty, or error is timeout):
    • Explain the failure reason (include error info if possible), and inform the user they can retry later or check possible issues like input or quota.

Script Output Requirements

  • The agent must always:
  • Parse stdout JSON.
  • Clearly inform the user of both the task ID and video link in the chat.

版本历史

共 2 个版本

  • v1.0.1 当前
    2026-03-30 01:57 安全 安全
  • v1.0.0
    2026-03-19 22:23

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,771
content-creation

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,063
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,480