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.md
source 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
}

参数

参数类型必填说明
promptstring正向提示词
modelstring模型名,默认
qwen-image-max
negative_promptstring反向提示词
sizestring分辨率,格式
宽*高
,默认
1664*928
prompt_extendboolean是否开启提示词智能改写,默认 true
watermarkboolean是否加水印,默认 false
seedinteger随机种子
output_pathstring输出路径;不填会落到
data/generated_images/

返回值

返回 JSON 字符串,包含:

  • saved_to
    : 本地 PNG 路径
  • image_url
    : 临时图片 URL(通常 24 小时有效)

发送到 IM(可选)

生成后如需发送图片到聊天,请调用

deliver_artifacts

{
  "artifacts": [
    {"type": "image", "path": "data/generated_images/xxx.png", "caption": "生成的图片"}
  ]
}