alicloud-ai-image-qwen-image▌
cinience/alicloud-skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Generate images using Qwen models via Alibaba DashScope SDK with normalized request/response mapping.
- ›Supports four Qwen image generation models: qwen-image , qwen-image-plus , qwen-image-max , and versioned snapshots with consistent image.generate interface
- ›Normalized request parameters include prompt, negative_prompt, size (WxH format), optional style, seed, and reference_image for reproducibility and conditional generation
- ›Requires DASHSCOPE_API_KEY environment variable or credent
Category: provider
Model Studio Qwen Image
Validation
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 And Evidence
- Write generated image URLs, prompts, and metadata to
output/alicloud-ai-image-qwen-image/. - Keep at least one sample JSON response per run.
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.
Prerequisites
- Install SDK (recommended in a venv to avoid PEP 668 limits):
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscope
- Set
DASHSCOPE_API_KEYin your environment, or adddashscope_api_keyto~/.alibabacloud/credentials(env takes precedence).
Critical model names
Use one of these exact model strings:
qwen-imageqwen-image-plusqwen-image-maxqwen-image-2.0qwen-image-2.0-proqwen-image-2.0-2026-03-03qwen-image-2.0-pro-2026-03-03qwen-image-max-2025-12-30qwen-image-plus-2026-01-09
Normalized interface (image.generate)
Request
prompt(string, required)negative_prompt(string, optional)size(string, required) e.g.1024*1024,768*1024style(string, optional)seed(int, optional)reference_image(string | bytes, optional)
Response
image_url(string)width(int)height(int)seed(int)
Quickstart (normalized request + preview)
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
Parameters at a glance
| 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. 1024*1024, 768*1024. |
style |
no | Optional stylistic hint. |
seed |
no | Use for reproducibility when supported. |
reference_image |
no | URL/file/bytes, SDK-specific mapping. |
Quick start (Python + DashScope SDK)
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 handling
| 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 location
- Default output:
output/alicloud-ai-image-qwen-image/images/ - Override base dir with
OUTPUT_DIR.
Operational guidance
- Store the returned image in object storage and persist only the URL in metadata.
- Cache results by
(prompt, negative_prompt, size, seed, reference_image hash)to avoid duplicate costs. - Add retries for transient 429/5xx responses with exponential backoff.
- Some backends ignore
negative_prompt,style, orseed; treat them as best-effort inputs. - If the response contains no image URL, surface a clear error and retry once with a simplified prompt.
Size notes
- Use
WxHformat (e.g.1024*1024,768*1024). - Prefer common sizes; unsupported sizes can return 400.
Anti-patterns
- Do not invent model names or aliases; use official model IDs only.
- Do not store large base64 blobs in DB rows; use object storage.
- Do not omit user-visible progress for long generations.
Workflow
- Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
- Run one minimal read-only query first to verify connectivity and permissions.
- Execute the target operation with explicit parameters and bounded scope.
- Verify results and save output/evidence files.
References
-
See
references/api_reference.mdfor a more detailed DashScope SDK mapping and response parsing tips. -
See
references/prompt-guide.mdfor prompt patterns and examples. -
For edit workflows, use
skills/ai/image/alicloud-ai-image-qwen-image-edit/. -
Source list:
references/sources.md
How to use alicloud-ai-image-qwen-image on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add alicloud-ai-image-qwen-image
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches alicloud-ai-image-qwen-image from GitHub repository cinience/alicloud-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate alicloud-ai-image-qwen-image. Access the skill through slash commands (e.g., /alicloud-ai-image-qwen-image) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.7★★★★★73 reviews- ★★★★★Charlotte Harris· Dec 28, 2024
We added alicloud-ai-image-qwen-image from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Kofi Farah· Dec 12, 2024
Keeps context tight: alicloud-ai-image-qwen-image is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Nia Jackson· Dec 12, 2024
Registry listing for alicloud-ai-image-qwen-image matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Chen Haddad· Dec 12, 2024
alicloud-ai-image-qwen-image is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Luis Patel· Dec 8, 2024
Useful defaults in alicloud-ai-image-qwen-image — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Chaitanya Patil· Dec 4, 2024
Registry listing for alicloud-ai-image-qwen-image matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Li Srinivasan· Dec 4, 2024
alicloud-ai-image-qwen-image fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Luis Tandon· Nov 27, 2024
I recommend alicloud-ai-image-qwen-image for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Piyush G· Nov 23, 2024
Keeps context tight: alicloud-ai-image-qwen-image is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Mei Li· Nov 23, 2024
We added alicloud-ai-image-qwen-image from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 73