Distribution Matching Distillation (DMD2): Photorealism in Lesser Steps (ComfyUI Workflow and LoRA Solution)
We have explored several solutions to distill diffusion models into efficient low-step generators. Distilled models produce rapid results, generally with reduced detail but often exhibiting improved compositional consistency and/or prompt adherence. Their application is promising for fast inference, batch dataset processing, and animation rendering.
DMD2 method distills a costly diffusion modelinto a one- or multi-step generator. For our use we will test the multistep generator version. We can use the technique either as full ComfyUI workflow, or as a LoRA version (used as standard lora, similar to Lightning destilled LoRAs) in ComfyUI or A1111.
Download and Installation
- Download dmd2_sdxl_4step_unet_fp16.safetensors from https://huggingface.co/tianweiy/DMD2/tree/main . The file comes not in standard model folder but into your \stable-diffusion-webui\models\unet. NOTE: If there is no "unet" folder there, create one.
- You may start with some test workflows here https://github.com/sandner-art/ai-research/tree/main/DMD-Workflows
SWARM and ComfyUI
In 2-pass technique (when you are using latent upscale), you may use around 1-3 steps for the first inference. Check test workflows for examples.
Using LoRA Version
Download dmd2_sdxl_4step_lora_fp16.safetensors LoRA from the same folder as before, in your standard \stable-diffusion-webui\models\Lora folder. Use it at full weight: 1. This is the fastest way how to test it in A1111.
Conclusion
DMD2 is surprisingly effective. While it can produce artifacts depending on the base model, it offers a new method for extracting high-quality outputs from SDXL base models, enabling the creation of realistic images and artistic effects. Compared to models like Flux (schnell), DMD2 has advantages such as compatibility with SDXL models and SDXL LoRAs.
You may also try NVIDIA AYS , a very good technique for fast rendering with SDXL.
Resouces
- Improved Distribution Matching Distillation for Fast Image Synthesis https://github.com/tianweiy/DMD2
- Models https://huggingface.co/tianweiy/DMD2/tree/main
- Test workflows https://github.com/sandner-art/ai-research/tree/main/DMD-Workflows