linkfox-aigc-videogen-multi
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese多参考图生视频
Multi-reference Image to Video Generation
根据多张参考图和提示词生成视频,支持 3 种 AI 视频模型,异步创建任务后轮询获取结果。
Generate videos based on multiple reference images and prompts, supporting 3 AI video models. Create tasks asynchronously and poll for results.
核心特点
Core Features
- 4 种模型选择:KLING/SEED/SEED_FAST/HAPPY_HORSE,覆盖不同风格和时长。
- 多图参考:传入多张图片作为参考,AI 综合生成视频。
- 丰富参数:支持 Pro 模式、声音生成、宽高比、分辨率等。
- 异步模式:创建任务立即返回 taskId,脚本自动轮询直到完成(超时 20 分钟)。
- 4 Model Options: KLING/SEED/SEED_FAST/HAPPY_HORSE, covering different styles and durations.
- Multi-image Reference: Pass multiple images as references, and the AI will generate videos comprehensively.
- Rich Parameters: Supports Pro mode, audio generation, aspect ratio, resolution, etc.
- Asynchronous Mode: Returns immediately after task creation, and the script automatically polls until completion (timeout after 20 minutes).
taskId
模型说明
Model Description
| 模型(videoType) | 说明 | 支持时长 | 图片上限 |
|---|---|---|---|
| KLING | 可灵 | 5秒/10秒 | ≤7张 |
| SEED | Seedance/豆包 | 5秒/10秒/15秒 | ≤9张 |
| SEED_FAST | Seedance 2.0 Fast | 5秒/10秒/15秒 | ≤9张 |
| HAPPY_HORSE | 百炼HappyHorse | 5秒/10秒/15秒(默认15) | ≤9张 |
| Model (videoType) | Description | Supported Duration | Max Images |
|---|---|---|---|
| KLING | Keling | 5s/10s | ≤7 |
| SEED | Seedance/Doubao | 5s/10s/15s | ≤9 |
| SEED_FAST | Seedance 2.0 Fast | 5s/10s/15s | ≤9 |
| HAPPY_HORSE | Bailian HappyHorse | 5s/10s/15s (default 15s) | ≤9 |
参数概览
Parameter Overview
- 必填字段:、
imageList、videoTypevideoTime - 可选核心:(2000字以内)、
prompt、aspectRatioresolution
完整参数表、响应字段结构与错误码,见 。
references/api.md- Required Fields: ,
imageList,videoTypevideoTime - Optional Core Parameters: (within 2000 characters),
prompt,aspectRatioresolution
For the complete parameter table, response field structure, and error codes, see .
references/api.md调用方式
Calling Methods
- 创建任务:→ 返回
POST /aigc/multiImageVideoGenAsync{taskId} - 轮询结果:→ 传入
POST /aigc/taskQuery→ 返回状态和结果{taskId} - Python 脚本:(脚本内部自动完成创建+轮询)
python scripts/aigc_videogen_multi.py '<JSON 参数>'
异步流程:
- 脚本调用 创建任务,获得
/aigc/multiImageVideoGenAsynctaskId - 等待 2 分钟后开始轮询 ,每 10 秒一次,最长等待 20 分钟
/aigc/taskQuery - 成功后自动下载视频到会话 目录
media/
输出策略(脚本默认行为):
- 脚本会自动把生成的视频下载转存到会话 目录,stdout 输出一行
media/。Saved full response: <路径数组> - 原始 API 响应静默落盘到 ,仅在无视频产物时才在 stdout 提示其路径。
data/
读数据建议:禁止 Read 转存的视频文件内容。直接把 后的本地路径提供给用户即可。
Saved full response:- Create Task: → Returns
POST /aigc/multiImageVideoGenAsync{taskId} - Poll for Results: → Pass
POST /aigc/taskQuery→ Returns status and results{taskId} - Python Script: (The script automatically handles creation + polling internally)
python scripts/aigc_videogen_multi.py '<JSON parameters>'
Asynchronous Flow:
- The script calls to create a task and obtain
/aigc/multiImageVideoGenAsynctaskId - 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 transfers 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 output.
data/
Data Reading Suggestion: Do NOT read the content of the transferred video file. Directly provide the local path after to the user.
Saved full response:解决认证和积分问题
Resolve Authentication and Points Issues
发生以下异常情况时,采用 references/onboarding.md 引导解决问题:
For the following abnormal situations, guide users to resolve them using references/onboarding.md:
异常情况
Abnormal Situations
- 未配置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: The message contains content like "insufficient points balance/insufficient billing/insufficient balance/quota exceeded/insufficient balance/package expired/need to recharge/please recharge" or similar meanings.
使用指引
Usage Guidelines
- 模型选择:一般多图参考用 ;高分辨率用
KLING;百炼风格用SEED。HAPPY_HORSE - 图片数量:KLING 最多 7 张,SEED/HAPPY_HORSE 最多 9 张。至少传 1 张。
- 时长匹配:必须传模型支持的时长值,否则报错。
- 提示词:可选,2000 字以内,描述期望的动态效果。
- Model Selection: Generally use for multi-reference images; use
KLINGfor high resolution; useSEEDfor Bailian style.HAPPY_HORSE - Number of Images: KLING supports up to 7 images, SEED/HAPPY_HORSE support up to 9 images. At least 1 image must be passed.
- 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
{"imageList": ["https://example.com/img1.jpg", "https://example.com/img2.jpg", "https://example.com/img3.jpg"], "videoType": "KLING", "videoTime": 10, "prompt": "商品多角度展示"}2. SEED 高分辨率多图
json
{"imageList": ["https://example.com/a.jpg", "https://example.com/b.jpg"], "videoType": "SEED", "videoTime": 15, "resolution": "1080p", "aspectRatio": "16:9"}3. HAPPY_HORSE 多图参考
json
{"imageList": ["https://example.com/p1.jpg", "https://example.com/p2.jpg", "https://example.com/p3.jpg"], "videoType": "HAPPY_HORSE", "videoTime": 15, "resolution": "1080p", "aspectRatio": "16:9"}1. KLING Multi-reference Images
json
{"imageList": ["https://example.com/img1.jpg", "https://example.com/img2.jpg", "https://example.com/img3.jpg"], "videoType": "KLING", "videoTime": 10, "prompt": "Multi-angle display of the product"}2. SEED High-resolution Multi-reference Images
json
{"imageList": ["https://example.com/a.jpg", "https://example.com/b.jpg"], "videoType": "SEED", "videoTime": 15, "resolution": "1080p", "aspectRatio": "16:9"}3. HAPPY_HORSE Multi-reference Images
json
{"imageList": ["https://example.com/p1.jpg", "https://example.com/p2.jpg", "https://example.com/p3.jpg"], "videoType": "HAPPY_HORSE", "videoTime": 15, "resolution": "1080p", "aspectRatio": "16:9"}展示规则
Display Rules
- 只展示转存后的本地路径:把 后的本地视频路径告诉用户,例如「视频已保存至:xxx/a.mp4」。
Saved full response: - 禁止 Read 视频文件、禁止展示 base64 内容。
- 禁止把原始 API 返回的临时 URL 直接给用户(带签名、会过期)。
- Only display the local path of the transferred video: Tell the user 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 最多 7 张参考图,SEED/HAPPY_HORSE 最多 9 张。
- HAPPY_HORSE 不支持 isPro。
- 失败时不重试(仅尝试 1 次)。
- Maximum 2000 characters for prompts.
- Generation time is relatively long, usually 100-600 seconds. The script automatically polls, with a timeout of 20 minutes.
- KLING supports up to 7 reference images, SEED/HAPPY_HORSE support up to 9 reference images.
- HAPPY_HORSE does not support isPro.
- No retries on failure (only 1 attempt).
不适用
Not Applicable Scenarios
不适用:
- 单图/首尾帧生视频 →
linkfox-aigc-videogen - 图片生成 →
linkfox-aigc-imagegen - 文本生成 →
linkfox-aigc-textgen
Not Applicable:
- Single image/first and last frame video generation →
linkfox-aigc-videogen - Image generation →
linkfox-aigc-imagegen - Text generation →
linkfox-aigc-textgen
反馈
Feedback
参见 。
references/api.mdSee .
references/api.md