Spaces:
Build error
Build error
Update app.py
Browse files
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("
|
| 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("
|
| 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 |
|