HomeBrowseUpload
← Back to registry
// Skill profile

Vidu Video Generation Skill

name: vidu-skills

by calvinzhao · published 2026-03-22

日历管理图像生成加密货币
Total installs
0
Stars
★ 0
Last updated
2026-03
// Install command
$ claw add gh:calvinzhao/calvinzhao-vidu-skill
View on GitHub
// Full documentation

---

name: vidu-skills

description: Generate video by calling the official Vidu API with curl. Use when the user wants 文生视频, 图生视频, 首尾帧生视频, 参考生视频, 创建主体 (material element), or to submit or check vidu tasks. Requires VIDU_TOKEN and optional VIDU_BASE_URL.

compatibility: Requires ability to run curl (or equivalent HTTP client). Set VIDU_TOKEN in the environment; VIDU_BASE_URL optional (default https://service.vidu.cn). See references/api_reference.md for full API.

version: 1.0.1

---

# Vidu Video Generation Skill

Generate AI videos with Vidu (生数) via direct API calls — text-to-video, image-to-video, start-end frame, reference-based generation, and material elements, up to 1080p. Use curl with VIDU_TOKEN.

Execution model: use curl (direct API)

**All execution is done by calling the official Vidu API** with curl (or any HTTP client). Base URL: **$VIDU_BASE_URL** (default `https://service.vidu.cn` for mainland China; `https://service.vidu.com` for overseas).

**Required headers for all requests:**

| Header | Value |

|--------|--------|

| Authorization | `Token $VIDU_TOKEN` |

| Content-Type | `application/json` |

| User-Agent | `viduclawbot/1.0 (+$VIDU_BASE_URL)` |

**Main endpoints:**

  • **Create upload**: POST `$VIDU_BASE_URL/tools/v1/files/uploads` → get `put_url`, `id`
  • **PUT image**: PUT raw image bytes to `put_url` → get ETag
  • **Finish upload**: PUT `$VIDU_BASE_URL/tools/v1/files/uploads/{id}/finish` → get `ssupload:?id={id}`
  • **Submit task**: POST `$VIDU_BASE_URL/vidu/v1/tasks` → get `task_id` (response `id`)
  • **Get task result**: GET `$VIDU_BASE_URL/vidu/v1/tasks/{task_id}` → get `state`, `creations[].nomark_uri`
  • **Task state (SSE)**: GET `$VIDU_BASE_URL/vidu/v1/tasks/state?id={task_id}` with `Accept: text/event-stream` — return SSE stream to the user; do not wait for terminal state. Events include `state`, `estimated_time_left`, `err_code`, **queue_wait_time** (排队预测时间, unit: minutes).
  • **Pre-process element**: POST `$VIDU_BASE_URL/vidu/v1/material/elements/pre-process`
  • **Create element**: POST `$VIDU_BASE_URL/vidu/v1/material/elements`
  • **List elements**: GET `$VIDU_BASE_URL/vidu/v1/material/elements/personal`
  • ---

    Key Capabilities

  • **文生视频 (text2video)** — POST `/vidu/v1/tasks` with `type: "text2video"`, `input.prompts` (text only), `settings`.
  • **图生视频 (img2video)** — Upload one image (Create upload → PUT → Finish) to get `ssupload:?id=...`; then POST `/vidu/v1/tasks` with `type: "img2video"`, prompts (text + image).
  • **首尾帧生视频 (headtailimg2video)** — Upload two images; POST `/vidu/v1/tasks` with `type: "headtailimg2video"`, prompts (text + image1 + image2).
  • **参考生视频 (character2video)** — Image(s) + material(s) + text (text required; image + material combined at most 7). POST `/vidu/v1/tasks` with `type: "character2video"`; Q2 only, do not send `transition`.
  • **创建主体** — POST pre-process → POST material/elements (images must be uploaded first). Query list: GET `/vidu/v1/material/elements/personal`.
  • **查询任务** — GET `/vidu/v1/tasks/{task_id}` for result; or GET `/vidu/v1/tasks/state?id={task_id}` for SSE stream.
  • ---

    Setup

    1. Obtain a VIDU token (e.g. from the official Vidu console).

    2. Set environment variables:

    - `export VIDU_TOKEN="your-token"` (required)

    - `export VIDU_BASE_URL=https://service.vidu.cn` (mainland China, default) or `https://service.vidu.com` (overseas)

    3. **Dependency**: curl or any HTTP client that can send JSON and binary PUT. No Python or scripts required for execution.

    ---

    Data usage note

    This skill sends user-provided text prompts, image data, and task parameters to the Vidu API (service.vidu.cn or service.vidu.com) for video generation. Input data is not persisted locally beyond what is needed for the request. Data handling follows Vidu’s official policy.

    ---

    Overview

    Vidu video generation is **asynchronous**: submit a task → get **task_id** → use task_id to **query** status/result (GET `/vidu/v1/tasks/{task_id}` or SSE `/vidu/v1/tasks/state?id=`) when needed.

  • **文生视频 (text2video)**: Text only. Q3 duration 1–16, aspect ratios 16:9/9:16/1:1/4:3/3:4, transition pro/speed; Q2 duration 2–8, do not send transition.
  • **图生视频 (img2video)**: **One image + one text**. Aspect ratio from input image (do not send aspect_ratio). Q3 duration 1–16, Q2 duration 2–8, transition pro/speed.
  • **首尾帧生视频 (headtailimg2video)**: **Two images (start frame, end frame) + one text**. Q3 1–16s, Q2 2–8s, transition pro/speed.
  • **参考生视频 (character2video)**: **Image + material + text** (combinations); **text required**. **Image + material at most 7**, at least one. Q2 only, duration 2–8, **do not send transition**. Reference materials in prompts via `type: "material"`, `material.id`, `material.version`.
  • **创建主体 (Create element)**: Upload 1–3 images, name and optional description; **must** call POST `/vidu/v1/material/elements/pre-process` first, then POST `/vidu/v1/material/elements`. Use pre-process `recaption` when description is omitted. Response includes element `id` and `version` for character2video.
  • **查询主体**: GET `/vidu/v1/material/elements/personal` with `pager.page`, `pager.pagesz`, `keyword`, `modalities`; returns `elements[].id`, `version`.
  • See **任务支持列表** below and **references/parameters.md**.

    ---

    任务支持列表 (Supported task list)

    When building the POST `/vidu/v1/tasks` body, ensure the user’s request matches one of the supported task types and constraints below. All parameters are passed in the request **body** (type, input.prompts, settings). **references/parameters.md** has the same list for quick lookup.

    **模型版本 (Model version)**

  • **Q3** → `model_version: "3.2"`
  • **Q2** → `model_version: "3.1"`
  • | 任务类型 | type | 输入 | 模型 | 时长(秒) | 宽高比 | 生成模式 transition | 清晰度 |

    |----------|------|------|------|----------|--------|----------------------|--------|

    | 文生视频 | text2video | 一段文字 | Q3 | 1–16 | 16:9, 9:16, 1:1, 4:3, 3:4 | pro(电影大片), speed(闪电出片) | 1080p |

    | 文生视频 | text2video | 一段文字 | Q2 | 2–8 | 16:9, 9:16, 1:1, 4:3, 3:4 | 不传 | 1080p |

    | 图生视频 | img2video | **一张图 + 一段文字** | Q3 | 1–16 | **依据输入图片,参数不传** | pro, speed | 1080p |

    | 图生视频 | img2video | 一张图 + 一段文字 | Q2 | 2–8 | 依据输入图片,不传 | pro, speed | 1080p |

    | 首尾帧生视频 | headtailimg2video | **两张图 + 一段文字** | Q3 | 1–16 | — | pro, speed | 1080p |

    | 首尾帧生视频 | headtailimg2video | 两张图 + 一段文字 | Q2 | 2–8 | — | pro, speed | 1080p |

    | 参考生视频 | character2video | **图+主体+文字(文字必填;图+主体合计最多7)** | Q2 | 2–8 | — | **不传** | 1080p |

  • **文生视频**: Text only; do not send transition for Q2.
  • **图生视频**: Exactly **1 image + 1 text**; do not send `aspect_ratio` in settings.
  • **首尾帧生视频**: Exactly **2 images (start, end) + 1 text**; order is start frame then end frame.
  • **参考生视频**: **Image + material + text** (text required; image + material combined at most 7); Q2 only; **do not send transition**.
  • ---

    创建主体(先 pre-process,再 POST /vidu/v1/material/elements)

    Create a material element for use in character2video: upload 1–3 images, name and description; API returns element `id` and `version`. **Flow**: **First** call **POST** `$VIDU_BASE_URL/vidu/v1/material/elements/pre-process` (required even if user provides description; body: `components`, `name`, `type: "user"`). Response includes `recaption` (style, description). Then call **POST** `$VIDU_BASE_URL/vidu/v1/material/elements` with the pre-process response `id`, same `components`, and `recaption` (or user description).

    **Pre-process**: POST `$VIDU_BASE_URL/vidu/v1/material/elements/pre-process`. See **references/api_reference.md** §3b.

    **Create element**: POST `$VIDU_BASE_URL/vidu/v1/material/elements`. Body: `id` (from pre-process), `name`, `modality: "image"`, `type: "user"`, `components` (1–3 items: **content** = `ssupload:?id={id}`, **src_img** = `ssupload:?id={id}`, `content_type: "image"`), `version: "0"`, `recaption`. See **references/api_reference.md** §3c.

    **Prerequisite**: Each image must be uploaded first (Create upload → PUT to put_url → Finish) to get `ssupload:?id={id}`; use these in `components`.

    ---

    查询主体(GET /vidu/v1/material/elements/personal)

  • **URL**: GET `$VIDU_BASE_URL/vidu/v1/material/elements/personal`
  • **Query**: `pager.page`, `pager.pagesz`, `pager.page_token` (optional), `keyword` (URL-encoded), `modalities` (e.g. `modalities=image`).
  • **Response**: `elements[]` with `id`, `name`, `version`, etc.; use `id` and `version` in character2video prompts.
  • ---

    参考生任务中引用主体(character2video)

    Materials are used only in **character2video**. When submitting POST `/vidu/v1/tasks`: `type: "character2video"`; `input.prompts` must include **(1) text prompt (required)**; (2) optional image prompt (`type: "image"`); (3) optional material prompt (`type: "material"`, `name`, `material: { "id", "version" }`). Combine image + material + text; text required; **image + material at most 7**, at least one.

    **Example body**:

    {
      "input": {
        "prompts": [
          { "type": "text", "content": "[@艾莉娅]" },
          { "type": "material", "name": "艾莉娅", "material": { "id": "3073530415201165", "version": "1765430214" } }
        ],
        "editor_mode": "normal",
        "enhance": true
      },
      "type": "character2video",
      "settings": { "duration": 5, "resolution": "1080p", "movement_amplitude": "auto", "aspect_ratio": "16:9", "sample_count": 1, "schedule_mode": "normal", "codec": "h265", "model_version": "3.1", "use_trial": false }
    }

    ---

    Bundled resources

  • **references/api_reference.md** — Full API contracts (endpoints, request/response). Use for building curl requests.
  • **references/parameters.md** — Task types and parameter constraints.
  • **references/errors_and_retry.md** — Error handling and retry guidance.
  • ---

    Workflow: Submit → Query → Get video URL

    **Summary**: Submit (POST `/vidu/v1/tasks` → get `task_id`) → Query (GET `/vidu/v1/tasks/{task_id}` or SSE `/vidu/v1/tasks/state?id=`) → Get video from `creations[].nomark_uri`.

    1. 文生视频 — Submit (curl example)

    curl -s -X POST "$VIDU_BASE_URL/vidu/v1/tasks" \
      -H "Authorization: Token $VIDU_TOKEN" \
      -H "Content-Type: application/json" \
      -H "User-Agent: viduclawbot/1.0 (+$VIDU_BASE_URL)" \
      -d '{
        "type": "text2video",
        "input": {
          "prompts": [{"type": "text", "content": "A cat walks in the snow at sunset"}],
          "editor_mode": "normal",
          "enhance": true
        },
        "settings": {
          "duration": 5,
          "resolution": "1080p",
          "aspect_ratio": "16:9",
          "model_version": "3.2",
          "transition": "pro",
          "sample_count": 1,
          "schedule_mode": "normal",
          "codec": "h265",
          "use_trial": false
        }
      }'

    Response contains `id` (task_id). Use it to query.

    2. 查询任务结果 (curl example)

    curl -s "$VIDU_BASE_URL/vidu/v1/tasks/$TASK_ID" \
      -H "Authorization: Token $VIDU_TOKEN" \
      -H "User-Agent: viduclawbot/1.0 (+$VIDU_BASE_URL)"
  • **state**: `success` | `failed` | `processing` | ...
  • On **success**: use `creations[].nomark_uri` as the video URL(s).
  • On **failed**: use `err_code`, `err_msg` to report to the user.
  • 3. 任务状态 SSE (optional, stream to user)

    curl -N -s "$VIDU_BASE_URL/vidu/v1/tasks/state?id=$TASK_ID" \
      -H "Authorization: Token $VIDU_TOKEN" \
      -H "Accept: text/event-stream" \
      -H "User-Agent: viduclawbot/1.0 (+$VIDU_BASE_URL)"

    Return the SSE output directly to the user; do not wait for a terminal state.

    4. 图片上传(图生视频 / 首尾帧 / 创建主体前)

    **Step 1 — Create upload:**

    curl -s -X POST "$VIDU_BASE_URL/tools/v1/files/uploads" \
      -H "Authorization: Token $VIDU_TOKEN" \
      -H "Content-Type: application/json" \
      -H "User-Agent: viduclawbot/1.0 (+$VIDU_BASE_URL)" \
      -d '{"metadata":{"image-width":"1920","image-height":"1080"},"scene":"vidu"}'

    From response take `id` and `put_url`.

    **Step 2 — PUT image bytes to put_url:**

    curl -s -X PUT "$PUT_URL" \
      -H "Content-Type: image/jpeg" \
      -H "x-amz-meta-image-width: 1920" \
      -H "x-amz-meta-image-height: 1080" \
      --data-binary @/path/to/image.jpg

    Save the **ETag** from the response (use quotes if the server returns them).

    **Step 3 — Finish upload:**

    curl -s -X PUT "$VIDU_BASE_URL/tools/v1/files/uploads/$UPLOAD_ID/finish" \
      -H "Authorization: Token $VIDU_TOKEN" \
      -H "Content-Type: application/json" \
      -H "User-Agent: viduclawbot/1.0 (+$VIDU_BASE_URL)" \
      -d "{\"etag\":\"$ETAG\",\"id\":\"$UPLOAD_ID\"}"

    Use `ssupload:?id=$UPLOAD_ID` in task prompts or in element `components`.

    5. 创建主体(curl flow)

    After uploading 1–3 images to get `ssupload:?id=...`:

    **Pre-process** — POST `$VIDU_BASE_URL/vidu/v1/material/elements/pre-process` with body `components` (array: each item has **content** = `ssupload:?id={id}`, **src_img** = `ssupload:?id={id}`, `content_type: "image"`), `name`, `type: "user"`. See api_reference §3b.

    **Create** — POST `$VIDU_BASE_URL/vidu/v1/material/elements` with body including `id` (from pre-process response), `name`, `modality: "image"`, `type: "user"`, `components`, `version: "0"`, `recaption` (from pre-process or user). See api_reference §3c.

    ---

    Implementation Guide

    1. **Determine task type**: text2video, img2video, headtailimg2video, character2video, or 创建主体.

    2. **Choose parameters**: From 任务支持列表 select `model_version` (Q2/Q3), `duration`, `aspect_ratio`, `transition` (omit for img2video aspect_ratio, character2video transition).

    3. **Prepare inputs**: For img2video/headtailimg2video/character2video or 创建主体, upload image(s) via Create upload → PUT → Finish to get `ssupload:?id=...`. For character2video with materials, ensure elements exist (create via pre-process + create element if needed).

    4. **Submit**: curl POST `$VIDU_BASE_URL/vidu/v1/tasks` with JSON body (type, input.prompts, settings). Capture `id` as task_id.

    5. **Query**: curl GET `$VIDU_BASE_URL/vidu/v1/tasks/{task_id}` (or use SSE) until state is success/failed; on success return `creations[].nomark_uri`; on failure return err_code/err_msg.

    ---

    Prompt Tips

  • **文生视频**: Include scene and action; you can add camera direction (e.g. “镜头缓慢左移”, “特写跟拍”).
  • **图生视频**: Describe what motion or change happens in the scene.
  • **首尾帧**: Similar start/end frames give smooth transition; very different frames can be used for morphing effects.
  • **参考生视频**: Create the material first; in the text prompt use references like `[@主体名]`; ensure text is always present.
  • ---

    Output to the user

  • **After submit**: Return the **task_id** (response `id`); tell the user the task is in progress and they can query status/result with that task_id (e.g. GET `/vidu/v1/tasks/{task_id}` or SSE state endpoint).
  • **After query**: If state is success, return the **nomark_uri** link(s); if failed, report **err_code** and **err_msg**.
  • **On failure**: Clearly state that the task failed and, when available, the reason (err_code / err_msg from the API or references).
  • ---

    Fallback (no curl)

    If the environment **cannot** run curl (or equivalent HTTP client), execution as described above is not possible. Tell the user that this skill requires curl (or an HTTP client) with VIDU_TOKEN and point them to **references/api_reference.md** for manual API usage.

    // Comments
    Sign in with GitHub to leave a comment.
    // Related skills

    More tools from the same signal band