ombhojane commited on
Commit
ade4b5d
·
verified ·
1 Parent(s): 198ad13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -40,7 +40,7 @@ if st.button("Generate"):
40
  farm_image = load_image_from_url(image_url)
41
 
42
  # Process image for depth map
43
- depth_map = get_depth_map(farm_image, depth_estimator).unsqueeze(0).half().to("cuda")
44
 
45
  # Load the ControlNet model and the StableDiffusionControlNetImg2ImgPipeline
46
  controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-normal", torch_dtype=torch.float16, use_safetensors=True)
@@ -49,7 +49,7 @@ if st.button("Generate"):
49
  controlnet=controlnet,
50
  torch_dtype=torch.float16,
51
  use_safetensors=True
52
- ).to("cuda")
53
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
54
  pipe.enable_model_cpu_offload()
55
 
 
40
  farm_image = load_image_from_url(image_url)
41
 
42
  # Process image for depth map
43
+ depth_map = get_depth_map(farm_image, depth_estimator).unsqueeze(0).half().to("cpu")
44
 
45
  # Load the ControlNet model and the StableDiffusionControlNetImg2ImgPipeline
46
  controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-normal", torch_dtype=torch.float16, use_safetensors=True)
 
49
  controlnet=controlnet,
50
  torch_dtype=torch.float16,
51
  use_safetensors=True
52
+ ).to("cpu")
53
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
54
  pipe.enable_model_cpu_offload()
55