---
title: Z-Image-Turbo-DistillPatch
canonical_url: "https://www.modelscope.ai/models/DiffSynth-Studio/Z-Image-Turbo-DistillPatch"
md_url: "https://www.modelscope.ai/models/DiffSynth-Studio/Z-Image-Turbo-DistillPatch.md"
repository: DiffSynth-Studio/Z-Image-Turbo-DistillPatch
last_updated: 2025-12-21
license: "Apache License 2.0"
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
base_model:
  - undefined
base_model_relation: adapter
library_name:
  - pytorch
  - lora
  - safetensors
frameworks:
  - Pytorch
supports_inference: txt2img
downloads: 166
stars: 1
tags:
  - LoRA
---

# Z-Image-Turbo-DistillPatch

> Z-Image-Turbo-DistillPatch - An open-source model by DiffSynth-Studio on ModelScope. Z-Image Turbo 加速能力修复 LoRA

DiffSynth-Studio/Z-Image-Turbo-DistillPatch is a text-to-image-synthesis model on ModelScope. licensed under Apache License 2.0. derived from undefined. and supports online inference (txt2img).

- **Repository**: DiffSynth-Studio/Z-Image-Turbo-DistillPatch
- **License**: Apache License 2.0
- **Tasks**: text-to-image-synthesis
- **Base model**: undefined
- **Online inference**: txt2img
- **Tags**: LoRA
- **Downloads**: 166
- **Stars**: 1
- **Last updated**: 2025-12-21

Source: https://www.modelscope.ai/models/DiffSynth-Studio/Z-Image-Turbo-DistillPatch

---

# Z-Image Turbo 加速能力修复 LoRA

## 模型介绍

这个模型是用于修复 Z-Image Turbo LoRA 加速能力的 LoRA。

直接基于 Z-Image Turbo 训练出的 LoRA 会失去加速能力，在加速配置（steps=8，cfg=1）下生成的图像变得模糊，在非加速配置（steps=30，cfg=2）下生成的图像正常。

更多关于训练策略和实现细节，欢迎查看我们的[技术博客](https://modelscope.cn/learn/3285)。

## 效果展示

训练数据：

![](assets/training_data.jpg)

生成结果：

|steps=8，cfg=1|steps=30，cfg=2|steps=8，cfg=1，使用本模型修复|
|-|-|-|
|![](assets/image_base_acc.jpg)|![](assets/image_base_nonacc.jpg)|![](assets/image_with_our_lora.jpg)|

## 推理代码

```python
from diffsynth.pipelines.z_image import ZImagePipeline, ModelConfig
import torch

pipe = ZImagePipeline.from_pretrained(
    torch_dtype=torch.bfloat16,
    device="cuda",
    model_configs=[
        ModelConfig(model_id="Tongyi-MAI/Z-Image-Turbo", origin_file_pattern="transformer/*.safetensors"),
        ModelConfig(model_id="Tongyi-MAI/Z-Image-Turbo", origin_file_pattern="text_encoder/*.safetensors"),
        ModelConfig(model_id="Tongyi-MAI/Z-Image-Turbo", origin_file_pattern="vae/diffusion_pytorch_model.safetensors"),
    ],
    tokenizer_config=ModelConfig(model_id="Tongyi-MAI/Z-Image-Turbo", origin_file_pattern="tokenizer/"),
)
pipe.load_lora(pipe.dit, "path/to/your/lora.safetensors")
pipe.load_lora(pipe.dit, ModelConfig(model_id="DiffSynth-Studio/Z-Image-Turbo-DistillPatch", origin_file_pattern="model.safetensors"))
image = pipe(prompt="a dog", seed=42, rand_device="cuda")
image.save("image.jpg")
```
