qwenz-image-gen
Generate images using Alibaba Cloud Bailian Qwen-Image and Z-Image models (通义千图文生图 + 人像照片模型)
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 3 · 920 · 4 current installs · 4 all-time installs
by@irron
MIT-0
Security Scan
OpenClaw
Suspicious
medium confidencePurpose & Capability
The skill's purpose (generate images via Alibaba Bailian Qwen-Image / Z-Image) matches the code and API endpoint used (dashscope.aliyuncs.com). However, the registry metadata in the package summary lists no required environment variables while SKILL.md and the script declare and require DASHSCOPE_API_KEY — an inconsistency that should be resolved.
Instruction Scope
Runtime instructions and the included script are focused on image generation and are proportionate: they build a JSON payload, POST to the Bailian endpoint, parse the response, and download the returned image. The script also attempts to discover the API key by reading TOOLS.md from several filesystem locations (current working dir, an absolute path /home/admin/clawd/TOOLS.md, and a path four levels up from the script). Reading those files is intended to obtain the declared key, but the locations accessed could expose or read files outside the skill's folder — worth noting before granting access.
Install Mechanism
This is an instruction-only skill with a single Python script and no install spec or external downloads. There is no package install or archive extraction — low install-surface risk.
Credentials
The only credential the skill needs is DASHSCOPE_API_KEY (used as a Bearer token to call the Bailian API), which is reasonable for this purpose. But the mismatch between the package-level 'required env vars: none' and SKILL.md's 'DASHSCOPE_API_KEY' is confusing. Also, the script's fallback to searching multiple TOOLS.md locations may read user files containing other secrets if present — it only extracts a matching DASHSCOPE_API_KEY line, but file reads are sensitive.
Persistence & Privilege
The skill does not request always:true, does not modify other skills or system config, and does not install persistent components. It only performs network calls at runtime and writes the downloaded image to a local path specified by the user (or a generated filename).
What to consider before installing
This skill appears to implement the described Alibaba Bailian image-generation flow and only needs a DASHSCOPE_API_KEY. Before installing: 1) verify the package metadata vs SKILL.md — ensure you supply DASHSCOPE_API_KEY if you intend to use it; 2) prefer setting the API key as an environment variable (export DASHSCOPE_API_KEY) rather than relying on TOOLS.md, since the script will try to read TOOLS.md from several filesystem locations (including unexpected paths) which could expose local files; 3) consider creating a dedicated API key with limited scope/quota for this skill; 4) be aware the script makes outbound HTTPS requests to dashscope.aliyuncs.com and will download the returned image from whatever host the API provides; 5) if you are uncomfortable with the script reading files outside the skill directory, inspect or run it in an isolated environment (container or VM) or modify the script to restrict TOOLS.md lookup to a single safe location. If these issues are acceptable, the skill is plausibly coherent with its stated purpose; otherwise proceed with caution.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
Runtime requirements
🎨 Clawdis
SKILL.md
Qwen-Image / Z-Image Skill
基于阿里云百炼的文图生成技能,智能识别场景自动选择最佳模型:
- 🧍 人像/照片 → z-image-turbo(专精高质量人像,支持胶片质感)
- 🖼️ 通用文图 → qwen-image-max(擅长复杂文字渲染、艺术风格)
Features
- 🤖 智能模型选择:自动检测人像场景,无需手动选择模型
- 🎨 双模型支持:Qwen-Image(通用) + Z-Image(人像)
- ✍️ 中文文字渲染:在图像中完美呈现复杂中文字符
- 📐 多尺寸支持:16:9、4:3、1:1、3:4、9:16 等多种比例
- 🔧 可手动指定:支持强制使用特定模型
Setup
- 从 阿里云百炼控制台 获取 API Key
- 配置方式选择其一:
- 环境变量:
export DASHSCOPE_API_KEY="sk-xxx" - TOOLS.md:在 TOOLS.md 中添加
DASHSCOPE_API_KEY: sk-xxx
- 环境变量:
地域注意:北京和新加坡地域 API Key 不互通
Available Models
| 模型 | 描述 | 最佳场景 |
|---|---|---|
| qwen-image-max | 最佳质量,减少AI痕迹,文字渲染优秀 | 漫画、插画、图文设计、风景、静物 |
| qwen-image-plus | 质量与速度平衡 | 通用场景 |
| qwen-image | 基础模型 | 快速生成 |
| z-image-turbo | 人像专精,胶片质感,真实感强 | 人像照片、人像写真、film grain效果 |
Supported Sizes
| 尺寸 | 比例 | 说明 |
|---|---|---|
| 1664*928 | 16:9 | 横向宽屏(通用默认) |
| 1472*1104 | 4:3 | 标准比例 |
| 1328*1328 | 1:1 | 方形 |
| 1104*1472 | 3:4 | 竖向 |
| 928*1664 | 9:16 | 手机竖屏 |
| 1120*1440 | 4:5 | 人像推荐 |
Usage
🎯 快速入门(推荐)
直接写提示词,自动识别场景并选择最佳模型:
# 人像类 → 自动使用 z-image-turbo
python scripts/generate.py "短发少女,清新自然风格,微笑"
# 通用类 → 自动使用 qwen-image-max
python scripts/generate.py "七龙珠孙悟空对战比克大魔王,漫画风格"
# 含film grain关键词 → 自动使用 z-image
python scripts/generate.py "胶片感,Kodak Portra 400风格的人像"
🔧 高级选项
python scripts/generate.py "prompt" \
--model z \ # 强制指定模型 (z/qwen/auto)
--size 1328*1328 \ # 图片尺寸
--prompt-extend \ # 开启提示词扩展
--no-watermark \ # 禁用水印
--output my-image.png # 输出路径
Auto-Detection Keywords
以下关键词会触发自动选择 z-image-turbo:
人物类:人、女、男、少女、帅哥、美女、肖像、人物、face、facial
照片/胶片类:photo、photograph、film grain、analog、Kodak、胶片、portra、cinematic、photorealistic、真实、写真人像
使用示例
人像照片(z-image)
python scripts/generate.py "东亚年轻女性,户外雪地场景,film grain效果,胶片质感"
漫画风格(qwen-image)
python scripts/generate.py "七龙珠孙悟空对战比克大魔王,漫画风格,能量波爆炸,天空背景"
带中文文字的漫画
python scripts/generate.py "一副对联,上联:智启千问,下联:机道为善,横批:人机共生"
Tips
- 人像首选 z-image:对面部细节、皮肤质感、胶片感优化更好
- 文字渲染选 qwen:复杂中文、图文混排场景更精准
- 自动模式省心:无需纠结选哪个模型
- 提示词长度:正向 ≤800字符,负向 ≤500字符
- 扩展提示词:
--prompt-extend可以让AI自动优化你的描述
Qwen-Image Skill - 国产文生图利器 🇨🇳
Files
2 totalSelect a file
Select a file to preview.
Comments
Loading comments…
