ComfyUI > Nodes > ComfyUI-TextOverlay > Text Overlay

ComfyUI Node: Text Overlay

Class Name

Text Overlay

Category
image/text
Author
munkyfoot (Account age: 3202days)
Extension
ComfyUI-TextOverlay
Latest Updated
2024-06-28
Github Stars
0.02K

How to Install ComfyUI-TextOverlay

Install this extension via the ComfyUI Manager by searching for ComfyUI-TextOverlay
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-TextOverlay in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Text Overlay Description

Enhance images with customizable text overlay for AI artists, offering styling options and optimal positioning.

Text Overlay:

The Text Overlay node is designed to enhance your images by adding customizable text directly onto them. This node is particularly useful for AI artists who want to annotate, brand, or creatively modify their images with text. It allows you to overlay text with various styling options, such as font type, size, color, and alignment, providing a high degree of flexibility and control over the final appearance. The node processes the input image and text, calculates the optimal positioning based on your specified parameters, and renders the text with optional stroke effects for added emphasis. This functionality is essential for creating visually appealing compositions, adding context or narrative to images, and ensuring that text elements are seamlessly integrated into the visual design.

Text Overlay Input Parameters:

image

The image parameter is the input image on which the text will be overlaid. It serves as the canvas for the text overlay process, and the quality and dimensions of this image will directly affect the final output.

text

The text parameter specifies the string of text you wish to overlay on the image. It supports multiline input, allowing you to add multiple lines of text. The default value is "Hello", and you can customize this to suit your needs.

font_size

The font_size parameter determines the size of the text to be overlaid. It accepts integer values ranging from 1 to 256, with a default size of 32. Adjusting this parameter will affect the readability and prominence of the text on the image.

font

The font parameter allows you to specify the font type for the text. The default font is "ariblk.ttf", but you can choose any available font to match your design preferences and ensure the text complements the image style.

fill_color_hex

The fill_color_hex parameter defines the color of the text using a hexadecimal color code. The default color is white ("#FFFFFF"), but you can change it to any color that suits your design, ensuring the text stands out against the image background.

stroke_color_hex

The stroke_color_hex parameter sets the color of the text stroke, which is the outline around the text. The default stroke color is black ("#000000"). This feature is useful for enhancing text visibility, especially against complex backgrounds.

stroke_thickness

The stroke_thickness parameter controls the thickness of the text stroke. It accepts float values from 0.0 to 1.0, with a default of 0.2. Adjusting this parameter can help make the text more legible and visually striking.

padding

The padding parameter specifies the amount of space around the text, measured in pixels. It ranges from 0 to 128, with a default value of 16. Padding helps position the text comfortably within the image, preventing it from being too close to the edges.

horizontal_alignment

The horizontal_alignment parameter determines the horizontal positioning of the text within the image. Options include "left", "center", and "right", with "center" as the default. This setting helps align the text according to your design requirements.

Text Overlay Output Parameters:

image_tensor_out

The image_tensor_out parameter is the output image with the text overlay applied. It is returned as a tensor, which can be further processed or saved as needed. This output represents the final result of the text overlay operation, combining the original image with the specified text and styling.

Text Overlay Usage Tips:

  • Experiment with different font sizes and colors to ensure the text is both readable and aesthetically pleasing against the image background.
  • Use the stroke color and thickness options to enhance text visibility, especially when overlaying text on images with busy or complex backgrounds.
  • Adjust the padding and alignment settings to position the text optimally within the image, ensuring it complements the overall composition.

Text Overlay Common Errors and Solutions:

Text is not visible on the image

  • Explanation: The text color may be too similar to the image background, making it hard to see.
  • Solution: Change the fill_color_hex to a contrasting color or increase the stroke_thickness to make the text stand out.

Text is cut off or not fully displayed

  • Explanation: The text may be too large for the image dimensions or the padding is insufficient.
  • Solution: Reduce the font_size or increase the padding to ensure the text fits within the image boundaries.

Font not found or not supported

  • Explanation: The specified font file may not be available or supported.
  • Solution: Ensure the font file is correctly named and located in the appropriate directory, or choose a different font that is available.

Text Overlay Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-TextOverlay
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.