linkfox-aigc-videogen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAI 生视频(首尾帧/单图模式)
AI Video Generation (First/Last Frame/Single Image Mode)
根据原图(首帧)和可选尾帧图生成视频,支持多种 AI 视频模型,异步创建任务后轮询获取结果。
Generate videos based on the original image (first frame) and optional last frame image, supporting multiple AI video models. Asynchronously create tasks and poll to retrieve results.
核心特点
Core Features
- 5 种模型选择:覆盖不同风格和时长需求。
- 首尾帧控制:可选尾帧图控制视频结束画面。
- 丰富参数:支持 Pro 模式、声音生成、运镜控制、宽高比等。
- 异步模式:创建任务立即返回 taskId,脚本自动轮询直到完成(超时 20 分钟)。
- 5 Model Options: Covers different style and duration requirements.
- First/Last Frame Control: Optional last frame image to control the video's ending scene.
- Rich Parameters: Supports Pro mode, sound generation, camera movement control, aspect ratio, etc.
- Asynchronous Mode: Immediately returns after task creation, and the script automatically polls until completion (timeout after 20 minutes).
taskId
模型说明
Model Description
| 模型(videoType) | 说明 | 支持时长 |
|---|---|---|
| KLING | 可灵 | 5秒/10秒 |
| WAN | 万相 | 5秒/10秒/15秒 |
| SEED | Seedance/豆包 | 5秒/10秒/15秒 |
| SEED_FAST | Seedance 2.0 Fast | 5秒/10秒/15秒 |
| HAILUO | 海螺 | 6秒/10秒 |
| Model (videoType) | Description | Supported Duration |
|---|---|---|
| KLING | Keling | 5s/10s |
| WAN | Wanxiang | 5s/10s/15s |
| SEED | Seedance/Doubao | 5s/10s/15s |
| SEED_FAST | Seedance 2.0 Fast | 5s/10s/15s |
| HAILUO | Hailuo | 6s/10s |
参数概览
Parameter Overview
- 必填字段:、
imageUrl、videoTypevideoTime - 可选核心:(尾帧图)、
lastFrameImageUrl(2000字以内)prompt
完整参数表、响应字段结构与错误码,见 。
references/api.md- Required Fields: ,
imageUrl,videoTypevideoTime - Optional Core Fields: (last frame image),
lastFrameImageUrl(within 2000 characters)prompt
Complete parameter table, response field structure and error codes can be found in .
references/api.md调用方式
Calling Methods
- 创建任务:→ 返回
POST /aigc/videoGenAsync{taskId} - 轮询结果:→ 传入
POST /aigc/taskQuery→ 返回状态和结果{taskId} - Python 脚本:(脚本内部自动完成创建+轮询)
python scripts/aigc_videogen.py '<JSON 参数>'
异步流程:
- 脚本调用 创建任务,获得
/aigc/videoGenAsynctaskId - 等待 2 分钟后开始轮询 ,每 10 秒一次,最长等待 20 分钟
/aigc/taskQuery - 成功后自动下载视频到会话 目录
media/
输出策略(脚本默认行为):
- 脚本会自动把生成的视频下载转存到会话 目录,stdout 输出一行
media/。Saved full response: <路径数组> - 原始 API 响应静默落盘到 ,仅在无视频产物时才在 stdout 提示其路径。
data/
读数据建议:禁止 Read 转存的视频文件内容。直接把 后的本地路径提供给用户即可。
Saved full response:- Create Task: → Returns
POST /aigc/videoGenAsync{taskId} - Poll for Results: → Pass in
POST /aigc/taskQuery→ Returns status and results{taskId} - Python Script: (the script automatically handles creation + polling internally)
python scripts/aigc_videogen.py '<JSON parameters>'
Asynchronous Process:
- The script calls to create a task and obtains
/aigc/videoGenAsynctaskId - Starts polling after waiting for 2 minutes, once every 10 seconds, with a maximum wait time of 20 minutes
/aigc/taskQuery - Automatically downloads the video to the session directory upon success
media/
Output Strategy (Default Script Behavior):
- The script automatically downloads and saves the generated video to the session directory, and outputs a line
media/to stdout.Saved full response: <path array> - The original API response is silently saved to , and its path is only prompted in stdout when there is no video product.
data/
Data Reading Suggestion: Do NOT read the content of the saved video file. Directly provide the local path after to the user.
Saved full response:解决认证和积分问题
Resolve Authentication and Points Issues
发生以下异常情况时,采用 references/onboarding.md 引导解决问题:
When the following exceptions occur, guide users to resolve them using references/onboarding.md:
异常情况
Exception Scenarios
- 未配置API Key:环境变量未配置 ,也未配置
LINKFOX_AGENT_API_KEY。LINKFOXAGENT_API_KEY - 响应401或402状态码
- 响应提示积分或余额不足:消息含"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值",或类似含义的内容。
- API Key Not Configured: The environment variable or
LINKFOX_AGENT_API_KEYis not configured.LINKFOXAGENT_API_KEY - Response with 401 or 402 Status Code
- Response Indicates Insufficient Points or Balance: Messages containing "insufficient points balance/insufficient billing/insufficient balance/quota exceeded/insufficient balance/package expired/need to recharge/please recharge" or similar meanings.
使用指引
Usage Guidelines
- 模型选择:一般商品视频用 ;长时长用
KLING/WAN。SEED - 首尾帧:传 (首帧,必传)+ 可选
imageUrl(尾帧),支持模型:KLING仅Pro / WAN / SEED。lastFrameImageUrl - 时长匹配:必须传模型支持的时长值,否则报错。
- 提示词:可选,2000 字以内,描述期望的动态效果。
- Model Selection: Use for general product videos; use
KLING/WANfor longer durations.SEED - First/Last Frames: Pass (first frame, required) + optional
imageUrl(last frame). Supported models: KLING (Pro mode only) / WAN / SEED.lastFrameImageUrl - Duration Matching: Must pass a duration value supported by the model, otherwise an error will occur.
- Prompt: Optional, within 2000 characters, describing the desired dynamic effects.
示例
Examples
1. KLING — 商品展示
json
{"imageUrl": "https://example.com/product.jpg", "videoType": "KLING", "videoTime": 10, "prompt": "商品展示视频"}3. WAN 万相 — 带声音和运镜
json
{"imageUrl": "https://example.com/scene.jpg", "videoType": "WAN", "videoTime": 15, "voice": true, "camera": "single"}4. SEED — 高分辨率
json
{"imageUrl": "https://example.com/scene.jpg", "videoType": "SEED", "videoTime": 10, "resolution": "1080p", "aspectRatio": "16:9"}1. KLING — Product Display
json
{"imageUrl": "https://example.com/product.jpg", "videoType": "KLING", "videoTime": 10, "prompt": "Product display video"}3. WAN Wanxiang — With Sound and Camera Movement
json
{"imageUrl": "https://example.com/scene.jpg", "videoType": "WAN", "videoTime": 15, "voice": true, "camera": "single"}4. SEED — High Resolution
json
{"imageUrl": "https://example.com/scene.jpg", "videoType": "SEED", "videoTime": 10, "resolution": "1080p", "aspectRatio": "16:9"}展示规则
Display Rules
- 只展示转存后的本地路径:把 后的本地视频路径告诉用户,例如「视频已保存至:xxx/a.mp4」。
Saved full response: - 禁止 Read 视频文件、禁止展示 base64 内容。
- 禁止把原始 API 返回的临时 URL 直接给用户(带签名、会过期)。
- Only Display Saved Local Path: Tell users the local video path after , e.g., "Video saved to: xxx/a.mp4".
Saved full response: - Do NOT read video files, do NOT display base64 content.
- Do NOT directly provide the temporary URL returned by the original API to users (it is signed and will expire).
限制
Limitations
- 提示词最大 2000 字符。
- 生成时间较长,通常 100-600 秒。脚本自动轮询,超时 20 分钟。
- KLING 尾帧图仅 Pro 模式下支持。
- 本接口仅支持单图/首尾帧模式。多参考图请使用 。
linkfox-aigc-videogen-multi - 失败时不重试(仅尝试 1 次)。
- Maximum prompt length is 2000 characters.
- Generation time is relatively long, usually 100-600 seconds. The script automatically polls, with a timeout of 20 minutes.
- KLING's last frame image is only supported in Pro mode.
- This interface only supports single image/first-last frame mode. For multiple reference images, use .
linkfox-aigc-videogen-multi - No retries on failure (only one attempt).
不适用
Not Applicable Scenarios
不适用:
- 多参考图生视频 →
linkfox-aigc-videogen-multi - 图片生成 →
linkfox-aigc-imagegen - 文本生成 →
linkfox-aigc-textgen
Not applicable for:
- Video generation with multiple reference images → Use
linkfox-aigc-videogen-multi - Image generation → Use
linkfox-aigc-imagegen - Text generation → Use
linkfox-aigc-textgen
反馈
Feedback
参见 。
references/api.mdSee .
references/api.md