mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-30 19:21:21 +00:00
i
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user