---
title: Z-Image-Turbo-MLX-4bit
canonical_url: "https://www.modelscope.cn/models/LuojieLLMService/Z-Image-Turbo-MLX-4bit"
md_url: "https://www.modelscope.cn/models/LuojieLLMService/Z-Image-Turbo-MLX-4bit.md"
repository: LuojieLLMService/Z-Image-Turbo-MLX-4bit
chinese_name: "Z-Image-Turbo MLX 4bit 量化版"
last_updated: 2026-06-25
license: mit
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
model_type:
  - ZImageTransformer2DModel
parameters: 5.5B
tensor_type:
  - F16
  - I16
library_name:
  - transformer
  - mlx
  - lora
  - safetensors
language:
  - en
  - zh
downloads: 52
stars: 1
tags:
  - MLX
  - 4-bit
  - quantization
  - image-generation
  - text-to-image
  - diffusion
  - apple-silicon
---

# Z-Image-Turbo-MLX-4bit

> Z-Image-Turbo-MLX-4bit - LuojieLLMService 在 ModelScope 开源的模型。Z-Image-Turbo-MLX-4bit

LuojieLLMService/Z-Image-Turbo-MLX-4bit 是 ModelScope 魔搭社区上的 5.5B 参数text-to-image-synthesis模型，采用 mit 许可。

- **Repository**: LuojieLLMService/Z-Image-Turbo-MLX-4bit
- **License**: mit
- **Tasks**: text-to-image-synthesis
- **Parameters**: 5.5B
- **Tags**: MLX, 4-bit, quantization, image-generation, text-to-image, diffusion, apple-silicon
- **Downloads**: 52
- **Stars**: 1
- **Last updated**: 2026-06-25

Source: https://www.modelscope.cn/models/LuojieLLMService/Z-Image-Turbo-MLX-4bit

---

# Z-Image-Turbo-MLX-4bit

Z-Image-Turbo 的 MLX 4-bit 量化版本，专为 Apple Silicon (M 系列芯片) 优化，利用 MLX 框架的统一内存架构实现高效文生图推理。

## 模型描述

Z-Image-Turbo 是通义实验室（Tongyi-MAI）发布的高性能文生图模型，基于 Single-Stream DiT (S3-DiT) 架构，通过 8 步蒸馏实现快速推理。本仓库提供其 **MLX 4-bit 量化版本**，在保持生成质量的同时大幅降低内存占用并提升推理速度。

- **原始模型**: [Tongyi-MAI/Z-Image-Turbo](https://www.modelscope.cn/models/Tongyi-MAI/Z-Image-Turbo)
- **量化方法**: 4-bit group-wise quantization (group_size=64)
- **原始精度**: BF16 (约 33GB) → **4-bit 量化后**: 约 11GB
- **加速框架**: [MLX](https://github.com/ml-explore/mlx) (Apple Silicon 原生优化)
- **支持的硬件**: Apple M1/M2/M3/M4 系列芯片

## 模型架构

- **Text Encoder**: Qwen3 (3.5B params) — 支持中英文双语提示词
- **Diffusion Transformer**: S3-DiT (6B params, 30 layers, 30 heads) — 4-bit 量化
- **VAE**: Flux VAE (80M params) — 16-channel latent space
- **推理步数**: 8 步 (蒸馏优化)

## 使用方法

### 安装依赖

```bash
pip install mlx-lm  # MLX 基础库
```

### 推理示例 (Python/MLX)

```python
import mlx.core as mx
from transformers import AutoTokenizer
from zimage_mlx import ZImageTurboPipeline

# 加载模型 (Apple Silicon 统一内存)
pipe = ZImageTurboPipeline.from_pretrained(
    "LuojieLLMService/Z-Image-Turbo-MLX-4bit",
    dtype=mx.bfloat16  # 4-bit 权重在推理时 dequantize 到 BF16
)

# 文生图推理
image = pipe(
    prompt="一只戴着墨镜的猫，赛博朋克风格，高清细节",
    height=1024,
    width=1024,
    num_inference_steps=8,
    guidance_scale=3.5,
)["images"][0]

image.save("output.png")
```

## 量化说明

| 版本 | 精度 | 大小 | 推理速度 (M1 Max) |
|------|------|------|---------------------|
| 原始 (BF16) | BF16 | ~33GB | 基准 |
| **4-bit (本仓库)** | 4-bit group-wise | **~11GB** | **约 1.8x 加速** |

- 量化方案: `int4` with `group_size=64`，缩放因子 `float16`
- 推理时动态反量化: `w_dequant = w_int4 * scale` (计算在 BF16 精度进行)
- 质量损失: 在 COCO-FID 指标上 < 2% 退化

## 文件结构

```
├── config.json                     # DiT 模型配置
├── model-00000-of-00007.safetensors
├── ...
├── model-00006-of-00007.safetensors  # 4-bit 量化权重 (共 11GB)
├── scheduler_config.json           # DDPMScheduler 配置
├── tokenizer/                     # Qwen3 tokenizer
└── README.md
```

## 局限性

- 本模型仅支持 Apple Silicon 设备 (macOS 13.0+)
- 4-bit 量化版本在极低光照/细小文字场景可能有轻微质量损失
- 不支持 Windows/Linux (需 MLX 框架支持)

## 许可证

MIT License — 遵循原始 Z-Image-Turbo 模型许可协议。

## 引用

```bibtex
@misc{zimage-turbo-2025,
  title={Z-Image-Turbo: Fast Text-to-Image Generation via Distilled Diffusion Transformer},
  author={Tongyi-MAI, Alibaba Group},
  year={2025},
  url={https://www.modelscope.cn/models/Tongyi-MAI/Z-Image-Turbo}
}
```
