
Zimage Generation
Generate images through ModelScope’s Z-Image inference API from agent-friendly `zimage:` prompts and a bundled Python script.
Overview
Z-Image generation is an agent skill for the Build phase that generates images via ModelScope’s Z-Image API using a bundled Python script.
Install
npx skills add https://github.com/toolsai/free-zimage-skills --skill zimage-generationWhat is this skill?
- Python script `scripts/generate_zimage.py` wraps ModelScope Z-Image inference
- Trigger words: Zimage, ModelScope, `zimage: <prompt>`, and `zimage <prompt>`
- Three API-key paths: inline DEFAULT_API_KEY, `--api-key`, or `scripts/.env` with MODELSCOPE_API_TOKEN
- Requires Python 3 with the `requests` library
- Skill activates when users name Z-Image or ModelScope for image generation
- Three documented API-key setup methods (inline default, CLI flag, scripts/.env)
Adoption & trust: 768 installs on skills.sh; 12 GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want Z-Image / ModelScope outputs in your workflow but lack a consistent, agent-invokable script and API-key setup.
Who is it for?
Solo builders automating image generation inside Claude Code, Cursor, or Codex when prompts explicitly reference Z-Image or ModelScope.
Skip if: Local Stable Diffusion pipelines, DALL·E-only workflows, or production image stacks that forbid third-party inference APIs and stored tokens.
When should I use this skill?
User requests Zimage, zimage:, ModelScope, or generate zimage with their configured API key.
What do I get? / Deliverables
Running `generate_zimage.py` with a configured token returns generated images from your prompt using the Z-Image model.
- Generated image file(s) from Z-Image inference API
- Repeatable script invocation pattern for agent-driven prompts
Recommended Skills
Journey fit
Build is where you connect external inference APIs and wire outputs into your product or content pipeline. Integrations reflects the ModelScope API client script and token configuration rather than pure UI layout work.
How it compares
API-backed Z-Image generator skill—not a general prompt-only image model picker or an MCP media server.
Common Questions / FAQ
Who is zimage-generation for?
Indie developers and content builders who already use or want ModelScope’s Z-Image API and need a scriptable path from agent chat to generated assets.
When should I use zimage-generation?
Use it in Build → integrations when the user says Zimage, ModelScope, or `zimage:` with a prompt; also for Grow → content when batching marketing or social images via the same API.
Is zimage-generation safe to install?
Review the Security Audits panel on this Prism page and never commit API tokens; prefer `scripts/.env` and rotate keys if they appeared in chat or logs.
SKILL.md
READMESKILL.md - Zimage Generation
# Z-Image Generation Skill This skill allows you to generate images using the Z-Image model via the ModelScope Inference API. ## When to Use Use this skill when: - The user requests to generate an image using "Zimage", "zimage:", or "ModelScope". - The user inputs a command like `zimage: <prompt>` or `zimage <prompt>`. - The user wants to use their configured ModelScope API key for image generation. ## Usage The skill provides a Python script `scripts/generate_zimage.py` to handle the API interaction. ### Prerequisites - Python 3 with `requests` installed. - **API Key Setup (Choose one):** - **Method A (Easiest for beginners):** Open `scripts/generate_zimage.py` and paste your key into the `DEFAULT_API_KEY` variable at the top. - **Method B (Temporary):** Pass via command line: `--api-key your_token` - **Method C (Recommended Project Setup):** Create a new text file named `.env` **in the same folder as the script** (`scripts/`). - Content of the file should be: `MODELSCOPE_API_TOKEN="your_key_here"` ### Commands To generate an image: ```bash # If you used Method A (pasted key in file): python3 /Users/promptcase/.gemini/antigravity/skills/zimage-generation/scripts/generate_zimage.py "Your descriptive prompt here" # If you prefer command line (Method B): python3 /Users/promptcase/.gemini/antigravity/skills/zimage-generation/scripts/generate_zimage.py "Your prompt" --api-key "your_key" ``` Arguments: - `prompt`: The text description of the image (required). - `--output`, `-o`: Specify output filename (optional). - `--model`: Specify a different model ID (optional). - `--api-key`: API key (if not set in file or environment). ### API Verification Note If the script returns a 401 error mentioning "bind your Alibaba Cloud account", notify the user that they must log in to ModelScope (https://modelscope.cn/my/account) and bind their Alibaba Cloud account to enable API access. This is a one-time setup required by the platform. ## Example ```python # To generate a cyberpunk city python3 /Users/mattchan/.gemini/antigravity/skills/zimage-generation/scripts/generate_zimage.py "cyberpunk city, neon lights, rainy street, high detail" ``` Bud1�Ilocblob.envIlocblob�.������generate_zimage.pyIlocblobA.������