2024-01-19 20:43:31 +08:00
2024-01-19 19:03:57 +08:00
2024-01-19 20:43:31 +08:00
2024-01-19 20:43:31 +08:00
2024-01-19 19:03:57 +08:00
2024-01-17 20:57:41 +08:00
2024-01-19 20:43:31 +08:00
2024-01-19 20:43:31 +08:00
2024-01-17 21:05:47 +08:00

ComfyUI Layer Style

A set of nodes for ComfyUI that generate image like Adobe Photoshop's Layer Style.

Currently completed the Drop Shadow, OuterGlow, and some auxiliary nodes. follow-up work is in progress.

中文说明点这里

Update

  • Commit MaskInvert node.
  • Commit ColorPick node.
  • Commit Stroke node.
  • Commit MaskPreview node.
  • Commit ImageOpacity node.
  • The layer_mask is not a mandatory input now. it is allowed to use layers and masks with different shapes, but the size must be consistent.
  • Commit ImageBlend node.
  • Commit OuterGlow node.
  • Commit DropShadow node.

Node Description

DropShadow:

Generate shadow image

Node options: image

  • 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.
  • invert_mask: Whether to reverse the mask.
  • blend_mode3: Blending mode of shadows.
  • opacity: Opacity of shadow.
  • distance_x: Horizontal offset of shadow.
  • distance_y: Vertical offset of shadow.
  • grow: Shadow expansion amplitude.
  • blur: Shadow blur level.
  • shadow_color: Shadow color, described in hexadecimal RGB format.

Output type:

  • image

OuterGlow:

Generate outer glow image

Node options: image

  • background_image1: The background image.
  • layer_image1: Layer image for composite.
  • layer_mask1,22: Mask for layer_image, shadows are generated according to their shape.
  • invert_mask: Whether to reverse the mask.
  • blend_mode3: Blending mode of glow.
  • opacity: Opacity of glow.
  • grow: Glow expansion amplitude.
  • blur: Gkow blur level.
  • glow_color: Glow color, described in hexadecimal RGB format.

Output type:

  • image

Stroke:

Generate a stroke of layer。 image

Node options:
image

  • 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.
  • invert_mask: Whether to reverse the mask.
  • blend_mode3: Blending mode of stroke.
  • opacity: Opacity of stroke.
  • inner_stroke*: Stroke shrinkage amplitude.
  • outer_stroke*: Stroke expansion amplitude.
  • stroke_color: Stroke color, described in hexadecimal RGB format.

*The width of the stroke is equal to inner_stroke plus outer_stroke value. Setting two values separately can make it more convenient to adjust the border range.

Output type:

  • image

ImageBlend:

Composit layer image and background image, multiple blend modes are available for option, and transparency can be set. image

Node options: image

  • background_image1: The background image.
  • layer_image1: Layer image for composite.
  • layer_mask1,2: Mask for layer_image.
  • invert_mask: Whether to reverse the mask.
  • blend_mode3: Blending mode.
  • opacity: Opacity of blend.

Output type:

  • image

ImageOpacity:

Adjust image opacity image

Node option:

  • image1: Image input, supporting RGB and RGBA. if is RGB, the alpha channel of the entire image will be automatically added.
  • mask1,2 : Mask input.
  • invert_mask: Whether to reverse the mask.
  • opacity: Opacity of image.

Output type:

  • image(RGBA)
  • mask

MaskPreview:

Preview the input mask image

input:mask

MaskInvert:

Invert the mask image

Input:

  • mask

Output type:

  • mask

ColorPicker:

Modify web extensions from mtb nodes. Select colors on the color palette and output RGB values. image

Node options:

  • mode: The output format is available in hexadecimal (HEX) and decimal (DEC).

Output Type:

  • string

Annotation:

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 and lighter.

Example workflow

image Some JSON workflow files in the workflow directory, that is example for ComfyUI.

The following tasks are in the planned list

  • Inner Shadow
  • Inner Glow
  • Texture
  • Color Overlay
  • Gradient Overlay

How to install

  • Open the cmd window in the plugin directory of ComfyUI, like "ComfyUI\custom_nodes",typegit 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, open the cmd window in the WordCloud plugin directory like "ComfyUI\custom_ Nodes\ComfyUI_WordCloud" and enter the following command: ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt

  • Restart ComfyUI

S
Description
No description provided
Readme MIT
226 MiB
Languages
Python 93.4%
JavaScript 6.3%
Batchfile 0.3%