chflame163 / ComfyUI_LayerStyle

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
MIT License
670 stars 33 forks source link

ComfyUI Layer Style

中文说明点这里

商务合作请联系email chflame@163.com.

For business cooperation, please contact email chflame@163.com.

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.

It migrate some basic functions of PhotoShop to ComfyUI, aiming to centralize the workflow and reduce the frequency of software switching.

image
*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.

How to install

..\..\..\python_embeded\python.exe -m pip install -r requirements.txt

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.

ModuleNotFoundError: No module named 'psd_tools'

This error is that the psd_tools were not installed correctly.

Solution:

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'

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.

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:

Requests.exceptions.ProxyError: HTTPSConnectionPool(xxxx...)

When this error has occurred, please check the network environment.

Update

**If the dependency package error after updating, please reinstall the relevant dependency packages.

Description

Nodes are divided into 5 groups according to their functions: LayerStyle, LayerColor, LayerMask, LayerUtility and LayerFilter.

LayerStyle

image
image

DropShadow

Generate shadow image

Node options: image

OuterGlow

Generate outer glow image

Node options: image

InnerShadow

Generate inner shadow image

Node options: image

InnerGlow

Generate inner glow image

Node options:
image

Stroke

Generate a stroke of layer。 image

Node options:
image

GradientOverlay

Generate gradient overlay image

Node options:

ColorOverlay

Generate color overlay image

Node options: image

LayerColor

image
image

LUT Apply

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

Node options:
image

*LUT 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 "LUT_dir=", after "=", enter the custom folder path name. all .cube 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 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. image

Node Options:
image

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. image

Node options:
image

ColorAdapter

Auto adjust the color tone of the image to resemble the reference image. image

Node options:
image

Exposure

Change the exposure of the image. image

Color of Shadow & Highlight

Adjust the color of the dark and bright parts of the image. image

Node options:
image

Node option:

ColorTemperature

image
Change the color temperature of the image.

Node Options:
image

Levels

image
Change the levels of image.

Node Options:
image

*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

image
Change the color balance of an image.

Node Options:
image

Gamma

Change the gamma value of the image.

Node options:
image

Brightness & Contrast

Change the brightness, contrast, and saturation of the image.

Node options:
image

RGB

Adjust the RGB channels of the image.

Node options:
image

YUV

Adjust the YUV channels of the image.

Node options:
image

LAB

Adjust the LAB channels of the image.

Node options:
image

HSV

Adjust the HSV channels of the image.

Node options:
image

LayerUtility

image

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.

The node provides mask output that can be used for subsequent workflows. image

Node options:
image

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 and ImageScaleRestore nodes to crop and modify upscale parts of image, and then paste them back in place. image

Node options:
image

Output:

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: image

RestoreCropBox

Restore the cropped image to the original image by CropByMask.

Node options:
image

CropBoxResolve

Parsing the corp_box to x , y , width , height . image

ImageScaleRestore

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

Node options:
image

Outputs:

ImageScaleRestoreV2

The V2 upgraded version of ImageScaleRestore.

Node options:
image
The following changes have been made based on ImageScaleRestore:

ImageMaskScaleAs

Scale the image or mask to the size of the reference image (or reference mask). image

Node options: image

*Only limited to input images and masks. forcing the integration of other types of inputs will result in node errors.

Outputs:

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. image

Node options:
image

Outputs:

ImageScaleByAspectRatioV2

V2 Upgraded Version of ImageScaleByAspectRatio

Node options:
image
The following changes have been made based on ImageScaleByAspectRatio:

QWenImage2Prompt

Inference the prompts based on the image. this node is repackage of the ComfyUI_VLM_nodes's UForm-Gen2 Qwen Node, thanks to the original author. Download model files from huggingface or Baidu Netdisk to ComfyUI/models/LLavacheckpoints/files_for_uform_gen2_qwen folder.

image

Node Options:

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, 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. image

Node options:
image

PromptEmbellish

Enter simple prompt words, output polished prompt words, and support inputting images as references. 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, 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. image

Node options:
image

ImageShift

Shift the image. this node supports the output of displacement seam masks, making it convenient to create continuous textures. image

Node options:
image

ImageBlend

A simple node for composit layer image and background image, multiple blend modes are available for option, and transparency can be set. image

Node options: image

ImageOpacity

Adjust image opacity image

Node option:

ColorPicker

Modify web extensions from mtb nodes. Select colors on the color palette and output RGB values, thanks to the original author. image

Node options:

Output type:

RGBValue

Output the color value as a single R, G, B three decimal values. Supports HEX and DEC formats for ColorPicker node output.

