Visit ComfyUI Online for ready-to-use ComfyUI environment
Facilitates text rendering on image canvas with customizable attributes, text wrapping, and tensor format conversion for seamless integration.
The TextRenderer
node is designed to facilitate the rendering of text onto an image canvas, providing a versatile tool for AI artists who wish to incorporate textual elements into their visual creations. This node allows you to specify various attributes of the text, such as its size, color, and alignment, as well as the background color of the canvas. It also supports text wrapping, which ensures that the text fits neatly within the specified dimensions. By converting the rendered image into a tensor format, the TextRenderer
node seamlessly integrates with other nodes in the pipeline, enabling further processing or manipulation. This functionality is particularly beneficial for creating annotated images, adding captions, or designing text-based graphics, making it an essential component for projects that require dynamic text rendering.
This parameter represents the text content you wish to render. It is automatically converted to a string if it is not already in that format, ensuring compatibility with the rendering process. The text can include multiple lines and will be processed according to the specified alignment and wrapping settings.
This parameter defines the width of the image canvas in pixels. It determines how much horizontal space is available for the text and influences the text wrapping behavior. There is no explicit minimum or maximum value provided, but it should be set according to the desired output size.
This parameter specifies the height of the image canvas in pixels. Similar to the width, it dictates the vertical space available for the text. The height should be chosen based on the amount of text and the desired layout.
This parameter sets the size of the font used to render the text. A larger font size will result in bigger text, which may require more space on the canvas. The font size should be selected to ensure readability and fit within the specified dimensions.
This parameter determines the color of the text. It is specified in a format that the rendering library can interpret, such as an RGB tuple. The font color should contrast with the background color to ensure the text is visible.
This parameter sets the color of the image canvas background. Like the font color, it is specified in a format that the rendering library can interpret. The background color should complement the font color to enhance the overall visual appeal.
This parameter provides a horizontal offset for the text position, allowing you to adjust the starting point of the text on the canvas. It is useful for fine-tuning the text alignment and ensuring it is positioned correctly.
This parameter offers a vertical offset for the text position, similar to the x_offset. It helps in adjusting the vertical placement of the text, ensuring it is centered or aligned as desired.
This parameter specifies the alignment of the text on the canvas. Options typically include "left," "right," and "center," allowing you to control how the text is positioned relative to the available space.
This parameter defines the maximum width for text wrapping, measured in pixels. It ensures that the text does not exceed the specified width, automatically breaking lines as needed. This is particularly useful for maintaining a clean and organized text layout.
The image_tensor
is the primary output of the TextRenderer
node, representing the rendered image in a tensor format. This format is suitable for further processing or integration with other nodes, allowing for seamless manipulation and analysis within the pipeline. The tensor contains the RGB channels of the image, ensuring that the visual information is preserved.
The mask_tensor
is an auxiliary output that provides a mask of the rendered text. It is useful for applications that require distinguishing the text from the background, such as image segmentation or overlay effects. The mask tensor is generated alongside the image tensor, ensuring consistency and alignment between the two outputs.
wrap_width
parameter to control the line breaks and maintain a tidy layout. This is especially important for longer text passages.align
settings to achieve the desired text positioning. Center alignment is often a good choice for balanced compositions.{font_path}
, falling back to default.font_size
, width
, or height
parameters to accommodate the text. Alternatively, use the wrap_width
parameter to enable text wrapping and prevent overflow.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.