360 Secure SkillHub
360 安全技能中心

Dashscope Image Gen

该 Skill 提供一个 Python 命令行脚本,读取提示词后调用 DashScope 的 OpenAI 兼容模式图片生成接口(qwen-image-max),将返回的图片保存到指定输出文件;附带一个说明接口与鉴权方式的参考文档。可选支持尺寸和数量参数。

dhdragon
dhdragon
热度 83.07
最近更新 2026-05-11 17:33:09
分类:创作依赖:代码执行 / 读写文件 / 第三方 API应用场景:图像生成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add dashscope-image-gen
Metadata
name
dashscope-image-gen
description
Generate images via Alibaba DashScope OpenAI-compatible endpoint (compatible-mode) using qwen-image-max. Use when the user asks for 文生图/图片生成/image generation, wants to call /images/generations, or needs a scriptable CLI tool to create images from prompts.

DashScope Image Generation (qwen-image-max)

Use this skill to generate an image from a text prompt through DashScope compatible-mode.

Quick start

Preferred (no secrets in shell history):

export DASHSCOPE_API_KEY="..."
./scripts/dashscope_image_gen.py --prompt "a cute robot, watercolor" --out robot.png

Optional params (best-effort; support depends on DashScope):

./scripts/dashscope_image_gen.py --prompt "industrial factory at night" --size 1024x1024 --n 1 --out factory.png

What to do when it fails

  1. Re-run with the same command and copy the HTTP error body.
  2. If the error indicates a different route/payload than OpenAI Images API:
    • Update scripts/dashscope_image_gen.py accordingly.
    • Update references/dashscope-openai-compatible.md with the correct details.

Files

  • scripts/dashscope_image_gen.py: main CLI (calls POST {baseUrl}/images/generations)
  • references/dashscope-openai-compatible.md: endpoint/auth notes