ComfyUI_LayerStyle

ComfyUI_LayerStyle

ComfyUI图层处理与合成工具集

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

ComfyUI图层样式Photoshop功能图像处理插件Github开源项目

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
<font size="1">*this workflow (title_example_workflow.json) is in the workflow directory. </font><br />

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

<font size="4">**If the dependency package error after updating, please reinstall the relevant dependency packages. </font><br />

  • 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

编辑推荐精选

堆友

堆友

多风格AI绘画神器

堆友平台由阿里巴巴设计团队创建,作为一款AI驱动的设计工具,专为设计师提供一站式增长服务。功能覆盖海量3D素材、AI绘画、实时渲染以及专业抠图,显著提升设计品质和效率。平台不仅提供工具,还是一个促进创意交流和个人发展的空间,界面友好,适合所有级别的设计师和创意工作者。

图像生成AI工具AI反应堆AI工具箱AI绘画GOAI艺术字堆友相机AI图像热门
码上飞

码上飞

零代码AI应用开发平台

零代码AI应用开发平台,用户只需一句话简单描述需求,AI能自动生成小程序、APP或H5网页应用,无需编写代码。

Vora

Vora

免费创建高清无水印Sora视频

Vora是一个免费创建高清无水印Sora视频的AI工具

Refly.AI

Refly.AI

最适合小白的AI自动化工作流平台

无需编码,轻松生成可复用、可变现的AI自动化工作流

酷表ChatExcel

酷表ChatExcel

大模型驱动的Excel数据处理工具

基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。

AI工具酷表ChatExcelAI智能客服AI营销产品使用教程
TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
AIWritePaper论文写作

AIWritePaper论文写作

AI论文写作指导平台

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

AI辅助写作AI工具AI论文工具论文写作智能生成大纲数据安全AI助手热门
博思AIPPT

博思AIPPT

AI一键生成PPT,就用博思AIPPT!

博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

AI办公办公工具AI工具博思AIPPTAI生成PPT智能排版海量精品模板AI创作热门
潮际好麦

潮际好麦

AI赋能电商视觉革命,一站式智能商拍平台

潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。

iTerms

iTerms

企业专属的AI法律顾问

iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。

下拉加载更多