Extensions/ComfyUI-WJNodes
ComfyUI Extension

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.

By 807502278·Created 2 years ago·Updated 12 months ago· 21
807502278/ComfyUI-WJNodes
Nodes86
On cloudLocal install
CategoryWJNode/ImageEdit/ImageCrop, WJNode/Math
Stars21
Updated12 months ago

Nodes (86)

Accurate mask clipping

Find the exact bounding box of a mask, and optionally crop to it

WJNode/ImageEdit/ImageCrop
adv crop

Expand, crop, fill, and even move an image using four numbers

WJNode/ImageEdit/ImageCrop
any math

One expression, up to four inputs, image/mask/value out

WJNode/Math
any math v2

Write expressions across ten inputs, get images, masks, or values back

WJNode/Math
Any Pipe

Bundle six wires into one to keep a big workflow readable

WJNode/Other-node
ApplyEasyOCR_batch

Find text across a whole image batch, get a mask and the text back

WJNode/Other-plugins/EasyOCR
Audio Batch Edit

Merge audio inputs, then slice a range out by index

WJNode/Audio
Audio Crop Batch

Trim by seconds, not by batch index — and reverse it by accident if you're not careful

WJNode/Audio
AudioDuration wan

Turn a time or an audio clip into a Wan-safe frame count

WJNode/Audio
Audio MergeBatch To Channel

Collapse up to four audio inputs into one

WJNode/Audio
audio resample

Change the sample rate, or fake a speed change without it

WJNode/Audio
audio scale

Stretch or squeeze a clip's duration by a plain multiplier

WJNode/Audio
Batch Average

Slice an image or mask batch into even chunks and pick one

WJNode/ImageEdit/Batch
bbox restore mask

Put an Impact Pack cropped mask back where it belongs

WJNode/Other-plugins/ImpackPack
Bilateral Filter

Smooth out banding without smearing your edges

WJNode/ImageEdit
Color check Name

Filter segmented color data by how close it is to a target color

WJNode/ImageEdit/Color
Color Data Break

Turn segmented color data into a usable prompt string

WJNode/ImageEdit/Color
color segmentation

Turn an ADE20K-style color-block image into a usable mask

WJNode/ImageEdit/Color
color segmentation v2

Pick masks by tag name instead of by color list

WJNode/ImageEdit/Color
ComfyUI Path Out

Read your ComfyUI folder paths at runtime instead of hardcoding them

WJNode/Path
Composite Application pro

Choose which layer your settings actually apply to

WJNode/ImageBlend/options_adv
Composite Basic

The starting node for WJNodes' modular image-blend settings

WJNode/ImageBlend/options
Composite Batch

Reconcile mismatched batch sizes before you composite

WJNode/ImageBlend/options
Composite Canvas adv

Set what's behind everything before you composite

WJNode/ImageBlend/options_adv
Composite Coordinate

Position, scale, and flip a layer before it composites

WJNode/ImageBlend/options
Composite Global adv

Swap which layer is on top without rewiring your graph

WJNode/ImageBlend/options_adv
Composite Mask

Pick what drives the blend, and what comes back out

WJNode/ImageBlend/options
Composite Merge pro

Combine two settings chains into one (carefully)

WJNode/ImageBlend/options_adv
Composite Other

The leftover-settings node — alpha flip and chain reset

WJNode/ImageBlend/options_adv
Composite Scale

Fit, cover, or stretch your layer to the canvas

WJNode/ImageBlend/options
crop by bboxs

Crop an image batch to bounding boxes, all sized the same

WJNode/ImageEdit/ImageCrop
crop data CoordinateSmooth

Stop a tracked crop region from jittering

WJNode/ImageEdit/mask_crop
crop data edit

Swap in replacement images and control paste-back feathering

WJNode/ImageEdit/mask_crop
Cutting video

Extract the frame ranges Detecting videos mask found

WJNode/video/slicing
del file

Check whether a file exists, and optionally delete it — carefully

WJNode/Path
Detecting videos mask

Find the continuous segments in a tracked video

WJNode/video/slicing
Determine Type

Find out what's actually flowing down a wire

WJNode/Other-node
filter DensePose color

Pick exactly which body parts your DensePose mask covers

WJNode/ImageEdit/Color
Folder Operations CH

Create, delete, check, or move folders from inside your graph

WJNode/Path
get image data

Pull batch, width, height, channels straight out of an image

WJNode/GetData
get image ratio

Turn an image's dimensions into a usable aspect-ratio string

WJNode/GetData
Graphics Detection Reference

A quick GPU benchmark, right inside ComfyUI

WJNode/Other-node
ImageCompositeMask Adv

A smarter image composite node that handles RGBA and batches for you

WJNode/ImageBlend
image math

