From a682fc51764ec3eecd5a03e78e2c7e2833bde141 Mon Sep 17 00:00:00 2001 From: lvmin Date: Tue, 18 Apr 2023 09:25:36 -0700 Subject: [PATCH] use cubic is safer --- scripts/controlnet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/controlnet.py b/scripts/controlnet.py index 2ac2e1528c5..f16f02d32f3 100644 --- a/scripts/controlnet.py +++ b/scripts/controlnet.py @@ -640,7 +640,7 @@ def get_pytorch_control(x): def high_quality_resize(x, size): old_size = x.shape[0] * x.shape[1] new_size = size[0] * size[1] - return cv2.resize(x, size, interpolation=cv2.INTER_LANCZOS4 if new_size > old_size else cv2.INTER_AREA) + return cv2.resize(x, size, interpolation=cv2.INTER_CUBIC if new_size > old_size else cv2.INTER_AREA) if resize_mode == external_code.ResizeMode.RESIZE: detected_map = cv2.resize(detected_map, (w, h), interpolation=cv2.INTER_CUBIC)