kling-video

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Kling Video

Kling视频

Generate AI videos using Kling video generation models. Use when you need to: (1) create videos from text prompts, (2) animate images into videos, (3) transform existing videos with AI, or (4) create AI avatar videos with speech.
使用Kling视频生成模型制作AI视频。适用于以下场景:(1) 根据文本提示生成视频,(2) 将图片动化为视频,(3) 用AI改造现有视频,(4) 制作带语音的AI数字人视频。

Input

输入

Provide input as JSON:
json
{
  "video_prompt": "Text description for the video you want to generate (e.g., 'A cat walking in a futuristic city at sunset')",
  "image_url": "<file-id>",
  "video_url": "<file-id>",
  "model_version": "Kling model to use: 'o1' for advanced reasoning or 'v2.6' for premium visuals",
  "duration": "Video duration in seconds (5-10s supported)",
  "aspect_ratio": "Video aspect ratio: '16:9' (landscape), '9:16' (portrait), or '1:1' (square)"
}
Note on File Inputs:
  • image_url
    and
    video_url
    require a file ID (format:
    df-xxxxx
    )
  • How to get file ID:
    1. Upload your file to Refly using
      refly file upload <file-path>
    2. Copy the returned file ID from the upload response
    3. Use this file ID in the input JSON
  • For text-to-video mode, omit both
    image_url
    and
    video_url
  • For image-to-video mode, provide
    image_url
  • For video-to-video mode, provide
    video_url
