ComfyUI-Light-Tool
An awesome light image processing tool nodes for ComfyUI.
Nodes (55)
Sticking a solid color behind your transparent renders
Same solid backdrop, but now with margins and auto-square
Force any image into a target ratio with centered padding
Auto-crop to the transparent subject — dead space, gone
Arithmetic inside your graph — all three output types at once
Force a number into the type your node insists on
Cut N pixels off each edge
Turn a JSON string into a real object your graph can use
How many images are in this batch? Ask the tensor.
Width, height, and file size — as numbers your graph can branch on
The long edge or the short edge, as a single number
Turn '#FF8800' into three numbers your graph can actually use
Side-by-side and stacked grids in one node, no math required
Turn a mask into an actual cutout with real transparency
Alpha-composite two images with an explicit mask — and a size gotcha
Pull one color channel out of an image and make it a mask
A text box that does exactly one thing — and strips your whitespace
Four text fields, one list output — for batch prompt plumbing
Inverts white and black — but it's an IMAGE node, and that's the catch
A yes/no for 'does this image have alpha?' — if it arrived with alpha at all
Pull a value out of JSON by dotted path, arrays included
A Load Image that can actually keep your transparency
Load images straight from a URL — several at once, if you like
Load a whole folder of images in one go, with slicing
Read a ComfyUI PNG's embedded workflow straight off the web
Pull a video from a URL into your ComfyUI input folder
Auto-crop the empty border off a mask in one node
Outline your mask's edges in any color — but read the fine print
Turn a mask into a real transparent cutout (white = kept)
The type adapter every mask workflow eventually needs
Dilate and erode — the mask cleanup you keep needing
Two images melted into one, eight sliders deep
Embed a video player in your graph and watch the clip without leaving it
Exact resize with real control over the interpolation
A 'fit within this box' resize that never upscales
The \"make sure it's big enough\" resize node that only scales up
Scale an image by a multiplier — like zooming a photo
Resize by one fixed side, keep the aspect ratio intact
Three ints in, one #RRGGBB out — the color-converter you'll forget you have
Adding an alpha channel when a node demands four
Flattening RGBA to RGB — and what you're actually losing
The 10-second fix for VAE dimension errors
Stuff your own data into a PNG's metadata and save it
Push files to Alibaba's OSS bucket and get back a URL
A downloader wearing a 'Save Video' badge — know what it's not
Fit any image into any box — stretch, fill, or pad, decided by one dropdown
Turn any JSON object into a string your text nodes can hold
The universal debug node — dump any value on the graph and pass it through
Read your strings without squinting at wire colors
Watermarks and stamps without a mask node in sight
Two strings, one delimiter, and a hidden batch superpower
A flat canvas in one node — and no, that default red is not a mistake
Join up to eight strings plus a whole list — the pack's one-stop string splicer
Find-and-replace for your prompts — regex included
A no-model upscaler with a sharpen toggle — and it knows when not to use it
ComfyUI-Light-Tool
English / 简体中文
A suite of lightweight and practical custom tool nodes for ComfyUI to enhance workflow efficiency and flexibility.
📦 Installation Guide
1. Manual Installation
# Navigate to the custom_nodes directory of ComfyUI
cd ComfyUI/custom_nodes
# Clone this repository
git clone https://github.com/ihmily/ComfyUI-Light-Tool.git
pip install -r requirements.txt
# Restart ComfyUI
2. Installation via ComfyUI-Manager
Automatic installation through ComfyUI-Manager:
- Go to the Manager panel in the ComfyUI interface.
- Under the Custom Nodes tab, search for
ComfyUI-Light-Tool. - Click Install and restart ComfyUI.
🎨 Functional Categories and Node List
1. Image Processing
1.1 Load Images
| Node Name | Function Description | | ----------------------- | --------------------------------------------------------------------------------- | | Load Image | Load local image files (supports preserving RGBA transparency). | | Load Image From URL | Download and load images from a URL (supports comma-separated multiple URLs). | | Load Image List | Batch load images from a directory (supports start index and count configuration).|
1.2 Image Compositing & Overlaying
| Node Name | Function Description | | ---------------------------------- | --------------------------------------------------------------------------------- | | Image Overlay | Overlay one image onto another (requires mask, image sizes must match). | | Simple Image Overlay | Freely overlay images (supports centering or custom offset positioning). | | Image Concat | Concatenate up to 5 images horizontally or vertically. | | Add Solid Color Background | Add a solid color background to transparent images (supports HEX or RGB color). | | Add Solid Color Background V2 | Add a solid color background with configurable margins and auto-square mode. | | Solid Color Background | Generate a custom solid color background image (supports RGB / RGBA / grayscale L).|
1.3 Image Scaling & Resizing
| Node Name | Function Description | | ----------------------------- | --------------------------------------------------------------------------------- | | Resize Image | Resize image to specified width and height directly. | | Resize Image V2 | Proportionally resize image by a fixed width or height. | | Resize Image By Ratio | Scale image by a ratio coefficient. | | Resize Image By Max Size | Proportionally shrink image to ensure dimensions don't exceed the specified max. | | Resize Image By Min Size | Proportionally enlarge image to ensure dimensions don't fall below the specified min. | | Scale Image | Scale image with multiple modes (AUTO / STRETCH / FILL / PAD). | | Upscale Image | Upscale image with multiple modes, supports sharpening (only applies to upscaling).|
1.4 Image Cropping
| Node Name | Function Description | | -------------------------- | --------------------------------------------------------------------------------------- | | Crop Image | Crop image by left / top / right / bottom margins. | | Safe Image Crop | Crop image from center to the nearest specified multiple (e.g. 64) for VAE compatibility.| | Bounding Box Cropping | Auto-crop based on the minimum bounding rectangle of transparent objects in the image. |
1.5 Mask Operations
| Node Name | Function Description | | ----------------------------------- | --------------------------------------------------------------------------------- | | Image to Mask | Convert a specified color channel (R/G/B/Alpha) of an image into a mask. | | Mask to Image | Convert a mask into a grayscale image. | | Invert Mask | Invert the white and black regions of a mask. | | Extract Transparent Image | Use a mask to extract the foreground, outputting an image with alpha channel. | | Mask Background to Transparent | Convert non-masked regions (non-white areas) in a mask image to transparency. | | Mask Bounding Box Cropping | Crop a mask image based on the bounding rectangle of the mask's valid region. | | Morphological Transform | Perform morphological operations on masks (dilate / erode) with configurable kernel size and iterations. | | Mask Contour Extractor | Extract mask contours and draw them on the image in a specified color. |
1.6 Color Channel Conversion
| Node Name | Function Description | | --------------- | ------------------------------------------- | | RGB to RGBA | Convert an RGB image to RGBA format. | | RGBA to RGB | Convert an RGBA image to RGB format. |
1.7 Image Information
| Node Name | Function Description | | -------------------- | --------------------------------------------------------------- | | Get Image Size | Get the width, height, and file size (bytes) of an image. | | Get Images Count | Get the number of images in a batch. | | Get Side Length | Get the pixel length of the longest or shortest side of an image.| | Is Transparent | Detect whether an image contains transparent regions (configurable threshold). |
2. Text Processing
| Node Name | Function Description | | ----------------------------------- | --------------------------------------------------------------------------------- | | Input Text | Input a single text string. | | Input Text List | Input up to 4 text strings combined into a list output. | | Connect Text Strings | Merge a list and multiple strings into one string with a delimiter. | | Simple Connect Text Strings | Simply connect two strings with a delimiter (supports batch list processing). | | Text Replace | Replace text content (supports plain matching and regex, case-insensitive option).| | Show Text | Display text content in the node panel. | | Show Anything | Display any type of data in the node panel (text, numbers, lists, etc.). |
3. Video Related
| Node Name | Function Description | | ----------------------------- | --------------------------------------------------------------------------------- | | Load Video | Download a video from a URL and save it to a directory, returns path and preview URL. | | Preview Video | Input a video URL and embed a preview player in the node panel. | | Save Video | Save a video from a URL to a specified local directory. | | Save Video to Aliyun OSS | Upload a video file (local path or URL) to Aliyun OSS. |
4. Data Processing
| Node Name | Function Description | | ------------------------------ | --------------------------------------------------------------------------------- | | Hex to RGB | Convert a hexadecimal color code to R / G / B integer values. | | RGB to Hex | Convert R / G / B integer values to a hexadecimal color code string. | | Calculate | Perform addition, subtraction, multiplication, division, and modulo on two numbers; outputs string / int / float simultaneously. | | Convert Num Type | Convert a value to integer / float / string type. | | KeyValue | Extract a value from a JSON string by key path (supports dot-notation and array indexing). | | Serialize JSON Object | Serialize a JSON object into a JSON string. | | Deserialize JSON String | Deserialize a JSON string into a JSON object. |
5. Practical Tools
| Node Name | Function Description | | ---------------------------- | --------------------------------------------------------------------------------- | | PhantomTankEffect | Generate a "Phantom Tank" effect image with adjustable offset, grayscale method, etc. | | Save to Aliyun OSS | Upload files (images/videos/etc.) to Aliyun OSS, supports signed URLs. | | Save Metadata | Write metadata (workflow / prompt etc.) into a PNG image and save it. | | Load Metadata From URL | Download an image from a URL and read the metadata embedded in it. |
🛠️ Development and Contribution
- Feedback: Submit issues via GitHub Issues.
- Code Contribution: Fork the repository and submit a Pull Request.
- Documentation Updates: Report any inaccuracies or omissions in the descriptions.
📖 License
This project is licensed under the MIT License.