Student3331 commited on
Commit
17cf37a
·
verified ·
1 Parent(s): eb173b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,8 +5,9 @@ import gradio as gr
5
  # Load model with CPU optimization
6
  pipe = StableDiffusionPipeline.from_pretrained(
7
  "CompVis/stable-diffusion-v1-4",
8
- torch_dtype=torch.float16
9
  )
 
10
  pipe.to("cpu") # Ensure it's running on CPU
11
 
12
  def generate_image(prompt):
@@ -22,4 +23,4 @@ demo = gr.Interface(
22
  )
23
 
24
  # Launch app
25
- demo.launch()
 
5
  # Load model with CPU optimization
6
  pipe = StableDiffusionPipeline.from_pretrained(
7
  "CompVis/stable-diffusion-v1-4",
8
+ torch_dtype=torch.float32 # Use float32 on CPU for compatibility
9
  )
10
+
11
  pipe.to("cpu") # Ensure it's running on CPU
12
 
13
  def generate_image(prompt):
 
23
  )
24
 
25
  # Launch app
26
+ demo.launch()