Extensions/ComfyUI-Light-Tool
ComfyUI Extension

ComfyUI-Light-Tool

An awesome light image processing tool nodes for ComfyUI.

By ihmily·Created 2 years ago·Updated 4 months ago· 20
ihmily/ComfyUI-Light-Tool
Nodes55
On cloudLocal install
CategoryComfyUI-Light-Tool/image/compositing, ComfyUI-Light-Tool/image/Resize
Stars20
Updated4 months ago

Nodes (55)

Light-Tool: Add solid color background

Sticking a solid color behind your transparent renders

ComfyUI-Light-Tool/image/compositing
Light-Tool: Add solid color background V2

Same solid backdrop, but now with margins and auto-square

ComfyUI-Light-Tool/image/compositing
Light-Tool: Ratio Padder

Force any image into a target ratio with centered padding

ComfyUI-Light-Tool/image/Resize
Light-Tool: Bounding Box Cropping

Auto-crop to the transparent subject — dead space, gone

ComfyUI-Light-Tool/image/ImageCrop
Light-Tool: Calculate

Arithmetic inside your graph — all three output types at once

ComfyUI-Light-Tool/DataProcessing
Light-Tool: Convert Num Type

Force a number into the type your node insists on

ComfyUI-Light-Tool/DataProcessing
Light-Tool: Crop Image

Cut N pixels off each edge

ComfyUI-Light-Tool/image/Crop
Light-Tool: Deserialize a JSON string

Turn a JSON string into a real object your graph can use

ComfyUI-Light-Tool/DataProcessing
Light-Tool: Get Images Count

How many images are in this batch? Ask the tensor.

ComfyUI-Light-Tool/image/other
Light-Tool: Get Image Size

Width, height, and file size — as numbers your graph can branch on

ComfyUI-Light-Tool/image/ImageInfo
Light-Tool: Get Side Length

The long edge or the short edge, as a single number

ComfyUI-Light-Tool/image/other
Light-Tool: Hex to RGB

Turn '#FF8800' into three numbers your graph can actually use

ComfyUI-Light-Tool/image/Color
Light-Tool: Image Concat

Side-by-side and stacked grids in one node, no math required

ComfyUI-Light-Tool/image/compositing
Light-Tool: Extract Transparent Image

Turn a mask into an actual cutout with real transparency

ComfyUI-Light-Tool/image/compositing
Light-Tool: Image Overlay

Alpha-composite two images with an explicit mask — and a size gotcha

ComfyUI-Light-Tool/image/compositing
Light-Tool: Image to Mask

Pull one color channel out of an image and make it a mask

ComfyUI-Light-Tool/image/mask
Light-Tool: Input Text

A text box that does exactly one thing — and strips your whitespace

ComfyUI-Light-Tool/Text
Light-Tool: Input Text List

Four text fields, one list output — for batch prompt plumbing

ComfyUI-Light-Tool/Text
Light-Tool: Invert Mask

Inverts white and black — but it's an IMAGE node, and that's the catch

ComfyUI-Light-Tool/image/mask
Light-Tool: Is Transparent

A yes/no for 'does this image have alpha?' — if it arrived with alpha at all

ComfyUI-Light-Tool/image/ImageInfo
Light-Tool: Get values from JSON

Pull a value out of JSON by dotted path, arrays included

ComfyUI-Light-Tool/DataProcessing
Light-Tool: Load Image

A Load Image that can actually keep your transparency

ComfyUI-Light-Tool/image/LoadImage
Light-Tool: Load Image From URL

Load images straight from a URL — several at once, if you like

ComfyUI-Light-Tool/image/LoadImage
Light-Tool: Load Image List

Load a whole folder of images in one go, with slicing

ComfyUI-Light-Tool/image/LoadImage
Light-Tool: Load Metadata From URL

Read a ComfyUI PNG's embedded workflow straight off the web

ComfyUI-Light-Tool/image/ImageInfo
Light-Tool: Load Video

Pull a video from a URL into your ComfyUI input folder

ComfyUI-Light-Tool/Video
Light-Tool: Mask Bounding Box Cropping

Auto-crop the empty border off a mask in one node

