clementchadebec commited on
Commit
0b4cc63
1 Parent(s): 9542a52

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -11
README.md CHANGED
@@ -15,26 +15,52 @@ widget:
15
  base_model: stabilityai/stable-diffusion-xl-base-1.0
16
  license: cc-by-nc-nd-4.0
17
  ---
18
- # flash-sdxl
19
 
20
- <Gallery />
21
 
 
 
22
 
23
- ## Trigger words
24
 
25
- You should use `Diffusion` to trigger the image generation.
 
 
26
 
27
- You should use `Distillation` to trigger the image generation.
28
 
29
- You should use `text-to-image` to trigger the image generation.
30
 
31
- You should use `fast image generation` to trigger the image generation.
 
32
 
33
- You should use `sdxl` to trigger the image generation.
34
 
 
 
 
 
35
 
36
- ## Download model
 
 
 
 
 
37
 
38
- Weights for this model are available in Safetensors format.
 
 
39
 
40
- [Download](/jasperai/flash-sdxl/tree/main) them in the Files & versions tab.
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  base_model: stabilityai/stable-diffusion-xl-base-1.0
16
  license: cc-by-nc-nd-4.0
17
  ---
18
+ # ⚡ FlashDiffusion: FlashSD ⚡
19
 
 
20
 
21
+ Flash Diffusion is a diffusion distillation method proposed in [ADD ARXIV]() *by Clément Chadebec, Onur Tasar and Benjamin Aubin.*
22
+ This model is a **26.4M** LoRA distilled version of SD1.5 model that is able to generate images in **2-4 steps**. The main purpose of this model is to reproduce the main results of the paper.
23
 
 
24
 
25
+ <p align="center">
26
+ <img style="width:700px;" src="images/hf_grid.png">
27
+ </p>
28
 
29
+ # How to use?
30
 
31
+ The model can be used using the `StableDiffusionPipeline` from `diffusers` library directly. It can allow reducing the number of required sampling steps to **2-4 steps**.
32
 
33
+ ```python
34
+ from diffusers import DiffusionPipeline, LCMScheduler
35
 
36
+ adapter_id = "jasperai/flash-sd"
37
 
38
+ pipe = DiffusionPipeline.from_pretrained(
39
+ "stabilityai/stable-diffusion-xl-base-1.0",
40
+ use_safetensors=True,
41
+ )
42
 
43
+ pipe.scheduler = LCMScheduler.from_pretrained(
44
+ "stabilityai/stable-diffusion-xl-base-1.0",
45
+ subfolder="scheduler",
46
+ timestep_spacing="trailing",
47
+ )
48
+ pipe.to("cuda")
49
 
50
+ # Fuse and load LoRA weights
51
+ pipe.load_lora_weights(adapter_id)
52
+ pipe.fuse_lora()
53
 
54
+ prompt = "A raccoon reading a book in a lush forest."
55
+
56
+ image = pipe(prompt, num_inference_steps=4, guidance_scale=0).images[0]
57
+ ```
58
+ <p align="center">
59
+ <img style="width:400px;" src="images/raccoon.png">
60
+ </p>
61
+
62
+ # Training Details
63
+
64
+
65
+ ## License
66
+ This model is released under the the Creative Commons BY-NC license.