From 284dec176b184578330c532f1483c90fe00a9cd9 Mon Sep 17 00:00:00 2001 From: Martin Rizzo Date: Thu, 30 Jul 2026 21:40:07 -0300 Subject: [PATCH] feat: Add enable_filters toggle to Basic Image Filters node The commit introduces an `enable_filters` switch to the "Basic Image Filters" node. While individual filters can still be disabled by setting them to 'none', this new master switch allows users to quickly activate or deactivate all configured filters with a single click. --- nodes/basic_image_filters.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/nodes/basic_image_filters.py b/nodes/basic_image_filters.py index fb1af49..99c914a 100644 --- a/nodes/basic_image_filters.py +++ b/nodes/basic_image_filters.py @@ -40,10 +40,14 @@ class BasicImageFilters(io.ComfyNode): search_aliases=["decode", "decode latent", "latent to image", "render latent"], inputs=[ io.Image.Input ("images"), - io.Boolean.Input ("auto_contrast", + io.Boolean.Input ("enable_auto_contrast", tooltip="When enabled, automatically adjusts the dynamic range of the " "image to fix washed-out tones and optimize contrast boundaries." ), + io.Boolean.Input ("enable_filters", + tooltip="When enabled, applies the color correction filters configured below. " + "If disabled, all filter selections and adjustments are bypassed." + ), Separator.Input("divider1", mode="divider"),#-------------------------------------- io.Combo.Input ("filter_1", options=["none", "bw", "color", "color_twist", "intensity_1", "intensity_2", ], @@ -53,7 +57,7 @@ class BasicImageFilters(io.ComfyNode): tooltip="The calibration offset for the selected filter. " "This value has a range from -0.5 to 0.5 with 0.0 as the " "default ideal baseline balance." - ), + ), Separator.Input("divider2", mode="spacer"),#-------------------------------------- io.Combo.Input ("filter_2", options=["none", "bw", "color", "color_twist", "intensity_1", "intensity_2", ], @@ -63,7 +67,7 @@ class BasicImageFilters(io.ComfyNode): tooltip="The calibration offset for the selected filter. " "This value has a range from -0.5 to 0.5 with 0.0 as the " "default ideal baseline balance." - ), + ), ], outputs=[ io.Image.Output(tooltip="The final filtered image."), @@ -73,21 +77,23 @@ class BasicImageFilters(io.ComfyNode): #__ FUNCTION __________________________________________ @classmethod def execute(cls, - images : torch.Tensor, - filter_1 : str, - filter_1_control: float, - filter_2 : str, - filter_2_control: float, - auto_contrast : bool, + images: torch.Tensor, + enable_auto_contrast: bool, + enable_filters : bool, + filter_1 : str, + filter_1_control : float, + filter_2 : str, + filter_2_control : float, divider1: Any = None, divider2: Any = None, ): images = images.permute(0, 3, 1, 2) - images = cls.apply_filter_to_images(images, filter_1, filter_1_control) - images = cls.apply_filter_to_images(images, filter_2, filter_2_control) + if enable_filters: + images = cls.apply_filter_to_images(images, filter_1, filter_1_control) + images = cls.apply_filter_to_images(images, filter_2, filter_2_control) - if auto_contrast: + if enable_auto_contrast: images = stretch_histogram(images) images = images.permute(0, 2, 3, 1).contiguous()