image

Node Options:

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. image

Node Options:

GetColorTone

Obtain the main color or average color from the image and output RGB values. image

Node options: image

Output type:

GetColorToneV2

V2 upgrade of GetColorTone. You can specify the dominant or average color to get the body or background. image

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

Output:

ExtendCanvas

Extend the canvas image

Node options: image

ExtendCanvasV2

V2 upgrade to ExtendCanvas.

Based on ExtendCanvas, color is modified to be a string type, and it supports external ColorPicker input. image

XY to Percent

image
Convert absolute coordinates to percentage coordinates.

image
Node options:

LayerImageTransform

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

image
Node options:

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.

image
Node options:

ColorImage

image
Generate an image of a specified color and size.

image
Node options:

ColorImageV2

The V2 upgraded version of ColorImage.

image
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

image
Generate an image with a specified size and color gradient.

image
Node options:

GradientImageV2

The V2 upgraded version of GradientImage.

image
The following changes have been made based on GradientImage:

*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.

ImageRewardFilter

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

image
Node options:

Outputs:

SimpleTextImage

image
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, thanks to the original author.

image
Node options:

*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. Open the text editing software and find the line starting with "FONT_dir=", after "=", enter the custom folder path name. 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

image
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.

image
Node options:

*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. Open the text editing software and find the line starting with "FONT_dir=", after "=", enter the custom folder path name. 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.

LaMa

image
Erase objects from the image based on the mask. this node is repackage of IOPaint, powered by state-of-the-art AI models, thanks to the original author.
It is have LaMa, LDM, ZITS,MAT, FcF, Manga models and the SPREAD method to erase. Please refer to the original link for the introduction of each model.
Please download the model files from lama models(Baidu Netdisk) or lama models(Google Drive) to ComfyUI/models/lama folder.

Node optons: image

ImageChannelSplit

image
Split the image channel into individual images.

Node options: image

ImageChannelMerge

image
Merge each channel image into one image.

Node options: image

ImageRemoveAlpha

image
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: image

ImageCombineAlpha

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

ImageAutoCrop

image
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 and RemBgUltra.

Node options: image

Output: 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: image

HLFrequencyDetailRestore

Using low frequency filtering and retaining high frequency to recover image details. Compared to kijai's DetailTransfer, this node is better integrated with the environment while retaining details. image

Node Options:
image

GetImageSize

image
Obtain the width and height of the image.

Output:

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. image

Node options:
image

BatchSelector

Retrieve specified images or masks from batch images or masks. image

Node Options:
image

TextJoin

image
Combine multiple paragraphs of text into one.

PrintInfo

image
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

image
Output a string.

String

image
Output a string. same as TextBox.

Integer

image
Output a integer value.

Float

image
Output a floating-point value with a precision of 5 decimal places.

Boolean

image
Output a boolean value.

NumberCalculator

image
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

image
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

image
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

image
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

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

Node Options:
image

CheckMask

Check if the mask contains enough valid areas and output a Boolean value.

Node Options:
image

If

image
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:
image

SwitchCase

image
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. Note that the string is case sensitive and Chinese and English full-width and half-width.

Node Options:
image

QueueStop

image
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:
image

PurgeVRAM

image
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:

SaveImagePlus

image
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: image

* 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

image
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: image

ShowBlindWaterMark

Decoding the invisible watermark added to the AddBlindWaterMark and SaveImagePlus nodes. image

CreateQRCode

Generate a square QR code picture.

Node Options:
image

DecodeQRCode

Decoding the QR code.

Node Options:
image

LoadPSD

image
image
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 and manual install it.

Node Options:
image

Outputs: flat_image: PSD preview image. layer_iamge: Find the layer output. all_layers: Batch images containing all layers.

SD3NegativeConditioning

image
Encapsulate the four nodes of Negative Condition in SD3 into a separate node.

Node Options:
image

LayerMask

image

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. image

Node Options:
image

MaskBoxDetect

Detect the area where the mask is located and output its position and size. image

Node options:
image

Output:

Ultra节点组

image
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:

The following figure is an example of the difference in output between three methods. image

SegmentAnythingUltra

Improvements to 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.

image
image

Node options:
image

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) image

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

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 and the functionality of ZHO-ZHO-ZHO's ComfyUI-BRIA_AI-RMBG, thanks to the original author.

*Download the BRIA Background Removal v1.4 model file (model.pth) to the /ComfyUI/models/rmbg/RMBG-1.4 folder. This model was developed by BRIA AI and can be used as an open-source model for non-commercial purposes.
**After downloading the model, recommended to add a line 'rmbg: models/rmbg/RMBG-1.4' in ComfyUI/extra_model_paths.yaml. (This step is not mandatory)

