LayerStyle

2167
By chflame
Updated 15 days ago
View on GitHub →See Common Issues →

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

Available Nodes

LayerUtility: TextImage

LayerUtility: TextImage Node Documentation

Overview

The LayerUtility: TextImage node is a component in the ComfyUI framework, designed to create custom images from text using specified styles and layouts. It allows users to convert text into images with varied font styles, sizes, and colors. The node offers flexibility in terms of text placement, scaling, and orientation, making it a versatile tool for text-based image creation.

Functionality

The LayerUtility: TextImage node is capable of generating an image from a string input while providing options to customize the visual appearance of the text. It also produces a mask for further image processing. Users can choose from a selection of fonts and control the layout and style of the text, either horizontally or vertically. This node offers a range of parameters to fine-tune the text’s appearance, including spacing, leading, scale, and color customization.

Inputs

The node accepts the following inputs:

  • Text: The actual text that will be converted into an image. This input allows for multiline text and has a default value of "Text".
  • Font File: A selection from a list of fonts available in the system. This determines the font style applied to the text.
  • Spacing: Controls the spacing between characters in the text. It is adjustable and can have both positive and negative values.
  • Leading: Adjusts the space between lines of text, particularly useful for multiline text inputs.
  • Horizontal Border: Sets the horizontal offset of the text within the image, expressed as a percentage of the image width.
  • Vertical Border: Sets the vertical offset of the text within the image, expressed as a percentage of the image height.
  • Scale: Adjusts the overall size of the text relative to the image dimensions. It affects the ratio of text size to the image.
  • Variation Range: Allows for random adjustments in the size and position of characters, enabling a more dynamic and varied text appearance.
  • Variation Seed: Sets the seed for random variation, ensuring repeatability of the random effects applied to character sizes and positions.
  • Layout: Defines whether the text is arranged horizontally or vertically within the image.
  • Width: Specifies the width of the resulting image.
  • Height: Specifies the height of the resulting image.
  • Text Color: Determines the color of the text in the image.
  • Background Color: Determines the background color of the image.

Optional Inputs

  • Size As: An optional input that allows users to specify the size of the resulting image based on another image's dimensions.

Outputs

The LayerUtility: TextImage node produces two outputs:

  • Image: The final image with the text rendered according to the specified parameters.
  • Mask: A mask image where the text areas are highlighted, useful for further image processing tasks in ComfyUI.

Usage in ComfyUI Workflows

In ComfyUI workflows, the LayerUtility: TextImage node can be used to create custom text-based images for a variety of applications such as titles, labels, annotations, or artistic text designs. It can be integrated into larger workflows that involve image processing or enhancement by providing text overlays or elements.

Users can control every aspect of the text's visual style, making it suitable for applications where precise text appearance is crucial. The optional size matching feature allows for creating consistent text sizes relative to other image inputs in the workflow.

Special Features and Considerations

  • Font Variety: The node allows users to select from a broad range of fonts, providing extensive customization options.
  • Randomization Capability: The variation range and seed inputs offer the ability to introduce randomness in character size and positioning, giving each text image a unique flair.
  • Flexible Layout Options: Users can choose between horizontal and vertical text layouts, accommodating different design needs.
  • Color Customization: Text and background colors are customizable, providing flexibility to match existing design palettes or themes.
  • Dynamic Scaling: The scale input helps maintain the text's proportionality within the image, ensuring good fit and readability.

This node is an essential component for users who require advanced text-to-image conversion capabilities within the ComfyUI ecosystem. It combines rich customization features with ease of use, making it a powerful tool for creative and practical text applications.