diff --git a/README.MD b/README.MD
index 973492c..6af7aa0 100644
--- a/README.MD
+++ b/README.MD
@@ -13,29 +13,32 @@ It migrate some basic functions of PhotoShop to ComfyUI, aiming to centralize th

*this workflow (title_example_workflow.json) is in the workflow directory.
-
-
## Example workflow
-Some JSON workflow files in the ```workflow``` directory, That's examples of how these nodes can be used in ComfyUI.
+Some JSON workflow files in the ```workflow``` directory, That's examples of how these nodes can be used in ComfyUI.
+
+## How to install
-## How to install
(Taking ComfyUI official portable package and Aki ComfyUI package as examples, please modify the dependency environment directory for other ComfyUI environments)
### Install plugin
+
* Recommended use ComfyUI Manager for installation.
* Or open the cmd window in the plugin directory of ComfyUI, like ```ComfyUI\custom_nodes```,type
-```
-git clone https://github.com/chflame163/ComfyUI_LayerStyle.git
-```
+
+ ```
+ git clone https://github.com/chflame163/ComfyUI_LayerStyle.git
+ ```
+
* Or download the zip file and extracted, copy the resulting folder to ```ComfyUI\custom_ Nodes```
-### Install dependency packages
+### Install dependency packages
+
* for ComfyUI official portable package, double-click the ```install_requirements.bat``` in the plugin directory, for Aki ComfyUI package double-click on the ```install_requirements_aki.bat``` in the plugin directory, and wait for the installation to complete.
-
+
* Or install dependency packages, open the cmd window in the ComfyUI_LayerStyle plugin directory like
-```ComfyUI\custom_ Nodes\ComfyUI_LayerStyle``` and enter the following command,
+ ```ComfyUI\custom_ Nodes\ComfyUI_LayerStyle``` and enter the following command,
for ComfyUI official portable package, type:
@@ -45,6 +48,7 @@ git clone https://github.com/chflame163/ComfyUI_LayerStyle.git
..\..\..\python_embeded\python.exe -s -m pip install -r requirements.txt
.\repair_dependency.bat
```
+
for Aki ComfyUI package, type:
```
@@ -53,100 +57,115 @@ git clone https://github.com/chflame163/ComfyUI_LayerStyle.git
..\..\python\python.exe -s -m pip install -r requirements.txt
.\repair_dependency.bat
```
+
* Restart ComfyUI.
### Download Model Files
+
From [BaiduNetdisk](https://pan.baidu.com/s/1T_uXMX3OKIWOJLPuLijrgA?pwd=1yye) download all files and copy them to ```ComfyUI\models``` folder. This link provides all the model files required for this plugin.
Or download the model file according to the instructions of each node.
## Common Issues
+
If the node cannot load properly or there are errors during use, please check the error message in the ComfyUI terminal window. The following are common errors and their solutions.
### Warning: xxxx.ini not found, use default xxxx..
+
This warning message indicates that the ini file cannot be found and does not affect usage. If you do not want to see these warnings, please modify all ```*.ini.example``` files in the plugin directory to ```*.ini```.
### ModuleNotFoundError: No module named 'psd_tools'
+
This error is that the ```psd_tools``` were not installed correctly.
Solution:
+
* Close ComfyUI and open the terminal window in the plugin directory and execute the following command:
-```../../../python_embeded/python.exe -s -m pip install psd_tools```
-If error occurs during the installation of psd_tool, such as ```ModuleNotFoundError: No module named 'docopt'``` , please download [docopt's whl](https://www.piwheels.org/project/docopt/) and manual install it.
-execute the following command in terminal window:
-```../../../python_embeded/python.exe -s -m pip install path/docopt-0.6.2-py2.py3-none-any.whl``` the ```path``` is path name of whl file.
+ ```../../../python_embeded/python.exe -s -m pip install psd_tools```
+ If error occurs during the installation of psd_tool, such as ```ModuleNotFoundError: No module named 'docopt'``` , please download [docopt's whl](https://www.piwheels.org/project/docopt/) and manual install it.
+ execute the following command in terminal window:
+ ```../../../python_embeded/python.exe -s -m pip install path/docopt-0.6.2-py2.py3-none-any.whl``` the ```path``` is path name of whl file.
### Cannot import name 'guidedFilter' from 'cv2.ximgproc'
+
This error is caused by incorrect version of the ```opencv-contrib-python``` package,or this package is overwriteen by other opencv packages.
-
### NameError: name 'guidedFilter' is not defined
+
The reason for the problem is the same as above.
-### Cannot import name 'VitMatteImageProcessor' from 'transformers'
+### Cannot import name 'VitMatteImageProcessor' from 'transformers'
+
This error is caused by the low version of ```transformers``` package.
-
### insightface Loading very slow
+
This error is caused by the low version of ```protobuf``` package.
#### For the issues with the above three dependency packages, please double click ```repair_dependency.bat``` (for Official ComfyUI Protable) or ```repair_dependency_aki.bat``` (for ComfyUI-aki-v1.x) in the plugin folder to automatically fix them.
-### onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasn't able to be loaded. Please install the correct version of CUDA and cuDNN as mentioned in the GPU requirements page
+### onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasn't able to be loaded. Please install the correct version of CUDA and cuDNN as mentioned in the GPU requirements page
+
Solution:
Reinstall the ```onnxruntime``` dependency package.
-### Error loading model xxx: We couldn't connect to huggingface.co ...
-Check the network environment. If you cannot access huggingface.co normally in China, try modifying the huggingface_hub package to force the use hf_mirror.
-* Find ```constants.py``` in the directory of ```huggingface_hub``` package (usually ```Lib/site packages/huggingface_hub``` in the virtual environment path),
-Add a line after ```import os```
-```
-os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
-```
+### Error loading model xxx: We couldn't connect to huggingface.co ...
+Check the network environment. If you cannot access huggingface.co normally in China, try modifying the huggingface_hub package to force the use hf_mirror.
+
+* Find ```constants.py``` in the directory of ```huggingface_hub``` package (usually ```Lib/site packages/huggingface_hub``` in the virtual environment path),
+ Add a line after ```import os```
+
+ ```
+ os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
+ ```
### ValueError: Trimap did not contain foreground values (xxxx...)
+
This error is caused by the mask area being too large or too small when using the ```PyMatting``` method to handle the mask edges.
Solution:
+
* Please adjust the parameters to change the effective area of the mask. Or use other methods to handle the edges.
### Requests.exceptions.ProxyError: HTTPSConnectionPool(xxxx...)
+
When this error has occurred, please check the network environment.
## Update
+
**If the dependency package error after updating, please double clicking ```repair_dependency.bat``` (for Official ComfyUI Protable) or ```repair_dependency_aki.bat``` (for ComfyUI-aki-v1.x) in the plugin folder to reinstall the dependency packages.
-
+* Commit [TextJoinV2](#TextJoinV2) node, add delimiter options on top of TextJion.
* Commit [GaussianBlurV2](#GaussianBlurV2) node, The parameter accuracy has been improved to 0.01.
* Commit [UserPromptGeneratorTxtImgWithReference](#UserPromptGeneratorTxtImgWithReference) node.
* Commit [GrayValue](#GrayValue) node, output the grayscale values corresponding to the RGB color values.
* [LUT Apply](#LUT), [TextImageV2](#TextImageV2), [TextImage](#TextImage), [SimpleTextImage](#SimpleTextImage) nodes to support defining multiple folders in ```resource-dir.ini```, separated by commas, semicolons, or spaces. Simultaneously supports refreshing real-time updates.
* [LUT Apply](#LUT), [TextImageV2](#TextImageV2), [TextImage](#TextImage), [SimpleTextImage](#SimpleTextImage) nodes support defining multi directory fonts and lut folders, and support refreshing and real-time updates.
* Commit [HumanPartsUltra](#HumanPartsUltra) node, used to generate human body parts masks. It is based on the warrper of [metal3d/ComfyUI_Human_Parts](https://github.com/metal3d/ComfyUI_Human_Parts), thank the original author.
-Download model file from [BaiduNetdisk](https://pan.baidu.com/s/1-6uwH6RB0FhIVfa3qO7hhQ?pwd=d862) or [huggingface](https://huggingface.co/Metal3d/deeplabv3p-resnet50-human/tree/main) and copy to ```ComfyUI\models\onnx\human-parts``` folder.
+ Download model file from [BaiduNetdisk](https://pan.baidu.com/s/1-6uwH6RB0FhIVfa3qO7hhQ?pwd=d862) or [huggingface](https://huggingface.co/Metal3d/deeplabv3p-resnet50-human/tree/main) and copy to ```ComfyUI\models\onnx\human-parts``` folder.
* ObjectDetector nodes add sort by confidence option.
* Commit [DrawBBoxMask](#DrawBBoxMask) node, used to convert the BBoxes output by the Object Detector node into a mask.
* Commit [UserPromptGeneratorTxtImg](#UserPromptGeneratorTxtImg) and [UserPromptGeneratorReplaceWord](#UserPromptGeneratorReplaceWord) nodes, Used to generate text and image prompts and replace prompt content.
* Commit [PhiPrompt](#PhiPrompt) node, Use Microsoft Phi 3.5 text and visual models for local inference. Can be used to generate prompt words, process prompt words, or infer prompt words from images. Running this model requires at least 16GB of video memory.
-Download model files from [BaiduNetdisk](https://pan.baidu.com/s/1BdTLdaeGC3trh1U3V-6XTA?pwd=29dh) or [huggingface.co/microsoft/Phi-3.5-vision-instruct](https://huggingface.co/microsoft/Phi-3.5-vision-instruct/tree/main) and [huggingface.co/microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct/tree/main) and copy to ```ComfyUI\models\LLM``` folder.
+ Download model files from [BaiduNetdisk](https://pan.baidu.com/s/1BdTLdaeGC3trh1U3V-6XTA?pwd=29dh) or [huggingface.co/microsoft/Phi-3.5-vision-instruct](https://huggingface.co/microsoft/Phi-3.5-vision-instruct/tree/main) and [huggingface.co/microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct/tree/main) and copy to ```ComfyUI\models\LLM``` folder.
* Commit [GetMainColors](#GetMainColors) node, it can obtained 5 main colors of image. Commit [ColorName](#ColorName) node, it can obtain the color name of input color value.
* Duplicate the [Brightness & Contrast](#Brightness) node as [BrightnessContrastV2](#BrightnessContrastV2), the [Color of Shadow & Highlight](#Highlight) node as [ColorofShadowHighlight](#HighlightV2), and [Shadow & Highlight Mask](#Shadow) to [Shadow Highlight Mask V2](#ShadowV2), to avoid errors in ComfyUI workflow parsing caused by the "&" character in the node name.
* Commit [VQAPrompt](#VQAPrompt) and [LoadVQAModel](#LoadVQAModel) nodes.
-Download the model from [BaiduNetdisk](https://pan.baidu.com/s/1ILREVgM0eFJlkWaYlKsR0g?pwd=yw75) or [huggingface.co/Salesforce/blip-vqa-capfilt-large](https://huggingface.co/Salesforce/blip-vqa-capfilt-large/tree/main) and [huggingface.co/Salesforce/blip-vqa-base](https://huggingface.co/Salesforce/blip-vqa-base/tree/main) and copy to ```ComfyUI\models\VQA``` folder.
+ Download the model from [BaiduNetdisk](https://pan.baidu.com/s/1ILREVgM0eFJlkWaYlKsR0g?pwd=yw75) or [huggingface.co/Salesforce/blip-vqa-capfilt-large](https://huggingface.co/Salesforce/blip-vqa-capfilt-large/tree/main) and [huggingface.co/Salesforce/blip-vqa-base](https://huggingface.co/Salesforce/blip-vqa-base/tree/main) and copy to ```ComfyUI\models\VQA``` folder.
* [Florence2Ultra](#Florence2Ultra), [Florence2Image2Prompt](#Florence2Image2Prompt) 和 [LoadFlorence2Model](#LoadFlorence2Model) nodes support the MiaoshouAI/Florence-2-large-PromptGen-v1.5 and MiaoshouAI/Florence-2-base-PromptGen-v1.5 model.
-Download model files from [BaiduNetdisk](https://pan.baidu.com/s/1xOL6x6LijIMSh_3woErjJg?pwd=t3xa) or [huggingface.co/MiaoshouAI/Florence-2-large-PromptGen-v1.5](https://huggingface.co/MiaoshouAI/Florence-2-large-PromptGen-v1.5/tree/main) and [huggingface.co/MiaoshouAI/Florence-2-base-PromptGen-v1.5](https://huggingface.co/MiaoshouAI/Florence-2-base-PromptGen-v1.5/tree/main) , copy to ```ComfyUI\models\florence2``` folder.
+ Download model files from [BaiduNetdisk](https://pan.baidu.com/s/1xOL6x6LijIMSh_3woErjJg?pwd=t3xa) or [huggingface.co/MiaoshouAI/Florence-2-large-PromptGen-v1.5](https://huggingface.co/MiaoshouAI/Florence-2-large-PromptGen-v1.5/tree/main) and [huggingface.co/MiaoshouAI/Florence-2-base-PromptGen-v1.5](https://huggingface.co/MiaoshouAI/Florence-2-base-PromptGen-v1.5/tree/main) , copy to ```ComfyUI\models\florence2``` folder.
* Commit [BiRefNetUltraV2](#BiRefNetUltraV2) and [LoadBiRefNetModel](#LoadBiRefNetModel) nodes, that support the use of the latest BiRefNet model.
-Download model file from [BaiduNetdisk](https://pan.baidu.com/s/12z3qUuqag3nqpN2NJ5pSzg?pwd=ek65) or [GoogleDrive](https://drive.google.com/drive/folders/1s2Xe0cjq-2ctnJBR24563yMSCOu4CcxM) named ```BiRefNet-general-epoch_244.pth``` to ```ComfyUI/Models/BiRefNet/pth``` folder. You can also download more BiRefNet models and put them here.
+ Download model file from [BaiduNetdisk](https://pan.baidu.com/s/12z3qUuqag3nqpN2NJ5pSzg?pwd=ek65) or [GoogleDrive](https://drive.google.com/drive/folders/1s2Xe0cjq-2ctnJBR24563yMSCOu4CcxM) named ```BiRefNet-general-epoch_244.pth``` to ```ComfyUI/Models/BiRefNet/pth``` folder. You can also download more BiRefNet models and put them here.
* [ExtendCanvasV2](#ExtendCanvasV2) node support negative value input, it means image will be cropped.
* The default title color of nodes is changed to blue-green, and nodes in LayerStyle, LayerColor, LayerMask, LayerUtility, and LayerFilter are distinguished by different colors.
* The Object Detector nodes added sort bbox option, which allows sorting from left to right, top to bottom, and large to small, making object selection more intuitive and convenient. The nodes released yesterday has been abandoned, please manually replace it with the new version node (sorry).
* Commit [SAM2Ultra](#SAM2Ultra), [SAM2VideoUltra](#SAM2VideoUltra), [ObjectDetectorFL2](#ObjectDetectorFL2), [ObjectDetectorYOLOWorld](#ObjectDetectorYOLOWorld), [ObjectDetectorYOLO8](#ObjectDetectorYOLO8), [ObjectDetectorMask](#ObjectDetectorMask) and [BBoxJoin](#BBoxJoin) nodes.
-Download models from [BaiduNetdisk](https://pan.baidu.com/s/1xaQYBA6ktxvAxm310HXweQ?pwd=auki) or [huggingface.co/Kijai/sam2-safetensors](https://huggingface.co/Kijai/sam2-safetensors/tree/main) and copy to ```ComfyUI/models/sam2``` folder,
-Download models from [BaiduNetdisk](https://pan.baidu.com/s/1QpjajeTA37vEAU2OQnbDcQ?pwd=nqsk) or [GoogleDrive](https://drive.google.com/drive/folders/1nrsfq4S-yk9ewJgwrhXAoNVqIFLZ1at7?usp=sharing) and copy to ```ComfyUI/models/yolo-world``` folder.
-This update introduces new dependencies, please reinstall the dependency package.
+ Download models from [BaiduNetdisk](https://pan.baidu.com/s/1xaQYBA6ktxvAxm310HXweQ?pwd=auki) or [huggingface.co/Kijai/sam2-safetensors](https://huggingface.co/Kijai/sam2-safetensors/tree/main) and copy to ```ComfyUI/models/sam2``` folder,
+ Download models from [BaiduNetdisk](https://pan.baidu.com/s/1QpjajeTA37vEAU2OQnbDcQ?pwd=nqsk) or [GoogleDrive](https://drive.google.com/drive/folders/1nrsfq4S-yk9ewJgwrhXAoNVqIFLZ1at7?usp=sharing) and copy to ```ComfyUI/models/yolo-world``` folder.
+ This update introduces new dependencies, please reinstall the dependency package.
* Commit [RandomGenerator](#RandomGenerator) node, Used to generate random numbers within a specified range, with outputs of int, float, and boolean, supporting batch generation of different random numbers by image batch.
* Commit [EVF-SAMUltra](#EVFSAMUltra) node, it is implementation of [EVF-SAM](https://github.com/hustvl/EVF-SAM) in ComfyUI. Please download model files from [BaiduNetdisk](https://pan.baidu.com/s/1EvaxgKcCxUpMbYKzLnEx9w?pwd=69bn) or [huggingface/EVF-SAM2](https://huggingface.co/YxZhang/evf-sam2/tree/main), [huggingface/EVF-SAM](https://huggingface.co/YxZhang/evf-sam/tree/main) to ```ComfyUI/models/EVF-SAM``` folder(save the models in their respective subdirectories).
-Due to the introduction of new dependencies package, after the plugin upgrade, please reinstall the dependency packages.
+ Due to the introduction of new dependencies package, after the plugin upgrade, please reinstall the dependency packages.
* Commit [ImageTaggerSave](#ImageTaggerSave) and [ImageAutoCropV3](#ImageAutoCropV3) nodes. Used to implement the automatic trimming and marking workflow for the training set (the workflow ```image_tagger_save.json``` is located in the workflow directory).
* Commit [CheckMaskV2](#CheckMaskV2) node, Added the ```simple``` method to detect masks more quickly.
* Commit [ImageReel](#ImageReel) and [ImageReelComposite](#ImageReelComposite) nodes to composite multiple images on a canvas.
@@ -202,7 +221,7 @@ Due to the introduction of new dependencies package, after the plugin upgrade, p
* Commit [BlendIfMask](#BlendIfMask) node, This node cooperates with ImgaeBlendV2 or ImageBlendAdvanceV2 to achieve the same Blend If function as Photoshop.
* Commit [ColorTemperature](#ColorTemperature) and [ColorBalance](#ColorBalance) nodes, used to adjust the color temperature and color balance of the picture.
* Add new types of [Blend Mode V2](#BlendModeV2) between images. now supports up to 30 blend modes. The new blend mode is available for all V2 versions that support mixed mode nodes, including ImageBlend V2, ImageBlendAdvance V2, DropShadow V2, InnerShadow V2, OuterGlow V2, InnerGlow V2, Stroke V2, ColorOverlay V2, GradientOverlay V2.
-Part of the code for BlendMode V2 is from [Virtuoso Nodes for ComfyUI](https://github.com/chrisfreilich/virtuoso-nodes). Thanks to the original authors.
+ Part of the code for BlendMode V2 is from [Virtuoso Nodes for ComfyUI](https://github.com/chrisfreilich/virtuoso-nodes). Thanks to the original authors.
* Commit [YoloV8Detect](#YoloV8Detect) node.
* Commit [QWenImage2Prompt](#QWenImage2Prompt) node, this node is repackage of the [ComfyUI_VLM_nodes](https://github.com/gokayfem/ComfyUI_VLM_nodes)'s ```UForm-Gen2 Qwen Node```, thanks to the original author.
* Commit [BooleanOperator](#BooleanOperator), [NumberCalculator](#NumberCalculator), [TextBox](#TextBox), [Integer](#Integer), [Float](#Float), [Boolean](#Boolean)nodes. These nodes can perform mathematical and logical operations.
@@ -237,11 +256,11 @@ Part of the code for BlendMode V2 is from [Virtuoso Nodes for ComfyUI](https://g
* Commit [MaskEdgeUltraDetail](#MaskEdgeUltraDetail) node, it process rough masks to ultra fine edges.Commit [Exposure](#Exposure) node.
* Commit [Sharp & Soft](#Sharp) node, it can enhance or smooth out image details. Commit [MaskByDifferent](#MaskByDifferent) node, it compare two images and output a Mask. Commit [SegmentAnythingUltra](#SegmentAnythingUltra) node, Improve the quality of mask edges. *If SegmentAnything is not installed, you will need to manually download the model.
* All nodes have fully supported batch images, providing convenience for video creation.
-(The CropByMask node only supports cuts of the same size. if a batch mask_for_crop inputted, the data from the first sheet will be used.)
+ (The CropByMask node only supports cuts of the same size. if a batch mask_for_crop inputted, the data from the first sheet will be used.)
* Commit [RemBgUltra](#RemBgUltra) and [PixelSpread](#PixelSpread) nodes significantly improved mask quality. *RemBgUltra requires manual model download.
* Commit [TextImage](#TextImage) node, it generate text images and masks.
* Add new types of [blend mode](#Blend) between images. now supports up to 19 blend modes. add **color_burn, color_dodge, linear_burn, linear_dodge, overlay, soft_light, hard_light, vivid_light, pin_light, linear_light** and **hard_mix**.
-The newly added blend mode is applicable to all nodes that support blend mode.
+ The newly added blend mode is applicable to all nodes that support blend mode.
* Commit [ColorMap](#ColorMap) filter node to create a pseudo color heatmap effect.
* Commit [WaterColor](#WaterColor) and [SkinBeauty](#SkinBeauty) nodes。These are image filters that generate watercolor and skin smoothness effects.
* Commit [ImageShift](#ImageShift) node to shift the image and output a displacement seam mask, making it convenient to create continuous textures.
@@ -257,17 +276,17 @@ The newly added blend mode is applicable to all nodes that support blend mode.
* Commit [ChannelShake](#ChannelShake) node, that is filter, can produce channel dislocation effect similar like Tiktok logo.
* Commit [MaskGradient](#MaskGradient) node, can create a gradient in the mask.
* Commit [GetColorTone](#GetColorTone) node, can obtain the main color or average color of the image.
-Commit [MaskGrow](#MaskGrow) and [MaskEdgeShrink](#MaskEdgeShrink) nodes.
+ Commit [MaskGrow](#MaskGrow) and [MaskEdgeShrink](#MaskEdgeShrink) nodes.
* Commit [MaskBoxDetect](#MaskBoxDetect) node, which can automatically detect the position through the mask and output it to the composite node.
-Commit [XY to Percent](#Percent) node to convert absolute coordinates to percent coordinates.
-Commit [GaussianBlur](#GaussianBlur) node.
-Commit [GetImageSize](#GetImageSize) node.
+ Commit [XY to Percent](#Percent) node to convert absolute coordinates to percent coordinates.
+ Commit [GaussianBlur](#GaussianBlur) node.
+ Commit [GetImageSize](#GetImageSize) node.
* Commit [ExtendCanvas](#ExtendCanvas) node.
* Commit [ImageBlendAdvance](#ImageBlendAdvance) node. This node allows for the synthesis of background images and layers of different sizes, providing a more free synthesis experience.
-Commit [PrintInfo](#PrintInfo) node as a workflow debugging aid.
+ Commit [PrintInfo](#PrintInfo) node as a workflow debugging aid.
* Commit [ColorImage](#ColorImage) and [GradientImage](#GradientImage) nodes, Used to generate solid and gradient color images.
* Commit [GradientOverlay](#GradientOverlay) and [ColorOverlay](#ColorOverlay) nodes.
-Add invalid mask input judgment and ignore it when invalid mask is input.
+ Add invalid mask input judgment and ignore it when invalid mask is input.
* Commit [InnerGlow](#InnerGlow), [InnerShadow](#InnerShadow) and [MotionBlur](#MotionBlur) nodes.
* Renaming all completed nodes, the nodes are divided into 4 groups:LayerStyle, LayerMask, LayerUtility, LayerFilter. workflows containing old version nodes need to be manually replaced with new version nodes.
* [OuterGlow](#OuterGlow) node has undergone significant modifications by adding options for **_brightness_**, **_light_color_**, and **_glow_color_**.
@@ -281,31 +300,34 @@ Add invalid mask input judgment and ignore it when invalid mask is input.
* Commit [OuterGlow](#OuterGlow) node.
* Commit [DropShadow](#DropShadow) node.
-
## Description
+
Nodes are divided into 5 groups according to their functions: LayerStyle, LayerColor, LayerMask, LayerUtility and LayerFilter.
+
* [LayerStyle](#LayerStyle) nodes provides layer styles that mimic Adobe Photoshop.
-
+ 
* [LayerColor](#LayerColor) node group provides color adjustment functionality.
-
+ 
* [LayerMask](#LayerMask) nodes provides mask assistance tools.
-
+ 
* [LayerUtility](#LayerUtility) nodes provides auxiliary nodes related to layer composit tools and workflows.
-
+ 
* [LayerFilter](#LayerFilter) nodes provides image effect filters.
-
+ 
# LayerStyle
+


-
### DropShadow
+
Generate shadow

Node options:

+
* background_image1: The background image.
* layer_image1: Layer image for composite.
* layer_mask1,2: Mask for layer_image, shadows are generated according to their shape.
@@ -319,13 +341,14 @@ Node options:
* shadow_color4: Shadow color.
* [note](#notes)
-
### OuterGlow
+
Generate outer glow

Node options:

+
* background_image1: The background image.
* layer_image1: Layer image for composite.
* layer_mask1,2: Mask for layer_image, grow are generated according to their shape.
@@ -339,13 +362,14 @@ Node options:
* glow_color4: Edge part color of glow.
* [note](#notes)
-
### InnerShadow
+
Generate inner shadow

Node options:

+
* background_image1: The background image.
* layer_image1: Layer image for composite.
* layer_mask1,2: Mask for layer_image, shadows are generated according to their shape.
@@ -359,13 +383,14 @@ Node options:
* shadow_color4: Shadow color.
* [note](#notes)
-
### InnerGlow
+
Generate inner glow

Node options:

+
* background_image1: The background image.
* layer_image1: Layer image for composite.
* layer_mask1,2: Mask for layer_image, grow are generated according to their shape.
@@ -379,13 +404,14 @@ Node options:
* glow_color4: Edge part color of glow.
* [note](#notes)
-
### Stroke
+
Generate a stroke of layer。

Node options:

+
* background_image1: The background image.
* layer_image1: Layer image for composite.
* layer_mask1,2: Mask for layer_image, stroke are generated according to their shape.
@@ -398,12 +424,13 @@ Node options:
* stroke_color4: Stroke color, described in hexadecimal RGB format.
* [note](#notes)
-
### GradientOverlay
+
Generate gradient overlay

Node options:
+
* background_image1: The background image.
* layer_image1: Layer image for composite.
* layer_mask1,2: Mask for layer_image.
@@ -417,13 +444,14 @@ Node options:
* angle: Gradient rotation angle.
* [note](#notes)
-
### ColorOverlay
+
Generate color overlay

Node options:

+
* background_image1: The background image.
* layer_image1: Layer image for composite.
* layer_mask1,2: Mask for layer_image.
@@ -434,15 +462,18 @@ Node options:
* [note](#notes)
# LayerColor
+


### LUT Apply
+
Apply LUT to the image. only supports .cube format.

Node options:

+
* LUT*: Here is a list of available. cube files in the LUT folder, and the selected LUT files will be applied to the image.
* color_space: For regular image, please select linear, for image in the log color space, please select log.
* strength: Range 0~100, LUT application strength. The larger the value, the greater the difference from the original image, and the smaller the value, the closer it is to the original image.
@@ -454,11 +485,13 @@ all .cube files in this folder will be collected and displayed in the node list
If the folder set in ini is invalid, the LUT folder that comes with the plugin will be enabled.
### AutoAdjust
+
Automatically adjust the brightness, contrast, and white balance of the image. Provide some manual adjustment options to compensate for the shortcomings of automatic adjustment.

Node Options:

+
* strength: Strength of adjust. The larger the value, the greater the difference from the original image.
* brightness: Manual adjustment of brightness.
* contrast: Manual adjustment of contrast.
@@ -468,41 +501,50 @@ Node Options:
* blue: Manual adjustment of the blue channel.
### AutoAdjustV2
+
On the basis of AutoAdjust, add mask input and only calculate the content inside the mask for automatic color adjustment. Add multiple automatic adjustment modes.

The following changes have been made based on AutoAdjust:

+
* mask: Optional mask input.
* mode: Automatic adjustment mode. "RGB" automatically adjusts according to the three channels of RGB, "lum + sat"automatically adjusts according to luminance and saturation, "luminance" automatically adjusts according to luminance, "saturation" automatically adjusts according to saturation, and "mono" automatically adjusts according to grayscale and outputs monochrome.
### AutoBrightness
+
Automatically adjust too dark or too bright image to moderate brightness, and support mask input. When mask input, only the content of the mask part is used as the data source of the automatic brightness. The output is still the whole adjusted image.

Node options:

+
* strength: Automatically adjust the intensity of the brightness. The larger the value, the more biased towards the middle value, the greater the difference from the original picture.
* saturation: Color saturation. Changes in brightness usually result in changes in color saturation, where appropriate compensation can be adjusted.
### ColorAdapter
+
Auto adjust the color tone of the image to resemble the reference image.

Node options:

+
* opacity: The opacity of an image after adjusting its color tone.
### Exposure
+
Change the exposure of the image.

### Color of Shadow & Highlight
+
Adjust the color of the dark and bright parts of the image.

Node options:

+
* image: The input image.
* mask: Optional input. if there is input, only the colors within the mask range will be adjusted.
* shadow_brightness: The brightness of the dark area.
@@ -517,25 +559,31 @@ Node options:
* highlight_range: The transitional range of the highlight area.
Node option:
+
* exposure: Exposure value. Higher values indicate brighter image.
### Color of Shadow HighlightV2
+
A replica of the ```Color of Shadow & Highlight``` node, with the "&" character removed from the node name to avoid ComfyUI workflow parsing errors.
### ColorTemperature
+

Change the color temperature of the image.
Node Options:

+
* temperature: Color temperature value. Range between-100 and 100. The higher the value, the higher the color temperature (bluer); The lower the color temperature, the lower the color temperature (yellowish).
### Levels
+

Change the levels of image.
Node Options:

+
* channel: Select the channel you want to adjust. Available in RGB, red, green, blue.
* black_point*: Input black point value. Value range 0-255, default 0.
* white_point*: Input white point value. Value range 0-255, default 255.
@@ -546,77 +594,91 @@ Node Options:
*If the black_point or output_black_point value is greater than white_point or output_white_point, the two values are swapped, with the larger value used as white_point and the smaller value used as black_point.
### ColorBalance
+

Change the color balance of an image.
Node Options:

+
* cyan_red: Cyan-Red balance. negative values are leaning cyan, positive values are leaning red.
* magenta_green: Megenta-Green balance. negative values are leaning megenta, positive values are leaning green.
* yellow_blue: Yellow-Blue balance. negative values are leaning yellow, positive values are leaning blue.
-
### Gamma
+
Change the gamma value of the image.
Node options:

+
* gamma: Value of the Gamma.
### Brightness & Contrast
+
Change the brightness, contrast, and saturation of the image.
Node options:

+
* brightness: Value of brightness.
* contrast: Value of contrast.
* saturation: Value of saturation.
### BrightnessContrastV2
+
A replica of the ```Brightness & Contrast``` node, with the "&" character removed from the node name to avoid ComfyUI workflow parsing errors.
### RGB
+
Adjust the RGB channels of the image.
Node options:

+
* R: R channel.
* G: G channel.
* B: B channel.
### YUV
+
Adjust the YUV channels of the image.
Node options:

+
* Y: Y channel.
* U: U channel.
* V: V channel.
### LAB
+
Adjust the LAB channels of the image.
Node options:

+
* L: L channel.
* A: A channel.
* B: B channel.
### HSV
+
Adjust the HSV channels of the image.
Node options:

+
* H: H channel.
* S: S channel.
* V: V channel.
-
# LayerUtility
+

-
### ImageBlendAdvance
+
Used for compositing layers, allowing for compositing layer images of different sizes on the background image, and setting positions and transformations. multiple mixing modes are available for selection, and transparency can be set.
The node provide layer transformation_methods and anti_aliasing options. helps improve the quality of synthesized images.
@@ -626,6 +688,7 @@ The node provides mask output that can be used for subsequent workflows.
Node options:

+
* background_image: The background image.
* layer_image5: Layer image for composite.
* layer_mask2,5: Mask for layer_image.
@@ -643,12 +706,14 @@ Node options:
* [note](#notes)
### CropByMask
+
Crop the image according to the mask range, and set the size of the surrounding borders to be retained.
This node can be used in conjunction with the [RestoreCropBox](#RestoreCropBox) and [ImageScaleRestore](#ImageScaleRestore) nodes to crop and modify upscale parts of image, and then paste them back in place.

Node options:

+
* image5: The input image.
* mask_for_crop5: Mask of the image, it will automatically be cut according to the mask range.
* invert_mask: Whether to reverse the mask.
@@ -660,25 +725,30 @@ Node options:
* [note](#notes)
Output:
+
* croped_image: The image after crop.
* croped_mask: The mask after crop.
* crop_box: The trimmed box data is used when restoring the RestoreCropBox node.
* box_preview: Preview image of cutting position, red represents the detected range, and green represents the cutting range after adding the reserved border.
### CropByMaskV2
+
The V2 upgraded version of CropByMask. Supports crop_box input, making it easy to cut layers of the same size.
The following changes have been made based on CropByMask:

+
* The input ```mask_for_crop``` reanme to ```mask```。
* Add optional inputs to the ```crop_box```. If there are inputs here, mask detection will be ignored and this data will be directly used for cropping.
* Add the option ```round_to_multiple``` to round the trimming edge length multiple. For example, setting it to 8 will force the width and height to be multiples of 8.
### RestoreCropBox
+
Restore the cropped image to the original image by [CropByMask](#CropByMask).
Node options:

+
* background_image: The original image before cutting.
* croped_image5: The cropped image. If the middle is enlarged, the size needs to be restored before restoration.
* croped_mask5: The cut mask.
@@ -687,15 +757,18 @@ Node options:
* [note](#notes)
### CropBoxResolve
+
Parsing the ```corp_box``` to ```x``` , ```y``` , ```width``` , ```height``` .

### ImageScaleRestore
+
Image scaling. when this node is used in pairs, the image can be automatically restored to its original size on the second node.

Node options:

+
* image5: The input image.
* mask2,5: Mask of image.
* original_size: Optional input, used to restore the image to its original size.
@@ -704,6 +777,7 @@ Node options:
* longest_side: When the scale_by_longest_side is set to True, this will be used this value to the long edge of the image. when the original_size have input, this setting will be ignored.
Outputs:
+
* image: The scaled image.
* mask: If have mask input, the scaled mask will be output.
* original_size: The original size data of the image is used for subsequent node recovery.
@@ -711,32 +785,37 @@ Outputs:
* height: The output image's height.
### ImageScaleRestoreV2
+
The V2 upgraded version of ImageScaleRestore.
Node options:

The following changes have been made based on ImageScaleRestore:
+
* scale_by: Allow scaling by specified dimensions for long, short, width, height, or total pixels. When this option is set to by_scale, use the scale value, and for other options, use the scale_by_length value.
* scale_by_length: The value here is used as ```scale_by``` to specify the length of the edge.
### ImageMaskScaleAs
+
Scale the image or mask to the size of the reference image (or reference mask).

Node options:

+
* scale_as*: Reference size. It can be an image or a mask.
* image: Image to be scaled. this option is optional input. if there is no input, a black image will be output.
* mask: Mask to be scaled. this option is optional input. if there is no input, a black mask will be output.
* fit: Scale aspect ratio mode. when the width to height ratio of the original image does not match the scaled size, there are three modes to choose from,
-The _letterbox_ mode retains the complete frame and fills in the blank spaces with black;
-The _crop_ mode retains the complete short edge, and any excess of the long edge will be cut off;
-The _fill_ mode does not maintain frame ratio and fills the screen with width and height.
+ The _letterbox_ mode retains the complete frame and fills in the blank spaces with black;
+ The _crop_ mode retains the complete short edge, and any excess of the long edge will be cut off;
+ The _fill_ mode does not maintain frame ratio and fills the screen with width and height.
* method: Scaling sampling methods, including lanczos, bicubic, hamming, bilinear, box, and nearest.
*Only limited to input images and masks. forcing the integration of other types of inputs will result in node errors.
Outputs:
+
* image: If there is an image input, the scaled image will be output.
* mask: If there is a mask input, the scaled mask will be output.
* original_size: The original size data of the image is used for subsequent node recovery.
@@ -744,25 +823,27 @@ Outputs:
* height: The output image's height.
### ImageScaleByAspectRatio
+
Scale the image or mask by aspect ratio. the scaled size can be rounded to a multiple of 8 or 16, and can be scaled to the long side size.

Node options:

+
* aspect_ratio: Here are several common frame ratios provided. alternatively, you can choose "original" to keep original ratio or customize the ratio using "custom".
* proportional_width: Proportional width. if the aspect ratio option is not "custom", this setting will be ignored.
* proportional_height: Proportional height. if the aspect ratio option is not "custom", this setting will be ignored.
* fit: Scale aspect ratio mode. when the width to height ratio of the original image does not match the scaled size, there are three modes to choose from,
-The _letterbox_ mode retains the complete frame and fills in the blank spaces with black;
-The _crop_ mode retains the complete short edge, and any excess of the long edge will be cut off;
-The _fill_ mode does not maintain frame ratio and fills the screen with width and height.
+ The _letterbox_ mode retains the complete frame and fills in the blank spaces with black;
+ The _crop_ mode retains the complete short edge, and any excess of the long edge will be cut off;
+ The _fill_ mode does not maintain frame ratio and fills the screen with width and height.
* method: Scaling sampling methods, including lanczos, bicubic, hamming, bilinear, box, and nearest.
* round_to_multiple: Round multiples. for example, setting it to 8 will force the width and height to be multiples of 8.
* scale_by_longest_side: Allow scaling by long edge size.
* longest_side: When the scale_by_longest_side is set to True, this will be used this value to the long edge of the image. when the original_size have input, this setting will be ignored.
-
Outputs:
+
* image: If have image input, the scaled image will be output.
* mask: If have mask input, the scaled mask will be output.
* original_size: The original size data of the image is used for subsequent node recovery.
@@ -770,27 +851,30 @@ Outputs:
* height: The output image's height.
### ImageScaleByAspectRatioV2
+
V2 Upgraded Version of ImageScaleByAspectRatio
Node options:

The following changes have been made based on ImageScaleByAspectRatio:
+
* scale_to_side: Allow scaling by specified dimensions for long, short, width, height, or total pixels.
* scale_to_length: The numerical value here serves as the length of the specified edge or the total pixels (kilo pixels) for scale_to_side.
* background_color4: The color of the background.
-
### QWenImage2Prompt
+
Inference the prompts based on the image. this node is repackage of the [ComfyUI_VLM_nodes](https://github.com/gokayfem/ComfyUI_VLM_nodes)'s ```UForm-Gen2 Qwen Node```, thanks to the original author.
Download model files from [huggingface](https://huggingface.co/unum-cloud/uform-gen2-qwen-500m) or [Baidu Netdisk](https://pan.baidu.com/s/1oRkUoOKWaxGod_XTJ8NiTA?pwd=d5d2) to ```ComfyUI/models/LLavacheckpoints/files_for_uform_gen2_qwen``` folder.

Node Options:
+
* question: Prompt of UForm-Gen-QWen model.
-
### PhiPrompt
+
Use Microsoft Phi 3.5 text and visual models for local inference. Can be used to generate prompt words, process prompt words, or infer prompt words from images. Running this model requires at least 16GB of video memory.
Download model files from [BaiduNetdisk](https://pan.baidu.com/s/1BdTLdaeGC3trh1U3V-6XTA?pwd=29dh) or [huggingface.co/microsoft/Phi-3.5-vision-instruct](https://huggingface.co/microsoft/Phi-3.5-vision-instruct/tree/main) and [huggingface.co/microsoft/Phi-3.5-mini-instruct](https://huggingface.co/microsoft/Phi-3.5-mini-instruct/tree/main) and copy to ```ComfyUI\models\LLM``` folder.

@@ -810,6 +894,7 @@ Node Options:
* max_new_tokens: The max_new_token parameter of LLM defaults to 512.
### UserPromptGeneratorTxtImg
+
UserPrompt preset for generating SD text to image prompt words.
Node options:
@@ -819,8 +904,8 @@ Node options:
* describe: Prompt word description. Enter a simple description here.
* limit_word: Maximum length limit for output prompt words. For example, 200 means that the output text will be limited to 200 words.
-
### UserPromptGeneratorTxtImgWithReference
+
UserCompt preset for generating SD text to image prompt words based on input content.
Node options:
@@ -831,8 +916,8 @@ Node options:
* describe: Prompt word description. Enter a simple description here.
* limit_word: Maximum length limit for output prompt words. For example, 200 means that the output text will be limited to 200 words.
-
### UserPromptGeneratorReplaceWord
+
UserPrompt preset used to replace a keyword in text with different content. This is not only a simple replacement, but also a logical sorting of the text based on the context of the prompt words to achieve the rationality of the output content.
Node options:
@@ -843,8 +928,8 @@ Node options:
* exclude_word: Keywords that need to be excluded.
* replace_with_word: That word will replace the exclude_word.
-
### PromptTagger
+
Inference the prompts based on the image. it can replace key word for the prompt. This node currently uses Google Gemini API as the backend service. Please ensure that the network environment can use Gemini normally.
Please apply for your API key on [Google AI Studio](https://makersuite.google.com/app/apikey), And fill it in ```api_key.ini```, this file is located in the root directory of the plug-in, and the default name is ```api_key.ini.example```. to use this file for the first time, you need to change the file suffix to ```.ini```. Open it using text editing software, fill in your API key after ```google_api_key=``` and save it.

@@ -857,8 +942,8 @@ Node options:
* exclude_word: Keywords that need to be excluded.
* replace_with_word: That word will replace the exclude_word.
-
### PromptEmbellish
+
Enter simple prompt words, output polished prompt words, and support inputting images as references, and support Chinese input. This node currently uses Google Gemini API as the backend service. Please ensure that the network environment can use Gemini normally.
Please apply for your API key on [Google AI Studio](https://makersuite.google.com/app/apikey), And fill it in ```api_key.ini```, this file is located in the root directory of the plug-in, and the default name is ```api_key.ini.example```. to use this file for the first time, you need to change the file suffix to ```.ini```. Open it using text editing software, fill in your API key after ```google_api_key=``` and save it.

@@ -872,12 +957,14 @@ Node options:
* discribe: Enter a simple description here. supports Chinese text input.
### Florence2Image2Prompt
+
Use the Florence 2 model to infer prompt words. The code for this node section is from[yiwangsimple/florence_dw](https://github.com/yiwangsimple/florence_dw), thanks to the original author.
*When using it for the first time, the model will be automatically downloaded. You can also download the model file from [BaiduNetdisk](https://pan.baidu.com/s/1hzw9-QiU1vB8pMbBgofZIA?pwd=mfl3) to ```ComfyUI/models/florence2``` folder.

Node Options:

+
* florence2_model: Florence2 model input.
* image: Image input.
* task: Select the task for florence2.
@@ -888,6 +975,7 @@ Node Options:
* fill_mask: Whether to use text marker mask filling.
### VQAPrompt
+
Use the blip-vqa model for visual question answering. Part of the code for this node is referenced from [celoron/ComfyUI-VisualQueryTemplate](https://github.com/celoron/ComfyUI-VisualQueryTemplate), thanks to the original author.
*Download model files from [BaiduNetdisk](https://pan.baidu.com/s/1ILREVgM0eFJlkWaYlKsR0g?pwd=yw75) or [huggingface.co/Salesforce/blip-vqa-capfilt-large](https://huggingface.co/Salesforce/blip-vqa-capfilt-large/tree/main) and [huggingface.co/Salesforce/blip-vqa-base](https://huggingface.co/Salesforce/blip-vqa-base/tree/main) and copy to ```ComfyUI\models\VQA``` folder.
@@ -899,10 +987,10 @@ Node Options:
* image: The image input.
* vqa_model: The vqa model input, it from [LoadVQAModel](#LoadVQAModel) node.
* question: Task text input. A single question is enclosed in curly braces "{}", and the answer to the question will be replaced in its original position in the text output. Multiple questions can be defined using curly braces in a single Q&A.
-For example, for a picture of an item placed in a scene, the question is:"{object color} {object} on the {scene}".
-
+ For example, for a picture of an item placed in a scene, the question is:"{object color} {object} on the {scene}".
### LoadVQAModel
+
Load the blip-vqa model.
Node Options:
@@ -912,14 +1000,14 @@ Node Options:
* precision: The model accuracy has two options: "fp16" and "fp32".
* device: The model running device has two options: "cuda" and "cpu".
-
-
### ImageShift
+
Shift the image. this node supports the output of displacement seam masks, making it convenient to create continuous textures.

Node options:

+
* image5: The input image.
* mask2,5: The mask of image.
* shift_x: Horizontal distance of shift.
@@ -931,11 +1019,13 @@ Node options:
* [note](#notes)
### ImageBlend
+
A simple node for composit layer image and background image, multiple blend modes are available for option, and transparency can be set.

Node options:

+
* background_image1: The background image.
* layer_image1: Layer image for composite.
* layer_mask1,2: Mask for layer_image.
@@ -944,13 +1034,14 @@ Node options:
* opacity: Opacity of blend.
* [note](#notes)
-
### ImageReel
+
Display multiple images in one reel. Text annotations can be added to each image in the reel. By using the [ImageReelComposite](#ImageReelComposite) node, multiple reel can be combined into one image.

Node Options:

+
* image1: The first image. it must be input.
* image2: The second image. optional input.
* image3: The third image. optional input.
@@ -963,13 +1054,16 @@ Node Options:
* border: The border width of the image in the reel.
Output:
+
* reel: The reel of [ImageReelComposite](#ImageReelComposit) node input.
### ImageReelComposite
+
Combine multiple reel into one image.
Node Options:

+
* reel_1: The first reel. it must be input.
* reel_2: The second reel. optional input.
* reel_3: The third reel. optional input.
@@ -977,19 +1071,20 @@ Node Options:
* font_file**: Here is a list of available font files in the font folder, and the selected font files will be used to generate images.
* border: The border width of the reel.
* color_theme: Theme color for the output image.
-*The font folder is defined in ```resource_dir.ini```, this file is located in the root directory of the plug-in, and the default name is ```resource_dir.ini.example```.
-to use this file for the first time, you need to change the file suffix to ```.ini```.
-Open the text editing software and find the line starting with "FONT_dir=", after "=", enter the custom folder path name.
-support defining multiple folders in ```resource-dir.ini```, separated by commas, semicolons, or spaces.
-all font files in this folder will be collected and displayed in the node list during ComfyUI initialization.
-If the folder set in ini is invalid, the font folder that comes with the plugin will be enabled.
-
+ *The font folder is defined in ```resource_dir.ini```, this file is located in the root directory of the plug-in, and the default name is ```resource_dir.ini.example```.
+ to use this file for the first time, you need to change the file suffix to ```.ini```.
+ Open the text editing software and find the line starting with "FONT_dir=", after "=", enter the custom folder path name.
+ support defining multiple folders in ```resource-dir.ini```, separated by commas, semicolons, or spaces.
+ all font files in this folder will be collected and displayed in the node list during ComfyUI initialization.
+ If the folder set in ini is invalid, the font folder that comes with the plugin will be enabled.
### ImageOpacity
+
Adjust image opacity

Node option:
+
* image5: Image input, supporting RGB and RGBA. if is RGB, the alpha channel of the entire image will be automatically added.
* mask2,5 : Mask input.
* invert_mask: Whether to reverse the mask.
@@ -997,100 +1092,124 @@ Node option:
* [note](#notes)
### ColorPicker
+
Modify web extensions from [mtb nodes](https://github.com/melMass/comfy_mtb). Select colors on the color palette and output RGB values, thanks to the original author.

Node options:
+
* mode: The output format is available in hexadecimal (HEX) and decimal (DEC).
Output type:
+
* value: String format.
### RGBValue
+
Output the color value as a single R, G, B three decimal values. Supports HEX and DEC formats for ColorPicker node output.

Node Options:
+
* color_value: Supports hexadecimal (HEX) or decimal (DEC) color values and should be of string or tuple type. Forcing in other types will result in an error.
### HSVValue
+
Output color values as individual decimal values of H, S, and V (maximum value of 255). Supports HEX and DEC formats for ColorPicker node output.

Node Options:
+
* color_value: Supports hexadecimal (HEX) or decimal (DEC) color values and should be of string or tuple type. Forcing in other types will result in an error.
### GrayValue
+
Output grayscale values based on color values. Supports outputting 256 level and 100 level grayscale values.

Node Options:
+
* color_value: Supports hexadecimal (HEX) or decimal (DEC) color values and should be of string or tuple type. Forcing in other types will result in an error.
Outputs:
+
* gray(256_level): 256 level grayscale value. Integer type, range 0~255.
* gray(100_level): 100 level grayscale value. Integer type, range 0~100.
### GetColorTone
+
Obtain the main color or average color from the image and output RGB values.

Node options:

+
* mode: There are two modes to choose from, with the main color and average color.
Output type:
+
* RGB color in HEX: The RGB color described by hexadecimal RGB format, like '#FA3D86'.
* HSV color in list: The HSV color described by python's list data format.
### GetColorToneV2
+
V2 upgrade of GetColorTone. You can specify the dominant or average color to get the body or background.

The following changes have been made on the basis of GetColorTong:

+
* color_of: Provides 4 options, mask, entire, background, and subject, to select the color of the mask area, entire picture, background, or subject, respectively.
* remove_background_method: There are two methods of background recognition: BiRefNet and RMBG V1.4.
* invert_mask: Whether to reverse the mask.
* mask_grow: Mask expansion. For subject, a larger value brings the obtained color closer to the color at the center of the body.
Output:
+
* image: Solid color picture output, the size is the same as the input picture.
* mask: Mask output.
### GetMainColors
+
Obtain the main color of the image. You can obtain 5 colors.


Node Options:

+
* image: The image input.
* k_means_algorithm:K-Means algorithm options. "lloyd" is the standard K-Means algorithm, while "elkan" is the triangle inequality algorithm, suitable for larger images.
Outputs:
+
* preview_image: 5 main color preview images.
* color_1~color_5: Color value output. Output an RGB string in HEX format.
### ColorName
+
Output the most similar color name in the color palette based on the color value.

Node Options:

+
* color: Color value input, in HEX format RGB string format.
* palette: Color palette. ```xkcd``` includes 949 colors, ```css3``` includes 147 colors, and ```html4``` includes 16 colors.
Output:
+
* color_name: Color name in string.
### ExtendCanvas
+
Extend the canvas

Node options:

+
* invert_mask: Whether to reverse the mask.
* top: Top extension value.
* bottom: Bottom extension value.
@@ -1099,26 +1218,31 @@ Node options:
* color; Color of canvas.
### ExtendCanvasV2
+
V2 upgrade to ExtendCanvas.
Based on ExtendCanvas, color is modified to be a string type, and it supports external ```ColorPicker``` input, Support negative value input, it means image will be cropped.

### XY to Percent
+

Convert absolute coordinates to percentage coordinates.

Node options:
+
* x: Value of X.
* y: Value of Y.
### LayerImageTransform
+

This node is used to transform layer_image separately, which can change size, rotation, aspect ratio, and mirror flip without changing the image size.

Node options:
+
* x: Value of X.
* y: Value of Y.
* mirror: Mirror flipping. Provide two flipping modes, horizontal flipping and vertical flipping.
@@ -1128,12 +1252,13 @@ Node options:
* Sampling methods for layer enlargement and rotation, including lanczos, bicubic, hamming, bilinear, box and nearest. Different sampling methods can affect the image quality and processing time of the synthesized image.
* anti_aliasing: Anti aliasing, ranging from 0 to 16, the larger the value, the less obvious the aliasing. An excessively high value will significantly reduce the processing speed of the node.
-
### LayerMaskTransform
+
Similar to LayerImageTransform node, this node is used to transform the layer_mask separately, which can scale, rotate, change aspect ratio, and mirror flip without changing the mask size.

Node options:
+
* x: Value of X.
* y: Value of Y.
* mirror: Mirror flipping. Provide two flipping modes, horizontal flipping and vertical flipping.
@@ -1143,22 +1268,25 @@ Node options:
* Sampling methods for layer enlargement and rotation, including lanczos, bicubic, hamming, bilinear, box and nearest. Different sampling methods can affect the image quality and processing time of the synthesized image.
* anti_aliasing: Anti aliasing, ranging from 0 to 16, the larger the value, the less obvious the aliasing. An excessively high value will significantly reduce the processing speed of the node.
-
### ColorImage
+

Generate an image of a specified color and size.

Node options:
+
* width: Width of the image.
* height: Height of the image.
* color4: Color of the image.
### ColorImageV2
+
The V2 upgraded version of ColorImage.

The following changes have been made based on ColorImage:
+
* size_as*: Input image or mask here to generate image according to its size. Note that this input takes priority over other size settings.
* size**: Size preset. the preset can be customized by the user. if have size_as input, this option will be ignored.
* custom_width: Image width. it valid when size is set to "custom". if have size_as input, this option will be ignored.
@@ -1167,13 +1295,14 @@ The following changes have been made based on ColorImage:
*Only limited to input images and masks. forcing the integration of other types of inputs will result in node errors.
**The preset size is defined in ```custom_size.ini```, this file is located in the root directory of the plug-in, and the default name is ```custom_size.ini.example```. to use this file for the first time, you need to change the file suffix to ```.ini```. Open with text editing software. Each row represents a size, with the first value being width and the second being height, separated by a lowercase "x" in the middle. To avoid errors, please do not enter extra characters.
-
### GradientImage
+

Generate an image with a specified size and color gradient.

Node options:
+
* width: Width of the image.
* height: Height of the image.
* angle: Angle of gradient.
@@ -1181,10 +1310,12 @@ Node options:
* end_color4: Color of the ending.
### GradientImageV2
+
The V2 upgraded version of GradientImage.

The following changes have been made based on GradientImage:
+
* size_as*: Input image or mask here to generate image according to its size. Note that this input takes priority over other size settings.
* size**: Size preset. the preset can be customized by the user. if have size_as input, this option will be ignored.
* custom_width: Image width. it valid when size is set to "custom". if have size_as input, this option will be ignored.
@@ -1194,24 +1325,29 @@ The following changes have been made based on GradientImage:
**The preset size is defined in ```custom_size.ini```, this file is located in the root directory of the plug-in, and the default name is ```custom_size.ini.example```. to use this file for the first time, you need to change the file suffix to ```.ini```. Open with text editing software. Each row represents a size, with the first value being width and the second being height, separated by a lowercase "x" in the middle. To avoid errors, please do not enter extra characters.
### ImageRewardFilter
+

Rating bulk pictures and outputting top-ranked pictures. it used [ImageReward] (https://github.com/THUDM/ImageReward) for image scoring, thanks to the original authors.

Node options:
+
* prompt: Optional input. Entering prompt here will be used as a basis to determine how well it matches the picture.
* output_nun: Number of pictures outputted. This value should be less than the picture batch.
Outputs:
+
* images: Bulk pictures output from high to low in order of rating.
* obsolete_images: Knockout pictures. Also output in order of rating from high to low.
### SimpleTextImage
+

Generate simple typesetting images and masks from text. This node references some of the functionalities and code of [ZHO-ZHO-ZHO/ComfyUI-Text_Image-Composite](https://github.com/ZHO-ZHO-ZHO/ComfyUI-Text_Image-Composite), thanks to the original author.

Node options:
+
* size_as*: The input image or mask here will generate the output image and mask according to their size. this input takes priority over the width and height below.
* font_file**: Here is a list of available font files in the font folder, and the selected font files will be used to generate images.
* align: Alignment options. There are three options: center, left, and right.
@@ -1226,7 +1362,6 @@ Node options:
* width: Width of the image. If there is a size_as input, this setting will be ignored.
* height: Height of the image. If there is a size_as input, this setting will be ignored.
-
*Only limited to input image and mask. forcing the integration of other types of inputs will result in node errors.
**The font folder is defined in ```resource_dir.ini```, this file is located in the root directory of the plug-in, and the default name is ```resource_dir.ini.example```. to use this file for the first time, you need to change the file suffix to ```.ini```.
@@ -1235,14 +1370,14 @@ support defining multiple folders in ```resource-dir.ini```, separated by commas
all font files in this folder will be collected and displayed in the node list during ComfyUI initialization.
If the folder set in ini is invalid, the font folder that comes with the plugin will be enabled.
-
-
### TextImage
+

Generate images and masks from text. support for adjusting the spacing between words and lines, horizontal and vertical adjustments, it can set random changes in each character, including size and position.

Node options:
+
* size_as*: The input image or mask here will generate the output image and mask according to their size. this input takes priority over the width and height below.
* font_file**: Here is a list of available font files in the font folder, and the selected font files will be used to generate images.
* spacing: Word spacing.this value is in pixels.
@@ -1267,11 +1402,13 @@ all font files in this folder will be collected and displayed in the node list d
If the folder set in ini is invalid, the font folder that comes with the plugin will be enabled.
### TextImageV2
+

This node is merged from [heshengtao](https://github.com/heshengtao). The PR modifies the scaling of the image text node based on the TextImage node. The font spacing follows the scaling, and the coordinates are no longer based on the top left corner of the text, but on the center point of the entire line of text. Thank you for the author's contribution.
### LaMa
+

Erase objects from the image based on the mask. this node is repackage of [IOPaint](https://www.iopaint.com), powered by state-of-the-art AI models, thanks to the original author.
It is have [LaMa](https://github.com/advimman/lama), [LDM](https://github.com/CompVis/latent-diffusion), [ZITS](https://github.com/DQiaole/ZITS_inpainting),[MAT](https://github.com/fenglinglwb/MAT), [FcF](https://github.com/SHI-Labs/FcF-Inpainting), [Manga](https://github.com/msxie92/MangaInpainting) models and the SPREAD method to erase. Please refer to the original link for the introduction of each model.
@@ -1279,53 +1416,60 @@ Please download the model files from [lama models(BaiduNetdisk)](https://pan.bai
Node optons:

+
* lama_model: Choose a model or method.
* device: After correctly installing Torch and Nvidia CUDA drivers, using cuda will significantly improve running speed.
* invert_mask: Whether to reverse the mask.
* grow: Positive values expand outward, while negative values contract inward.
* blur: Blur the edge.
-
### ImageChannelSplit
+

Split the image channel into individual images.
Node options:

+
* mode: Channel mode, include RGBA, YCbCr, LAB adn HSV.
### ImageChannelMerge
+

Merge each channel image into one image.
Node options:

+
* mode: Channel mode, include RGBA, YCbCr, LAB adn HSV.
### ImageRemoveAlpha
+

Remove the alpha channel from the image and convert it to RGB mode. you can choose to fill the background and set the background color.
Node options:

+
* RGBA_image: The input image supports RGBA or RGB modes.
* mask: Optional input mask. If there is an input mask, it will be used first, ignoring the alpha that comes with RGBA_image.
* fill_background: Whether to fill the background.
* background_color4: Color of background.
-
### ImageCombineAlpha
+

Merge the image and mask into an RGBA mode image containing an alpha channel.
### ImageAutoCrop
+

Automatically cutout and crop the image according to the mask. it can specify the background color, aspect ratio, and size for output image. this node is designed to generate the image materials for training models.
*Please refer to the model installation methods for [SegmentAnythingUltra](#SegmentAnythingUltra) and [RemBgUltra](#RemBgUltra).
-
Node options:

+
* background_color4: The background color.
* aspect_ratio: Here are several common frame ratios provided. alternatively, you can choose "original" to keep original ratio or customize the ratio using "custom".
* proportional_width: Proportional width. if the aspect ratio option is not "custom", this setting will be ignored.
@@ -1346,7 +1490,6 @@ cropped_image: Crop and replace the background image.
box_preview: Crop position preview.
cropped_mask: Cropped mask.
-
### ImageAutoCropV2
The V2 upgrad version of ```ImageAutoCrop```, it has made the following changes based on the previous version:
@@ -1358,12 +1501,13 @@ The V2 upgrad version of ```ImageAutoCrop```, it has made the following changes
* scale_by: Allow scaling by specified dimensions for longest, shortest, width, or height.
* scale_by_length: The value here is used as ```scale_by``` to specify the length of the edge.
+### ImageAutoCropV3
-### ImageAutoCropV3
Automatically crop the image to the specified size. You can input a mask to preserve the specified area of the mask. This node is designed to generate image materials for training the model.
Node Options:

+
* image: The input image.
* mask: Optional input mask. The masking part will be preserved within the range of the cutting aspect ratio.
* aspect_ratio: The aspect ratio of the output. Here are common frame ratios provided, with "custom" being the custom ratio and "original" being the original frame ratio.
@@ -1378,13 +1522,14 @@ Outputs:
cropped_image: The cropped image.
box_preview: Preview of cutting position.
-
### HLFrequencyDetailRestore
+
Using low frequency filtering and retaining high frequency to recover image details. Compared to [kijai's DetailTransfer](https://github.com/kijai/ComfyUI-IC-Light), this node is better integrated with the environment while retaining details.

Node Options:

+
* image: Background image input.
* detail_image: Detail image input.
* mask: Optional input, if there is a mask input, only the details of the mask part are restored.
@@ -1393,73 +1538,90 @@ Node Options:
* mask_blur: Mask edge blur. Valid only if there is masked input.
### GetImageSize
+

Obtain the width and height of the image.
Output:
+
* width: The width of image.
* height: The height of image.
* original_size: The original size data of the image is used for subsequent node recovery.
### ImageHub
+
Switch output from multiple input images and masks, supporting 9 sets of inputs. All input items are optional. if there is only image or mask in a set of input, the missing item will be output as None.

Node options:

+
* output: Switch output. the value is the corresponding input group. when the ```random-output``` option is True, this setting will be ignored.
* random_output: When this is true, the ```output``` setting will be ignored and a random set will be output among all valid inputs.
-
### BatchSelector
+
Retrieve specified images or masks from batch images or masks.

Node Options:

+
* images: Batch images input. This input is optional.
* masks: Batch masks input. This input is optional.
* select: Select the output image or mask at the batch index value, where 0 is the first image. Multiple values can be entered, separated by any non numeric character, including but not limited to commas, periods, semicolons, spaces or letters, and even Chinese characters.
-Note: If the value exceeds the batch size, the last image will be output. If there is no corresponding input, an empty 64x64 image or a 64x64 black mask will be output.
-
+ Note: If the value exceeds the batch size, the last image will be output. If there is no corresponding input, an empty 64x64 image or a 64x64 black mask will be output.
### TextJoin
+

Combine multiple paragraphs of text into one.
+
+### TextJoinV2
+
+Added delimiter options on the basis of [TextJoin](#TextJoin).
+
### PrintInfo
+

Used to provide assistance for workflow debugging. When running, the properties of any object connected to this node will be printed to the console.
This node allows any type of input.
-
### TextBox
+

Output a string.
### String
+

Output a string. same as TextBox.
### Integer
+

Output a integer value.
### Float
+

Output a floating-point value with a precision of 5 decimal places.
### Boolean
+

Output a boolean value.
### RandomGenerator
+
Used to generate random value within a specified range, with outputs of int, float, and boolean. Supports batch and list generation, and supports batch generation of a set of different random number lists based on image batch.

Node Options:

+
* image: Optional input, generate a list of random numbers that match the quantity in batches according to the image.
* min_value: Minimum value. Random numbers will randomly take values from the minimum to the maximum.
* max_value: Maximum value. Random numbers will randomly take values from the minimum to the maximum.
@@ -1472,65 +1634,76 @@ float: Float random number.
bool: Boolean random number.
### NumberCalculator
+

Performs mathematical operations on two numeric values and outputs integer and floating point results*. Supported operations include```+```, ```-```, ```*```, ```/```, ```**```, ```//```, ```%```.
* The input only supports boolean, integer, and floating point numbers, forcing in other data will result in error.
### NumberCalculatorV2
+

