bahman007 commited on
Commit
32ec4c2
·
verified ·
1 Parent(s): b0fa9e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 GPU
6
- pipe = StableDiffusionXLPipeline.from_pretrained("sd-community/sdxl-flash", torch_dtype=torch.float16).to("cuda")
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")