kling-video
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseKling 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:
- and
image_urlrequire a file ID (format:video_url)df-xxxxx - How to get file ID:
- Upload your file to Refly using
refly file upload <file-path> - Copy the returned file ID from the upload response
- Use this file ID in the input JSON
- Upload your file to Refly using
- For text-to-video mode, omit both and
image_urlvideo_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需要文件ID(格式:video_url)df-xxxxx - 如何获取文件ID:
- 使用将文件上传到Refly
refly file upload <file-path> - 从上传响应中复制返回的文件ID
- 在输入JSON中使用该文件ID
- 使用
- 文本转视频模式下,省略和
image_urlvideo_url - 图片转视频模式下,提供
image_url - 视频转视频模式下,提供
video_url
Execution (Pattern A: File Generation)
执行流程(模式A:文件生成)
Step 0 (Optional): Upload Files for Image/Video-to-Video Modes
步骤0(可选):为图片/视频转视频模式上传文件
bash
undefinedbash
undefinedUpload 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"
undefinedVIDEO_RESULT=$(refly file upload /path/to/your/video.mp4)
VIDEO_FILE_ID=$(echo "$VIDEO_RESULT" | jq -r '.payload.fileId')
echo "视频文件ID:$VIDEO_FILE_ID"
undefinedStep 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
undefinedUse 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')
undefinedRESULT=$(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')
undefinedStep 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 30000bash
open "https://refly.ai/workflow/c-p3ydudm0cbdu13cmqodjqwhu"
refly workflow status "$RUN_ID" --watch --interval 30000Step 3: Download and Show Result
步骤3:下载并查看结果
bash
undefinedbash
undefinedGet 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
undefinedecho "$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
undefinedExpected 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