This commit is contained in:
lllyasviel
2024-01-30 13:36:38 -08:00
parent 4b670d2e65
commit ce07ae6895
4 changed files with 9 additions and 17 deletions

View File

@@ -935,9 +935,9 @@ class ControlNetUiGroup(object):
else None,
)
is_hwc, is_png = judge_image_type(result)
is_image = judge_image_type(result)
if not is_hwc:
if not is_image:
result = img
result = external_code.visualize_inpaint_mask(result)

View File

@@ -411,6 +411,4 @@ def crop_and_resize_image(detected_map, resize_mode, h, w):
def judge_image_type(img):
is_image_hw3or4 = isinstance(img, np.ndarray) and img.ndim == 3 and int(img.shape[2]) in [3, 4]
is_png = is_image_hw3or4 and int(img.shape[2]) == 4
return is_image_hw3or4, is_png
return isinstance(img, np.ndarray) and img.ndim == 3 and int(img.shape[2]) in [3, 4]