Project Icon

ComfyUI_LayerStyle

ComfyUI图层处理与合成工具集

ComfyUI_LayerStyle是为ComfyUI开发的图层处理和合成工具集,将Photoshop部分基本功能迁移至ComfyUI。项目提供多种功能节点,如图层混合、蒙版处理、背景去除和图像分割等,实现类似Photoshop的图层效果。通过集中工作流程,减少软件切换,提高图像处理效率。项目持续更新,不断优化性能并增加新功能,适合ComfyUI用户进行复杂图像处理。

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

(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
  • Or download the zip file and extracted, copy the resulting folder to ComfyUI\custom_ Nodes

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,

  for ComfyUI official portable package, type:

..\..\..\python_embeded\python.exe -s -m pip install .\whl\docopt-0.6.2-py2.py3-none-any.whl
..\..\..\python_embeded\python.exe -s -m pip install -r requirements.txt
.\repair_dependency.bat

  for Aki ComfyUI package, type:

..\..\python\python.exe -s -m pip install .\whl\docopt-0.6.2-py2.py3-none-any.whl
..\..\python\python.exe -s -m pip install -r requirements.txt
.\repair_dependency.bat
  • Restart ComfyUI.

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 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'

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:

  • 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 reinstall the relevant dependency packages.

  • Commit Florence2Ultra, Florence2Image2Prompt and LoadFlorence2Model nodes.
  • TransparentBackgroundUltra node add new model support. Please download the model file according to the instructions.
  • Commit SegformerUltraV2, SegfromerFashionPipeline and SegformerClothesPipeline nodes, used for segmentation of clothing. please download the model file according to the instructions.
  • Commit install_requirements.bat and install_requirements_aki.bat, One click solution to install dependency packages.
  • Commit TransparentBackgroundUltra node, it remove background based on transparent-background model.
  • Change the VitMatte model of the Ultra node to a local call. Please download all files of vitmatte model to the ComfyUI/models/vitmatte folder.
  • GetColorToneV2 node add the mask method to the color selection option, which can accurately obtain the main color and average color within the mask.
  • ImageScaleByAspectRatioV2 node add the "background_color" option.
  • LUT Apply Add the "strength" option.
  • Commit AutoAdjustV2 node, add optional mask input and support for multiple automatic color adjustment modes.
  • Due to the upcoming discontinuation of gemini-pro vision services, PromptTagger and PromptEmbellish have added the "gemini-1.5-flash" API to continue using it.
  • Ultra nodes added the option to run VitMatte on the CUDA device, resulting in a 5-fold increase in running speed.
  • Commit QueueStop node, used to terminate the queue operation.
  • Optimize performance of the VitMate method for Ultra nodes when processing large-size image.
  • CropByMaskV2 add option to round the cutting size by multiples.
  • Commit CheckMask node, it detect whether the mask contains sufficient effective areas. Commit HSVValue node, it convert color values to HSV values.
  • BooleanOperatorV2, NumberCalculatorV2, Integer, Float, Boolean nodes add string output to output the value as a string for use with SwitchCase.
  • Commit SwitchCase node, Switches the output based on the matching string. Can be used for any type of data switching.
  • Commit String node, Used to output a string. It is the TextBox simplified node.
  • Commit If node,Switches output based on Boolean conditional input. Can be used for any type of data switching.
  • Commit StringCondition node, Determines whether the text contains or does not contain a substring.
  • Commit NumberCalculatorV2 node,Add the nth root operation. Commit BooleanOperatorV2 node, Increasing greater/less than, greater/less then or equal logical judgment. The two nodes can access numeric inputs and can input numeric values within the node. Note: Numeric input takes precedence. Values in nodes will not be valid when there is input.
  • Commit SD3NegativeConditioning node, Encapsulate the four nodes of Negative Condition in SD3 into a separate node.
  • ImageRemoveAlpha node add optional mask input.
  • Commit HLFrequencyDetailRestore node, Using low-frequency filtering and high-frequency preserving to restore image details, the fusion is better.
  • Commit AddGrain and MaskGrain nodes, Add noise to a picture or mask.
  • Commit FilmV2 node, The fastgrain method is added on the basis of the previous one, and the noise generation speed is 10 times faster.
  • Commit ImageToMask node, it can be converted image into 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.
  • The blackpoint and whitepoint options in some nodes have been changed to slider adjustment for a more intuitive display. Include MaskEdgeUltraDetailV2, SegmentAnythingUltraV2, RmBgUltraV2PersonMaskUltraV2BiRefNetUltra, SegformerB2ClothesUltra, BlendIfMask and Levels.
  • ImageScaleRestoreV2 and ImageScaleByAspectRatioV2 nodes add the total_pixel method to scale images.
  • Commit MediapipeFacialSegment node,Used to segment facial features, including left and right eyebrows, eyes, lips, and teeth.
  • Commit BatchSelector node,Used to retrieve specified images or masks from batch images or masks.
  • LayerUtility creates new subdirectories such as SystemIO, Data, and Prompt. Some nodes are classified into subdirectories.
  • Commit MaskByColor node, Generate a mask based on the selected color.
  • Commit LoadPSD node, It read the psd format, and output layer images. 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.
  • Commit SegformerB2ClothesUltra node, it used to segment character clothing. The model segmentation code is fromStartHua, thanks to the original author.
  • SaveImagePlus node adds the output workflow to the json function, supports %date and %time to embeddint date or time to path and filename, and adds the preview switch.
  • Commit SaveImagePlus node,It 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.
  • Commit AddBlindWaterMark, ShowBlindWaterMark nodes, Add invisible watermark and decoded watermark to the picture. Commit CreateQRCode, DecodeQRCode nodes, It can generate two-dimensional code pictures and decode two-dimensional codes.
  • ImageScaleRestoreV2, ImageScaleByAspectRatioV2, ImageAutoCropV2 nodes add options for width and height, which can specify width or height as fixed values.
  • Commit PurgeVRAM node, Clean up VRAM an RAM.
  • Commit AutoAdjust node, it can automatically adjust image contrast and white balance.
  • Commit RGBValue node to output the color value as a single decimal value of R, G, B. This idea is from vxinhao, Thanks.
  • Commit seed node to output the seed value. The ImageMaskScaleAs, ImageScaleBySpectRatio, ImageScaleBySpectRatioV2, ImageScaleRestore, ImageScaleRestoreV2 nodes increase width, height output.
  • Commit Levels node, it can achieve the same color levels adjustment function as Photoshop.Sharp&Soft add the "None" option.
  • Commit BlendIfMask node, This node cooperates with ImgaeBlendV2 or ImageBlendAdvanceV2 to achieve the same Blend If function as Photoshop.
  • Commit ColorTemperature and ColorBalance nodes, used to adjust the color temperature and color balance of the picture.
  • Add new types of Blend Mode V2 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. Thanks to the original authors.
  • Commit YoloV8Detect node.
  • Commit QWenImage2Prompt node, this node is repackage of the ComfyUI_VLM_nodes's UForm-Gen2 Qwen Node, thanks to the original author.
  • Commit BooleanOperator, NumberCalculator, TextBox, Integer, Float, Booleannodes. These nodes can perform mathematical and logical operations.
  • Commit ExtendCanvasV2 node,support color value input.
  • Commit AutoBrightness node,it can automatically adjust the brightness of image.
  • CreateGradientMask node add center option.
  • Commit GetColorToneV2 node, can select the main and average colors for the background or body.
  • Commit ImageRewardFilter node, can filter out poor quality pictures.
  • Ultra nodes add VITMatte(local) method, You can choose this method to avoid accessing huggingface.co if you have already downloaded the model before.
  • Commit HDR Effect node,it enhances the dynamic range and visual appeal of input images. this node is repackage of HDR Effects (SuperBeasts.AI).
  • Commit CropBoxResolve node.
  • Commit BiRefNetUltra node, it using the BiRefNet model to remove background has better recognition ability and ultra-high edge details.
  • Commit ImageAutoCropV2 node, it can choose not to remove the background, support mask input, and scale by long or short side size.
  • Commit ImageHub node, supports up to 9 sets of Image and Mask switching output, and supports random output.
  • Commit TextJoin node.
  • Commit PromptEmbellish node. it output polished prompt words, and support inputting images as references.
  • Ultra nodes have been fully upgraded to V2 version, with the addition of VITMatte edge processing method, which is suitable for handling semi transparent areas. Include MaskEdgeUltraDetailV2, SegmentAnythingUltraV2, RmBgUltraV2 and PersonMaskUltraV2 nodes.
  • Commit Color of Shadow & Highlight node, it can adjust the color of
项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

吐司

探索Tensor.Art平台的独特AI模型,免费访问各种图像生成与AI训练工具,从Stable Diffusion等基础模型开始,轻松实现创新图像生成。体验前沿的AI技术,推动个人和企业的创新发展。

Project Cover

SubCat字幕猫

SubCat字幕猫APP是一款创新的视频播放器,它将改变您观看视频的方式!SubCat结合了先进的人工智能技术,为您提供即时视频字幕翻译,无论是本地视频还是网络流媒体,让您轻松享受各种语言的内容。

Project Cover

美间AI

美间AI创意设计平台,利用前沿AI技术,为设计师和营销人员提供一站式设计解决方案。从智能海报到3D效果图,再到文案生成,美间让创意设计更简单、更高效。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号