The upgraded version of NumberCalculator has added numerical inputs within nodes and square root operations. The square root operation option is ```nth_root```
Note: The input takes priority, and when there is input, the values within the node will be invalid.
### BooleanOperator
+

Perform a Boolean operation on two numeric values and output the result*. Supported operations include```==```, ```!=```, ```and```, ```or```, ```xor```, ```not```, ```min```, ```max```.
* The input only supports boolean, integer, and floating point numbers, forcing in other data will result in error. The ```and``` operation between the values outputs a larger number, and the ```or``` operation outputs a smaller number.
-
### BooleanOperatorV2
+

The upgraded version of Boolean Operator has added numerical inputs within nodes and added judgments for greater than, less than, greater than or equal to, and less than or equal to.
Note: The input takes priority, and when there is input, the values within the node will be invalid.
-
### StringCondition
+

Determine whether the text contains or does not contain substrings, and output a Boolean value.
Node Options:

+
* text: Input text.
* condition: Judgment conditions. ```include``` determines whether it contains a substring, and ```exclude``` determines whether it does not.
* sub_string: Substring.
### CheckMask
+
Check if the mask contains enough valid areas and output a Boolean value.
Node Options:

+
* white_point: The white point threshold used to determine whether the mask is valid is considered valid if it exceeds this value.
* area_percent: The percentage of effective areas. If the proportion of effective areas exceeds this value, output True.
### CheckMaskV2
+
On the basis of CheckMask, the ```method``` option has been added, which allows for the selection of different detection methods. The ```area_percent``` is changed to a floating point number with an accuracy of 2 decimal places, which can detect smaller effective areas.
Node Options:

+
* method: There are two detection methods, which are ```simple``` and ```detectability```. The simple method only detects whether the mask is completely black, while the detect_percent method detects the proportion of effective areas.
### If
+

Switches output based on Boolean conditional input. It can be used for any type of data switching, including but not limited to numeric values, strings, pictures, masks, models, latent, pipe pipelines, etc.
Node Options:

+
* if_condition: Conditional input. Boolean, integer, floating point, and string inputs are supported. When entering a value, 0 is judged to be False; When a string is entered, an empty string is judged as Flase.
* when_True: This item is output when the condition is True.
* when_False: This item is output when the condition is False.
### SwitchCase
+

Switches the output based on the matching string. It can be used for any type of data switching, including but not limited to numeric values, strings, pictures, masks, models, latent, pipe pipelines, etc. Supports up to 3 sets of case switches.
Compare case to ```switch_condition``` , if the same, output the corresponding input. If there are the same cases, the output is prioritized in order. If there is no matching case, the default input is output.
@@ -1538,6 +1711,7 @@ Note that the string is case sensitive and Chinese and English full-width and ha
Node Options:

+
* input_default: Input entry for default output. This input is required.
* input_1: Input entry used to match ```case_1```. This input is optional.
* input_2: Input entry used to match ```case_2```. This input is optional.
@@ -1548,30 +1722,34 @@ Node Options:
* case_3: case_3 string.
### QueueStop
+