image

Node options:
image

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: image

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,thanks to the original author.

*From https://huggingface.co/ViperYX/BiRefNet download the BiRefNet-ep480.pth,pvt_v2_b2.pth,pvt_v2_b5.pth,swin_base_patch4_window12_384_22kto1k.pth, swin_large_patch4_window12_384_22kto1k.pth 5 files to ComfyUI/models/BiRefNet folder.

image

Node options:
image

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, edge processing code from ComfyUI-Image-Filters,thanks to the original author.

image

Node options:
image

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: image

*Download all model files from https://huggingface.co/mattmdjaga/segformer_b2_clothes to ComfyUI/models/segformer_b2_clothes folder.

Node Options:
image

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, thanks to the original author. image

Node options:
image

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: image

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 or BaiduNetdisk to ComfyUI/models/yolo folder.

image

Node Options:
image

Outputs:

MediapipeFacialSegment

Use the Mediapipe model to detect facial features, segment left and right eyebrows, eyes, lips, and tooth. image

Node Options:
image

MaskByColor

Generate a mask based on the selected color. image

Node Options:
image

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. image

Node Options:
image

*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. image

Node options:
image

PixelSpread

Pixel expansion preprocessing on the masked edge of an image can effectively improve the edges of image composit. image

Node options:
image

MaskByDifferent

Calculate the differences between two images and output them as mask. image

Node options:
image

MaskGrow

Grow and shrink edges and blur the mask image

Node options: image

MaskEdgeShrink

Smooth transition and shrink the mask edges while preserving edge details. image

Node options: image

Comparison of MaskGrow and MaskEdgeShrink image

MaskMotionBlur

Create motion blur on the mask. image

Node options:
image

MaskGradient

Create a gradient for the mask from one side. please note the difference between this node and the CreateGradientMask node. image

Node options: image

CreateGradientMask

Create a gradient mask. please note the difference between this node and the MaskGradient node. image
image

Node options:
image

*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. image

Node options:
image

MaskGrain

Generates noise for the mask. image

Node Options:
image

MaskPreview

Preview the input mask image

MaskInvert

Invert the mask image

LayerFilter

image

Sharp & Soft

Enhance or smooth out details for image. image

Node options: image

SkinBeauty

Make the skin look smoother. image

Node options: image

WaterColor

Watercolor painting effect image

Node option: image

SoftLight

Soft light effect, the bright highlights on the screen appear blurry. image

Node options: image

ChannelShake

Channel misalignment. similar to the effect of Tiktok logo. image

Node options: image

HDR Effects

enhances the dynamic range and visual appeal of input images. This node is reorganize and encapsulate of HDR Effects (SuperBeasts.AI), thanks to the original author. image

Node options: image

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, thanks to the original author. image

Node options: image

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 BetterFilmGrain node, thanks to the original authors. image

LightLeak

Simulate the light leakage effect of the film. please download the light_leak.pkl(Baidu Netdisk) or [light_leak.pkl(Google Drive)]([light_leak.pkl(Google Drive)(https://drive.google.com/file/d/1DcH2Zkyj7W3OiAeeGpJk1eaZpdJwdCL-/view?usp=sharing)), copy the file to ComfyUI/models/layerstyle folder. image

Node options: image

ColorMap

Pseudo color heat map effect. image

Node options: image

MotionBlur

Make the image motion blur image

Node options:

GaussianBlur

Make the image gaussian blur image

Node options:

AddGrain

Add noise to the picture. image

Node Options: image

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.

3 The Blend Mode include normal, multply, screen, add, subtract, difference, darker, color_burn, color_dodge, linear_burn, linear_dodge, overlay, soft_light, hard_light, vivid_light, pin_light, linear_light, and hard_mix. all of 19 blend modes in total.
image
*Preview of the blend mode

3 The BlendModeV2 include normal, dissolve, darken, multiply, color burn, linear burn, darker color, lighten, screen, color dodge, linear dodge(add), lighter color, dodge, overlay, soft light, hard light, vivid light, linear light, pin light, hard mix, difference, exclusion, subtract, divide, hue, saturation, color, luminosity, grain extract, grain merge all of 30 blend modes in total.
Part of the code for BlendMode V2 is from Virtuoso Nodes for ComfyUI. Thanks to the original authors. image
*Preview of the Blend Mode V2

4 The RGB color described by hexadecimal RGB format, like '#FA3D86'.

5 The layer_image and layer_mask must be of the same size.

Stars

Star History Chart

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.