Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > comfyui_my_img_util > OpenCV Denoise (Luma/Chroma)

ComfyUI Node: OpenCV Denoise (Luma/Chroma)

Class Name

OpenCVDenoiseColored

Category
Image/Post-Processing
Author
sugarkwork (Account age: 0days)
Extension
comfyui_my_img_util
Latest Updated
2026-02-13
Github Stars
0.0K

How to Install comfyui_my_img_util

Install this extension via the ComfyUI Manager by searching for comfyui_my_img_util
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfyui_my_img_util in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

OpenCV Denoise (Luma/Chroma) Description

Reduces image grain and color speckles with OpenCV denoising while preserving edges and texture.

OpenCV Denoise (Luma/Chroma):

OpenCVDenoiseColored reduces visible grain and colored speckles in an image using OpenCV’s fast non-local means denoising method. The method compares small areas of an image with other areas that look similar, helping smooth noise while retaining more recognizable edges and texture than simple blurring. It treats brightness noise and color noise separately, so you can address one without applying the same strength to the other. Stronger denoising can also soften fine details, making a balanced setting important for artwork with delicate textures. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))

OpenCV Denoise (Luma/Chroma) Input Parameters:

image

The IMAGE to denoise. The node processes each image in the incoming batch separately and returns them together in the same order. It expects ordinary three-channel RGB image data in the format used by the image workflow; the source converts each image to an 8-bit OpenCV image before processing. There is no minimum, maximum, or default value for this required input. An empty batch or an image without three color channels cannot be processed by this implementation.

h_luminance

A FLOAT controlling how strongly the method reduces brightness-related noise, such as light and dark grain. Its default is 3.0, its minimum is 0.0, its maximum is 100.0, and its interface step is 0.5. Raising it can clean up more grain but may also remove subtle shading and fine detail; lowering it preserves more detail but may leave noise visible. Start near the default and increase it gradually while checking textured areas and edges. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))

h_color

A FLOAT controlling the strength of color-noise reduction, particularly small, unwanted colored speckles. Its default is 3.0, its minimum is 0.0, its maximum is 100.0, and its interface step is 0.5. Increase it when color speckling remains after brightness grain is acceptable; excessive strength can reduce subtle color variation. This setting acts on color information separately from h_luminance, so the two strengths need not match. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))

search_window

An INT specifying the width, in pixels, of the area searched for similar image patches. Its default is 5, its minimum is 5, its maximum is 50, and its interface step is 2. A larger window gives the method a wider area in which to find similarities, but increases processing time. OpenCV specifies an odd window size; the default and the interface’s step sequence produce odd values, so keep it odd when supplying a value through a connection. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))

template_window

An INT specifying the width, in pixels, of the small patch compared when the method looks for similarities. Its default is 3, its minimum is 3, its maximum is 20, and its interface step is 2. Changing this alters the size of the image details considered during comparison, so test it against the scale of the noise and textures you want to preserve. OpenCV specifies an odd patch size; the default and the interface’s step sequence produce odd values, so keep it odd when supplying a value through a connection. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))

OpenCV Denoise (Luma/Chroma) Output Parameters:

image

The denoised IMAGE result. It contains one processed image for each incoming image, in the same batch order and at the same width and height. The node converts the OpenCV result back to RGB and returns floating-point image values scaled to the usual 0 to 1 range. Because processing passes through 8-bit image data, the result does not retain finer-than-8-bit precision from the input. This is the image to preview or pass to later editing steps.

OpenCV Denoise (Luma/Chroma) Usage Tips:

  • Begin with the node defaults and compare the result with the original at full size. Increase h_luminance in small increments when brightness grain remains; stop when important edges or textures begin to look soft. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))
  • If the main problem is colored speckles, try increasing h_color first while leaving h_luminance near its default. This lets you address color noise without unnecessarily strengthening brightness smoothing. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))
  • Keep search_window small when processing speed matters. Increase it only when the wider search visibly improves the result, because larger search windows take longer to process. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))
  • Try template_window at 3 first, then compare odd sizes such as 5 or 7 on a representative crop containing both noise and fine detail. The patch size changes what the method considers similar; there is no single best value for every image. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))
  • Supply RGB images with three color channels. This implementation does not add an alpha channel to its result, so handle transparency separately if your workflow depends on it.

OpenCV Denoise (Luma/Chroma) Common Errors and Solutions:

RuntimeError: stack expects a non-empty TensorList

  • Explanation: The incoming image batch was empty, so the node had no processed images to combine into its output.
  • Solution: Connect a source that supplies at least one image and check whether an earlier filtering or batch step produced an empty result.

cv2.error: ... Invalid number of channels in input image

  • Explanation: OpenCV could not perform the node’s RGB-to-BGR conversion because an incoming image did not have the expected three color channels. The exact wording may vary by OpenCV version.
  • Solution: Convert grayscale images to RGB before this node. For images with transparency, prepare a three-channel RGB image and manage the alpha channel separately.

cv2.error: ... templateWindowSize ... or ... searchWindowSize ...

  • Explanation: OpenCV expects odd sizes for these windows. A connected value may bypass the odd-number sequence offered by the node’s interface.
  • Solution: Set template_window and search_window to odd integers within their listed ranges, then run the node again. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))

cv2.error: ... fastNlMeansDenoisingColored ...

  • Explanation: OpenCV rejected the image or denoising configuration; its detailed error text depends on the installed version. The underlying function expects an 8-bit, three-channel image, which this node attempts to create from each incoming RGB image. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))
  • Solution: Check that the incoming images have three channels and usable dimensions, then retry with the default window settings. If the error persists, inspect the full OpenCV message for the condition it identifies.

RuntimeError: ... out of memory ... or the process stops during denoising

  • Explanation: Large images or batches can require substantial memory, and a larger search window increases processing time. The exact message depends on where processing runs out of resources. (docs.opencv.org (https://docs.opencv.org/doc/doxygen/html/d1/d79/group__photo__denoise.html?utm_source=openai))
  • Solution: Try one smaller image first, reduce the batch size, and return search_window to its default of 5. Increase image size or the window only after a smaller run succeeds.

OpenCV Denoise (Luma/Chroma) Related Nodes

Go back to the extension to check out more related nodes.
comfyui_my_img_util
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

OpenCV Denoise (Luma/Chroma)