Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -403,9 +403,10 @@ def infer(
|
|
403 |
|
404 |
# #control_mode = "pose_estimation" # Режим работы ControlNet
|
405 |
|
406 |
-
if control_mode.value == "pose_estimation":
|
|
|
407 |
|
408 |
-
print('control_mode
|
409 |
|
410 |
# Инициализация ControlNet
|
411 |
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-openpose", torch_dtype=torch_dtype)
|
@@ -488,9 +489,10 @@ def infer(
|
|
488 |
|
489 |
# #control_mode = "edge_detection" # Режим работы ControlNet
|
490 |
|
491 |
-
if control_mode.value == "edge_detection":
|
|
|
492 |
|
493 |
-
print('control_mode
|
494 |
|
495 |
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16, use_safetensors=True)
|
496 |
|
@@ -539,9 +541,10 @@ def infer(
|
|
539 |
|
540 |
# #control_mode = "depth_map" # Режим работы ControlNet
|
541 |
|
542 |
-
if control_mode.value == "depth_map":
|
|
|
543 |
|
544 |
-
print('control_mode
|
545 |
|
546 |
depth_estimator = pipeline("depth-estimation")
|
547 |
depth_map = get_depth_map(control_image, depth_estimator).unsqueeze(0).half().to(device)
|
|
|
403 |
|
404 |
# #control_mode = "pose_estimation" # Режим работы ControlNet
|
405 |
|
406 |
+
#if control_mode.value == "pose_estimation":
|
407 |
+
if control_mode == "pose_estimation":
|
408 |
|
409 |
+
print('control_mode = ', control_mode)
|
410 |
|
411 |
# Инициализация ControlNet
|
412 |
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-openpose", torch_dtype=torch_dtype)
|
|
|
489 |
|
490 |
# #control_mode = "edge_detection" # Режим работы ControlNet
|
491 |
|
492 |
+
#if control_mode.value == "edge_detection":
|
493 |
+
if control_mode == "edge_detection":
|
494 |
|
495 |
+
print('control_mode = ', control_mode)
|
496 |
|
497 |
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16, use_safetensors=True)
|
498 |
|
|
|
541 |
|
542 |
# #control_mode = "depth_map" # Режим работы ControlNet
|
543 |
|
544 |
+
#if control_mode.value == "depth_map":
|
545 |
+
if control_mode == "depth_map":
|
546 |
|
547 |
+
print('control_mode = ', control_mode)
|
548 |
|
549 |
depth_estimator = pipeline("depth-estimation")
|
550 |
depth_map = get_depth_map(control_image, depth_estimator).unsqueeze(0).half().to(device)
|