Nekochu commited on
Commit
eaaf713
·
1 Parent(s): b107f30

fix Examples (needs fn+outputs), full README with API/CLI/MCP docs

Browse files
Files changed (2) hide show
  1. README.md +76 -8
  2. app.py +6 -2
README.md CHANGED
@@ -12,6 +12,7 @@ tags:
12
  - gguf
13
  - cpu
14
  - anime
 
15
  short_description: Z-Anime 6B - CPU anime image generation via sd.cpp
16
  models:
17
  - SeeSee21/Z-Anime
@@ -20,29 +21,96 @@ startup_duration_timeout: 1h
20
 
21
  # Z-Anime Image Generation (CPU)
22
 
23
- Generate anime images with [Z-Anime 6B](https://huggingface.co/SeeSee21/Z-Anime) (S3-DiT, distill 4-step) via [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp). Runs on free CPU Spaces.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  ## Models
26
 
27
  | Component | File | Size |
28
  |-----------|------|------|
29
- | Diffusion (DiT) | Z-Anime distill-4step Q5_K_M GGUF | ~4.5 GB |
30
- | Text Encoder | Qwen3-4B Q8_0 GGUF | 4.28 GB |
31
- | VAE | ae.safetensors | 168 MB |
32
-
33
- GGUF converted at build time from [Z-Anime BF16](https://huggingface.co/SeeSee21/Z-Anime/blob/main/diffusion_models/z-anime-distill-4step-bf16.safetensors).
34
 
35
  ## Settings
36
 
37
  - **Steps:** 4 (distilled)
38
- - **CFG:** 1.0
39
  - **Sampler:** euler_ancestral
40
  - **Resolution:** 512x512 (recommended on CPU)
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  ## Credits
43
 
44
  - [Z-Anime](https://huggingface.co/SeeSee21/Z-Anime) by SeeSee21
45
  - [Z-Image](https://github.com/Tongyi-MAI/Z-Image) by Alibaba Tongyi Lab
46
  - [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp) by leejet
47
- - [Z-Anime 8-step GGUF](https://huggingface.co/DaNS2025/Z-Anime_8-steps.GGUF) by DaNS2025
48
  - [Qwen3-4B Text Encoder GGUF](https://huggingface.co/worstplayer/Z-Image_Qwen_3_4b_text_encoder_GGUF) by worstplayer
 
12
  - gguf
13
  - cpu
14
  - anime
15
+ - mcp-server
16
  short_description: Z-Anime 6B - CPU anime image generation via sd.cpp
17
  models:
18
  - SeeSee21/Z-Anime
 
21
 
22
  # Z-Anime Image Generation (CPU)
23
 
24
+ **CPU Inference** - Generate anime images with Z-Anime 6B via stable-diffusion.cpp GGUF. ~30 min at 512x512 on free CPU.
25
+
26
+ ## Features
27
+
28
+ - **Image Generation** - text to image via GGUF quantized Z-Anime 6B (S3-DiT)
29
+ - **Distill 4-Step** - fast inference with distilled model (4 steps, CFG 1.0)
30
+ - **CLI Support** - command-line interface for local generation
31
+ - **MCP Server** - AI assistant integration (Claude, Cursor, VS Code)
32
+
33
+ ## Image Generation
34
+
35
+ 1. Enter a prompt describing the anime image
36
+ 2. Adjust resolution (512x512 recommended on CPU)
37
+ 3. Adjust CFG (1.0 best, max 1.5)
38
+ 4. Click **Generate**
39
+
40
+ **Timing:** ~30 min at 512x512 on free CPU. GPU is much faster (~2 min).
41
 
42
  ## Models
43
 
44
  | Component | File | Size |
45
  |-----------|------|------|
46
+ | Diffusion (DiT) | [Z-Anime distill-4step Q5_0 GGUF](https://huggingface.co/WeReCooking/Z-Anime-4step-GGUF) | 4.23 GB |
47
+ | Text Encoder | [Qwen3-4B IQ4_XS GGUF](https://huggingface.co/worstplayer/Z-Image_Qwen_3_4b_text_encoder_GGUF) | 2.29 GB |
48
+ | VAE | [ae.safetensors](https://huggingface.co/SeeSee21/Z-Anime/blob/main/vae/ae.safetensors) | 168 MB |
 
 
49
 
50
  ## Settings
51
 
52
  - **Steps:** 4 (distilled)
53
+ - **CFG:** 1.0 (max 1.5, do not exceed)
54
  - **Sampler:** euler_ancestral
55
  - **Resolution:** 512x512 (recommended on CPU)
56
 
57
+ ---
58
+
59
+ ## API
60
+
61
+ ### Python Client
62
+
63
+ ```python
64
+ from gradio_client import Client
65
+
66
+ client = Client("WeReCooking/Z-Anime-CPU")
67
+ result = client.predict(
68
+ prompt="anime girl with silver hair, fantasy armor, dramatic lighting",
69
+ negative_prompt="worst quality, low quality, blurry, bad anatomy",
70
+ resolution="512x512",
71
+ cfg=1.0,
72
+ seed=-1,
73
+ api_name="/generate"
74
+ )
75
+ print(result) # (image, status_message)
76
+ ```
77
+
78
+ ### MCP (Model Context Protocol)
79
+
80
+ This Space supports MCP for AI assistants (Claude Desktop, Cursor, VS Code).
81
+
82
+ **MCP Config:**
83
+ ```json
84
+ {
85
+ "mcpServers": {
86
+ "z-anime": {"url": "https://werecooking-z-anime-cpu.hf.space/gradio_api/mcp/"}
87
+ }
88
+ }
89
+ ```
90
+
91
+ ---
92
+
93
+ ## CLI Usage
94
+
95
+ ```bash
96
+ # Basic generation
97
+ python app.py "anime girl with silver hair, fantasy armor" -o output.png
98
+
99
+ # With seed and CFG
100
+ python app.py "1girl, maid outfit, cafe background" --seed 42 --cfg 1.0 -o maid.png
101
+
102
+ # Custom resolution and negative prompt
103
+ python app.py "landscape, cherry blossoms, shrine" -r 768x512 -n "blurry, low quality" -o landscape.png
104
+
105
+ # Start Gradio UI instead
106
+ python app.py --gradio
107
+ ```
108
+
109
+ ---
110
+
111
  ## Credits
112
 
113
  - [Z-Anime](https://huggingface.co/SeeSee21/Z-Anime) by SeeSee21
114
  - [Z-Image](https://github.com/Tongyi-MAI/Z-Image) by Alibaba Tongyi Lab
115
  - [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp) by leejet
 
116
  - [Qwen3-4B Text Encoder GGUF](https://huggingface.co/worstplayer/Z-Image_Qwen_3_4b_text_encoder_GGUF) by worstplayer
app.py CHANGED
@@ -211,9 +211,13 @@ def gradio_main():
211
 
212
  gr.Examples(
213
  examples=[
214
- ["anime girl with silver hair, fantasy armor, dramatic lighting, beautiful background art, professional anime illustration quality, cinematic composition, detailed shading, high quality anime art."],
 
 
215
  ],
216
- inputs=[prompt_input],
 
 
217
  cache_examples=True,
218
  cache_mode="lazy",
219
  )
 
211
 
212
  gr.Examples(
213
  examples=[
214
+ ["anime girl with silver hair, fantasy armor, dramatic lighting, beautiful background art, professional anime illustration quality, cinematic composition, detailed shading, high quality anime art.",
215
+ "worst quality, low quality, lowres, blurry, bad anatomy, deformed hands, extra fingers, fused fingers, missing fingers, bad proportions, wrong proportions, extra limbs, broken limbs, duplicate body parts, asymmetrical eyes, distorted face, warped features, poorly drawn face, mutated, extra eyes, cropped head, cut-off body, bad framing, jpeg artifacts, compression artifacts, watermark, logo, signature, text, error, noisy, oversmoothed, muddy colors, background clutter, censored, 3d, chibi, character doll, sepia, high contrast",
216
+ "512x512", 1.0, -1],
217
  ],
218
+ inputs=[prompt_input, neg_input, res_input, cfg_input, seed_input],
219
+ outputs=[output_img, status_box],
220
+ fn=gui_generate,
221
  cache_examples=True,
222
  cache_mode="lazy",
223
  )