ComfyUI_essentials
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
Available Nodes
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
- Text: The string of text to display. Supports multiline inputs and can accommodate dynamic prompts.
- Font: A selection of fonts available from the repository. Only font files with
.ttfor.otfextensions are supported. - Size: Numeric size of the font. The range is from 1 to 9999.
- Color: Color for the text in hexadecimal format (e.g.,
#FFFFFFfor white). - Background Color: Background color for the text image in hexadecimal format, supporting transparency (e.g.,
#00000000for transparent). - Shadow Distance: Distance for the text shadow effect. Accepts values between 0 and 100.
- Shadow Blur: Amount of blur applied to the shadow. The range is 0 to 100.
- Shadow Color: Color of the shadow in hexadecimal format.
- Horizontal Align: Alignment of text horizontally. Options are: "left", "center", "right".
- Vertical Align: Alignment of text vertically. Options are: "top", "center", "bottom".
- Offset X: Horizontal offset for the text position. Allows adjustment in a range determined by the environment’s resolution limit.
- Offset Y: Vertical offset for the text position. Allows adjustment in the same range as offset X.
- 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:
- Image: The final image with the text applied, suitable for further processing or use.
- 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.