salahIguiliz commited on
Commit
88e2ebd
·
1 Parent(s): 34643a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -20,11 +20,12 @@ high_threshold = 200
20
  # Models
21
  pose_model = OpenposeDetector.from_pretrained("lllyasviel/ControlNet")
22
  controlnet = ControlNetModel.from_pretrained(
23
- "lllyasviel/sd-controlnet-openpose", torch_dtype=torch.float16
24
  )
25
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
26
- "runwayml/stable-diffusion-v1-5", controlnet=controlnet, safety_checker=None, torch_dtype=torch.float16
27
  )
 
28
 
29
 
30
  def get_pose(image):
@@ -87,8 +88,7 @@ def inference(prompt,canny_image,number,seed ):
87
  # need to explicitly call pipe.to("cuda").
88
  #pipe.enable_model_cpu_offload()
89
  # xformers
90
- pipe.enable_xformers_memory_efficient_attention()
91
- torch.cuda.is_available()
92
  # Generator seed,
93
  generator = torch.manual_seed(seed)
94
  image_ = canny_image
 
20
  # Models
21
  pose_model = OpenposeDetector.from_pretrained("lllyasviel/ControlNet")
22
  controlnet = ControlNetModel.from_pretrained(
23
+ "lllyasviel/sd-controlnet-openpose"
24
  )
25
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
26
+ "runwayml/stable-diffusion-v1-5", controlnet=controlnet, safety_checker=None
27
  )
28
+ pipe = pipe.to("cpu")
29
 
30
 
31
  def get_pose(image):
 
88
  # need to explicitly call pipe.to("cuda").
89
  #pipe.enable_model_cpu_offload()
90
  # xformers
91
+ #pipe.enable_xformers_memory_efficient_attention()
 
92
  # Generator seed,
93
  generator = torch.manual_seed(seed)
94
  image_ = canny_image