Stop the current queue. When executed at this node, the queue will stop. The workflow diagram above illustrates that if the image is larger than 1Mega pixels, the queue will stop executing.
Node Options:

+
* mode: Stop mode. If you choose ```stop```, it will be determined whether to stop based on the input conditions. If you choose ```continue```, ignore the condition to continue executing the queue.
* stop: If true, the queue will stop. If false, the queue will continue to execute.
### PurgeVRAM
+

Clean up GPU VRAM and system RAM. any type of input can be accessed, and when executed to this node, the VRAM and garbage objects in the RAM will be cleaned up. Usually placed after the node where the inference task is completed, such as the VAE Decode node.
Node Options:
+
* purge_cache: Clean up cache。
* purge_models: Unload all loaded models。
-
-
### SaveImagePlus
+

Enhanced save image node. You can customize the directory where the picture is saved, add a timestamp to the file name, select the save format, set the image compression rate, set whether to save the workflow, and optionally add invisible watermarks to the picture. (Add information in a way that is invisible to the naked eye, and use the ```ShowBlindWaterMark``` node to decode the watermark). Optionally output the json file of the workflow.
Node Options:

+
* iamge: The input image.
* custom_path*: User-defined directory, enter the directory name in the correct format. If empty, it is saved in the default output directory of ComfyUI.
* filename_prefix*: The prefix of file name.
@@ -1585,13 +1763,15 @@ Node Options:
* Enter```%date``` for the current date (YY-mm-dd) and ```%time``` for the current time (HH-MM-SS). You can enter ```/``` for subdirectories. For example, ```%date/name_%tiem``` will output the image to the ```YY-mm-dd``` folder, with ```name_HH-MM-SS``` as the file name prefix.
-### ImageTaggerSave
+### ImageTaggerSave
+