ComfyUI-Light-Tool/image/ImageCrop
Light-Tool: MaskContourExtractor

Outline your mask's edges in any color — but read the fine print

ComfyUI-Light-Tool/image/ImageInfo
Light-Tool: Mask Background to Transparent

Turn a mask into a real transparent cutout (white = kept)

ComfyUI-Light-Tool/image/mask
Light-Tool: Mask to Image

The type adapter every mask workflow eventually needs

ComfyUI-Light-Tool/image/mask
Light-Tool: Morphological Transform

Dilate and erode — the mask cleanup you keep needing

ComfyUI-Light-Tool/image/transform
Light-Tool: Generate PhantomTankEffect

Two images melted into one, eight sliders deep

ComfyUI-Light-Tool/image/compositing
Light-Tool: Preview Video

Embed a video player in your graph and watch the clip without leaving it

ComfyUI-Light-Tool/Video
Light-Tool: Resize Image

Exact resize with real control over the interpolation

ComfyUI-Light-Tool/image/Resize
Light-Tool: Resize Image By Max Size

A 'fit within this box' resize that never upscales

ComfyUI-Light-Tool/image/Resize
Light-Tool: Resize Image By Min Size

The \"make sure it's big enough\" resize node that only scales up

ComfyUI-Light-Tool/image/Resize
Light-Tool: Resize Image By Ratio

Scale an image by a multiplier — like zooming a photo

ComfyUI-Light-Tool/image/Resize
Light-Tool: Resize Image V2

Resize by one fixed side, keep the aspect ratio intact

ComfyUI-Light-Tool/image/Resize
Light-Tool: RGB to Hex

Three ints in, one #RRGGBB out — the color-converter you'll forget you have

ComfyUI-Light-Tool/image/Color
Light-Tool: RGB To RGBA

Adding an alpha channel when a node demands four

ComfyUI-Light-Tool/image/transform
Light-Tool: RGBa To RGB

Flattening RGBA to RGB — and what you're actually losing

ComfyUI-Light-Tool/image/transform
Light-Tool: Safe Image Crop

The 10-second fix for VAE dimension errors

ComfyUI-Light-Tool/image/Crop
Light-Tool: Save Metadata

Stuff your own data into a PNG's metadata and save it

ComfyUI-Light-Tool/image/ImageInfo
Light-Tool: Save File To Aliyun OSS

Push files to Alibaba's OSS bucket and get back a URL

ComfyUI-Light-Tool/OSS
Light-Tool: Save Video

A downloader wearing a 'Save Video' badge — know what it's not

ComfyUI-Light-Tool/Video
Light-Tool: Scale Image

Fit any image into any box — stretch, fill, or pad, decided by one dropdown

ComfyUI-Light-Tool/image/transform
Light-Tool: Serialize a JSON object

Turn any JSON object into a string your text nodes can hold

ComfyUI-Light-Tool/DataProcessing
Light-Tool: Show Anything

The universal debug node — dump any value on the graph and pass it through

ComfyUI-Light-Tool/Utility
Light-Tool: Show Text

Read your strings without squinting at wire colors

ComfyUI-Light-Tool/Text
Light-Tool: Simple Image Overlay

Watermarks and stamps without a mask node in sight

ComfyUI-Light-Tool/image/compositing
Light-Tool: Simple Connect Text Strings

Two strings, one delimiter, and a hidden batch superpower

ComfyUI-Light-Tool/Text
Light-Tool: SolidColorBackground

A flat canvas in one node — and no, that default red is not a mistake

ComfyUI-Light-Tool/image/compositing
Light-Tool: Connect Text Strings

Join up to eight strings plus a whole list — the pack's one-stop string splicer

ComfyUI-Light-Tool/Text
Light-Tool: Text Replace

Find-and-replace for your prompts — regex included

ComfyUI-Light-Tool/Text
Light-Tool: Upscale Image

A no-model upscaler with a sharpen toggle — and it knows when not to use it

ComfyUI-Light-Tool/image/transform
Readme

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:

  1. Go to the Manager panel in the ComfyUI interface.
  2. Under the Custom Nodes tab, search for ComfyUI-Light-Tool.
  3. 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.