ombhojane commited on
Commit
6e079a3
·
verified ·
1 Parent(s): aff254d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -25,7 +25,7 @@ def process_image_and_prompt(input_image, prompt):
25
  depth_estimator = pipeline("depth-estimation")
26
 
27
  # Get depth map
28
- depth_map = get_depth_map(input_image, depth_estimator).unsqueeze(0).half().to("cuda")
29
 
30
  # Load the ControlNet model and the StableDiffusionControlNetImg2ImgPipeline
31
  controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-normal", torch_dtype=torch.float16, use_safetensors=True)
@@ -34,7 +34,7 @@ def process_image_and_prompt(input_image, prompt):
34
  controlnet=controlnet,
35
  torch_dtype=torch.float16,
36
  use_safetensors=True
37
- ).to("cuda")
38
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
39
  pipe.enable_model_cpu_offload()
40
 
 
25
  depth_estimator = pipeline("depth-estimation")
26
 
27
  # Get depth map
28
+ depth_map = get_depth_map(input_image, depth_estimator).unsqueeze(0).half().to("cpu")
29
 
30
  # Load the ControlNet model and the StableDiffusionControlNetImg2ImgPipeline
31
  controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-normal", torch_dtype=torch.float16, use_safetensors=True)
 
34
  controlnet=controlnet,
35
  torch_dtype=torch.float16,
36
  use_safetensors=True
37
+ ).to("cpu")
38
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
39
  pipe.enable_model_cpu_offload()
40