The node used to save the training set images and their text labels, where the image files and text label files have the same file name. Customizable directory for saving images, adding timestamps to file names, selecting save formats, and setting image compression rates.
*The workflow image_tagger_stave.exe is located in the workflow directory.
Node Options:

+
* iamge: The input image.
* tag_text: Text label of image.
* custom_path*: User-defined directory, enter the directory name in the correct format. If empty, it is saved in the default output directory of ComfyUI.
@@ -1603,48 +1783,53 @@ Node Options:
* Enter```%date``` for the current date (YY-mm-dd) and ```%time``` for the current time (HH-MM-SS). You can enter ```/``` for subdirectories. For example, ```%date/name_%tiem``` will output the image to the ```YY-mm-dd``` folder, with ```name_HH-MM-SS``` as the file name prefix.
-
### AddBlindWaterMark
+

Add an invisible watermark to a picture. Add the watermark image in a way that is invisible to the naked eye, and use the ```ShowBlindWaterMark``` node to decode the watermark.
Node Options:

+
* iamge: The input image.
* watermark_image: Watermark image. The image entered here will automatically be converted to a square black and white image as a watermark. It is recommended to use a QR code as a watermark.
-
### ShowBlindWaterMark
+
Decoding the invisible watermark added to the ```AddBlindWaterMark``` and ```SaveImagePlus``` nodes.

-
### CreateQRCode
+
Generate a square QR code picture.
Node Options:

+
* size: The side length of image.
* border: The size of the border around the QR code, the larger the value, the wider the border.
* text: Enter the text content of the QR code here, and multi-language is not supported.
### DecodeQRCode
+
Decoding the QR code.
Node Options:

+
* image: The input QR code image.
* pre_blur: Pre-blurring, you can try to adjust this value for QR codes that are difficult to identify.
### LoadPSD
+


