ModelTC/LightX2V-Qwen-Image-Lightning
Qwen-Image-Lightning: Speed up Qwen-Image model with distillation
📌 What is Qwen‑Image‑Lightning?
Qwen‑Image‑Lightning is a set of distilled (i.e., faster, lighter) checkpoint files for the Qwen‑Image text‑to‑image model released by the QwenLM team. The “Lightning” models keep the original’s ability to render complex Chinese/English text inside images, but they require far fewer diffusion steps (4 or 8 steps instead of the 100‑step baseline), giving 12–25× speed‑up with only modest quality loss.
🔧 Main components
| Component | What it is | Typical use |
|---|---|---|
| Lightning checkpoints | .safetensors files (fp32, bf16, fp8) that contain the distilled weights for Qwen‑Image (base) and Qwen‑Image‑Edit (editing). |
Load with 🤗 Diffusers, ComfyUI, or any pipeline that supports Qwen‑Image. |
| LoRA weights | Low‑rank adapters (“Lightning LoRAs”) that can be applied on top of the base model to improve quality or adapt to FP8 bases. | Fine‑tune or combine with existing LoRAs for better visual fidelity. |
| ComfyUI workflows | JSON files that describe a ready‑to‑run graph in the ComfyUI visual editor. | One‑click generation or editing inside ComfyUI. |
| Evaluation scripts | Example scripts (e.g., in the Nunchaku repo) showing how to run the model with cache‑acceleration or 4‑bit quantisation. | Benchmark speed/quality or reduce GPU memory. |
🚀 Why use the Lightning version?
- Speed – 4‑step models run in a fraction of the time of the original 100‑step diffusion.
- Memory‑friendly – FP8 / 4‑bit variants let you run on a single consumer‑grade GPU.
- Compatibility – Works with the official 🤗 Diffusers
QwenImagePipeline, ComfyUI, and third‑party tools like Nunchaku and Cache‑dit. - Quality‑focused updates – V2.0 improves over‑saturation and skin texture compared to V1.x.
📂 How to get started
- Pick a checkpoint – Choose the step count (4 or 8) and precision you need (fp32, bf16, fp8). Links are in the Latest News section.
- Load with Diffusers
from diffusers import QwenImagePipeline pipe = QwenImagePipeline.from_pretrained("lightx2v/Qwen-Image-Lightning-4steps-V2.0") image = pipe(prompt="...", num_inference_steps=4).images[0] - Optional LoRA – If you are using the FP8 base, download the matching Lightning LoRA (see the “Using Lightning LoRAs with FP8 Models” table) and apply it with
pipe.unet.add_adapter(). - ComfyUI – Open the provided JSON workflow (
workflows/...json) to run the model visually.
📊 Reported performance (from the README)
| Model | Steps | Speed‑up vs. base | Typical quality notes |
|---|---|---|---|
| Qwen‑Image‑Lightning‑8steps‑V1.1 | 8 | ~12× faster | Good overall, but hair‑like details may be slightly blurred. |
| Qwen‑Image‑Lightning‑4steps‑V1.0 | 4 | ~25× faster | Very fast; may lose fine text rendering in dense scenes. |
| V2.0 (both 4‑ and 8‑step) | 4 / 8 | similar speed | Reduced over‑saturation, better skin tones. |
The README also notes that for very dense or small text the original 100‑step model still performs best, and that extremely complex scenes can challenge all versions.
🛠️ Known issues & fixes
- Grid artifacts when using the original FP8 base with LoRAs trained on BF16. The repo supplies two remedies:
- Use the newly‑distilled Lightning LoRA that was trained on the FP8 base.
- Switch to the scaled FP8 base weight (
qwen_image_fp8_e4m3fn_scaled.safetensors) which aligns better with existing LoRAs.
- Compatibility with the official Qwen‑Image FP8 model was fixed in Oct 2025 (see Issue #32).
📚 Where to learn more
- Diffusers docs –
https://huggingface.co/docs/diffusers/main/api/pipelines/qwenimage - ComfyUI tutorials –
https://docs.comfy.org/tutorials/image/qwen/qwen-image - Nunchaku example script –
https://github.com/nunchaku-tech/nunchaku/blob/main/examples/v1/qwen-image-lightning.py - Cache‑dit 3.5‑step inference –
https://github.com/vipshop/cache-dit/blob/main/examples/pipeline/run_qwen_image_lightning.py
🎯 TL;DR
Qwen‑Image‑Lightning provides fast, low‑step distilled checkpoints (4 / 8 steps) for the Qwen‑Image text‑to‑image model, with multiple precision formats and ready‑to‑use LoRA adapters. It integrates with the major diffusion toolkits (🤗 Diffusers, ComfyUI) and offers a clear upgrade path from the original model while keeping the standout ability to render complex Chinese/English text.
Related
- Project
- Project
- Project
- Project