请以JSON格式提供输入:
json
{
  "video_prompt": "你想要生成的视频的文本描述(例如:'一只猫在日落时分的未来城市中行走')",
  "image_url": "<file-id>",
  "video_url": "<file-id>",
  "model_version": "要使用的Kling模型:'o1'用于高级推理,'v2.6'用于优质视觉效果",
  "duration": "视频时长(支持5-10秒)",
  "aspect_ratio": "视频宽高比:'16:9'(横屏)、'9:16'(竖屏)或'1:1'(正方形)"
}
文件输入说明:
  • image_url
    video_url
    需要文件ID(格式:
    df-xxxxx
  • 如何获取文件ID:
    1. 使用
      refly file upload <file-path>
      将文件上传到Refly
    2. 从上传响应中复制返回的文件ID
    3. 在输入JSON中使用该文件ID
  • 文本转视频模式下,省略
    image_url
    video_url
  • 图片转视频模式下,提供
    image_url
  • 视频转视频模式下,提供
    video_url

Execution (Pattern A: File Generation)

执行流程(模式A:文件生成)

Step 0 (Optional): Upload Files for Image/Video-to-Video Modes

步骤0(可选):为图片/视频转视频模式上传文件

bash
undefined
bash
undefined

Upload an image for image-to-video

上传图片用于图片转视频

IMAGE_RESULT=$(refly file upload /path/to/your/image.jpg) IMAGE_FILE_ID=$(echo "$IMAGE_RESULT" | jq -r '.payload.fileId') echo "Image file ID: $IMAGE_FILE_ID"
IMAGE_RESULT=$(refly file upload /path/to/your/image.jpg) IMAGE_FILE_ID=$(echo "$IMAGE_RESULT" | jq -r '.payload.fileId') echo "图片文件ID:$IMAGE_FILE_ID"

Or upload a video for video-to-video

或上传视频用于视频转视频

VIDEO_RESULT=$(refly file upload /path/to/your/video.mp4) VIDEO_FILE_ID=$(echo "$VIDEO_RESULT" | jq -r '.payload.fileId') echo "Video file ID: $VIDEO_FILE_ID"
undefined
VIDEO_RESULT=$(refly file upload /path/to/your/video.mp4) VIDEO_FILE_ID=$(echo "$VIDEO_RESULT" | jq -r '.payload.fileId') echo "视频文件ID:$VIDEO_FILE_ID"
undefined

Step 1: Run the Skill and Get Run ID

步骤1:运行技能并获取运行ID

Example 1: Text-to-Video
bash
RESULT=$(refly skill run --id skpi-rzakvguz9m7memgp3o6dokta --input '{
  "video_prompt": "A cat walking through a futuristic city at sunset",
  "duration": "5",
  "aspect_ratio": "16:9",
  "model_version": "v2.6"
}')
RUN_ID=$(echo "$RESULT" | jq -r '.payload.workflowExecutions[0].id')
Example 2: Image-to-Video
bash
undefined
示例1:文本转视频
bash
RESULT=$(refly skill run --id skpi-rzakvguz9m7memgp3o6dokta --input '{
  "video_prompt": "一只猫在日落时分的未来城市中行走",
  "duration": "5",
  "aspect_ratio": "16:9",
  "model_version": "v2.6"
}')
RUN_ID=$(echo "$RESULT" | jq -r '.payload.workflowExecutions[0].id')
示例2:图片转视频
bash
undefined

Use the IMAGE_FILE_ID from Step 0

使用步骤0中获取的IMAGE_FILE_ID

RESULT=$(refly skill run --id skpi-rzakvguz9m7memgp3o6dokta --input '{ "video_prompt": "Camera slowly zooms in on the scene", "image_url": "'"$IMAGE_FILE_ID"'", "duration": "5", "aspect_ratio": "16:9", "model_version": "v2.6" }') RUN_ID=$(echo "$RESULT" | jq -r '.payload.workflowExecutions[0].id')
undefined
RESULT=$(refly skill run --id skpi-rzakvguz9m7memgp3o6dokta --input '{ "video_prompt": "镜头缓慢拉近场景", "image_url": "'"$IMAGE_FILE_ID"'", "duration": "5", "aspect_ratio": "16:9", "model_version": "v2.6" }') RUN_ID=$(echo "$RESULT" | jq -r '.payload.workflowExecutions[0].id')
undefined

Step 2: Open Workflow in Browser and Wait for Completion

步骤2:在浏览器中打开工作流并等待完成

bash
open "https://refly.ai/workflow/c-p3ydudm0cbdu13cmqodjqwhu"
refly workflow status "$RUN_ID" --watch --interval 30000
bash
open "https://refly.ai/workflow/c-p3ydudm0cbdu13cmqodjqwhu"
refly workflow status "$RUN_ID" --watch --interval 30000

Step 3: Download and Show Result

步骤3:下载并查看结果

bash
undefined
bash
undefined

Get files from this run

获取本次运行生成的文件

FILES=$(refly workflow toolcalls "$RUN_ID" --files --latest | jq -r '.payload.files[]')
FILES=$(refly workflow toolcalls "$RUN_ID" --files --latest | jq -r '.payload.files[]')

Download and open each file

下载并打开每个文件

echo "$FILES" | jq -c '.' | while read -r file; do FILE_ID=$(echo "$file" | jq -r '.fileId') FILE_NAME=$(echo "$file" | jq -r '.name') if [ -n "$FILE_ID" ] && [ "$FILE_ID" != "null" ]; then refly file download "$FILE_ID" -o "$HOME/Desktop/${FILE_NAME}" open "$HOME/Desktop/${FILE_NAME}" fi done
undefined
echo "$FILES" | jq -c '.' | while read -r file; do FILE_ID=$(echo "$file" | jq -r '.fileId') FILE_NAME=$(echo "$file" | jq -r '.name') if [ -n "$FILE_ID" ] && [ "$FILE_ID" != "null" ]; then refly file download "$FILE_ID" -o "$HOME/Desktop/${FILE_NAME}" open "$HOME/Desktop/${FILE_NAME}" fi done
undefined

Expected Output

预期输出

  • Type: Video
  • Format: .mp4 video file
  • Location:
    ~/Desktop/
  • Action: Opens automatically to show user
  • 类型:视频
  • 格式:.mp4视频文件
  • 保存位置
    ~/Desktop/
  • 操作:自动打开供用户查看

Rules

规则

Follow base skill workflow:
~/.claude/skills/refly/SKILL.md
遵循基础技能工作流:
~/.claude/skills/refly/SKILL.md