Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@ import torch
|
|
2 |
import gradio as gr
|
3 |
from diffusers import StableDiffusionXLPipeline, DPMSolverSinglestepScheduler
|
4 |
|
5 |
-
# Load model and set the device to
|
6 |
-
pipe = StableDiffusionXLPipeline.from_pretrained("sd-community/sdxl-flash", torch_dtype=torch.
|
7 |
|
8 |
# Ensure sampler uses "trailing" timesteps
|
9 |
pipe.scheduler = DPMSolverSinglestepScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
|
|
2 |
import gradio as gr
|
3 |
from diffusers import StableDiffusionXLPipeline, DPMSolverSinglestepScheduler
|
4 |
|
5 |
+
# Load model and set the device to CPU
|
6 |
+
pipe = StableDiffusionXLPipeline.from_pretrained("sd-community/sdxl-flash", torch_dtype=torch.float32).to("cpu")
|
7 |
|
8 |
# Ensure sampler uses "trailing" timesteps
|
9 |
pipe.scheduler = DPMSolverSinglestepScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|