SmallO commited on
Commit
14fb55e
·
1 Parent(s): 91b6a8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -19,15 +19,16 @@ import streamlit as st
19
 
20
  def pic_mo(prom):
21
  model_id = "runwayml/stable-diffusion-v1-5"
22
- pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
23
- pipe = pipe.to("cpu")
24
 
25
  prompt = str(prom)
26
 
27
- image = pipe(prompt).images[0]
28
-
29
  return image
30
 
 
31
  def main():
32
  st.title("Text to Image with runwayml/stable-diffusion-v1-5")
33
 
 
19
 
20
  def pic_mo(prom):
21
  model_id = "runwayml/stable-diffusion-v1-5"
22
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32) # Change to float32
23
+ # No need to specify .to("cuda") if running on CPU
24
 
25
  prompt = str(prom)
26
 
27
+ image = pipe(prompt).images[0]
28
+
29
  return image
30
 
31
+
32
  def main():
33
  st.title("Text to Image with runwayml/stable-diffusion-v1-5")
34