File size: 3,075 Bytes
18070fb
736cf48
 
 
 
18070fb
 
736cf48
 
 
 
 
 
 
eaaf713
736cf48
 
 
 
18070fb
 
736cf48
 
eaaf713
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736cf48
 
 
 
 
eaaf713
 
 
6fa797e
736cf48
 
6fa797e
eaaf713
736cf48
 
 
eaaf713
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736cf48
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
title: Z-Anime Image Generation (CPU)
emoji: 🎨
colorFrom: blue
colorTo: pink
sdk: docker
pinned: false
license: apache-2.0
tags:
  - image-generation
  - z-anime
  - gguf
  - cpu
  - anime
  - mcp-server
short_description: Z-Anime 6B - CPU anime image generation via sd.cpp
models:
  - SeeSee21/Z-Anime
startup_duration_timeout: 1h
---

# Z-Anime Image Generation (CPU)

**CPU Inference** - Generate anime images with Z-Anime 6B via stable-diffusion.cpp GGUF. ~30 min at 512x512 on free CPU.

## Features

- **Image Generation** - text to image via GGUF quantized Z-Anime 6B (S3-DiT)
- **Distill 4-Step** - fast inference with distilled model (4 steps, CFG 1.0)
- **CLI Support** - command-line interface for local generation
- **MCP Server** - AI assistant integration (Claude, Cursor, VS Code)

## Image Generation

1. Enter a prompt describing the anime image
2. Adjust resolution (512x512 recommended on CPU)
3. Adjust CFG (1.0 best, max 1.5)
4. Click **Generate**

**Timing:** ~30 min at 512x512 on free CPU. GPU is much faster (~2 min).

## Models

| Component | File | Size |
|-----------|------|------|
| Diffusion (DiT) | [Z-Anime distill-4step Q5_0 GGUF](https://huggingface.co/WeReCooking/Z-Anime-4step-GGUF) | 4.23 GB |
| Text Encoder | [Qwen3-4B IQ4_XS GGUF](https://huggingface.co/worstplayer/Z-Image_Qwen_3_4b_text_encoder_GGUF) | 2.29 GB |
| VAE | [ae.safetensors](https://huggingface.co/SeeSee21/Z-Anime/blob/main/vae/ae.safetensors) | 168 MB |

## Settings

- **Steps:** 4 (distilled)
- **CFG:** 1.0 (max 1.5, do not exceed)
- **Sampler:** euler_ancestral
- **Resolution:** 512x512 (recommended on CPU)

---

## API

### Python Client

```python
from gradio_client import Client

client = Client("WeReCooking/Z-Anime-CPU")
result = client.predict(
    prompt="anime girl with silver hair, fantasy armor, dramatic lighting",
    negative_prompt="worst quality, low quality, blurry, bad anatomy",
    resolution="512x512",
    cfg=1.0,
    seed=-1,
    api_name="/generate"
)
print(result)  # (image, status_message)
```

### MCP (Model Context Protocol)

This Space supports MCP for AI assistants (Claude Desktop, Cursor, VS Code).

**MCP Config:**
```json
{
  "mcpServers": {
    "z-anime": {"url": "https://werecooking-z-anime-cpu.hf.space/gradio_api/mcp/"}
  }
}
```

---

## CLI Usage

```bash
# Basic generation
python app.py "anime girl with silver hair, fantasy armor" -o output.png

# With seed and CFG
python app.py "1girl, maid outfit, cafe background" --seed 42 --cfg 1.0 -o maid.png

# Custom resolution and negative prompt
python app.py "landscape, cherry blossoms, shrine" -r 768x512 -n "blurry, low quality" -o landscape.png

# Start Gradio UI instead
python app.py --gradio
```

---

## Credits

- [Z-Anime](https://huggingface.co/SeeSee21/Z-Anime) by SeeSee21
- [Z-Image](https://github.com/Tongyi-MAI/Z-Image) by Alibaba Tongyi Lab
- [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp) by leejet
- [Qwen3-4B Text Encoder GGUF](https://huggingface.co/worstplayer/Z-Image_Qwen_3_4b_text_encoder_GGUF) by worstplayer