--- license: apache-2.0 base_model: - Tongyi-MAI/Z-Image pipeline_tag: text-to-image library_name: diffusers language: - en - ko tags: - text-to-image - image-generation - quantized - bitsandbytes - nf4 - 4-bit - on-device - korean - pocket - vidraft --- # ๐Ÿ–ผ๏ธ POCKET-Image-Zimage โ€” 4-bit (NF4) Z-Image for on-device A **4-bit (NF4) quantized build of [Z-Image](https://huggingface.co/Tongyi-MAI/Z-Image)** (Apache-2.0), packaged by VIDRAFT for **low-VRAM, on-device** image generation โ€” part of the POCKET line. - ๐Ÿ“ฆ **~6 GB on disk** (transformer + text encoder in NF4, VAE in fp16) - โšก **Runs from ~8.6 GB VRAM** (โ‰ˆ**4.5 GB** with CPU offload) โ€” vs **23.3 GB** for bf16 - ๐ŸŽฏ ~2.7โ€“5ร— smaller footprint, quality on par with the bf16 base ## Usage ```python import torch from diffusers import ZImagePipeline # or ZImageImg2ImgPipeline / ZImageInpaintPipeline pipe = ZImagePipeline.from_pretrained( "FINAL-Bench/POCKET-Image-Zimage", torch_dtype=torch.bfloat16 ).to("cuda") img = pipe("a serene mountain lake at sunrise, photorealistic", num_inference_steps=20).images[0] img.save("out.png") ``` Requires **`bitsandbytes`** (CUDA). Measured reload + generate peak: ~10.9 GB VRAM. For Apple Silicon / CPU, an `optimum-quanto` int8 build (~13.4 GB) is the portable option. ## ๐ŸŽจ The full POCKET-Image system This repo hosts the **quantized base model** only. The headline **character-perfect Korean & multilingual text** feature is delivered by the POCKET-Image *pipeline*, not by these weights alone. Try the full system here: - **๐ŸŽจ Studio (generate here):** https://huggingface.co/spaces/FINAL-Bench/POCKET-Image-Studio Base model: [Tongyi-MAI/Z-Image](https://huggingface.co/Tongyi-MAI/Z-Image) (Apache-2.0) ยท Quantization: bitsandbytes NF4 ยท By VIDRAFT. --- ## ๐Ÿงฉ The POCKET Family โ€” On-device AI by VIDRAFT *Big models, small hardware. No GPU, no cloud.* **Models** - ๐Ÿ“ฆ [POCKET-35B-GGUF](https://huggingface.co/FINAL-Bench/POCKET-35B-GGUF) โ€” flagship, PC / server, no GPU - ๐Ÿ“ฆ [POCKET-26B-GGUF](https://huggingface.co/FINAL-Bench/POCKET-26B-GGUF) โ€” compact 26B - ๐Ÿ‡ฐ๐Ÿ‡ท [POCKET-KR-GGUF](https://huggingface.co/FINAL-Bench/POCKET-KR-GGUF) โ€” Korean, Android - ๐ŸŽ [POCKET-KR-MLX](https://huggingface.co/FINAL-Bench/POCKET-KR-MLX) โ€” Korean, iPhone / Mac - ๐ŸŒ [POCKET-EN-GGUF](https://huggingface.co/FINAL-Bench/POCKET-EN-GGUF) โ€” English, phone / PC - ๐Ÿ–ผ๏ธ [POCKET-Image-Zimage](https://huggingface.co/FINAL-Bench/POCKET-Image-Zimage) โ€” 4-bit Z-Image (this repo) **Demos & tools (Spaces)** - ๐ŸŽจ [POCKET-Image Studio](https://huggingface.co/spaces/FINAL-Bench/POCKET-Image-Studio) โ€” text-in-image, generate in-page - ๐Ÿ–ฅ๏ธ [POCKET-35B-CPU](https://huggingface.co/spaces/FINAL-Bench/POCKET-35B-CPU) โ€” 35B answering on a CPU - ๐Ÿ–ฅ๏ธ [POCKET-26B-CPU](https://huggingface.co/spaces/FINAL-Bench/POCKET-26B-CPU) โ€” 26B on a CPU ๐Ÿ“š [Full POCKET collection](https://huggingface.co/collections/FINAL-Bench/pocket-models-6a618ee5d23eafb7e185a5c6)