SuperAPI AI Directory

linkfox-aigc-videogen-multi

Design & creation

View repository

Updated 10-16 00:00

About this skill

Multi-Reference Image-to-Video

Generate videos based on multiple reference images and prompts, supports 3 AI video models, asynchronously creates tasks and then polls for results.

Core Features

  • 4 Model Choices: KLING/SEED/SEED_FAST/HAPPY_HORSE, covering different styles and durations.
  • Multi-Image Reference: Pass in multiple images as references, and AI comprehensively generates the video.
  • Rich Parameters: Supports Pro mode, sound generation, aspect ratio, resolution, etc.
  • Asynchronous Mode: Creating a task immediately returns a taskId, and the script automatically polls until completion (20-minute timeout).

Model Description

Model (videoType) Description Supported Durations Image Limit
KLING Kling 5 seconds/10 seconds ≤7 images
SEED Seedance/Doubao 5 seconds/10 seconds/15 seconds ≤9 images
SEED_FAST Seedance 2.0 Fast 5 seconds/10 seconds/15 seconds ≤9 images
HAPPY_HORSE Bailian HappyHorse 5 seconds/10 seconds/15 seconds (default 15) ≤9 images

Parameter Overview

  • Required Fields:imageList、videoType、videoTime
  • Optional Core:prompt(within 2000 characters),aspectRatio、resolution

For the complete parameter table, response field structure, and error codes, see references/api.md。

How to Call

  • Create Task:POST /aigc/multiImageVideoGenAsync → Returns {taskId}
  • Poll Results:POST /aigc/taskQuery → Pass in {taskId} → Returns status and results
  • Python Script:python scripts/aigc_videogen_multi.py '<JSON 参数>'(the script internally completes creation + polling automatically)

Asynchronous Flow:

  1. The script calls /aigc/multiImageVideoGenAsync to create a task and obtain taskId
  2. After waiting 2 minutes, start polling /aigc/taskQuery, once every 10 seconds, with a maximum wait of 20 minutes
  3. After success, automatically download the video to the session media/ directory

Output Strategy (Default Script Behavior):

  • The script will automatically download and save the generated videodownload and saveto the session media/ directory, and output one line to stdout Saved full response: <路径数组>。
  • The raw API response is silently written to disk at data/, and its path is only shown on stdout when there is no video output.

Data Reading Recommendations:Prohibited Read the contents of the saved video file. Directly provide the local path after Saved full response: to the user.

Resolve Authentication and Compute Issues

When the following abnormal situations occur, use references/onboarding.md to guide problem resolution:

Abnormal Situations

  • API Key Not Configured: The environment variable is not configured LINKFOX_AGENT_API_KEY, and LINKFOXAGENT_API_KEY。
  • Response 401 or 402 status code
  • Response indicates insufficient compute or balance: The message contains "insufficient compute balance/insufficient billing/insufficient balance/quota exceeded/insufficient balance/package expired/recharge required/please recharge", or content with a similar meaning.

Usage Guide

  1. Model Selection: Generally use KLINGfor multi-image reference; use SEEDfor high resolution; use HAPPY_HORSE。
  2. Image Count: KLING supports up to 7 images, SEED/HAPPY_HORSE supports up to 9 images. Upload at least 1 image.
  3. Duration Matching: You must pass a duration value supported by the model, otherwise an error will occur.
  4. Prompt: Optional, within 2000 characters, describing the desired dynamic effect.

Examples

1. KLING Multi-Reference Images

{"imageList": ["https://example.com/img1.jpg", "https://example.com/img2.jpg", "https://example.com/img3.jpg"], "videoType": "KLING", "videoTime": 10, "prompt": "商品多角度展示"}

2. SEED High-Resolution Multi-Image

{"imageList": ["https://example.com/a.jpg", "https://example.com/b.jpg"], "videoType": "SEED", "videoTime": 15, "resolution": "1080p", "aspectRatio": "16:9"}

3. HAPPY_HORSE Multi-Image Reference

{"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

  • Only display the local path after transfer: Tell the user the local video path after Saved full response: , for example "Video saved to: xxx/a.mp4".
  • Prohibited Read video files,Prohibiteddisplay base64 content.
  • ProhibitedGive the user the temporary URL returned directly by the original API (signed, will expire).

Limitations

  • The prompt is at most 2000 characters.
  • Generation takes a long time, usually 100-600 seconds. The script automatically polls, with a timeout of 20 minutes.
  • KLING supports up to 7 reference images, SEED/HAPPY_HORSE supports up to 9 images.
  • HAPPY_HORSE does not support isPro.
  • Do not retry on failure (only try once).

Not Applicable

Not Applicable:

  • Single-image/first-last frame video generation → linkfox-aigc-videogen
  • Image generation → linkfox-aigc-imagegen
  • Text generation → linkfox-aigc-textgen

Feedback

See references/api.md。