Add, subtract, multiply, or AND two images or masks

WJNode/ImageEdit
image math value

Deprecated — here's what it does and why to use the v1 replacement

WJNode/ImageEdit
image scale pixel option

The advanced settings panel for image scale pixel v2

WJNode/ImageEdit/ratio
image scale pixel v2

Resize by target megapixels, the way Wan video actually wants it

WJNode/ImageEdit/ratio
image url download

Pull images straight off the web into your graph

WJNode/ImageFile
invert channel adv

Split, invert, and reassemble image channels

WJNode/ImageEdit
ListMerger

Combine two image lists into one batch

WJNode/ImageEdit
load color config

The color lookup behind DensePose and ADE20K masking

WJNode/ImageEdit/Color
load ColorName config

Load and filter a named-color lookup table

WJNode/ImageEdit/Color
load_EasyOCR_model

Load OCR weights once, reuse them across every OCR call

WJNode/Other-plugins/EasyOCR
Load Image Adv

The ComfyUI loader that hands back the file path

WJNode/ImageFile
Load Image From Path

Skip the input folder, point straight at a file

WJNode/ImageFile
load torchvision model

A ResNet-family loader for image similarity, not generation

WJNode/Other-plugins/Detection
mask and mask math

Combine two masks with add, subtract, multiply, or intersect

WJNode/ImageEdit/MaskEdit
maskCompositeMask Adv

Layering multiple masks together, batches and all

WJNode/ImageBlend
mask crop option Basic

The config node behind WJNode's mask-cropping

WJNode/ImageEdit/mask_crop
mask crop option SmoothCrop

Stopping your crop box from jittering across video frames

WJNode/ImageEdit/mask_crop
mask crop square

Crop to a mask, work at full res, paste it back

WJNode/ImageEdit/mask_crop
Mask Detection

Check if a mask is actually empty before you waste a sampling pass on it

WJNode/GetData
mask line mapping

A Levels adjustment for masks that stretches contrast automatically

WJNode/ImageEdit/MaskEdit
mask select mask

Pick the masks that overlap a region, drop the rest

WJNode/ImageEdit/MaskEdit
QwenImage ratio

Pick a supported aspect ratio and resize straight to it

WJNode/ImageEdit/ratio
Random Select Prompt

A reproducible random picker for a list of prompts

WJNode/Prompt
ratio selector

One dropdown, seven aspect ratios, wire it anywhere

WJNode/ImageEdit/ratio
Robust Imager Merge

Stitch two images side by side without fighting mismatched sizes

WJNode/ImageEdit
Run torchvision model

Turn two images into a similarity score

WJNode/Other-plugins/Detection
run yolo bboxs

Batch YOLO detection using Impact Pack's own detector

WJNode/Other-plugins/ImpackPack
run yolo bboxs v2

The batched YOLO detector, now with device control

WJNode/Other-plugins/ImpackPack
Sam2AutoSegmentation data

Kijai's auto-segmenter, plus the coordinates SAM2 video keying needs

WJNode/Other-plugins/SAM2
Save Image Out

Save a file and get its path back, in one node

WJNode/ImageFile
Save Image To Path

Writing to an exact file, not ComfyUI's numbered output folder

WJNode/ImageFile
SaveMP4

Turn a frame batch into an actual MP4, audio and all

WJNode/video/video_file
SaveMP4 batch

Saving multiple video clips at once, not one big video

WJNode/video/video_file
SegmDetectorCombined batch

Impact Pack's detector mask, batched across a whole video

WJNode/Other-plugins/ImpackPack
SelectBatch paragraph

Grab a contiguous slice of a batch by start index and length

WJNode/ImageEdit/Batch
Select Batch v2

Pick, repeat, and reorder frames in a batch by index

WJNode/ImageEdit/Batch
Select Images Batch

Pick exact frames out of a batch, and get the rejects too

WJNode/ImageEdit/Batch
Split Path

Pull the drive, folder, filename, and extension out of a path string

WJNode/Path
Str Append

Glue a prefix and suffix onto anything to build a string

WJNode/Path
Video Fade

Crossfade two video clips together instead of a hard cut

WJNode/video/merge
Video MaskBasedSplit

Cut a video into segments wherever the mask goes empty

WJNode/video/slicing
Video OverlappingSeparation test

Split one video into two overlapping halves to test seam continuity

WJNode/video/merge
WAS Mask Fill Region batch

Fill the holes in a mask, now with batch support

WJNode/Other-plugins/WAS
Readme

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

  1. Clone or download this repository to your ComfyUI custom_nodes directory:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git
  1. Install dependencies (optional, most are already included in ComfyUI):
cd ComfyUI-WJNodes
pip install -r requirements.txt