ComfyUI-WJNodes
Ready to use upon download. No need to install dependencies for the time being. If there are new functions or suggestions, please provide feedback. Attention! The delfile node is not recommended for use on servers. I am not responsible for any losses incurred.
Nodes (86)
Find the exact bounding box of a mask, and optionally crop to it
Expand, crop, fill, and even move an image using four numbers
One expression, up to four inputs, image/mask/value out
Write expressions across ten inputs, get images, masks, or values back
Bundle six wires into one to keep a big workflow readable
Find text across a whole image batch, get a mask and the text back
Merge audio inputs, then slice a range out by index
Trim by seconds, not by batch index — and reverse it by accident if you're not careful
Turn a time or an audio clip into a Wan-safe frame count
Collapse up to four audio inputs into one
Change the sample rate, or fake a speed change without it
Stretch or squeeze a clip's duration by a plain multiplier
Slice an image or mask batch into even chunks and pick one
Put an Impact Pack cropped mask back where it belongs
Smooth out banding without smearing your edges
Filter segmented color data by how close it is to a target color
Turn segmented color data into a usable prompt string
Turn an ADE20K-style color-block image into a usable mask
Pick masks by tag name instead of by color list
Read your ComfyUI folder paths at runtime instead of hardcoding them
Choose which layer your settings actually apply to
The starting node for WJNodes' modular image-blend settings
Reconcile mismatched batch sizes before you composite
Set what's behind everything before you composite
Position, scale, and flip a layer before it composites
Swap which layer is on top without rewiring your graph
Pick what drives the blend, and what comes back out
Combine two settings chains into one (carefully)
The leftover-settings node — alpha flip and chain reset
Fit, cover, or stretch your layer to the canvas
Crop an image batch to bounding boxes, all sized the same
Stop a tracked crop region from jittering
Swap in replacement images and control paste-back feathering
Extract the frame ranges Detecting videos mask found
Check whether a file exists, and optionally delete it — carefully
Find the continuous segments in a tracked video
Find out what's actually flowing down a wire
Pick exactly which body parts your DensePose mask covers
Create, delete, check, or move folders from inside your graph
Pull batch, width, height, channels straight out of an image
Turn an image's dimensions into a usable aspect-ratio string
A quick GPU benchmark, right inside ComfyUI
A smarter image composite node that handles RGBA and batches for you
Add, subtract, multiply, or AND two images or masks
Deprecated — here's what it does and why to use the v1 replacement
The advanced settings panel for image scale pixel v2
Resize by target megapixels, the way Wan video actually wants it
Pull images straight off the web into your graph
Split, invert, and reassemble image channels
Combine two image lists into one batch
The color lookup behind DensePose and ADE20K masking
Load and filter a named-color lookup table
Load OCR weights once, reuse them across every OCR call
The ComfyUI loader that hands back the file path
Skip the input folder, point straight at a file
A ResNet-family loader for image similarity, not generation
Combine two masks with add, subtract, multiply, or intersect
Layering multiple masks together, batches and all
The config node behind WJNode's mask-cropping
Stopping your crop box from jittering across video frames
Crop to a mask, work at full res, paste it back
Check if a mask is actually empty before you waste a sampling pass on it
A Levels adjustment for masks that stretches contrast automatically
Pick the masks that overlap a region, drop the rest
Pick a supported aspect ratio and resize straight to it
A reproducible random picker for a list of prompts
One dropdown, seven aspect ratios, wire it anywhere
Stitch two images side by side without fighting mismatched sizes
Turn two images into a similarity score
Batch YOLO detection using Impact Pack's own detector
The batched YOLO detector, now with device control
Kijai's auto-segmenter, plus the coordinates SAM2 video keying needs
Save a file and get its path back, in one node
Writing to an exact file, not ComfyUI's numbered output folder
Turn a frame batch into an actual MP4, audio and all
Saving multiple video clips at once, not one big video
Impact Pack's detector mask, batched across a whole video
Grab a contiguous slice of a batch by start index and length
Pick, repeat, and reorder frames in a batch by index
Pick exact frames out of a batch, and get the rejects too
Pull the drive, folder, filename, and extension out of a path string
Glue a prefix and suffix onto anything to build a string
Crossfade two video clips together instead of a hard cut
Cut a video into segments wherever the mask goes empty
Split one video into two overlapping halves to test seam continuity
Fill the holes in a mask, now with batch support
ComfyUI-WJNodes
- This is a simple node package that I use myself. If there are new functions or suggestions, please provide feedback.
- If you want to use modified versions of other nodes, you need to install their corresponding dependencies
Node list:
- ImageFile: WJNode/ImageFile
- ✅
Load_Image_From_Path: Load image from path - ✅
Save_Image_To_Path: Save image by overwriting the path - ✅
Save_Image_Out: Save image to output and output the path - ✅
Load_Image_Adv: Load image with mask inversion and path output, supports multiple formats (jpg, png, jpeg, webp, tiff, bmp, gif, ico, svg) - ✅
image_url_download: Download images from URLs with configurable timeout, supports batch processing
- ✅
- ImageEdit: WJNode/ImageEdit
- ✅
invert_channel_adv: Invert/separate image channels, RGBA to mask batch, replace channels, any channel to RGBA - ✅
ListMerger: Merge multiple image lists into a single batch - ✅
Bilateral_Filter: Image/Mask Bilateral Filtering: Can repair layered distortion caused by color or brightness scaling - ✅
image_math: Image mathematical operations with expression support - ✅
image_math_value: Image and value mathematical calculations - ✅
Robust_Imager_Merge: Advanced image merging with robust handling - ✅
image_scale_pixel_v2: Advanced image scaling by total pixels with alignment, cropping, and bbox filling options - ✅
image_scale_pixel_option: Generate advanced options for image_scale_pixel_v2 node
- ✅
- Crop: WJNode/ImageEdit/image_crop
- ✅
adv_crop: Advanced cropping: can quickly crop/expand/move/flip images, can output background masks and custom filling - ✅
Accurate_mask_clipping: Accurately find mask boundaries and optionally crop to those boundaries - ✅
crop_by_bboxs: Crop images using bounding box data
- ✅
- Mask Crop: WJNode/ImageEdit/mask_crop
- ✅
mask_crop_square: Square cropping based on mask data - ✅
mask_crop_option_SmoothCrop: Smooth cropping with advanced options - ✅
mask_crop_option_Basic: Basic mask cropping options - ✅
crop_data_edit: Edit and modify crop data - ✅
crop_data_CoordinateSmooth: Coordinate smoothing for crop data
- ✅
- Mask Editing: WJNode/ImageEdit/MaskEdit
- ✅
mask_select_mask: Mask selection within a mask batch (intersection represents selection) - 🟩
coords_select_mask: Coordinate selection of masks, used to assist SAM2 video keying (under development) - ✅
mask_line_mapping: Mask line mapping, can automatically calculate maximum and minimum values when input is -1 or 256 - ✅
mask_and_mask_math: Mask to mask operations, supports addition/subtraction/intersection/multiplication operations,
Adjustable cv2 and torch modes, if cv2 is not installed, automatically switches to torch
- ✅
- Math: WJNode/Math
- ✅
any_math: Any data calculation, supports pure data input such as images/values/arrays, and outputs images or any data type - ✅
any_math_v2: Support arbitrary data calculation with more inputs and 3 sets of outputs
- ✅
- Batch: WJNode/Batch
- ✅
Select_Images_Batch: Batch selection and recombination of images/masks with index support - ✅
Select_Batch_v2: Advanced batch selection with loop, limit, and processing options - ✅
SelectBatch_paragraph: Paragraph-based batch selection - ✅
Batch_Average: Average cutting of image/mask batches with division and completion options
- ✅
- Color: WJNode/Color
- ✅
load_color_config: Load color configuration for color block to mask, supports ADE20K preprocessing color data - ✅
color_segmentation: Color block to mask conversion, supports ADE20K and SAM2 data preprocessing - ✅
color_segmentation_v2: Enhanced color block to mask v2, uses keys in color configuration to select masks - ✅
filter_DensePose_color: Filter DensePose color data - ✅
load_ColorName_config: Load color name configuration - ✅
Color_check_Name: Check color names and filter color data - ✅
Color_Data_Break: Break down color data into components
- ✅
- Video Merge: WJNode/video/merge
- ✅
Video_fade: Two video segments can choose two ways to fade in and out - ✅
SaveMP4: Save single video as MP4 format - ✅
SaveMP4_batch: Save video batch as MP4 format - ✅
Video_MaskBasedSplit: Split video based on mask data - ✅
Detecting_videos_mask: Detect masks in video sequences - ✅
Cutting_video: Cut video sequences based on segment data - ✅
Video_OverlappingSeparation_test: Test overlapping separation in videos
- ✅
- GetData: WJNode/GetData
- ✅
Mask_Detection: Mask detection: detect whether there is a mask, detect whether it is all hard edges,
detect whether the mask is pure white/pure black/pure gray and output values 0-255 - ✅
get_image_data: Obtain image size data from images/masks (batch/width/height/channels/shape) - ✅
get_image_ratio: Obtain image aspect ratio data (max/min dimensions, ratio float/string, ratio classification)
- ✅
- Other Functions: WJNode/Other-functions
- ✅
Any_Pipe: Group any data, known bug: nested grouping will split - ✅
Determine_Type: Display data type and determine data characteristics
- ✅
- Other: WJNode/Other
- 🟩Load value feature recognition model (e.g., nsfw, aesthetic score, AI value, time)
- 🟩Input recognition model and image batch, output batch and corresponding feature values
- 🟩Sort image batches through specified arrays (e.g., feature value arrays)
- Detection: WJNode/Other-plugins/Detection
- ✅
load_torchvision_model: Load pre-trained torchvision models (ResNet, DenseNet, etc.) for feature extraction - ✅
Run_torchvision_model: Calculate similarity between images using loaded models and various distance metrics
- ✅
- Hardware: WJNode/Other-node
- ✅
Graphics_Detection_Reference: Test GPU computing capabilities including hardware info, precision tests, memory bandwidth,
operator performance, and AI benchmarks with RTX 4090 comparison
- ✅
- WAS Plugins: WJNode/Other-plugins/WAS (To use the following nodes, you must install WAS plugin)
- ✅
WAS_Mask_Fill_Region_batch: Optimize WAS plugin's WAS_Mask_Fill_Region (mask cleanup) to support batches
Thanks to @WASasquatch
- ✅
- Impact Pack Plugins: WJNode/Other-plugins (To use the following nodes, you must install Impact Pack plugin)
- ✅
SegmDetectorCombined_batch: Optimize impact-pack plugin's SegmDetectorCombined (segm detection mask) to support batches
Thanks to @ltdrdata - ✅
bbox_restore_mask: Add impact-pack plugin's seg decomposition, restore cropped images through cropping data (SEG editing) - ✅
Sam2AutoSegmentation_data: Add Sam2AutoSegmentation (kijai) node's color list/coordinate output, used to assist SAM2 video keying
Thanks to @kijai - ✅
run_yolo_bboxs: Run YOLO detection and return bounding boxes - ✅
run_yolo_bboxs_v2: Enhanced YOLO detection with additional features
- ✅
- EasyOCR Plugins: WJNode/Other-plugins/EasyOCR (To use the following nodes, you must install EasyOCR)
- ✅
load_EasyOCR_model: Load OCR models separately for faster operation and model caching - ✅
ApplyEasyOCR_batch: Modify OCR recognition nodes to support batch processing
Thanks to @prodogape
- ✅
- Path: WJNode/Path
- ✅
ComfyUI_Path_Out: Output ComfyUI common paths (root, output/input, plugins, models, cache, Python environment) - ✅
Str_Append: Add prefix/suffix to strings (reference KJNode) - ✅
del_file: Detect whether file or path exists, whether to delete file, operation requires input signal, deletion requires write permission - ✅
Split_Path: Path slicing, input path, output: disk symbol/path/file/extension + detect whether it is a file - ✅
Folder_Operations_CH: Folder operations with Chinese support
- ✅
Models Directory (Optional)
These models are automatically downloaded to ComfyUI's models directory and shared with other plugins:
models/
├── torchvision/ # Torchvision models for similarity detection
│ └── resnet/
│ ├── resnet50-11ad3fa6.pth
│ └── ...
├── EasyOCR/ # OCR models
│ ├── craft_mlt_25k.pth
│ ├── latin_g2.pth
│ └── zh_sim_g2.pth
└── sam2/ # SAM2 models (if using SAM2 features)
├── sam2_hiera_small.safetensors
└── ...
Installation
- Clone or download this repository to your ComfyUI custom_nodes directory:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git
- Install dependencies (optional, most are already included in ComfyUI):
cd ComfyUI-WJNodes
pip install -r requirements.txt