Load the PSD format file and export the layers.
Note that this node requires the installation of the ```psd_tools``` dependency package, If error occurs during the installation of psd_tool, such as ```ModuleNotFoundError: No module named 'docopt'``` , please download [docopt's whl](https://www.piwheels.org/project/docopt/) and manual install it.
-
Node Options:

+
* image: Here is a list of *.psd files under ```ComfyUI/input```, where previously loaded psd images can be selected.
* file_path: The complete path and file name of the psd file.
* include_hidden_layer: whether include hidden layers.
@@ -1657,27 +1842,29 @@ flat_image: PSD preview image.
layer_iamge: Find the layer output.
all_layers: Batch images containing all layers.
-
### SD3NegativeConditioning
+

Encapsulate the four nodes of Negative Condition in SD3 into a separate node.
Node Options:

+
* zero_out_start: Set the ConditioningSetTimestepRange start value for Negative ConditioningZeroOut, which is the same as the ConditioningSetTimestepRange end value for Negative.
-
# LayerMask
+

-
### BlendIfMask
+
Reproduction of Photoshop's layer Style - Blend If function. This node outputs a mask for layer composition on the ImageBlend or ImageBlendAdvance nodes.
```mask``` is an optional input, and if you enter a mask here, it will act on the output.

Node Options:

+
* invert_mask: Whether to reverse the mask.
* blend_if: Channel selection for Blend If. There are four options: ```gray``` , ```red```, ```green```, and ```blue```.
* black_point: Black point values, ranging from 0-255.
@@ -1685,19 +1872,21 @@ Node Options:
* white_point: White point values, ranging from 0-255.
* white_range: Brightness transition range. The larger the value is, the richer the transition level of the bright part mask is.
-
### MaskBoxDetect
+
Detect the area where the mask is located and output its position and size.

Node options:

+
* detect: Detection method, ```min_bounding_rect``` is the minimum bounding rectangle of block shape, ```max_inscribed_rect``` is the maximum inscribed rectangle of block shape, and ```mask-area``` is the effective area for masking pixels.
* x_adjust: Adjust of horizontal deviation after detection.
* y_adjust: Adjust of vertical offset after detection.
* scale_adjust: Adjust the scaling offset after detection.
Output:
+
* box_preview: Preview image of detection results. Red represents the detected result, and green represents the adjust output result.
* x_percent: Horizontal position output in percentage.
* y_percent: Vertical position output in percentage.
@@ -1706,17 +1895,18 @@ Output:
* x: The x-coordinate of the top left corner position.
* y: The y-coordinate of the top left corner position.
-
## Ultra Nodes
+

Nodes that use ultra fine edge masking processing methods, the latest version of nodes includes: SegmentAnythingUltraV2, RmBgUltraV2, BiRefNetUltra, PersonMaskUltraV2, SegformerB2ClothesUltra and MaskEdgeUltraDetailV2.
There are three edge processing methods for these nodes:
+
* ```PyMatting``` optimizes the edges of the mask by using a closed form matching to mask trimap.
* ```GuideFilter``` uses opencv guidedfilter to feather edges based on color similarity, and performs best when edges have strong color separation.
-The code for the above two methods is from the [ComfyUI-Image-Filters](https://github.com/spacepxl/ComfyUI-Image-Filters) in spacepxl's Alpha Matte, thanks to the original author.
+ The code for the above two methods is from the [ComfyUI-Image-Filters](https://github.com/spacepxl/ComfyUI-Image-Filters) in spacepxl's Alpha Matte, thanks to the original author.
* ```VitMatte``` uses the transformer vit model for high-quality edge processing, preserving edge details and even generating semi transparent masks.
-Note: When running for the first time, you need to download the vitmate model file and wait for the automatic download to complete. If the download cannot be completed, you can run the command ```huggingface-cli download hustvl/vitmatte-small-composition-1k``` to manually download.
-After successfully downloading the model, you can use ```VITMatte(local)``` without accessing the network.
+ Note: When running for the first time, you need to download the vitmate model file and wait for the automatic download to complete. If the download cannot be completed, you can run the command ```huggingface-cli download hustvl/vitmatte-small-composition-1k``` to manually download.
+ After successfully downloading the model, you can use ```VITMatte(local)``` without accessing the network.
* VitMatte's options: ```device``` set whether to use CUDA for vitimate operations, which is about 5 times faster than CPU. ```max_megapixels``` set the maximum image size for vitmate operation, and oversized images will be reduced in size. For 16G VRAM, it is recommended to set it to 3.
*Download all model files from [BaiduNetdisk](https://pan.baidu.com/s/1xYF-V6QRwcFalEqLS7giWg?pwd=jiyz) or [Huggingface](https://huggingface.co/hustvl/vitmatte-small-composition-1k/tree/main) to ```ComfyUI/models/vitmatte``` folder.
@@ -1724,24 +1914,26 @@ After successfully downloading the model, you can use ```VITMatte(local)``` with
The following figure is an example of the difference in output between three methods.

-
### SegmentAnythingUltra
+
Improvements to [ComfyUI Segment Anything](https://github.com/storyicon/comfyui_segment_anything), thanks to the original author.
*Please refer to the installation of ComfyUI Segment Anything to install the model. If ComfyUI Segment Anything has been correctly installed, you can skip this step.
+
* From [here](https://huggingface.co/bert-base-uncased/tree/main) download the config.json,model.safetensors,tokenizer_config.json,tokenizer.json and vocab.txt 5 files to ```ComfyUI/models/bert-base-uncased``` folder.
* Download [GroundingDINO_SwinT_OGC config file](https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/GroundingDINO_SwinT_OGC.cfg.py), [GroundingDINO_SwinT_OGC model](https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swint_ogc.pth),
-[GroundingDINO_SwinB config file](https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/GroundingDINO_SwinB.cfg.py), [GroundingDINO_SwinB model](https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swinb_cogcoor.pth) to ```ComfyUI/models/grounding-dino``` folder.
+ [GroundingDINO_SwinB config file](https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/GroundingDINO_SwinB.cfg.py), [GroundingDINO_SwinB model](https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swinb_cogcoor.pth) to ```ComfyUI/models/grounding-dino``` folder.
* Download [sam_vit_h](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth),[sam_vit_l](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth),
-[sam_vit_b](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth), [sam_hq_vit_h](https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_h.pth),
-[sam_hq_vit_l](https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_l.pth), [sam_hq_vit_b](https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_b.pth),
-[mobile_sam](https://github.com/ChaoningZhang/MobileSAM/blob/master/weights/mobile_sam.pt) to ```ComfyUI/models/sams``` folder.
-*Or download them from [GroundingDino models on BaiduNetdisk](https://pan.baidu.com/s/1P7WQDuaqSYazlSQX8SJjxw?pwd=24ki) and [SAM models on BaiduNetdisk](https://pan.baidu.com/s/1n7JrHb2vzV2K2z3ktqpNxg?pwd=yoqh) .
-
-
+ [sam_vit_b](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth), [sam_hq_vit_h](https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_h.pth),
+ [sam_hq_vit_l](https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_l.pth), [sam_hq_vit_b](https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_b.pth),
+ [mobile_sam](https://github.com/ChaoningZhang/MobileSAM/blob/master/weights/mobile_sam.pt) to ```ComfyUI/models/sams``` folder.
+ *Or download them from [GroundingDino models on BaiduNetdisk](https://pan.baidu.com/s/1P7WQDuaqSYazlSQX8SJjxw?pwd=24ki) and [SAM models on BaiduNetdisk](https://pan.baidu.com/s/1n7JrHb2vzV2K2z3ktqpNxg?pwd=yoqh) .
+ 
+ 
Node options:

+
* sam_model: Select the SAM model.
* ground_dino_model: Select the Grounding DINO model.
* threshold: The threshold of SAM.
@@ -1752,19 +1944,21 @@ Node options:
* prompt: Input for SAM's prompt.
### SegmentAnythingUltraV2
+
The V2 upgraded version of SegmentAnythingUltra has added the VITMatte edge processing method.(Note: Images larger than 2K in size using this method will consume huge memory)

On the basis of SegmentAnythingUltra, the following changes have been made:

+
* detail_method: Edge processing methods. provides VITMatte, VITMatte(local), PyMatting, GuidedFilter. If the model has been downloaded after the first use of VITMatte, you can use VITMatte (local) afterwards.
* detail_erode: Mask the erosion range inward from the edge. the larger the value, the larger the range of inward repair.
* detail_dilate: The edge of the mask expands outward. the larger the value, the wider the range of outward repair.
* device: Set whether the VitMatte to use cuda.
* max_megapixels: Set the maximum size for VitMate operations.
-
### SAM2Ultra
+
This node is modified from [kijai/ComfyUI-segment-anything-2](https://github.com/kijai/ComfyUI-segment-anything-2). Thank to [kijai](https://github.com/kijai) for making significant contributions to the Comfyui community.
SAM2 Ultra node only support single image. If you need to process multiple images, please first convert the image batch to image list.
*Download models from [BaiduNetdisk](https://pan.baidu.com/s/1xaQYBA6ktxvAxm310HXweQ?pwd=auki) or [huggingface.co/Kijai/sam2-safetensors](https://huggingface.co/Kijai/sam2-safetensors/tree/main) and copy to ```ComfyUI/models/sam2``` folder.
@@ -1791,8 +1985,8 @@ Node Options:
* max_megapixels: Set the maximum size for VitMate operations.
### SAM2VideoUltra
-SAM2 Video Ultra node support processing multiple frames of images or video sequences. Please define the recognition box data in the first frame of the sequence to ensure correct recognition.
+SAM2 Video Ultra node support processing multiple frames of images or video sequences. Please define the recognition box data in the first frame of the sequence to ensure correct recognition.
https://github.com/user-attachments/assets/4726b8bf-9b98-4630-8f54-cb7ed7a3d2c5
@@ -1820,11 +2014,13 @@ Node Options:
* max_megapixels: Set the maximum size for VitMate operations.A larger size will result in finer mask edges, but it will lead to a significant decrease in computation speed.
### ObjectDetectorFL2
+
Use the Florence2 model to identify objects in images and output recognition box data.
*Download models from [BaiduNetdisk](https://pan.baidu.com/s/1hzw9-QiU1vB8pMbBgofZIA?pwd=mfl3) and copy to ```ComfyUI/models/florence2``` folder.
Node Options:

+
* image: The image to segment.
* florence2_model: Florence2 model, it from [LoadFlorence2Model](#LoadFlorence2Model) node.
* prompt: Describe the object that needs to be identified.
@@ -1833,11 +2029,13 @@ Node Options:
* select_index: This option is valid when bbox_delect is 'by_index'. 0 is the first one. Multiple values can be entered, separated by any non numeric character, including but not limited to commas, periods, semicolons, spaces or letters, and even Chinese.
### ObjectDetectorYOLOWorld
+
Use the YOLO-World model to identify objects in images and output recognition box data.
*Download models from [BaiduNetdisk](https://pan.baidu.com/s/1QpjajeTA37vEAU2OQnbDcQ?pwd=nqsk) or [GoogleDrive](https://drive.google.com/drive/folders/1nrsfq4S-yk9ewJgwrhXAoNVqIFLZ1at7?usp=sharing) and copy to ```ComfyUI/models/yolo-world``` folder.
Node Options:

+
* image: The image to segment.
* confidence_threshold: The threshold of confidence.
* nms_iou_threshold: The threshold of Non-Maximum Suppression.
@@ -1847,11 +2045,13 @@ Node Options:
* select_index: This option is valid when bbox_delect is 'by_index'. 0 is the first one. Multiple values can be entered, separated by any non numeric character, including but not limited to commas, periods, semicolons, spaces or letters, and even Chinese.
### ObjectDetectorYOLO8
+
Use the YOLO-8 model to identify objects in images and output recognition box data.
*Download models from [GoogleDrive](https://drive.google.com/drive/folders/1I5TISO2G1ArSkKJu1O9b4Uvj3DVgn5d2) or [BaiduNetdisk](https://pan.baidu.com/s/1pEY6sjABQaPs6QtpK0q6XA?pwd=grqe) and copy to ```ComfyUI/models/yolo``` folder.
Node Options:

+
* image: The image to segment.
* yolo_model: Choose the yolo model.
* sort_method: The selection box sorting method has 4 options: "left_to_right", "top_to_bottom", "big_to_small" and "confidence".
@@ -1859,31 +2059,37 @@ Node Options:
* select_index: This option is valid when bbox_delect is 'by_index'. 0 is the first one. Multiple values can be entered, separated by any non numeric character, including but not limited to commas, periods, semicolons, spaces or letters, and even Chinese.
### ObjectDetectorMask
+
Use mask as recognition box data. All areas surrounded by white areas on the mask will be recognized as an object. Multiple enclosed areas will be identified separately.
Node Options:

+
* object_mask: The mask input.
* sort_method: The selection box sorting method has 4 options: "left_to_right", "top_to_bottom", "big_to_small" and "confidence".
* bbox_select: Select the input box data. There are three options: "all" to select all, "first" to select the box with the highest confidence, and "by_index" to specify the index of the box.
* select_index: This option is valid when bbox_delect is 'by_index'. 0 is the first one. Multiple values can be entered, separated by any non numeric character, including but not limited to commas, periods, semicolons, spaces or letters, and even Chinese.
### BBoxJoin
+
Merge recognition box data.
Node Options:

+
* bboxes_1: Required input. The first set of identification boxes.
* bboxes_2: Optional input. The second set of identification boxes.
* bboxes_3: Optional input. The third set of identification boxes.
* bboxes_4: Optional input. The fourth set of identification boxes.
### DrawBBoxMask
+
Draw the recognition BBoxes data output by the Object Detector node as a mask.

Node Options:

+
* image: Image input. It must be consistent with the image recognized by the Object Detector node.
* bboxes: Input recognition BBoxes data.
* grow_top: Each BBox expands upwards as a percentage of its height, positive values indicate upward expansion and negative values indicate downward expansion.
@@ -1892,6 +2098,7 @@ Node Options:
* grow_right: Each BBox expands to the right as a percentage of its width, positive values indicate expansion to the right and negative values indicate expansion to the left.
### EVF-SAMUltra
+
This node is implementation of [EVF-SAM](https://github.com/hustvl/EVF-SAM) in ComfyUI.
*Please download model files from [BaiduNetdisk](https://pan.baidu.com/s/1EvaxgKcCxUpMbYKzLnEx9w?pwd=69bn) or [huggingface/EVF-SAM2](https://huggingface.co/YxZhang/evf-sam2/tree/main), [huggingface/EVF-SAM](https://huggingface.co/YxZhang/evf-sam/tree/main) to ```ComfyUI/models/EVF-SAM``` folder(save the models in their respective subdirectories).

@@ -1914,6 +2121,7 @@ Node Options:
* max_megapixels: Set the maximum size for VitMate operations.
### Florence2Ultra
+
Using the segmentation function of the Florence2 model, while also having ultra-high edge details.
The code for this node section is from [spacepxl/ComfyUI-Florence-2](https://github.com/spacepxl/ComfyUI-Florence-2), thanks to the original author.
*Download the model files from [BaiduNetdisk](https://pan.baidu.com/s/1hzw9-QiU1vB8pMbBgofZIA?pwd=mfl3) to ```ComfyUI/models/florence2``` folder.
@@ -1922,6 +2130,7 @@ The code for this node section is from [spacepxl/ComfyUI-Florence-2](https://git
Node Options:

+
* florence2_model: Florence2 model input.
* image: Image input.
* task: Select the task for florence2.
@@ -1936,14 +2145,15 @@ Node Options:
* max_megapixels: Set the maximum size for VitMate operations.
### LoadFlorence2Model
+
Florence2 model loader.
*When using it for the first time, the model will be automatically downloaded.

At present, there are base, base-ft, large, large-ft, DocVQA, SD3-Captioner and base-PromptGen models to choose from.
-
### RemBgUltra
+
Remove background. compared to the similar background removal nodes, this node has ultra-high edge details.
This node combines the Alpha Matte node of Spacepxl's [ComfyUI-Image-Filters](https://github.com/spacepxl/ComfyUI-Image-Filters) and the functionality of ZHO-ZHO-ZHO's [ComfyUI-BRIA_AI-RMBG](https://github.com/ZHO-ZHO-ZHO/ComfyUI-BRIA_AI-RMBG), thanks to the original author.
@@ -1954,16 +2164,19 @@ This node combines the Alpha Matte node of Spacepxl's [ComfyUI-Image-Filters](ht
Node options:

+
* detail_range: Edge detail range.
* black_point: Edge black sampling threshold.
* white_point: Edge white sampling threshold.
* process_detail: Set to false here will skip edge processing to save runtime.
### RmBgUltraV2
+
The V2 upgraded version of RemBgUltra has added the VITMatte edge processing method.(Note: Images larger than 2K in size using this method will consume huge memory)
On the basis of RemBgUltra, the following changes have been made:

+
* detail_method: Edge processing methods. provides VITMatte, VITMatte(local), PyMatting, GuidedFilter. If the model has been downloaded after the first use of VITMatte, you can use VITMatte (local) afterwards.
* detail_erode: Mask the erosion range inward from the edge. the larger the value, the larger the range of inward repair.
* detail_dilate: The edge of the mask expands outward. the larger the value, the wider the range of outward repair.
@@ -1971,6 +2184,7 @@ On the basis of RemBgUltra, the following changes have been made:
* max_megapixels: Set the maximum size for VitMate operations.
### BiRefNetUltra
+
Using the BiRefNet model to remove background has better recognition ability and ultra-high edge details.
The code for the model part of this node comes from Viper's [ComfyUI-BiRefNet](https://github.com/viperyl/ComfyUI-BiRefNet),thanks to the original author.
@@ -1980,6 +2194,7 @@ The code for the model part of this node comes from Viper's [ComfyUI-BiRefNet](h
Node options:

+
* detail_method: Edge processing methods. provides VITMatte, VITMatte(local), PyMatting, GuidedFilter. If the model has been downloaded after the first use of VITMatte, you can use VITMatte (local) afterwards.
* detail_erode: Mask the erosion range inward from the edge. the larger the value, the larger the range of inward repair.
* detail_dilate: The edge of the mask expands outward. the larger the value, the wider the range of outward repair.
@@ -1989,8 +2204,8 @@ Node options:
* device: Set whether the VitMatte to use cuda.
* max_megapixels: Set the maximum size for VitMate operations.
-
### BiRefNetUltraV2
+
This node supports the use of the latest BiRefNet model.
*Download model file from [BaiduNetdisk](https://pan.baidu.com/s/12z3qUuqag3nqpN2NJ5pSzg?pwd=ek65) or [GoogleDrive](https://drive.google.com/drive/folders/1s2Xe0cjq-2ctnJBR24563yMSCOu4CcxM) named ```BiRefNet-general-epoch_244.pth``` to ```ComfyUI/Models/BiRefNet/pth``` folder. You can also download more BiRefNet models and put them here.
@@ -2011,6 +2226,7 @@ Node Options:
* max_megapixels: Set the maximum size for VitMate operations.
### LoadBiRefNetModel
+
Load the BiRefNet model.
Node Options:
@@ -2019,6 +2235,7 @@ Node Options:
* model: Select the model. List the files in the ```CoomfyUI/models/BiRefNet/pth``` folder for selection.
### TransparentBackgroundUltra
+
Using the transparent-background model to remove background has better recognition ability and speed, while also having ultra-high edge details.
*From [googledrive](https://drive.google.com/drive/folders/10KBDY19egb8qEQBv34cqIVSwd38bUAa9?usp=sharing) or [BaiduNetdisk](https://pan.baidu.com/s/10JO0uKzTxJaIkhN_J7RSyw?pwd=v0b0) download all files to ```ComfyUI/models/transparent-background``` folder.
@@ -2027,6 +2244,7 @@ Using the transparent-background model to remove background has better recogniti
Node Options:

+
* model: Select the model.
* detail_method: Edge processing methods. provides VITMatte, VITMatte(local), PyMatting, GuidedFilter. If the model has been downloaded after the first use of VITMatte, you can use VITMatte (local) afterwards.
* detail_erode: Mask the erosion range inward from the edge. the larger the value, the larger the range of inward repair.
@@ -2038,6 +2256,7 @@ Node Options:
* max_megapixels: Set the maximum size for VitMate operations.
### PersonMaskUltra
+
Generate masks for portrait's face, hair, body skin, clothing, or accessories. Compared to the previous A Person Mask Generator node, this node has ultra-high edge details.
The model code for this node comes from [a-person-mask-generator](https://github.com/djbielejeski/a-person-mask-generator), edge processing code from [ComfyUI-Image-Filters](https://github.com/spacepxl/ComfyUI-Image-Filters),thanks to the original author.
*Download model files from [BaiduNetdisk](https://pan.baidu.com/s/13zqZtBt89ueCyFufzUlcDg?pwd=jh5g) to ```ComfyUI/models/mediapipe``` folder.
@@ -2046,6 +2265,7 @@ The model code for this node comes from [a-person-mask-generator](https://github
Node options:

+
* face: Face recognition.
* hair: Hair recognition.
* body: Body skin recognition.
@@ -2059,26 +2279,29 @@ Node options:
* process_detail: Set to false here will skip edge processing to save runtime.
### PersonMaskUltraV2
+
The V2 upgraded version of PersonMaskUltra has added the VITMatte edge processing method.(Note: Images larger than 2K in size using this method will consume huge memory)
On the basis of PersonMaskUltra, the following changes have been made:

+
* detail_method: Edge processing methods. provides VITMatte, VITMatte(local), PyMatting, GuidedFilter. If the model has been downloaded after the first use of VITMatte, you can use VITMatte (local) afterwards.
* detail_erode: Mask the erosion range inward from the edge. the larger the value, the larger the range of inward repair.
* detail_dilate: The edge of the mask expands outward. the larger the value, the wider the range of outward repair.
* device: Set whether the VitMatte to use cuda.
* max_megapixels: Set the maximum size for VitMate operations.
-*
-### SegformerB2ClothesUltra
-
-Generate masks for characters' faces, hair, arms, legs, and clothing, mainly used for segmenting clothing.
-The model segmentation code is from[StartHua](https://github.com/StartHua/Comfyui_segformer_b2_clothes),thanks to the original author.
-Compared to the comfyui_segformer_b2_clothes, this node has ultra-high edge details. (Note: Generating images with edges exceeding 2K in size using the VITMatte method will consume a lot of memory)
+* ### SegformerB2ClothesUltra
+
+ 
+ Generate masks for characters' faces, hair, arms, legs, and clothing, mainly used for segmenting clothing.
+ The model segmentation code is from[StartHua](https://github.com/StartHua/Comfyui_segformer_b2_clothes),thanks to the original author.
+ Compared to the comfyui_segformer_b2_clothes, this node has ultra-high edge details. (Note: Generating images with edges exceeding 2K in size using the VITMatte method will consume a lot of memory)
*Download all model files from [huggingface](https://huggingface.co/mattmdjaga/segformer_b2_clothes/tree/main) or [BaiduNetdisk](https://pan.baidu.com/s/1OK-HfCNyZWux5iQFANq9Rw?pwd=haxg) to ```ComfyUI/models/segformer_b2_clothes``` folder.
Node Options:

+
* face: Facial recognition switch.
* hair: Hair recognition switch.
* hat: Hat recognition switch.
@@ -2104,6 +2327,7 @@ Node Options:
* max_megapixels: Set the maximum size for VitMate operations.
### SegformerUltraV2
+


Using the segformer model to segment clothing with ultra-high edge details. Currently supports segformer b2 clothes, segformer b3 clothes and segformer b3 fashion。
@@ -2114,6 +2338,7 @@ Using the segformer model to segment clothing with ultra-high edge details. Curr
Node Options:

+
* image: The input image.
* segformer_pipeline: Segformer pipeline input. The pipeline is output by SegformerClottesPipeline and SegformerFashionPipeline node.
* detail_method: Edge processing methods. provides VITMatte, VITMatte(local), PyMatting, GuidedFilter. If the model has been downloaded after the first use of VITMatte, you can use VITMatte (local) afterwards.
@@ -2126,10 +2351,12 @@ Node Options:
* max_megapixels: Set the maximum size for VitMate operations.
### SegformerClothesPipiline
+
Select the segformer clothes model and choose the segmentation content.
Node Options:

+
* model: Model selection. There are currently two models available to choose from for segformer b2 clothes and segformer b3 clothes.
* face: Facial recognition switch.
* hair: Hair recognition switch.
@@ -2148,11 +2375,13 @@ Node Options:
* bag: Bag recognition switch.
* scarf: Scarf recognition switch.
-### SegformerFashionPipiline
+### SegformerFashionPipiline
+
Select the segformer fashion model and choose the segmentation content.
Node Options:

+
* model: Model selection. Currently, there is only one model available for selection: segformer b3 fashion。
* shirt: shirt and blouse switch.
* top: top, t-shirt, sweatshirt switch.
@@ -2202,6 +2431,7 @@ Node Options:
* tassel: tassel switch.
### HumanPartsUltra
+
Used for generate human body parts masks, it is based on the warrper of [metal3d/ComfyUI_Human_Parts](https://github.com/metal3d/ComfyUI_Human_Parts), thank the original author.
This node has added ultra-fine edge processing based on the original work. Download model file from [BaiduNetdisk](https://pan.baidu.com/s/1-6uwH6RB0FhIVfa3qO7hhQ?pwd=d862) or [huggingface](https://huggingface.co/Metal3d/deeplabv3p-resnet50-human/tree/main) and copy to ```ComfyUI\models\onnx\human-parts``` folder.

@@ -2231,14 +2461,15 @@ Node Options:
* device: Set whether the VitMatte to use cuda.
* max_megapixels: Set the maximum size for VitMate operations.
-
### MaskEdgeUltraDetail
+
Process rough masks to ultra fine edges.
This node combines the Alpha Matte and the Guided Filter Alpha nodes functions of Spacepxl's [ComfyUI-Image-Filters](https://github.com/spacepxl/ComfyUI-Image-Filters), thanks to the original author.

Node options:

+
* method: Provide two methods for edge processing: PyMatting and OpenCV-GuidedFilter. PyMatching has a slower processing speed, but for video, it is recommended to use this method to obtain smoother mask sequences.
* mask_grow: Mask expansion amplitude. positive values expand outward, while negative values contract inward. For rougher masks, negative values are usually used to shrink their edges for better results.
* fix_gap: Repair the gaps in the mask. if obvious gaps in the mask, increase this value appropriately.
@@ -2248,11 +2479,13 @@ Node options:
* white_point: Edge white sampling threshold.
### MaskEdgeUltraDetailV2
+
The V2 upgraded version of MaskEdgeUltraDetail has added the VITMatte edge processing method.(Note: Images larger than 2K in size using this method will consume huge memory)
This method is suitable for handling semi transparent areas.
On the basis of MaskEdgeUltraDetail, the following changes have been made:

+
* method: Edge processing methods. provides VITMatte, VITMatte(local), PyMatting, GuidedFilter. If the model has been downloaded after the first use of VITMatte, you can use VITMatte (local) afterwards.
* edge_erode: Mask the erosion range inward from the edge. the larger the value, the larger the range of inward repair.
* edge_dilate: The edge of the mask expands outward. the larger the value, the wider the range of outward repair.
@@ -2260,6 +2493,7 @@ On the basis of MaskEdgeUltraDetail, the following changes have been made:
* max_megapixels: Set the maximum size for VitMate operations.
### YoloV8Detect
+
Use the YoloV8 model to detect faces, hand box areas, or character segmentation. Supports the output of the selected number of channels.
Download the model files from [GoogleDrive](https://drive.google.com/drive/folders/1I5TISO2G1ArSkKJu1O9b4Uvj3DVgn5d2) or [BaiduNetdisk](https://pan.baidu.com/s/1pEY6sjABQaPs6QtpK0q6XA?pwd=grqe) to ```ComfyUI/models/yolo``` folder.
@@ -2267,16 +2501,18 @@ Download the model files from [GoogleDrive](https://drive.google.com/drive/folde
Node Options:

+
* yolo_model: Yolo model selection. the model with ```seg``` name can output segmented masks, otherwise they can only output box masks.
* mask_merge: Select the merged mask. ```all``` is to merge all mask outputs. The selected number is how many masks to output, sorted by recognition confidence to merge the output.
Outputs:
+
* mask: The output mask.
* yolo_plot_image: Preview of yolo recognition results.
* yolo_masks: For all masks identified by yolo, each individual mask is output as a mask.
-
### MediapipeFacialSegment
+
Use the Mediapipe model to detect facial features, segment left and right eyebrows, eyes, lips, and tooth.
*Download the model files from [BaiduNetdisk](https://pan.baidu.com/s/13zqZtBt89ueCyFufzUlcDg?pwd=jh5g) to ```ComfyUI/models/mediapipe``` folder.
@@ -2284,6 +2520,7 @@ Use the Mediapipe model to detect facial features, segment left and right eyebro
Node Options:

+
* left_eye: Recognition switch of left eye.
* left_eyebrow: Recognition switch of left eyebrow.
* right_eye: Recognition switch of right eye.
@@ -2292,11 +2529,13 @@ Node Options:
* tooth: Recognition switch of tooth.
### MaskByColor
+
Generate a mask based on the selected color.

Node Options:

+
* image: Input image.
* mask: This input is optional, if there is a mask, only the colors inside the mask are included in the range.
* color: Color selector. Click on the color block to select a color, and you can use the straws on the color picker panel to pick up the screen color. Note: When using straws, maximize the browser window.
@@ -2307,11 +2546,13 @@ Node Options:
* invert_mask: Whether to reverse the mask.
### ImageToMask
+
Convert the image to a mask. Supports converting any channel in LAB, RGBA, YUV, and HSV modes into masks, while providing color scale adjustment. Support mask optional input to obtain masks that only include valid parts.

Node Options:

+
* image: Input image.
* mask: This input is optional, if there is a mask, only the colors inside the mask are included in the range.
* channel: Channel selection. You can choose any channel of LAB, RGBA, YUV, or HSV modes.
@@ -2322,13 +2563,14 @@ Node Options:
*If the black_point or output_black_point value is greater than white_point or output_white_point, the two values are swapped, with the larger value used as white_point and the smaller value used as black_point.
-
### Shadow & Highlight Mask
+
Generate masks for the dark and bright parts of the image.

Node options:

+
* image: The input image.
* mask: Optional input. if there is input, only the colors within the mask range will be adjusted.
* shadow_level_offset: The offset of values in the dark area, where larger values bring more areas closer to the bright into the dark area.
@@ -2337,44 +2579,53 @@ Node options:
* highlight_range: The transitional range of the highlight area.
### Shadow Highlight Mask V2
+
A replica of the ```Shadow & Highlight Mask``` node, with the "&" character removed from the node name to avoid ComfyUI workflow parsing errors.
### PixelSpread
+
Pixel expansion preprocessing on the masked edge of an image can effectively improve the edges of image composit.

Node options:

+
* invert_mask: Whether to reverse the mask.
* mask_grow: Mask expansion amplitude.
### MaskByDifferent
+
Calculate the differences between two images and output them as mask.

Node options:

+
* gain: The gain of difference calculate. higher value will result in a more significant slight difference.
* fix_gap: Fix the internal gaps of the mask. higher value will repair larger gaps.
* fix_threshold: The threshold for fix_gap.
* main_subject_detect: Setting this to True will enable subject detection, ignoring differences outside of the subject.
### MaskGrow
+
Grow and shrink edges and blur the mask

Node options:

+
* invert_mask: Whether to reverse the mask.
* grow: Positive values expand outward, while negative values contract inward.
* blur: Blur the edge.
### MaskEdgeShrink
+
Smooth transition and shrink the mask edges while preserving edge details.

Node options:

+
* invert_mask: Whether to reverse the mask.
* shrink_level: Shrink the smoothness level.
* soft: Smooth amplitude.
@@ -2385,21 +2636,25 @@ Comparison of MaskGrow and MaskEdgeShrink

### MaskMotionBlur
+
Create motion blur on the mask.

Node options:

+
* invert_mask: Whether to reverse the mask.
* blur: The size of blur.
* angle: The angle of blur.
### MaskGradient
+
Create a gradient for the mask from one side. please note the difference between this node and the CreateGradientMask node.

Node options:

+
* invert_mask: Whether to reverse the mask.
* gradient_side: Generate gradient from which edge. There are four directions: top, bottom, left and right.
* gradient_scale: Gradient distance. The default value of 100 indicates that one side of the gradient is completely transparent and the other side is completely opaque. The smaller the value, the shorter the distance from transparent to opaque.
@@ -2407,12 +2662,14 @@ Node options:
* opacity: The opacity of the gradient.
### CreateGradientMask
+
Create a gradient mask. please note the difference between this node and the MaskGradient node.


Node options:

+
* size_as*: The input image or mask here will generate the output image and mask according to their size. this input takes priority over the width and height below.
* width: Width of the image. If there is a size_as input, this setting will be ignored.
* height: Height of the image. If there is a size_as input, this setting will be ignored.
@@ -2423,93 +2680,110 @@ Node options:
*Only limited to input image and mask. forcing the integration of other types of inputs will result in node errors.
-
### MaskStroke
+
Generate mask contour strokes.

Node options:

+
* invert_mask: Whether to reverse the mask.
* stroke_grow: Stroke expansion/contraction amplitude, positive values indicate expansion and negative values indicate contraction.
* stroke_width: Stroke width.
* blur: Blur of stroke.
### MaskGrain
+
Generates noise for the mask.

Node Options:

+
* grain: Noise intensity.
* invert_mask: Whether to reverse the mask.
### MaskPreview
+
Preview the input mask

### MaskInvert
+
Invert the mask

-
# LayerFilter
+

### Sharp & Soft
+
Enhance or smooth out details for image.

Node options:

+
* enhance: Provide 4 presets, which are very sharp, sharp, soft and very soft. If you choose None, you will not do any processing.
### SkinBeauty
+
Make the skin look smoother.

Node options:

+
* smooth: Skin smoothness.
* threshold: Smooth range. the larger the range with the smaller value.
* opacity: The opacity of the smoothness.
### WaterColor
+
Watercolor painting effect

Node option:

+
* line_density: The black line density.
* opacity: The opacity of watercolor effects.
### SoftLight
+
Soft light effect, the bright highlights on the screen appear blurry.

Node options:

+
* soft: Size of soft light.
* threshold: Soft light range. the light appears from the brightest part of the picture. in lower value, the range will be larger, and in higher value, the range will be smaller.
* opacity: Opacity of the soft light.
### ChannelShake
+
Channel misalignment. similar to the effect of Tiktok logo.

Node options:

+
* distance: Distance of channel separation.
* angle: Angle of channel separation.
* mode: Channel shift arrangement order.
### HDR Effects
+
enhances the dynamic range and visual appeal of input images.
This node is reorganize and encapsulate of [HDR Effects (SuperBeasts.AI)](https://github.com/SuperBeastsAI/ComfyUI-SuperBeasts), thanks to the original author.

Node options:

+
* hdr_intensity: Range: 0.0 to 5.0, Controls the overall intensity of the HDR effect, Higher values result in a more pronounced HDR effect.
* shadow_intensity: Range: 0.0 to 1.0,Adjusts the intensity of shadows in the image,Higher values darken the shadows and increase contrast.
* highlight_intensity: Range: 0.0 to 1.0,Adjusts the intensity of highlights in the image,Higher values brighten the highlights and increase contrast.
@@ -2517,14 +2791,15 @@ Node options:
* contrast: Range: 0.0 to 1.0,Enhances the contrast of the image, Higher values result in more pronounced contrast.
* enhance_color: Range: 0.0 to 1.0,Enhances the color saturation of the image, Higher values result in more vibrant colors.
-
### Film
+
Simulate the grain, dark edge, and blurred edge of the film, support input depth map to simulate defocus.
This node is reorganize and encapsulate of [digitaljohn/comfyui-propost](https://github.com/digitaljohn/comfyui-propost), thanks to the original author.

Node options:

+
* image: The input image.
* depth_map: Input depth map to simulate defocus effect. it is an optional input. if there is no input, will simulates radial blur at the edges of the image.
* center_x: The horizontal axis of the center point position of the dark edge and radial blur, where 0 represents the leftmost side, 1 represents the rightmost side, and 0.5 represents at the center.
@@ -2540,15 +2815,18 @@ Node options:
* focal_depth: Simulate the focal distance of defucus. 0 indicates that focus is farthest, and 1 indicates that is closest. this setting only valid when input the depth_map.
### FilmV2
+
The upgraded version of the Film node adds the fastgrain method on the basis of the previous one, and the speed of generating noise is accelerated by 10 times. The code for fastgrain is from [github.com/spacepxl/ComfyUI-Image-Filters](https://github.com/spacepxl/ComfyUI-Image-Filters) BetterFilmGrain node, thanks to the original authors.

### LightLeak
+
Simulate the light leakage effect of the film. please download model file from [Baidu Netdisk](https://pan.baidu.com/s/18Z0lhsDAejbwlOrCZFMuNg?pwd=o8sz) or [Google Drive]([light_leak.pkl(Google Drive)(https://drive.google.com/file/d/1DcH2Zkyj7W3OiAeeGpJk1eaZpdJwdCL-/view?usp=sharing)) and copy to ```ComfyUI/models/layerstyle``` folder.

Node options:

+
* light: 32 types of light spots are provided. random is a random selection.
* corner: There are four options for the corner where the light appears: top left, top right, bottom left, and bottom right.
* hue: The hue of the light.
@@ -2556,48 +2834,58 @@ Node options:
* opacity: The opacity of the light.
### ColorMap
+
Pseudo color heat map effect.

Node options:

+
* color_map: Effect type. there are a total of 22 types of effects, as shown in the above figure.
* opacity: The opacity of the color map effect.
### MotionBlur
+
Make the image motion blur

Node options:
+
* angle: The angle of blur.
* blur: The size of blur.
### GaussianBlur
+
Make the image gaussian blur

Node options:
+
* blur: The size of blur, integer, range 1-999.
### GaussianBlurV2
+
Gaussian blur. Change the parameter precision to floating-point number, with a precision of 0.01
Node options:

+
* blur: The size of blur, float, range 0 - 1000.
### AddGrain
+
Add noise to the picture.

Node Options:

+
* grain_power: Noise intensity.
* grain_scale: Noise size.
* grain_sat: Color saturation of noise.
-
## Annotation for notes
+
1 The layer_image, layer_mask and the background_image(if have input), These three items must be of the same size.
2 The mask not a mandatory input item. the alpha channel of the image is used by default. If the image input does not include an alpha channel, the entire image's alpha channel will be automatically created. if have masks input simultaneously, the alpha channel will be overwrite by the mask.
@@ -2615,10 +2903,10 @@ Part of the code for BlendMode V2 is from [Virtuoso Nodes for ComfyUI](https://g
5 The layer_image and layer_mask must be of the same size.
-## Stars
+## Stars
[](https://star-history.com/#chflame163/ComfyUI_LayerStyle&Date)
# statement
-LayerStyle nodes follows the MIT license, Some of its functional code comes from other open-source projects. Thanks to the original author. If used for commercial purposes, please refer to the original project license to authorization agreement.
+LayerStyle nodes follows the MIT license, Some of its functional code comes from other open-source projects. Thanks to the original author. If used for commercial purposes, please refer to the original project license to authorization agreement.
diff --git a/README_CN.MD b/README_CN.MD
index 96afbdf..fff4815 100644
--- a/README_CN.MD
+++ b/README_CN.MD
@@ -116,6 +116,7 @@ os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
## 更新说明
**如果本插件更新后出现依赖包错误,请双击运行插件目录下的```install_requirements.bat```(官方便携包),或 ```install_requirements_aki.bat```(秋叶整合包) 重新安装依赖包。
+* 添加 [TextJoinV2](#TextJoinV2) 节点,在TextJion基础上增加分隔符选项。
* 添加 [GaussianBlurV2](#GaussianBlurV2) 节点,参数精度提升到0.01。
* 添加 [UserPromptGeneratorTxtImgWithReference](#UserPromptGeneratorTxtImgWithReference) 节点。
* 添加 [GrayValue](#GrayValue) 节点,输出RGB色值对应的灰度值。
@@ -1406,6 +1407,9 @@ box_preview: 裁切位置预览。

将多段文字组合为一段。
+### TextJoinV2
+
+在[TextJoin](#TextJoin) 的基础上增加了分隔符选项。
### PrintInfo

diff --git a/image/text_join_v2_node.jpg b/image/text_join_v2_node.jpg
new file mode 100644
index 0000000..bcb2a24
Binary files /dev/null and b/image/text_join_v2_node.jpg differ
diff --git a/py/image_scale_by_aspect_ratio_v2.py b/py/image_scale_by_aspect_ratio_v2.py
index 0b2b5bf..38a3547 100644
--- a/py/image_scale_by_aspect_ratio_v2.py
+++ b/py/image_scale_by_aspect_ratio_v2.py
@@ -63,7 +63,6 @@ class ImageScaleByAspectRatioV2:
mask = torch.unsqueeze(mask, 0)
for m in mask:
m = torch.unsqueeze(m, 0)
- print(f"m.shape={m.shape}")
if not is_valid_mask(m) and m.shape==torch.Size([1,64,64]):
log(f"Warning: {NODE_NAME} input mask is empty, ignore it.", message_type='warning')
else:
diff --git a/py/imagefunc.py b/py/imagefunc.py
index a527b2d..f0a2bd5 100644
--- a/py/imagefunc.py
+++ b/py/imagefunc.py
@@ -2241,7 +2241,7 @@ def file_is_extension(filename:str, ext_list:tuple) -> bool:
return False
# 遍历目录下包括子目录指定后缀文件,返回字典
-def collect_files(default_dir:str, root_dir:str, suffixes:tuple):
+def collect_files(root_dir:str, suffixes:tuple, default_dir:str=""):
result = {}
for dirpath, _, filenames in os.walk(root_dir):
for file in filenames:
@@ -2285,12 +2285,12 @@ def get_resource_dir() -> list:
LUT_DICT = {}
for dir in default_lut_dir:
- LUT_DICT.update(collect_files(default_lut_dir[0], dir, ('.cube'))) # 后缀要小写
+ LUT_DICT.update(collect_files(root_dir=dir, suffixes= ('.cube'), default_dir=default_lut_dir[0] )) # 后缀要小写
LUT_LIST = list(LUT_DICT.keys())
FONT_DICT = {}
for dir in default_font_dir:
- FONT_DICT.update(collect_files(default_font_dir[0], dir, ('.ttf', '.otf'))) # 后缀要小写
+ FONT_DICT.update(collect_files(root_dir=dir, suffixes=('.ttf', '.otf'), default_dir=default_font_dir[0])) # 后缀要小写
FONT_LIST = list(FONT_DICT.keys())
return (LUT_DICT, FONT_DICT)
@@ -2362,6 +2362,34 @@ def draw_bounding_boxes(image: Image, bboxes: list, color: str = "#FF0000", line
return image
+def draw_bbox(image: Image, bbox: tuple, color: str = "#FF0000", line_width: int = 5, title: str = "", font_size: int = 10) -> Image:
+ """
+ Draw bounding boxes on the image using the coordinates provided in the bboxes dictionary.
+ """
+
+ (_, FONT_DICT) = get_resource_dir()
+
+ font = ImageFont.truetype(list(FONT_DICT.items())[0][1], font_size)
+
+ draw = ImageDraw.Draw(image)
+ width, height = image.size
+ if line_width < 0: # auto line width
+ line_width = (image.width + image.height) // 1000
+
+ random_color = generate_random_color()
+ if color != "random":
+ random_color = color
+ xmin = min(bbox[0], bbox[2])
+ xmax = max(bbox[0], bbox[2])
+ ymin = min(bbox[1], bbox[3])
+ ymax = max(bbox[1], bbox[3])
+ draw.rectangle([xmin, ymin, xmax, ymax], outline=random_color, width=line_width)
+ if title != "":
+ draw.text((xmin, ymin - font_size*1.2), title, font=font, fill=random_color)
+
+ return image
+
+
'''Constant'''
diff --git a/py/text_join.py b/py/text_join.py
index 0643d57..e5f2b1f 100644
--- a/py/text_join.py
+++ b/py/text_join.py
@@ -33,10 +33,49 @@ class TextJoin:
return (combined_text.encode('unicode-escape').decode('unicode-escape'),)
+class LS_TextJoinV2:
+
+ def __init__(self):
+ pass
+
+ @classmethod
+ def INPUT_TYPES(cls):
+ return {
+ "required": {
+ "text_1": ("STRING", {"multiline": False,"forceInput":True}),
+ "delimiter": ("STRING", {"default": ",", "multiline": False}),
+ },
+ "optional": {
+ "text_2": ("STRING", {"multiline": False,"forceInput":True}),
+ "text_3": ("STRING", {"multiline": False,"forceInput":True}),
+ "text_4": ("STRING", {"multiline": False,"forceInput":True}),
+ }
+ }
+
+ RETURN_TYPES = ("STRING",)
+ RETURN_NAMES = ("text",)
+ FUNCTION = "text_join"
+ CATEGORY = '😺dzNodes/LayerUtility/Data'
+
+ def text_join(self, text_1, delimiter, text_2=None, text_3=None, text_4=None):
+
+ texts = [text_1]
+ if text_2 is not None:
+ texts.append(text_2)
+ if text_3 is not None:
+ texts.append(text_3)
+ if text_4 is not None:
+ texts.append(text_4)
+ combined_text = delimiter.join(texts)
+
+ return (combined_text.encode('unicode-escape').decode('unicode-escape'),)
+
NODE_CLASS_MAPPINGS = {
- "LayerUtility: TextJoin": TextJoin
+ "LayerUtility: TextJoin": TextJoin,
+ "LayerUtility: TextJoinV2": LS_TextJoinV2
}
NODE_DISPLAY_NAME_MAPPINGS = {
- "LayerUtility: TextJoin": "LayerUtility: TextJoin"
+ "LayerUtility: TextJoin": "LayerUtility: TextJoin",
+ "LayerUtility: TextJoinV2": "LayerUtility: TextJoinV2"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 380eec5..9d62f1b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,7 @@
[project]
name = "comfyui_layerstyle"
description = "A set of nodes for ComfyUI it generate image like Adobe Photoshop's Layer Style. the Drop Shadow is first completed node, and follow-up work is in progress."
-version = "1.0.68"
+version = "1.0.70"
license = "MIT"
dependencies = ["numpy", "pillow", "torch", "matplotlib", "Scipy", "scikit_image", "scikit_learn", "opencv-contrib-python", "pymatting", "segment_anything", "timm", "addict", "yapf", "colour-science", "wget", "mediapipe", "loguru", "typer_config", "fastapi", "rich", "google-generativeai", "diffusers", "omegaconf", "tqdm", "transformers", "kornia", "image-reward", "ultralytics", "blend_modes", "blind-watermark", "qrcode", "pyzbar", "transparent-background", "huggingface_hub", "accelerate", "bitsandbytes", "torchscale", "wandb", "hydra-core", "psd-tools", "inference-cli[yolo-world]", "inference-gpu[yolo-world]", "onnxruntime"]