一键导入
tongyi-image
// 通过阿里云百炼 DashScope 生成 AI 图片 — 文生图、图像编辑、风格重绘、背景生成、画面扩展、涂鸦作画、电商套图。任务异步执行+轮询,成功后可自动下载到本地。
// 通过阿里云百炼 DashScope 生成 AI 图片 — 文生图、图像编辑、风格重绘、背景生成、画面扩展、涂鸦作画、电商套图。任务异步执行+轮询,成功后可自动下载到本地。
Bailian-powered unified creative studio — built-in Wan/Qwen image generation + HappyHorse 1.0 (text-to-video / image-to-video / reference-to-video / video-edit) + Wan 2.6/2.7 + 5 digital-human modes (photo speak / video relip / video reface / pose drive / avatar compose) + CosyVoice & Edge-TTS + storyboard long-video pipeline. Use when the user asks for AI image or video generation on Aliyun Bailian, keyframes, ecommerce images, multi-character video with audio sync, video editing/style transfer, talking-head, lip-sync, video reface, or storyboard-driven long video.
Web search and content extraction with Tavily and Exa via inference.sh CLI. Apps: Tavily Search, Tavily Extract, Exa Search, Exa Answer, Exa Extract. Capabilities: AI-powered search, content extraction, direct answers, research. Use for: research, RAG pipelines, fact-checking, content aggregation, agents. Triggers: web search, tavily, exa, search api, content extraction, research, internet search, ai search, search assistant, web scraping, rag, perplexity alternative
DashScope-powered digital human studio — photo speak, video relip, video reface, avatar compose. Use when the user asks for an AI talking-head video, lip-sync replacement on an existing video, replacing a person inside a video, or composing a new character from multiple reference images.
Guide AI-powered video editing, highlight extraction, silence removal, and talking-head polish through ClipSense.
Research, score, and plan content ideas through the Idea Research plugin.
通过火山引擎 Ark API 生成 AI 视频 — 文生视频、图生视频、多模态、视频编辑、视频续写、长视频分镜拼接。任务异步执行+轮询,成功后可自动下载到本地。
| name | tongyi-image |
| description | 通过阿里云百炼 DashScope 生成 AI 图片 — 文生图、图像编辑、风格重绘、背景生成、画面扩展、涂鸦作画、电商套图。任务异步执行+轮询,成功后可自动下载到本地。 |
| env_any | ["DASHSCOPE_API_KEY"] |
输入一句中文/英文描述(可选参考图、风格、尺寸),输出一张或多张高清图片。
所有调用都是 DashScope 异步任务:先 POST 拿 task_id,再轮询 GET task_status,
就绪后下载图片 URL(24h 过期,自动落盘到 data_dir/images/)。
seedance-video skill);需要精确蒙版的局部修图(用 image-edit 插件)tongyi_image_create({prompt, model?, size?, negative_prompt?, n?})tongyi_image_status({task_id})tongyi_image_list({limit?})| mode | 描述 | 主流模型 |
|---|---|---|
| text2img | 纯文本生图 | wan27-pro, qwen-pro |
| img_edit | 参考图改写(无蒙版) | wan27-edit |
| style_repaint | 把一张人像换成预设风格 | wanx-style-repaint |
| bg_generation | 给商品/前景图生成新背景 | wanx-background-generation |
| outpainting | 画面外扩 / 改变长宽比 | wanx-outpainting |
| sketch2img | 涂鸦/线稿成图 | wanx-sketch-to-image |
| ecommerce | 电商套图(一组商品场景图) | wanx-ecommerce |
prompt + (可选 ref image) → DashScope POST → task_id →
poll loop(默认 10s)→ status==SUCCEEDED →
extract image URLs → (可选 auto_download) → 落盘 + 广播 task_update
| Gate | 检查内容 | 通过条件 |
|---|---|---|
| G1 | DashScope API Key 已配置 | await tm.get_config("dashscope_api_key") 非空 |
| G2 | upload 路径在插件 data_dir 内(防遍历) | add_upload_preview_route 已注册 + path.relative_to(base) OK |
| G3 | task 异常用日志 + UI broadcast 兜底 | _broadcast_update(task_id, "failed") + error_message 落库 |
| 信任点 | 怎么自查 |
|---|---|
| 钱花在哪 / Cost | DashScope API 唯一调用方;本插件不引入第三方计费 |
| 数据流向 / Data | 上传图先存 data_dir/uploads/,仅作为 base64 发给百炼 |
| 出错怎么办 / Errors | 全部异常落库 error_message,UI 通过 task_update 推送 |
| 远程依赖 / Network | 仅 https://dashscope.aliyuncs.com/;无遥测 |
auto_download=true(默认开)才能离线复用add_upload_preview_route 兜底(relative_to(base))update_task SQL 列名走白名单,杜绝注入(见 tongyi_task_manager._UPDATABLE_COLUMNS)on_unload 改为 async,await _poll_task / _client.close() / _tm.close(),避免 Windows WinError 32api.spawn_task(...),host 在 unload 时统一 cancel + drain/storage/stats 走 SDK collect_storage_stats(asyncio.to_thread + max_files 上限),UI 不再卡顿POST /upload 响应新增 url 字段(build_preview_url),UI 端可渐进迁移到可访问 URL(见 issue #479)storyboard 插件新增 GET /api/plugins/storyboard/tasks/{task_id}/export-tongyi.json,
把分镜直接转成本插件可消费的请求体数组:
# 拿到分镜 → 一键批量出图
curl -s localhost:8000/api/plugins/storyboard/tasks/<sb_id>/export-tongyi.json \
| jq -c '.post_examples[]' \
| while read -r row; do
body=$(echo "$row" | jq -c '.body')
curl -s -X POST localhost:8000/api/plugins/tongyi-image/tasks \
-H 'content-type: application/json' -d "$body"
done
prompt = visual + 构图 + 风格(省去音效/台词),size 默认 1024*1024,
n 自动 clamp 到 1..4,body 字段名与 CreateTaskBody 完全一致 — 测试断言保护,
后续如重命名会立即报错。