comfyui_my_img_util Introduction
comfyui_my_img_util is a collection of experimental image-processing nodes for ComfyUI. It gives you a few practical ways to prepare or choose images within a workflow: resize and crop an image, reduce photographic noise, rotate an image, or select one image from several possible inputs.
These nodes can help when an image has the wrong framing, visible grain or colored speckles, needs to be turned, or comes from a workflow with multiple possible image sources. Each node performs a separate task, so you can use the ones that fit your project.
How comfyui_my_img_util Works
In ComfyUI, you connect nodes to pass images through a workflow. The nodes in this extension each take an image—or, in the selector’s case, several possible images—and produce an output for the next step.
- Resize and crop adjusts an image to a target size while keeping its proportions. If some of the image must be cut away, you choose which part to keep centered.
- Denoise looks for image noise and reduces brightness-related grain and colored speckles with separate controls.
- Rotate turns an image by your chosen angle. Any newly exposed space is transparent, and a separate mask identifies that space.
- Select chooses one image from available inputs according to their assigned priorities.
For example, you might first crop an image to improve its composition, then reduce noise before using it elsewhere in your workflow. These are independent tools; you do not need to use them together.
comfyui_my_img_util Features
Image Resize And Crop
This node resizes an image while preserving its aspect ratio—the relationship between its width and height. It also lets you choose the center around which the image is cropped.
That choice matters when the original image and desired output have different shapes. For instance, turning a wide image into a square requires removing part of the sides. By changing the crop center, you can keep the subject in frame rather than accepting a crop centered on the middle of the original image.
<img width="2435" height="1487" alt="Image Resize And Crop node example" src="https://github.com/user-attachments/assets/67b26190-7e23-42d1-a131-516867b674f0" />
OpenCV Denoise (Luma/Chroma)
This node reduces noise using OpenCV’s fastNlMeansDenoisingColored method. It is particularly useful for photographs with the grain and colored speckles often seen at high ISO settings. You can adjust the two kinds of noise separately:
- Luminance noise looks like grain or roughness in the image’s brightness.
- Color noise looks like small patches or speckles of unwanted color, such as red or green.
| Input | What it controls |
|---|---|
image | The image to clean up. |
h_luminance | Strength of luminance-noise reduction. Higher values remove more grain but can also soften fine details. The author gives 1.5–2.5 as a guide. |
h_color | Strength of color-noise reduction. The author notes that this is generally set a little higher than h_luminance. |
search_window | The area searched for similar image patches. A larger value can improve noise reduction in fine areas, but takes more processing time. |
template_window | The size of the patch used to compare image areas for similarity. |
The node outputs a denoised IMAGE. If you want to preserve texture while removing obvious color speckles, try keeping h_luminance modest and adjusting h_color separately. If the result looks too smooth, reduce the denoising strength.
<img width="2238" height="1793" alt="OpenCV Denoise node example" src="https://github.com/user-attachments/assets/2a982667-3c08-4533-a8bb-92890cbc7786" />
Simple Image Rotate
This node rotates an image by a specified angle. A positive angle turns it counterclockwise; a negative angle turns it clockwise. The output image size may change to accommodate the rotated image.
Rotation can expose empty areas around the original image. Rather than filling those areas with a color, the node makes them transparent in its RGBA image output. It also provides a mask that marks the empty areas in white and the original image area in black.
| Input | What it controls |
|---|---|
image | The image to rotate. |
angle | The rotation angle; positive and negative values turn in opposite directions. |
| Output | What you receive |
|---|---|
image | The rotated image, including transparency where rotation creates gaps. |
mask | An image identifying those gaps: white for empty areas and black for the original image area. |
The mask can help you identify which parts of the rotated result were not present in the source image.
Simple Image Rotate node example
Auto Image Selector
This node chooses one image from up to four candidate inputs. You assign each candidate a rank; lower rank numbers have higher priority. This is useful when a workflow has multiple possible image sources and you want the node to select one automatically.
| Input | What it controls |
|---|---|
image1–image4 | Optional images to consider for selection. |
rank1–rank4 | Optional priorities for the corresponding images. The minimum rank is 1, and smaller numbers have higher priority. |
ng_image | An optional image used for exclusion. Any candidate that matches it exactly is removed from consideration. |
The node outputs the selected image and its rank. For example, you could give your preferred image rank 1 and an alternative rank 2. If a candidate exactly matches ng_image, it will not be selected.
Auto Image Selector node example
Troubleshooting comfyui_my_img_util
My denoised image looks too soft. What should I change?
Lower h_luminance and compare the result with your original image. Increasing denoising strength can remove real details along with grain. Adjust h_color separately if colored speckles are still visible.
Denoising takes longer than expected. What can I try?
Try a smaller search_window. A larger search area takes more processing time.
Why are there transparent areas after I rotate an image?
They are spaces exposed when the image turns. This is expected: the rotated image marks them as transparent, while the mask shows them in white.
Why did the image dimensions change after rotation?
The node may change the output size to accommodate the rotated image.
Why wasn’t an image selected by Auto Image Selector?
Check that the image is connected as a candidate, review its rank relative to the other candidates, and check whether it exactly matches ng_image. Lower rank numbers have higher priority, while an exact match to ng_image is excluded.
Learn More about comfyui_my_img_util
The node images above show the author’s examples of each feature. If you are new to a node, start with its example image, then change one setting at a time in your own workflow so you can see how that setting affects the result.
