ehristoforu commited on
Commit
299657c
1 Parent(s): 05046d1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -1
README.md CHANGED
@@ -27,7 +27,7 @@ inference:
27
  blurry, amputation
28
  ---
29
 
30
- # **SDXL Flash**
31
 
32
  ![preview](images/preview.png)
33
 
@@ -42,3 +42,22 @@ Introducing the new fast model SDXL Flash, we learned that all fast XL models wo
42
  - **CFG Scale**: 2.5-3.5
43
  - **Sampler**: DPM++ SDE
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  blurry, amputation
28
  ---
29
 
30
+ # **SDXL Flash** *in collaboration with [Project Fluently](https://hf.co/fluently)*
31
 
32
  ![preview](images/preview.png)
33
 
 
42
  - **CFG Scale**: 2.5-3.5
43
  - **Sampler**: DPM++ SDE
44
 
45
+ ### Diffusers usage
46
+
47
+ ```bash
48
+ pip install torch diffusers
49
+ ```
50
+
51
+ ```py
52
+ import torch
53
+ from diffusers import StableDiffusionXLPipeline, DPMSolverSinglestepScheduler
54
+
55
+ # Load model.
56
+ pipe = StableDiffusionXLPipeline.from_pretrained("sd-community/sdxl-flash", torch_dtype=torch.float16, variant="fp16").to("cuda")
57
+
58
+ # Ensure sampler uses "trailing" timesteps.
59
+ pipe.scheduler = DPMSolverSinglestepScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
60
+
61
+ # Image generation.
62
+ pipe("a happy dog, sunny day, realism", num_inference_steps=7, guidance_scale=3).images[0].save("output.png")
63
+ ```