Z-Image-Turbo-Quantized

4
license:apache-2.0
by
lightx2v
Image Model
OTHER
New
0 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary

AI model with specialized capabilities.

Code Examples

🚀 Installationbash
git clone https://github.com/ModelTC/LightX2V.git
cd LightX2V
pip install .
Complete Examplepython
from lightx2v import LightX2VPipeline

# Initialize pipeline
pipe = LightX2VPipeline(
    model_path="Tongyi-MAI/Z-Image-Turbo",
    model_cls="z_image",
    task="t2i",
)

# Step 1: Enable quantization (FP8 transformer + INT4 text encoder)
pipe.enable_quantize(
    dit_quantized=True,
    dit_quantized_ckpt="lightx2v/Z-Image-Turbo-Quantized/z_image_turbo_scaled_fp8_e4m3fn.safetensors",
    quant_scheme="fp8-sgl",
    # IMPORTANT: Use int4 Qwen3 for 8GB VRAM
    text_encoder_quantized=True,
    text_encoder_quantized_ckpt="JunHowie/Qwen3-4B-GPTQ-Int4",
    text_encoder_quant_scheme="int4"
)

# Step 2: Enable CPU offloading
pipe.enable_offload(
    cpu_offload=True,
    offload_granularity="model",  # Use "model" for maximum memory savings
)

# Step 3: Create generator
pipe.create_generator(
    attn_mode="flash_attn3",
    aspect_ratio="16:9",
    infer_steps=9,
    guidance_scale=1,
)

# Step 4: Generate image
pipe.generate(
    seed=42,
    prompt="A beautiful landscape with mountains and lakes, ultra HD, 4K",
    negative_prompt="",
    save_result_path="output.png",
)
⚙️ Configuration Optionspython
dit_quantized_ckpt="lightx2v/Z-Image-Turbo-Quantized/z_image_turbo_scaled_fp8_e4m3fn.safetensors",
quant_scheme="fp8-sgl",
python
dit_quantized_ckpt="lightx2v/Z-Image-Turbo-Quantized/z_image_turbo_int8.safetensors",
quant_scheme="int8-sgl",

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.