Generate images with Model Studio DashScope SDK using Qwen Image generation models (qwen-image, qwen-image-plus, qwen-image-max and snapshots). Use when impl...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install alicloud-ai-image-qwen-image或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install alicloud-ai-image-qwen-image⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/alicloud-ai-image-qwen-image/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: alicloud-ai-image-qwen-image description: Generate images with Model Studio DashScope SDK using Qwen Image generation models (qwen-image, qwen-image-plus, qwen-image-max and snapshots). Use when implementing or documenting image.generate requests/responses, mapping prompt/negative_prompt/size/seed/reference_image, or integrating image generation into the video-agent pipeline. version: 1.0.0 ---
Category: provider
mkdir -p output/alicloud-ai-image-qwen-image
python -m py_compile skills/ai/image/alicloud-ai-image-qwen-image/scripts/generate_image.py && echo "py_compile_ok" > output/alicloud-ai-image-qwen-image/validate.txt
Pass criteria: command exits 0 and output/alicloud-ai-image-qwen-image/validate.txt is generated.
output/alicloud-ai-image-qwen-image/.Build consistent image generation behavior for the video-agent pipeline by standardizing image.generate inputs/outputs and using DashScope SDK (Python) with the exact model name.
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscope
DASHSCOPE_API_KEY in your environment, or add dashscope_api_key to ~/.alibabacloud/credentials (env takes precedence).Use one of these exact model strings:
qwen-imageqwen-image-plusqwen-image-maxqwen-image-2.0qwen-image-2.0-proqwen-image-max-2025-12-30qwen-image-plus-2026-01-09prompt (string, required)negative_prompt (string, optional)size (string, required) e.g. 10241024, 7681024style (string, optional)seed (int, optional)reference_image (string | bytes, optional)image_url (string)width (int)height (int)seed (int)Minimal normalized request body:
{
"prompt": "a cinematic portrait of a cyclist at dusk, soft rim light, shallow depth of field",
"negative_prompt": "blurry, low quality, watermark",
"size": "1024*1024",
"seed": 1234
}
Preview workflow (download then open):
curl -L -o output/alicloud-ai-image-qwen-image/images/preview.png "<IMAGE_URL_FROM_RESPONSE>" && open output/alicloud-ai-image-qwen-image/images/preview.png
Local helper script (JSON request -> image file):
python skills/ai/image/alicloud-ai-image-qwen-image/scripts/generate_image.py \\
--request '{"prompt":"a studio product photo of headphones","size":"1024*1024"}' \\
--output output/alicloud-ai-image-qwen-image/images/headphones.png \\
--print-response
| Field | Required | Notes | |------|----------|-------| | prompt | yes | Describe a scene, not just keywords. | | negative_prompt | no | Best-effort, may be ignored by backend. | | size | yes | WxH format, e.g. 10241024, 7681024. | | style | no | Optional stylistic hint. | | seed | no | Use for reproducibility when supported. | | reference_image | no | URL/file/bytes, SDK-specific mapping. |
Use the DashScope SDK and map the normalized request into the SDK call. Note: For qwen-image-max, the DashScope SDK currently succeeds via ImageGeneration (messages-based) rather than ImageSynthesis. If the SDK version you are using expects a different field name for reference images, adapt the input mapping accordingly.
import os
from dashscope.aigc.image_generation import ImageGeneration
# Prefer env var for auth: export DASHSCOPE_API_KEY=...
# Or use ~/.alibabacloud/credentials with dashscope_api_key under [default].
def generate_image(req: dict) -> dict:
messages = [
{
"role": "user",
"content": [{"text": req["prompt"]}],
}
]
if req.get("reference_image"):
# Some SDK versions accept {"image": <url|file|bytes>} in messages content.
messages[0]["content"].insert(0, {"image": req["reference_image"]})
response = ImageGeneration.call(
model=req.get("model", "qwen-image-max"),
messages=messages,
size=req.get("size", "1024*1024"),
api_key=os.getenv("DASHSCOPE_API_KEY"),
# Pass through optional parameters if supported by the backend.
negative_prompt=req.get("negative_prompt"),
style=req.get("style"),
seed=req.get("seed"),
)
# Response is a generation-style envelope; extract the first image URL.
content = response.output["choices"][0]["message"]["content"]
image_url = None
for item in content:
if isinstance(item, dict) and item.get("image"):
image_url = item["image"]
break
return {
"image_url": image_url,
"width": response.usage.get("width"),
"height": response.usage.get("height"),
"seed": req.get("seed"),
}
| Error | Likely cause | Action | |------|--------------|--------| | 401/403 | Missing or invalid DASHSCOPE_API_KEY | Check env var or ~/.alibabacloud/credentials, and access policy. | | 400 | Unsupported size or bad request shape | Use common WxH and validate fields. | | 429 | Rate limit or quota | Retry with backoff, or reduce concurrency. | | 5xx | Transient backend errors | Retry with backoff once or twice. |
output/alicloud-ai-image-qwen-image/images/OUTPUT_DIR.(prompt, negative_prompt, size, seed, reference_image hash) to avoid duplicate costs.negative_prompt, style, or seed; treat them as best-effort inputs.WxH format (e.g. 10241024, 7681024).1) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating. 2) Run one minimal read-only query first to verify connectivity and permissions. 3) Execute the target operation with explicit parameters and bounded scope. 4) Verify results and save output/evidence files.
references/api_reference.md for a more detailed DashScope SDK mapping and response parsing tips.references/prompt-guide.md for prompt patterns and examples.skills/ai/image/alicloud-ai-image-qwen-image-edit/.references/sources.md安装 Alicloud Ai Image Qwen Image 后,可以对 AI 说这些话来触发它
Help me get started with Alicloud Ai Image Qwen Image
Explains what Alicloud Ai Image Qwen Image does, walks through the setup, and runs a quick demo based on your current project
Use Alicloud Ai Image Qwen Image to generate images with Model Studio DashScope SDK using Qwen Image ge...
Invokes Alicloud Ai Image Qwen Image with the right parameters and returns the result directly in the conversation
What can I do with Alicloud Ai Image Qwen Image in my design & creative workflow?
Lists the top use cases for Alicloud Ai Image Qwen Image, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/alicloud-ai-image-qwen-image/ 目录(个人级,所有项目可用),或 .claude/skills/alicloud-ai-image-qwen-image/(项目级)。重启 AI 客户端后,用 /alicloud-ai-image-qwen-image 主动调用,或让 AI 根据上下文自动发现并使用。
Alicloud Ai Image Qwen Image 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Alicloud Ai Image Qwen Image 可免费安装使用。请查阅仓库了解许可证信息。
Generate images with Model Studio DashScope SDK using Qwen Image generation models (qwen-image, qwen-image-plus, qwen-image-max and snapshots). Use when impl...
Automate my design & creative tasks using Alicloud Ai Image Qwen Image
Identifies repetitive steps in your workflow and sets up Alicloud Ai Image Qwen Image to handle them automatically
Alicloud Ai Image Qwen Image 属于「Design & Creative」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。