Openakita generate-image
Generate images from text prompts using Qwen-Image (Dashscope). Saves output as local PNG files. Requires DASHSCOPE_API_KEY. Use deliver_artifacts to send generated images to IM chat.
install
source · Clone the upstream repo
git clone https://github.com/openakita/openakita
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openakita/openakita "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/system/generate-image" ~/.claude/skills/openakita-openakita-generate-image && rm -rf "$T"
manifest:
skills/system/generate-image/SKILL.mdsource content
generate_image - 文生图(Qwen-Image)
使用通义百炼 Qwen-Image 系列模型(如
qwen-image-max)根据提示词生成图片,并自动下载保存为本地 PNG 文件。
前置条件
- 环境变量:
(与通义其它模型共用)DASHSCOPE_API_KEY - 可选:
DASHSCOPE_IMAGE_API_URL- 北京地域(默认):
https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation - 新加坡地域:
https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
- 北京地域(默认):
(API 参考:
https://help.aliyun.com/zh/model-studio/qwen-image-api)
用法
{ "prompt": "一张极简风格的产品海报,白色背景,中心是一只橘猫的线稿,标题“OPENAKITA”", "model": "qwen-image-max", "size": "1328*1328", "prompt_extend": true, "watermark": false }
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| prompt | string | 是 | 正向提示词 |
| model | string | 否 | 模型名,默认 |
| negative_prompt | string | 否 | 反向提示词 |
| size | string | 否 | 分辨率,格式 ,默认 |
| prompt_extend | boolean | 否 | 是否开启提示词智能改写,默认 true |
| watermark | boolean | 否 | 是否加水印,默认 false |
| seed | integer | 否 | 随机种子 |
| output_path | string | 否 | 输出路径;不填会落到 |
返回值
返回 JSON 字符串,包含:
: 本地 PNG 路径saved_to
: 临时图片 URL(通常 24 小时有效)image_url
发送到 IM(可选)
生成后如需发送图片到聊天,请调用
deliver_artifacts:
{ "artifacts": [ {"type": "image", "path": "data/generated_images/xxx.png", "caption": "生成的图片"} ] }