Instructions to use zttzzt/eDMD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use zttzzt/eDMD with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("zttzzt/eDMD") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
|
Download README.md from zttzzt/eDMD: direct link, hf CLI and curl.
- Browser
- Download file 2.68 kB
-
https://huggingface.co/zttzzt/eDMD/resolve/main/README.md
- Command line
-
hf download hf://zttzzt/eDMD/README.md
-
curl -L -o README.md https://huggingface.co/zttzzt/eDMD/resolve/main/README.md
2.68 kB
| license: other | |
| license_name: per-directory | |
| license_link: LICENSE.md | |
| base_model: | |
| - stabilityai/stable-diffusion-3-medium-diffusers | |
| - black-forest-labs/FLUX.2-klein-base-4B | |
| - black-forest-labs/FLUX.2-klein-base-9B | |
| base_model_relation: adapter | |
| library_name: diffusers | |
| pipeline_tag: text-to-image | |
| tags: | |
| - lora | |
| - text-to-image | |
| - distillation | |
| - few-step | |
| # eDMD: Endpoint Distribution Matching for Few-Step Diffusion Distillation | |
|  | |
| 4-step students of three text-to-image teachers, as LoRA. Paper: [arXiv:2611.17194](https://arxiv.org/abs/2611.17194). Code: [Westlake-AGI-Lab/eDMD](https://github.com/Westlake-AGI-Lab/eDMD). | |
| | Directory | Base model | HPSv3++ (DrawBench-1000) | License | | |
| |---|---|---|---| | |
| | [`sd3_medium/`](sd3_medium) | [stabilityai/stable-diffusion-3-medium-diffusers](https://huggingface.co/stabilityai/stable-diffusion-3-medium-diffusers) | 11.17 | Stability AI Non-Commercial Research Community License | | |
| | [`flux2_klein_4b/`](flux2_klein_4b) | [black-forest-labs/FLUX.2-klein-base-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-4B) | 12.70 | Apache 2.0 | | |
| | [`flux2_klein_9b/`](flux2_klein_9b) | [black-forest-labs/FLUX.2-klein-base-9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B) | 12.43 | FLUX Non-Commercial License | | |
| Each directory holds the LoRA (`edmd_<directory>_lora.safetensors`) with its teacher's license ([`LICENSE.md`](LICENSE.md)). | |
| ## Diffusers | |
| ```python | |
| import torch | |
| from diffusers import Flux2KleinPipeline | |
| pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-base-4B", torch_dtype=torch.bfloat16) | |
| pipe.load_lora_weights("zttzzt/eDMD", subfolder="flux2_klein_4b", weight_name="edmd_flux2_klein_4b_lora.safetensors") | |
| pipe.to("cuda") | |
| image = pipe("a red fox in fresh snow, morning light", num_inference_steps=4, guidance_scale=1.0).images[0] | |
| ``` | |
| The students sample in 4 steps without guidance, on their teacher's grid: | |
| | Directory | Pipeline | Call | | |
| |---|---|---| | |
| | `sd3_medium/` | `StableDiffusion3Pipeline` | `num_inference_steps=4, sigmas=[1.0, 0.75, 0.5, 0.25], guidance_scale=1.0` | | |
| | `flux2_klein_4b/`, `flux2_klein_9b/` | `Flux2KleinPipeline` | `num_inference_steps=4, guidance_scale=1.0` | | |
| ## With the eDMD code | |
| ```bash | |
| python scripts/infer.py --weights zttzzt/eDMD/flux2_klein_4b/edmd_flux2_klein_4b_lora.safetensors --prompt "a red fox in fresh snow" | |
| ``` | |
| Each file's metadata carries the student's sampler (steps, grid, size), which the eDMD code reads for sampling and | |
| for the paper's evaluation (`python -m edmd.cli.evaluate generate --checkpoint <file> --eval drawbench1k ...`). | |