Z Image logo

Z Image

Community
smithjohn78390
z-image

Z-Image 文生图:调用 ModelScope Z-Image-Turbo 生成多风格图片。

Overview

Publishersmithjohn78390
Repositorysmith--skills
Skill namez-image
Stars
49
Forks
11
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by smithjohn78390 on GitHub. Read the source before you install it.

Installation

Install the Z Image AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/smithjohn78390/smith--skills/tree/main/z-image
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/smithjohn78390/smith--skills.git /tmp/smith--skills
mkdir -p .claude/skills
cp -r /tmp/smith--skills/z-image .claude/skills/z-image
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Z Image in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Z Image on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Z Image is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Z-Image - ModelScope 通义万相图片生成

统一的 Z-Image-Turbo 文生图能力,内置 24+ 种视觉风格模板,支持自动风格检测。

Quick Start

bash
# 基础文生图
python ~/.claude/skills/z-image/scripts/generate.py "一个程序员在深夜写代码"

# 指定风格
python ~/.claude/skills/z-image/scripts/generate.py "武侠少年仗剑天涯" --style anime_shonen

# 自动检测风格
python ~/.claude/skills/z-image/scripts/generate.py "纳瓦尔的智慧哲学" --auto-style

# 批量生成
python ~/.claude/skills/z-image/scripts/generate.py prompts.txt --batch --style neon_wisdom

# 列出所有风格
python ~/.claude/skills/z-image/scripts/generate.py --list-styles

Triggers

  • 生成图片 / 生图 / 做图
  • z-image generate
  • 用万相生成
  • text to image
  • generate image with style

Quick Reference

FeatureDetail
APIModelScope api-inference.modelscope.cn
ModelTongyi-MAI/Z-Image-Turbo
Cost~$0.01/image
Styles24+ presets in 7 categories
Auto-detectKeyword chain + LLM fallback
OutputPNG, 1024x1024 default
AsyncSubmit + poll pattern

How It Works

用户输入 (prompt + style)
    │
    ▼
┌─────────────────────────────┐
│ 1. Style Resolution         │
│  • 指定风格 → 直接使用       │
│  • --auto-style → 检测链     │
│    Keyword → LLM fallback   │
│  • 默认 → anime_japanese    │
├─────────────────────────────┤
│ 2. Prompt Enhancement       │
│  • base_style + colors      │
│  • lighting + modifiers     │
│  • negative prompt          │
├─────────────────────────────┤
│ 3. API Call (Async)         │
│  • POST /v1/images/gen      │
│  • Poll task status         │
│  • Download result          │
├─────────────────────────────┤
│ 4. Post-processing          │
│  • Resize to target         │
│  • Save to output dir       │
└─────────────────────────────┘

Style Categories

CategoryStylesBest For
Anime (5)anime_japanese, anime_chibi, anime_shonen, anime_iyashikei, anime_cyberpunk故事/角色/动漫内容
Neon (6)neon_wisdom, neon_tech, neon_wealth, neon_contrast, neon_timeline, neon_mindmap知识/商业/哲理内容
Tech (2)tech_dark, tech_light科技/产品展示
Documentary (3)documentary, vintage_50s, vintage_80s传记/历史/纪录片
Art (3)watercolor, ink_chinese, comic_style艺术/文化内容
Minimal (2)minimal_white, flat_design简约/解释类内容
Mood (2)warm_cozy, dark_dramatic氛围/情感内容

Commands

CommandDescription
generate.py "prompt"生成单张图片
generate.py "prompt" --style X指定风格生成
generate.py "prompt" --auto-style自动检测风格
generate.py prompts.txt --batch批量生成
generate.py --list-styles列出所有风格
generate.py --list-styles --category anime按分类列出
generate.py "prompt" --size 1920x1080指定尺寸
generate.py "prompt" --output ./my-images/指定输出目录

Configuration

API Key 配置优先级:

  1. --api-key 命令行参数
  2. MODELSCOPE_API_KEY 环境变量
  3. ~/.claude/skills/z-image/config/secrets.md 文件
bash
# 方式1: 环境变量
export MODELSCOPE_API_KEY="ms-xxxxx"

# 方式2: 配置文件
echo "API_KEY=ms-xxxxx" > ~/.claude/skills/z-image/config/secrets.md

Scripts

scripts/generate.py - CLI 入口

主要的图片生成脚本,支持单张和批量模式。

bash
# 单张生成
python scripts/generate.py "赛博朋克城市夜景" --style anime_cyberpunk --output ./output/

# 批量生成(从文件读取 prompt)
python scripts/generate.py prompts.txt --batch --style neon_tech

# 自动风格检测
python scripts/generate.py "纳瓦尔谈财富自由" --auto-style

Exit codes: 0=success, 1=failure, 10=API error, 11=style not found

scripts/style_templates.py - 风格模板库

24+ 种视觉风格定义和自动检测逻辑。可独立导入使用:

python
from style_templates import get_style_prompt, auto_detect_style, STYLES

# 获取增强后的 prompt
enhanced = get_style_prompt("一个少年在山顶", "anime_shonen")

# 自动检测风格
style = auto_detect_style("纳瓦尔的智慧与幸福哲学")  # → "neon_wisdom"

# 列出所有风格
for sid, s in STYLES.items():
    print(f"{sid}: {s.name} - {s.description}")

Integration

其他 skill 可以直接调用 z-image:

python
import sys
sys.path.insert(0, str(Path.home() / ".claude/skills/z-image/scripts"))
from generate import ZImageClient

client = ZImageClient(api_key="ms-xxx")
result = await client.generate("prompt", style="neon_wisdom")
print(result)  # 图片路径

Dependent Skills

以下 skill 依赖 z-image 能力:

SkillUsage
video-skill视频封面和帧图生成
image-fenjing分镜图片生成
videofreeProfile-based 视频图片
voice-first-video语音视频配图
novel-to-video网文转视频插图
hunhe-video混合视频图片生成

Anti-Patterns

AvoidWhyInstead
硬编码 API Key安全风险用环境变量或 secrets.md
跳过风格增强生成质量差始终使用 style template
同步等待 API阻塞进程用 async + polling
忽略 negative prompt出现瑕疵每个风格都有专属 negative

Verification

  • python scripts/generate.py --list-styles 输出 24+ 种风格
  • python scripts/generate.py "test" --dry-run 输出增强后的 prompt
  • API Key 配置正确(环境变量或 secrets.md)
  • 生成图片保存到指定目录

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Z Image AI skill do?

Z-Image 文生图:调用 ModelScope Z-Image-Turbo 生成多风格图片。

Why use Z Image on TypingMind?

Because you install it once and use it with any model. Z Image is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Z Image in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/smithjohn78390/smith--skills/tree/main/z-image. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Z Image?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Z Image?

As many as you like. As long as a model supports skills, you can use Z Image with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Z Image AI skill free?

Yes. It is published on GitHub by smithjohn78390 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