在 Claude Code 里用 WaveSpeed 技能生成图像与视频
给 Claude Code 接入 AI 媒体生成的三种方式——一条命令装技能、插件市场、MCP server——以及 agent 拿它们做什么、哪里有坑。
By WaveSpeedAI2 min read
Claude Code 最擅长的接口只有一个:shell。WaveSpeed CLI 正是为这个接口设计的——wavespeed.ai 上的每个模型都是一条 wavespeed run <model-id> 命令——agent 在任务中途就能生成主图、编辑素材、让静态图动起来,不用你离开会话。
接入有三种方式,底层能力相同,按你管理配置的习惯选。
前置条件
- Node.js ≥ 18
- CLI:
npm install -g @wavespeed/cli - WaveSpeed API 密钥——
wavespeed login打开密钥页面并校验粘贴内容
方式一:技能(最轻)
wavespeed skill install # 写入 .claude/skills/wavespeed/SKILL.md
就一个文件,进 git 全团队共享。技能教 agent「查找 → 检查 → 运行」模式:
# 1. 在实时目录里查找模型
wavespeed models "seedream"
wavespeed models --type image-to-video --popular
# 2. 检查它的真实输入 schema(逐模型实时拉取)
wavespeed run bytedance/seedream-v5.0-pro -h
# 3. 运行,用 JSON 读结果
wavespeed run bytedance/seedream-v5.0-pro \
-p "a cyberpunk skyline at golden hour" \
-i aspect_ratio="16:9" -i resolution="2k" --json
本地文件走 @path 标记——一步完成上传并替换成托管 URL:
wavespeed run bytedance/seedream-v5.0-pro/edit \
-p "replace the background with a sunlit kitchen" \
-i images='["@./input.jpg"]' --json
方式二:插件市场
/plugin marketplace add WaveSpeedAI/claude-plugins
/plugin install wavespeed@wavespeed
同一份技能,以受管插件的形式交付——更新走市场,不用重跑安装命令。
方式三:MCP server
claude mcp add wavespeed -- npx -y @wavespeed/mcp
七个类型化工具替代 shell 命令:list_models、get_model_schema、run_model(同样支持 @path 上传)、get_price、get_balance、upload_file、get_prediction。适合团队统一走 MCP、或不希望 agent 直接跑 shell 的场景。server 复用 CLI 的登录态,wavespeed login 一次两边通用。
花费控制
wavespeed price bytedance/seedream-v5.0-pro -i resolution=2k # 报价,不扣费
wavespeed balance
有一点要知道:很多模型按输入计费——音频时长、帧数。不带这些输入询价,公式会坍缩到模型的基础价,那是区间下限。命令会列出它没看到的输入(--json 里的 unpriced_inputs);实际扣费金额以运行为准。
坑
- 裸路径不会上传。
-i image=./photo.jpg发出去的是字符串本身。要写@./photo.jpg。 - 不要编造模型 ID——先用
wavespeed models或wavespeed schema <id>确认。 - 运行永远带
--json,让 agent 读outputs[0]而不是解析人类可读输出。 - 项目默认值和别名放在
wavespeed.json(wavespeed init生成)。
相关链接
- CLI(MIT):WaveSpeedAI/wavespeed-cli ·
@wavespeed/cli - 插件市场:WaveSpeedAI/claude-plugins
- MCP server:WaveSpeedAI/mcp-server ·
@wavespeed/mcp - 模型目录:wavespeed.ai/models
