SuperAPI AI Directory

linkfox-aigc-videogen

Design & creation

View repository

Updated 10-16 00:00

About this skill

AI Video Generation (First/Last Frame / Single Image Mode)

Generates a video from a source image (first frame) and an optional last frame image, supports multiple AI video models, creates a task asynchronously and then polls for the result.

Core Features

  • 5 model choices: covering different styles and duration requirements.
  • First/last frame control: an optional last frame image controls the video's ending frame.
  • Rich parameters: supports Pro mode, sound generation, camera movement control, aspect ratio, etc.
  • Asynchronous mode: creating a task returns a taskId immediately, and the script automatically polls until completion (20-minute timeout).

Model Description

Model (videoType) Description Supported durations
KLING Keling 5 seconds/10 seconds
WAN Wanxiang 5 seconds/10 seconds/15 seconds
SEED Seedance/Doubao 5 seconds/10 seconds/15 seconds
SEED_FAST Seedance 2.0 Fast 5 seconds/10 seconds/15 seconds
HAILUO Hailuo 6 seconds/10 seconds

Parameter Overview

  • Required fields:imageUrl、videoType、videoTime
  • Optional core:lastFrameImageUrl(last frame image),prompt(within 2000 characters)

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

How to Call

  • Create task:POST /aigc/videoGenAsync → returns {taskId}
  • Poll result:POST /aigc/taskQuery → pass in {taskId} → returns status and result
  • Python script:python scripts/aigc_videogen.py '<JSON 参数>'(the script automatically completes creation + polling internally)

Asynchronous flow:

  1. The script calls /aigc/videoGenAsync to create a task and obtain taskId
  2. Wait 2 minutes before starting to poll /aigc/taskQuery, once every 10 seconds, waiting up to 20 minutes
  3. On success, automatically download the video to the session media/ directory

Output strategy (default script behavior):

  • The script automaticallydownloads and savesthe generated video to the session media/ directory, and outputs 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 advice:Do not Read the contents of the saved video file. Simply provide the user with the local path after Saved full response: .

Resolving authentication and compute issues

When the following abnormal situations occur, use references/onboarding.md to guide 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: For general product videos use KLING; for long durations use WAN/SEED。
  2. First and last frames: pass imageUrl(first frame, required) + optional lastFrameImageUrl(last frame), supported models: KLING Pro only / WAN / SEED.
  3. Duration matching: you must pass a duration value supported by the model, otherwise an error will occur.
  4. Prompt: optional, within 2000 characters, describes the desired dynamic effect.

Examples

1. KLING — Product showcase

{"imageUrl": "https://example.com/product.jpg", "videoType": "KLING", "videoTime": 10, "prompt": "商品展示视频"}

3. WAN Wanxiang — with audio and camera movement

{"imageUrl": "https://example.com/scene.jpg", "videoType": "WAN", "videoTime": 15, "voice": true, "camera": "single"}

4. SEED — high resolution

{"imageUrl": "https://example.com/scene.jpg", "videoType": "SEED", "videoTime": 10, "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 the video file,Prohibiteddisplay base64 content.
  • Prohibitedgiving 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 polls automatically, with a 20-minute timeout.
  • KLING last frame image is only supported in Pro mode.
  • This interface only supports single-image/first-and-last-frame mode. For multiple reference images, use linkfox-aigc-videogen-multi。
  • No retry on failure (only 1 attempt).

Not applicable

Not applicable:

  • Multiple reference image to video → linkfox-aigc-videogen-multi
  • Image generation → linkfox-aigc-imagegen
  • Text generation → linkfox-aigc-textgen

Feedback

See references/api.md。