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
    taskId
    immediately after task creation, and the script automatically polls until completion (timeout after 20 minutes).

模型说明

Model Description

模型(videoType)说明支持时长图片上限
KLING可灵5秒/10秒≤7张
SEEDSeedance/豆包5秒/10秒/15秒≤9张
SEED_FASTSeedance 2.0 Fast5秒/10秒/15秒≤9张
HAPPY_HORSE百炼HappyHorse5秒/10秒/15秒(默认15)≤9张
Model (videoType)DescriptionSupported DurationMax Images
KLINGKeling5s/10s≤7
SEEDSeedance/Doubao5s/10s/15s≤9
SEED_FASTSeedance 2.0 Fast5s/10s/15s≤9
HAPPY_HORSEBailian HappyHorse5s/10s/15s (default 15s)≤9

参数概览

Parameter Overview

  • 必填字段
    imageList
    videoType
    videoTime
  • 可选核心
    prompt
    (2000字以内)、
    aspectRatio
    resolution
完整参数表、响应字段结构与错误码,见
references/api.md
  • Required Fields:
    imageList
    ,
    videoType
    ,
    videoTime
  • Optional Core Parameters:
    prompt
    (within 2000 characters),
    aspectRatio
    ,
    resolution
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 参数>'
    (脚本内部自动完成创建+轮询)
异步流程
  1. 脚本调用
    /aigc/multiImageVideoGenAsync
    创建任务,获得
    taskId
  2. 等待 2 分钟后开始轮询
    /aigc/taskQuery
    ,每 10 秒一次,最长等待 20 分钟
  3. 成功后自动下载视频到会话
    media/
    目录
输出策略(脚本默认行为)
  • 脚本会自动把生成的视频下载转存到会话
    media/
    目录,stdout 输出一行
    Saved full response: <路径数组>
  • 原始 API 响应静默落盘到
    data/
    ,仅在无视频产物时才在 stdout 提示其路径。
读数据建议禁止 Read 转存的视频文件内容。直接把
Saved full response:
后的本地路径提供给用户即可。
  • Create Task:
    POST /aigc/multiImageVideoGenAsync
    → Returns
    {taskId}
  • Poll for Results:
    POST /aigc/taskQuery
    → Pass
    {taskId}
    → Returns status and results
  • Python Script:
    python scripts/aigc_videogen_multi.py '<JSON parameters>'
    (The script automatically handles creation + polling internally)
Asynchronous Flow:
  1. The script calls
    /aigc/multiImageVideoGenAsync
    to create a task and obtain
    taskId
  2. Starts polling
    /aigc/taskQuery
    after waiting for 2 minutes, once every 10 seconds, with a maximum wait time of 20 minutes
  3. Automatically downloads the video to the session
    media/
    directory upon success
Output Strategy (Default Script Behavior):
  • The script automatically downloads and transfers the generated video to the session
    media/
    directory, and outputs a line
    Saved full response: <path array>
    to stdout.
  • The original API response is silently saved to
    data/
    , and its path is only prompted in stdout when there is no video output.
Data Reading Suggestion: Do NOT read the content of the transferred video file. Directly provide the local path after
Saved full response:
to the user.

解决认证和积分问题

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
    LINKFOX_AGENT_API_KEY
    or
    LINKFOXAGENT_API_KEY
    is not configured.
  • 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

  1. 模型选择:一般多图参考用
    KLING
    ;高分辨率用
    SEED
    ;百炼风格用
    HAPPY_HORSE
  2. 图片数量:KLING 最多 7 张,SEED/HAPPY_HORSE 最多 9 张。至少传 1 张。
  3. 时长匹配:必须传模型支持的时长值,否则报错。
  4. 提示词:可选,2000 字以内,描述期望的动态效果。
  1. Model Selection: Generally use
    KLING
    for multi-reference images; use
    SEED
    for high resolution; use
    HAPPY_HORSE
    for Bailian style.
  2. Number of Images: KLING supports up to 7 images, SEED/HAPPY_HORSE support up to 9 images. At least 1 image must be passed.
  3. Duration Matching: Must pass a duration value supported by the model, otherwise an error will occur.
  4. 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

  • 只展示转存后的本地路径:把
    Saved full response:
    后的本地视频路径告诉用户,例如「视频已保存至:xxx/a.mp4」。
  • 禁止 Read 视频文件、禁止展示 base64 内容。
  • 禁止把原始 API 返回的临时 URL 直接给用户(带签名、会过期)。
  • Only display the local path of the transferred video: Tell the user the local video path after
    Saved full response:
    , e.g., "Video saved to: xxx/a.mp4".
  • 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.md
See
references/api.md
.