adi2606 commited on
Commit
38f7b83
1 Parent(s): 9c4dee0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,12 +3,12 @@ from diffusers import DiffusionPipeline
3
  import torch
4
  import os
5
 
6
- # Load Stable Diffusion model
7
  @st.cache_resource
8
  def load_model():
9
  model_id = "xinsir/controlnet-union-sdxl-1.0"
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
- pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16 if device == "cuda" else torch.float32)
12
  pipe.to(device)
13
  return pipe
14
 
@@ -41,4 +41,4 @@ if st.button("Generate Image"):
41
  st.image(file_path, caption=f"Generated Image {i+1}")
42
  st.success(f"Saved image to {file_path}")
43
 
44
- st.balloons()
 
3
  import torch
4
  import os
5
 
6
+ # Load Diffusion model
7
  @st.cache_resource
8
  def load_model():
9
  model_id = "xinsir/controlnet-union-sdxl-1.0"
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
+ pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16 if device == "cuda" else torch.float32)
12
  pipe.to(device)
13
  return pipe
14
 
 
41
  st.image(file_path, caption=f"Generated Image {i+1}")
42
  st.success(f"Saved image to {file_path}")
43
 
44
+ st.balloons()