linkfox-aigc-videogen

Original🇨🇳 Chinese
Translated
2 scriptsChecked / no sensitive code detected

AI Video Generation Tool (First/Last Frame/Single Image Mode) generates videos based on the original image and prompts, with optional last frame image support to control the ending scene. Supported models include KLING, WAN, SEED (Doubao), SEED_FAST, and HAILUO. Triggered when users use phrases like "generate video", "AI video", "image-to-video", "make a video", "video generation", "generate video", "image to video", "dynamic video".

4installs
Added on

NPX Install

npx skill4agent add linkfox-ai/linkfox-skills linkfox-aigc-videogen

SKILL.md Content (Chinese)

View Translation Comparison →

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

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

Model Description

Model (videoType)DescriptionSupported Duration
KLINGKeling5s/10s
WANWanxiang5s/10s/15s
SEEDSeedance/Doubao5s/10s/15s
SEED_FASTSeedance 2.0 Fast5s/10s/15s
HAILUOHailuo6s/10s

Parameter Overview

  • Required Fields:
    imageUrl
    ,
    videoType
    ,
    videoTime
  • Optional Core Fields:
    lastFrameImageUrl
    (last frame image),
    prompt
    (within 2000 characters)
Complete parameter table, response field structure and error codes can be found in
references/api.md
.

Calling Methods

  • Create Task:
    POST /aigc/videoGenAsync
    → Returns
    {taskId}
  • Poll for Results:
    POST /aigc/taskQuery
    → Pass in
    {taskId}
    → Returns status and results
  • Python Script:
    python scripts/aigc_videogen.py '<JSON parameters>'
    (the script automatically handles creation + polling internally)
Asynchronous Process:
  1. The script calls
    /aigc/videoGenAsync
    to create a task and obtains
    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 saves 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 product.
Data Reading Suggestion: Do NOT read the content of the saved video file. Directly provide the local path after
Saved full response:
to the user.

Resolve Authentication and Points Issues

When the following exceptions occur, guide users to resolve them using references/onboarding.md:

Exception Scenarios

  • 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: 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

  1. Model Selection: Use
    KLING
    for general product videos; use
    WAN
    /
    SEED
    for longer durations.
  2. First/Last Frames: Pass
    imageUrl
    (first frame, required) + optional
    lastFrameImageUrl
    (last frame). Supported models: KLING (Pro mode only) / WAN / SEED.
  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 — 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

  • Only Display Saved Local Path: Tell users 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

  • 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

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

See
references/api.md
.