This repo contains some useful tools, especially for improving speed.
Package profile
README
This repo contains some useful tools, especially for improving speed.
Nodes in this pack
63 nodesRelated resources
5 connectionsSources
1 sourceSource excerpts
1 excerptSource context: Repo zhangp365/ComfyUI-utils-nodes
AspectRatioSizeNodeOfUtils
Select aspect ratio (1:1, 9:16, 16:9, 3:4, etc.) and size preset (1k, 2k, 4k) to output corresponding width and height values. Supports "auto" mode to pass through input dimensions directly. Includes divisibility option (none/8/16) to ensure output values are aligned, and batchsize pass-through.
Utils/Numbers · 3 outputs
BooleanControlOutput
This node outputs different values based on a boolean input. If the boolean input is True, it will output the values of truetext, truefloat, trueint, True, and False. If the boolean input is False, it will output the values of falsetext, falsefloat, falseint, False, and True.
Utils/Text · 0 inputs · 7 parameters · 5 outputs
CheckpointLoaderSimpleWithSwitch
Enhanced the official LoadCheckpoint node by integrating three switches. Each switch controls whether a specific component is loaded. When a switch is turned off, the corresponding component will not be loaded. if you use the extra vae and close the model's vae loading, that will save memory.
Utils/Loaders · 0 inputs · 4 parameters · 3 outputs
ColorCorrectOfUtils
This node, ColorCorrectOfUtils, is an extension of the original ColorCorrect node developed by @EllangoK. Added the channels of red, green, and blue adjustment functionalities.
Art Venture/Post Processing · 1 input · 10 parameters · 1 output
ConcatTextOfUtils
This node will concatenate two strings together
Utils/Text · 0 inputs · 4 parameters · 1 output
CropByMaskToSpecificSize
This node is designed to crop the image by the mask to a specific size.
Utils/Mask · 2 inputs · 8 parameters · 4 outputs
DeepfaceAnalyzeFaceAttributes
> Notice: The face detection node depends on TensorFlow 2.17, which is now outdated and may cause compatibility issues. Therefore, it is no longer installed by default. If you need to use this node, please refer to requirements.txt to install the dependencies manually. Users who have previously installed this library are not affected. This node integrates the deepface library to analyze face attributes (gender, race, emotion, age). It analyzes only the largest face in the image and supports processing one image at a time. If the input image is a standard square face image, you can enable the standardsinglefaceimage switch. In this case, the node will skip face detection and analyze the attributes directly. Upon the first run, the node will download the deepface models, which may take some time. > Note: If you encounter the following exception while running the node: > > ValueError: The layer sequential has never been called and thus has no defined input. > > Please set the environment variable TFUSELEGACYKERAS to 1, then restart ComfyUI. > Caution: If you are not using this node, please remove the dependencies in requirements.txt. Otherwise, it will install TensorFlow version 2.17.x.
Utils/Face · 1 input · 6 parameters · 5 outputs
DetectorForNSFW
This node adapts the original model and inference code from nudenet for use with Comfy. A small 10MB default model, 320n.onnx, is provided. If you wish to use other models from that repository, download the ONNX model and place it in the models/nsfw directory, then set the appropriate detectsize. From initial testing, the filtering effect is better than classifier models such as Falconsai/nsfwimagedetection. You can also adjust the confidence levels for various rules such as buttocksexposed to be more lenient or strict. Lower confidence levels will filter out more potential NSFW images. Setting the value to 1 will stop filtering for that specific feature. The outputimage includes the original image and the alternative image or the blank image. detectresult is the result of the detection with json format. filteredimage only includes the image after filtering, if it is just one image and nsfw, it raises an exception in the saveimage node.
Utils/Filter · 2 inputs · 8 parameters · 3 outputs
EmptyConditioning
This node is designed to return an empty conditioning, the size is zero. It can be used to replace the conditioning when the conditioning is not actually needed.
Utils/Conditioning · 0 inputs · 0 parameters · 1 output
FalFunControlVideoRequestNode
This node is designed to use the fal-ai/wan-fun-control model. It can input pose or depth videos along with a reference frame, then generate the resulting video based on the control input.
Utils/Video · 1 input · 16 parameters · 5 outputs
FalImage2VideoRequestNode
This node is designed to generate videos from images using FAL's API. It provides high-quality video generation with various customization options. To use this node, you need to get your FAL API key: - Visit fal.ai - Log in with your account - Go to API keys settings - Create a new API key - Copy the API key for use in the node's input or falconfig.yml
Utils/Video · 1 input · 13 parameters · 5 outputs
FalNanoBananaNode
This node is designed to edit images using FAL's nano-banana models. It supports two models: fal-ai/nano-banana/edit and fal-ai/nano-banana-pro/edit. The node supports uploading up to 4 images or providing image URLs, and can generate multiple images with various aspect ratios, resolutions, and output formats.
Utils/Image · 4 inputs · 10 parameters · 4 outputs
FalVideo2VideoRequestNode
This node is designed to use the fal-ai/wan-22-vace-fun-a14b/pose model. When you input a pose video and an image, it will generate an action video based on the pose sequence.
Utils/Video · 3 inputs · 29 parameters · 5 outputs
FloatMultipleAddLiteral
Compact description unavailable for this node.
Utils/Numbers · 0 inputs · 4 parameters · 3 outputs
FrameAdjuster
Compact description unavailable for this node.
Utils · 2 inputs · 5 parameters · 4 outputs
GeminiPromptEnhance
This node is designed to enhance the text description of the image, using the latest Gemini 2.0 flash model. It can add quality descriptors, lighting descriptions, scene descriptions, and skin descriptions to the text. and according to the gender input, can modify the content about gender. To use this node, you must get your free API key from Google AI Studio: - Visit Google AI Studio - Log in with your Google account - Click on "Get API key" or go to settings - Create a new API key - Copy the API key for use in the node's input or geminiconfig.json this code is original from https://github.com/ShmuelRonen/ComfyUI-GeminiFlash2.0Exp, added new features. thanks to @ShmuelRonen.
Utils/Text · 1 input · 10 parameters · 1 output
GenderControlOutput
This node determines the output based on the input gender. If the gender input is 'M', it will output male-specific text, float, and integer values. If the gender input is 'F', it will output female-specific text, float, and integer values.
Utils/Text · 1 input · 7 parameters · 5 outputs
ImageAutoSelector
This node is designed to automatically select the image from the input. If the prior image is not empty, return the prior image; otherwise, return the alternative image or the third image.
Utils/Image · 3 inputs · 0 parameters · 1 output
ImageBatchOneOrMore
This node can input one or more images, the limit is six. It expands the functionality of the official ImageBatch node from two to multiple images.
Utils/Image · 6 inputs · 0 parameters · 1 output
ImageCompositeMaskedOneByOne
Modified the official ImageCompositeMasked node to process images one by one, instead of processing an entire batch at once. In video scenarios, processing in a batch may require a significant amount of memory, but this method helps reduce memory usage.
Utils/Image · 3 inputs · 4 parameters · 1 output
ImageCompositeMaskedWithSwitch
Modified the official ImageCompositeMasked node by adding a switch. When turned off, it will return the destination image directly.
Utils/Image · 3 inputs · 5 parameters · 1 output
ImageCompositeWatermark
This node is designed to composite a watermark into the destination image. It can select the position of the watermark, resize the watermark according to the input ratio, and add a margin to the watermark.
Utils/Image · 3 inputs · 5 parameters · 1 output
ImageConcanateOfUtils
Compact description unavailable for this node.
Utils/Image · 6 inputs · 1 parameter · 1 output
ImageMaskColorAverage
This node is designed to calculate the average color of the image within the mask. It returns the decimal and hexadecimal values of the average color.
Utils/Image · 2 inputs · 0 parameters · 2 outputs
ImageResizeTo8x
Modified the image-resize-comfyui image resize node by adding logic to crop the resulting image size to 8 times size, similar to the VAE encode node. This avoids pixel differences when pasting back by the ImageCompositeMasked node.
Utils/Image · 2 inputs · 12 parameters · 4 outputs
ImageScaleToTotalPixelsSwitch
Modified the official ImageScaleToTotalPixels node by adding a switch. When turned off, it will return the input image directly.
1 input · 4 parameters
ImagesConcanateToGrid
This node is designed to concatenate the input one batch images to a grid. It can concatenate images in the horizontal or vertical direction.
Utils/Image · 1 input · 2 parameters · 1 output
ImageTransition
This node is designed to generate a transition image between two images. The first image gradually fades out while the second image simultaneously appears, creating a smooth transition effect.
Utils/Image · 2 inputs · 3 parameters · 1 output
ImageTransitionBottomToTop
This node is designed to generate a transition image between two images. The first image gradually slides up while the second image simultaneously appears from the bottom, creating a smooth vertical transition effect.
ImageTransitionLeftToRight
This node is designed to generate a transition image between two images. The first image gradually slides to the right while the second image simultaneously appears from the left, creating a smooth transition effect.
ImageTransitionRightToLeft
This node is designed to generate a transition image between two images. The first image gradually slides to the left while the second image simultaneously appears from the right, creating a smooth transition effect.
ImageTransitionTopToBottom
This node is designed to generate a transition image between two images. The first image gradually slides down while the second image simultaneously appears from the top, creating a smooth vertical transition effect.
IntMultipleAddLiteral
Compact description unavailable for this node.
Utils/Numbers · 0 inputs · 4 parameters · 3 outputs
LayerUtility: CropByMask To Specific Size
Compact description unavailable for this node.
LoadImageMaskWithoutListDir
When there are a lot of images in the input directory, loading image as Mask with os.listdir can be slow. This node avoids using os.listdir to improve performance.
Utils/Mask · 0 inputs · 4 parameters · 2 outputs
LoadImageMaskWithSwitch
Modified the official LoadImageMask node by adding a switch. When turned off, it will not load the image to mask.
Utils/Mask · 0 inputs · 3 parameters · 2 outputs
LoadImageWithoutListDir
When there are a lot of images in the input directory, loading image with os.listdir can be slow. This node avoids using os.listdir to improve performance.
Utils/Image · 0 inputs · 3 parameters · 6 outputs
LoadImageWithSwitch
Modified the official LoadImage node by adding a switch. When turned off, it will not load the image.
Utils/Image · 0 inputs · 2 parameters · 3 outputs
MaskAreaComparison
This node compares the area of the mask with the threshold. If the area is greater than the threshold, it will return True; otherwise, it will return False.
Mask/Utils · 1 input · 1 parameter · 2 outputs
MaskAutoSelector
Check the three input masks. If any are available, return the first. If none are available, raise an exception.
Utils/Mask · 3 inputs · 0 parameters · 1 output
MaskCoverFourCorners
Generates a mask by covering the selected corners with circular edges. This mask can be used as an attention mask to remove watermarks from the corners.
Utils/Mask · 1 input · 7 parameters · 1 output
MaskFastGrow
This node is designed for growing masks quickly. When using the official or other mask growth nodes, the speed slows down significantly with large grow values, such as above 20. In contrast, this node maintains consistent speed regardless of the grow value.
Utils/Mask · 1 input · 5 parameters · 1 output
MaskFromFaceModel
Generates a mask from the face model of the Reactor face swap node. The mask covers the facial area below the eyes, excluding the forehead. Enabling addbboxupperpoints provides a rough approximation but lacks precision. If the forehead is essential for your application, consider using a different mask or adjusting the generated mask as needed.
Utils/Mask · 3 inputs · 5 parameters · 2 outputs
MaskofCenter
Generates a mask by covering the center of the image with a circular edge. This mask can be used as an attention mask, then model can focus on the center of the image.
Utils/Mask · 1 input · 7 parameters · 3 outputs
MatchImageRatioToPreset
According to the input image ratio, decide which standard SDXL training size is the closest match. This is useful for subsequent image resizing and other processes.
Utils/Image · 1 input · 2 parameters · 4 outputs
ModelsDownloaderOfUtils
This node downloads models or LoRAs to a subdirectory. If the model already exists, it simply returns the model name in the corresponding location.
Utils/Download · 0 inputs · 8 parameters · 4 outputs
ModifyTextGender
This node adjusts the text to describe the gender based on the input. If the gender input is 'M', the text will be adjusted to describe as male; if the gender input is 'F', it will be adjusted to describe as female.
Utils/Text · 2 inputs · 3 parameters · 1 output
NeedImageSizeAndCount
Compact description unavailable for this node.
Utils/Image · 1 input · 0 parameters · 3 outputs
NovitaVideoRequestNode
This node is designed to generate videos using Novita's API. It supports image-to-video generation with various resolution options and duration settings.
Utils/Video · 0 inputs · 10 parameters · 5 outputs
QwenEditPlusLoraNode
This node is designed to edit images using FAL's qwen-image-edit-plus-lora model. It supports uploading multiple images (first image is required, up to 3 additional images are optional) and applying up to 3 LoRAs with custom weights. The node automatically handles image uploads to FAL and returns the edited image with dimensions.
Utils/Image · 4 inputs · 21 parameters · 3 outputs
ReferenceLatentSwitch
Modified the official ReferenceLatent node by adding a switch. When turned off, it will return the input conditioning directly.
2 inputs · 1 parameter
ReplicateRequstNode
This node is designed to generate images using Replicate's model API. It supports various aspect ratios, LoRA weights, and provides flexible error handling options.
Utils/Image · 1 input · 14 parameters · 4 outputs
ReplicateVideoRequestNode
This node is designed to generate videos using Replicate's model API, with Wan2.2 as the default video model.
Utils/Video · 1 input · 16 parameters · 5 outputs
SegmindVideoRequestNode
This node is designed to generate videos from an image using Segmind's API. The default model is the wan-2.2-i2v-fast. The image must be a url. It supports fast video generation with various resolution and aspect ratio options.
Utils/Video · 0 inputs · 12 parameters · 5 outputs
SplitMask
This node splits one mask into two masks of the same size according to the area of the submasks. If there are more than two areas, it will select the two largest submasks.
Utils/Mask · 2 inputs · 0 parameters · 2 outputs
TextInputAutoSelector
Check the component and alternative input. If the component input is not empty, return this text; otherwise, return the alternative text.
Utils/Text · 1 input · 1 parameter · 1 output
TextPreview
Added the node for convenience. The code is originally from ComfyUI-Custom-Scripts, thanks.
Utils/Text · 1 input · 0 parameters · 1 output
TorchCompileModelAdvancedOfUtils
This node enables model compilation using torch.compile. It extends ComfyUI's original torch compile node by adding compile mode options and a toggle switch.
Utils · 1 input · 3 parameters · 1 output
UpscaleImageWithModelIfNeed
Enhanced the official UpscaleImageWithModel node by adding a judge. If the input image area exceeds a predefined threshold, upscaling is bypassed. The threshold is a percentage of the SDXL standard size (1024x1024) area.
Utils/Image · 2 inputs · 1 parameter · 1 output
VAEEncoderSwitch
Modified the official VAEEncoder node by adding a switch. When turned off, it will return None.
Utils/Switch · 2 inputs · 1 parameter · 1 output
VolcanoArkImageEditNode
Compact description unavailable for this node.
Image/Ark · 3 inputs · 8 parameters · 1 output
VolcanoImageEditNode
火山引擎图像编辑节点
Image/Volcano · 1 input · 6 parameters · 1 output
VolcanoOutpaintingNode
火山引擎图像扩展节点
Image/Volcano · 2 inputs · 4 parameters · 1 output