Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI_SamplingUtils > Text Overlay

ComfyUI Node: Text Overlay

Class Name

TextOverlayNode

Category
advanced/image
Author
silveroxides (Account age: 2211days)
Extension
ComfyUI_SamplingUtils
Latest Updated
2026-06-03
Github Stars
0.02K

How to Install ComfyUI_SamplingUtils

Install this extension via the ComfyUI Manager by searching for ComfyUI_SamplingUtils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_SamplingUtils 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Text Overlay Description

Overlay text onto images for captions, annotations, and visual enhancement with customizable appearance and positioning options.

Text Overlay:

The TextOverlayNode is designed to enhance images by overlaying text onto them, providing a versatile tool for adding captions, annotations, or any textual information directly onto an image. This node is particularly beneficial for creating visually appealing graphics where text needs to be integrated seamlessly with the image. It allows for customization of text appearance, including font size, color, and background settings, ensuring that the text is both legible and aesthetically pleasing. The node's ability to position text precisely on the image, either by specific pixel coordinates or as a percentage of the image size, offers flexibility in design. This makes it an essential tool for artists and designers looking to add informative or decorative text to their visual projects.

Text Overlay Input Parameters:

image

This parameter represents the image onto which the text will be overlaid. It serves as the canvas for the text overlay operation.

text

This is the text string that you want to overlay on the image. It supports multiline input and defaults to "Hello World". The text content is crucial as it determines the message or information conveyed on the image.

font_size

This parameter controls the size of the text font. It accepts values ranging from 1 to 1024, with a default of 32. Adjusting the font size impacts the readability and prominence of the text on the image.

text_color

This parameter specifies the color of the text in hexadecimal format, defaulting to "FFFFFF" (white). The text color is important for ensuring contrast and visibility against the image background.

bg_color

This parameter defines the background color behind the text, also in hexadecimal format, with a default of "000000" (black). The background color helps in making the text stand out, especially when the image has a complex or colorful background.

draw_background

This boolean parameter determines whether a background should be drawn behind the text. It defaults to True, meaning a background will be drawn, which can enhance text visibility.

bg_padding

This parameter sets the padding around the text background, with a range from 0 to 1024 and a default of 10. Padding affects the spacing between the text and its background, influencing the overall text block appearance.

bg_transparency

This parameter controls the transparency level of the text background, ranging from 0.0 (fully transparent) to 1.0 (fully opaque), with a default of 0.5. Transparency allows for blending the text background with the image, creating a more integrated look.

use_percentage

This boolean parameter, when set to True, treats the top, bottom, left, and right positioning values as percentages of the image size, rather than absolute pixel values. This allows for more flexible and responsive text positioning.

top

This parameter specifies the top offset for the text placement, with a range from -1 to 8192 and a default of -1. A value of -1 centers the text vertically or uses the bottom offset if specified.

bottom

This parameter sets the bottom offset for text placement, with a range from -1 to 8192 and a default of -1. A value of -1 centers the text vertically or uses the top offset if specified.

left

This parameter determines the left offset for text placement, with a range from -1 to 8192 and a default of -1. A value of -1 centers the text horizontally or uses the right offset if specified.

This parameter specifies the right offset for text placement, with a range from -1 to 8192 and a default of -1. A value of -1 centers the text horizontally or uses the left offset if specified.

Text Overlay Output Parameters:

image_with_text

This output parameter represents the image with the text overlay applied. It is the final product of the node's operation, combining the original image with the specified text and styling options.

Text Overlay Usage Tips:

  • To ensure text readability, choose a text color that contrasts well with the image background. Adjust the bg_color and bg_transparency to enhance visibility if needed.
  • Use the use_percentage option for responsive designs where the image size may vary, ensuring consistent text placement across different image dimensions.
  • Experiment with font_size and bg_padding to achieve the desired text prominence and spacing, especially when dealing with images of varying resolutions.

Text Overlay Common Errors and Solutions:

Invalid color format

  • Explanation: The text or background color is not specified in the correct hexadecimal format.
  • Solution: Ensure that the color values are provided as six-character hexadecimal strings, such as "FFFFFF" for white.

Text exceeds image boundaries

  • Explanation: The text size or positioning causes it to extend beyond the image edges.
  • Solution: Adjust the font_size, bg_padding, or positioning parameters to fit the text within the image boundaries.

Transparency value out of range

  • Explanation: The bg_transparency value is set outside the allowed range of 0.0 to 1.0.
  • Solution: Ensure the transparency value is within the specified range to avoid errors in rendering the text background.

Text Overlay Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_SamplingUtils
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Text Overlay