← See All Custom Node Packs

ComfyUI_essentials

1125

Run ComfyUI Easily with InstaSD

Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

DrawText+

Documentation for DrawText+ Node

Overview

The DrawText+ node is a feature in the ComfyUI Essentials repository designed to overlay custom text onto an image. This node allows for extensive customization, making it a versatile tool for graphical projects where text needs to be dynamically integrated.

Functionality

The DrawText+ node enables users to draw strings of text onto images with a wide range of customization options including font selection, text size, color, alignment, and more. It can handle multiline text and supports both left-to-right and right-to-left text direction.

Inputs

The DrawText+ node accepts the following inputs:

Required Inputs

  1. Text: The string of text to display. Supports multiline inputs and can accommodate dynamic prompts.
  2. Font: A selection of fonts available from the repository. Only font files with .ttf or .otf extensions are supported.
  3. Size: Numeric size of the font. The range is from 1 to 9999.
  4. Color: Color for the text in hexadecimal format (e.g., #FFFFFF for white).
  5. Background Color: Background color for the text image in hexadecimal format, supporting transparency (e.g., #00000000 for transparent).
  6. Shadow Distance: Distance for the text shadow effect. Accepts values between 0 and 100.
  7. Shadow Blur: Amount of blur applied to the shadow. The range is 0 to 100.
  8. Shadow Color: Color of the shadow in hexadecimal format.
  9. Horizontal Align: Alignment of text horizontally. Options are: "left", "center", "right".
  10. Vertical Align: Alignment of text vertically. Options are: "top", "center", "bottom".
  11. Offset X: Horizontal offset for the text position. Allows adjustment in a range determined by the environment’s resolution limit.
  12. Offset Y: Vertical offset for the text position. Allows adjustment in the same range as offset X.
  13. Direction: Text directionality. Options include left-to-right ("ltr") and right-to-left ("rtl").

Optional Input

  • Image Composite: Allows an image to be used as a base layer, onto which the text will be composited.

Outputs

The DrawText+ node produces the following outputs:

  1. Image: The final image with the text applied, suitable for further processing or use.
  2. Mask: A binary mask indicating where the text has been applied. This is useful for additional image processing tasks where knowing the text location is important.

Usage in ComfyUI Workflows

In a ComfyUI workflow, DrawText+ can be incorporated as a tool to enhance images with text overlays such as titles, labels, or annotations. It is particularly beneficial in workflows that involve dynamic content generation, like automated report generation with textual elements.

Example scenarios might include:

  • Adding captions to images for educational materials.
  • Overlaying dynamic data onto images for dashboards.
  • Creating templates of images for social media posts with custom text.

Special Features and Considerations

  • Dynamic Text: The node supports the use of dynamic prompts, allowing for text content to change based on user input or other environmental variables.
  • Multiline and RTL Support: It supports both multiline text and right-to-left text direction, providing flexibility for different language requirements.
  • Shadow and Alignment Customization: The shadow properties and alignment capabilities offer advanced aesthetic customization suitable for sophisticated design requirements.

When using DrawText+, consider the node's placement in your workflow to ensure text overlays are applied at the correct stage of image processing. Additionally, when working with images that have existing content, use the image composite feature to maintain other design elements.