diff --git a/README.md b/README.md index 0c6138f6..8dc58b64 100644 --- a/README.md +++ b/README.md @@ -428,15 +428,11 @@ class ControlNetExampleForge(scripts.Script): # Below are two methods to preprocess images. # Method 1: do it in your own way - canny_image_1 = cv2.cvtColor(cv2.Canny(input_image, 100, 200), cv2.COLOR_GRAY2RGB) + canny_image = cv2.cvtColor(cv2.Canny(input_image, 100, 200), cv2.COLOR_GRAY2RGB) # Method 2: use built-in preprocessor - from modules_forge.shared import shared_preprocessors - canny_image_2 = shared_preprocessors['canny'](input_image, 100, 200) - - # The two methods will give your same result - assert np.allclose(canny_image_1, canny_image_2) - canny_image = canny_image_1 + # from modules_forge.shared import shared_preprocessors + # canny_image = shared_preprocessors['canny'](input_image, 100, 200) # Output preprocessor result. Now called every sampling. Cache in your own way. p.extra_result_images.append(canny_image) diff --git a/extensions-builtin/sd_forge_controlnet_example/scripts/sd_forge_controlnet_example.py b/extensions-builtin/sd_forge_controlnet_example/scripts/sd_forge_controlnet_example.py index 6c424619..64696724 100644 --- a/extensions-builtin/sd_forge_controlnet_example/scripts/sd_forge_controlnet_example.py +++ b/extensions-builtin/sd_forge_controlnet_example/scripts/sd_forge_controlnet_example.py @@ -80,15 +80,11 @@ class ControlNetExampleForge(scripts.Script): # Below are two methods to preprocess images. # Method 1: do it in your own way - canny_image_1 = cv2.cvtColor(cv2.Canny(input_image, 100, 200), cv2.COLOR_GRAY2RGB) + canny_image = cv2.cvtColor(cv2.Canny(input_image, 100, 200), cv2.COLOR_GRAY2RGB) # Method 2: use built-in preprocessor - from modules_forge.shared import shared_preprocessors - canny_image_2 = shared_preprocessors['canny'](input_image, 100, 200) - - # The two methods will give your same result - assert np.allclose(canny_image_1, canny_image_2) - canny_image = canny_image_1 + # from modules_forge.shared import shared_preprocessors + # canny_image = shared_preprocessors['canny'](input_image, 100, 200) # Output preprocessor result. Now called every sampling. Cache in your own way. p.extra_result_images.append(canny_image)