Skill 详情

zimage-generation

通过 Python 脚本使用 ModelScope 的 Z-Image API 生成图像,由 Zimage 或 ModelScope 请求触发。

匹配类型直接匹配已针对 图像生成 审核
来源toolsai/​free-zimage-skills外部来源
报告安装量864仅表示受欢迎程度

使用前先检查

自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。

已保存的来源预览

SKILL.md

这段内容是审核时保存的快照。外部来源才是完整且最新的版本。

---
name: zimage-generation
description: "Generate high-quality images using ModelScope's Z-Image API. Use this skill when the user wants to generate images using the specific Z-Image model or ModelScope API they provided. Trigger words: 'Zimage', 'ModelScope', 'generate zimage'."
---

# 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"
```
在 GitHub 阅读完整来源 (打开外部页面)
相关上下文

相关工作