Doubao Native Image and Video Generation Skill: Direct Integration with Volcengine Ark in Agent

Introduction

When connecting to Doubao Text-to-Image, Image-to-Image, or Text-to-Video within an Agent, the common practice is to hang an additional layer of MCP service or hand-write curl commands to assemble Ark requests. Video tasks also require separate polling for task_id and downloading video_url, which easily breaks the chain within conversations.

The Skill introduced below consolidates image and video generation into a set of native capabilities: The Agent calls local python3 scripts based on SKILL.md, directly requesting the Volcano Engine Ark Beijing endpoint without relying on external MCP. Official documentation emphasizes the use of Endpoints, rather than bypassing console configuration to call model names directly.

What is this

Doubao Image and Video Generation Native Skill (Coordinate @user_9aa92135/doubao-image-video) is a SkillHub community skill, categorized under design-media and published by user_9aa92135. The current SkillHub page marks the version as v1.0.0. The page tags indicate “API Key Configuration Required” and define the capability direction as image generation and video processing.

The skill package includes scripts/doubao_media.py and references/api-notes.md, following the general SKILL.md format. When users mention Doubao, Text-to-Image, Image-to-Image, Text-to-Video, Image-to-Video, querying video tasks, waiting for completion, or downloading finished videos, the Agent should prioritize this skill rather than defaulting to launching upstream MCP (unless the user explicitly requests MCP compatibility).

Core Functions

The following capabilities are derived from the skill package SKILL.md and references/api-notes.md, and have been verified against the installation package.

Image Generation

  • Text-to-Image, as well as Image-to-Image or multi-reference image generation via --image-url and --ref-image-url.
  • Request: POST https://ark.cn-beijing.volces.com/api/v3/images/generations.
  • Prioritize using --endpoint-id or the environment variable DOUBAO_IMAGE_ENDPOINT_ID; fallback to --model or default model environment variables if missing.

Video Generation and Async Tasks

  • Text-to-Video, Image-to-Video (First frame --first-frame-image-url, Reference image --ref-image-url).
  • Create Task: POST https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks.
  • Query Task: GET https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks/{task_id}.
  • Video is an asynchronous process; a task_id is obtained upon success. You can use the task subcommand to query, or use wait to poll and download according to content.video_url upon success.
  • The script appends --dur, --fps, --rs, --ratio to the prompt as needed (consistent with upstream implementation); ratio is 16:9 for 720p, otherwise adaptive.

Runtime Dependencies

  • Requires local python3 (Skill metadata openclaw.requires.bins).
  • Required environment variable: DOUBAO_API_KEY (Volcano Engine Ark API Key).
  • Optional: DOUBAO_IMAGE_ENDPOINT_ID, DOUBAO_VIDEO_ENDPOINT_ID; Default model names DOUBAO_DEFAULT_IMAGE_MODEL (default doubao-seedream-4-5), DOUBAO_DEFAULT_VIDEO_MODEL (default doubao-seedance-1.0-lite-t2v).

Installation and Activation

Method 1: Let the Agent install via official prompts

The installation prompt provided on the SkillHub page is:

Please install `@user_9aa92135/doubao-image-video` according to https://skillhub.cn/install/skillhub.md.

Send the above content to the current AI Client, allowing the Agent to read the SkillHub installation documentation and complete the installation.

Method 2: SkillHub CLI

First, check if the CLI is installed (see documentation at https://skillhub.cn/install/skillhub.md):

command -v skillhub && skillhub --version

If not installed, execute the full installation or CLI-only installation:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

When installing skills, you must use --dir to point to the current Agent’s skills directory; otherwise, if it defaults to ./skills/, it might not be recognized. Common paths are as follows (excerpted from SkillHub installation documentation):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

Example (replace the directory with the path corresponding to your environment):

skillhub install @user_9aa92135/doubao-image-video --dir ~/.cursor/skills

The page also supports Zip package installation and installation to local Agents; choose either CLI or Zip.

Configure API Key and Endpoint

Set in the Agent runtime environment:

export DOUBAO_API_KEY="Your Volcano Engine Ark API Key"
# Recommended to fill in the Endpoint ID after creating and authorizing in the console
export DOUBAO_IMAGE_ENDPOINT_ID="Image Endpoint ID"
export DOUBAO_VIDEO_ENDPOINT_ID="Video Endpoint ID"

Skill instructions require: If there is an activated Ark Endpoint, prioritize --endpoint-id or the above environment variables, rather than assuming any model name is available.

Typical Usage

The following commands are from SKILL.md; {baseDir} needs to be replaced with the skill installation directory (e.g., ~/.cursor/skills/@user_9aa92135/doubao-image-video).

Text-to-Image

python3 {baseDir}/scripts/doubao_media.py image \
  --prompt "A cinematic cyberpunk alley in rain" \
  --size 2560x1440

Text-to-Video

python3 {baseDir}/scripts/doubao_media.py video \
  --prompt "A panda astronaut waves on the moon" \
  --video-duration 5 \
  --fps 24 \
  --resolution 1080p

Query Video Task

python3 {baseDir}/scripts/doubao_media.py task --task-id your-task-id

Wait for Task and Download MP4

python3 {baseDir}/scripts/doubao_media.py wait \
  --task-id your-task-id \
  --timeout 600 \
  --interval 5 \
  --download-to ./doubao-result.mp4

The script outputs structured JSON and does not print keys; it returns concise error messages upon failure. If the API returns InvalidEndpointOrModel.NotFound, you should first verify that the Endpoint has been created and authorized in the Ark console.

For Image-to-Image or Image-to-Video, if the user provides an image URL, pass it as-is to --image-url / --first-frame-image-url / --ref-image-url. Do not download or transfer it yourself unless requested by the user.

Use Cases and Notes

Who it is for

  • Developers who have activated Ark on Volcano Engine and are willing to manage Doubao image/video models using Endpoints.
  • Teams using clients like Cursor, Claude Code, Codex who want to complete the full chain of “Generate → Query Task → Download Video” within conversations without maintaining a separate MCP process.

Limitations and Notes

  • DOUBAO_API_KEY must be configured; the script will fail directly without a Key.
  • Video prompt length limit is 500 characters (validated within the script).
  • The skill is positioned as a native OpenClaw capability; the upstream GitHub project doubao-image-video-mcp is referenced as a homepage in metadata, but the MCP service should not be started by default during daily use.
  • The SkillHub page shows this skill has been scanned by KonLabs and YunDing Labs as risk-free; however, you must still keep your API Key secure and do not commit it to repositories.

SkillHub side statistics (based on scraped data): Rating 100,000, approximately 11,500 downloads, 117 installations; the page also shows approximately 12,000 downloads, which is of the same magnitude.

Conclusion

Doubao Image and Video Generation Native Skill consolidates Doubao-related image and video Ark calls, async task queries, and result downloads into a single SKILL.md and a single Python script, making it suitable as the default Doubao multimedia toolchain for Agents.

Official SkillHub Page: https://www.skillhub.cn/skills/user_9aa92135/doubao-image-video
Skill Coordinate Page: https://api.skillhub.cn/user_9aa92135/doubao-image-video

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye