Visit ComfyUI Online for ready-to-use ComfyUI environment
Versatile node for creating customizable text-based images with various parameters and mask support.
The YCTextImageGenerator is a versatile node designed to create text-based images with customizable features, making it an essential tool for AI artists who want to integrate text into their visual projects. This node allows you to generate images with text by specifying various parameters such as canvas size, font style, text alignment, and color options. It provides the flexibility to adjust the orientation and positioning of the text, ensuring that the final output aligns with your creative vision. The node also supports the creation of a corresponding mask, which can be used for further image processing or effects. By offering a wide range of customization options, the YCTextImageGenerator empowers you to produce high-quality text images that can be seamlessly integrated into your artistic workflows.
The canvas_width
parameter defines the width of the canvas on which the text will be drawn. It allows you to specify the horizontal size of the image, with a default value of 512 pixels. The minimum and maximum values are 64 and 4096 pixels, respectively, and the width can be adjusted in increments of 8 pixels. This parameter is crucial for determining the overall size of the generated image and ensuring that the text fits appropriately within the canvas.
The canvas_height
parameter sets the height of the canvas for the text image. Similar to canvas_width
, it has a default value of 512 pixels, with a range from 64 to 4096 pixels and adjustable in steps of 8 pixels. This parameter controls the vertical dimension of the image, allowing you to accommodate text of varying lengths and orientations.
The font_size
parameter specifies the size of the text font, with a default value of 72. It can be adjusted between 8 and 500, in increments of 1. This parameter directly affects the readability and visual impact of the text, enabling you to scale the font size to suit your design needs.
The orientation
parameter determines the direction in which the text is laid out, offering options of "horizontal" or "vertical". The default setting is "horizontal". This parameter is essential for aligning the text with the intended design, whether it be for traditional horizontal reading or vertical arrangements.
The alignment
parameter controls the horizontal alignment of the text within the canvas, with options including "left", "center", and "right". The default is "center". This setting is important for positioning the text in a way that complements the overall composition of the image.
The vertical_alignment
parameter sets the vertical alignment of the text, with choices of "top", "middle", and "bottom". The default is "middle". This parameter helps in placing the text at the desired vertical position on the canvas, ensuring a balanced layout.
The x_position
parameter allows you to specify the horizontal starting point of the text on the canvas. It has a default value of 0, with a range from -4096 to 4096, adjustable in steps of 1. This parameter provides precise control over the text's horizontal placement, enabling you to fine-tune its position.
The y_position
parameter defines the vertical starting point of the text on the canvas. Like x_position
, it defaults to 0 and ranges from -4096 to 4096, with a step size of 1. This parameter is crucial for adjusting the vertical placement of the text, allowing for detailed positioning.
The background_color
parameter sets the color of the canvas background, with a default value of "#000000" (black). This parameter is important for creating contrast with the text color and enhancing the visual appeal of the image.
The text_color
parameter specifies the color of the text, defaulting to "#ffffff" (white). This setting is vital for ensuring the text stands out against the background, contributing to the overall readability and aesthetic of the image.
The background_alpha
parameter controls the transparency of the canvas background, with a default value of 1.0 (fully opaque). It ranges from 0.0 (fully transparent) to 1.0, adjustable in steps of 0.01. This parameter allows for the creation of images with varying levels of background visibility.
The text_alpha
parameter sets the transparency of the text, with a default of 1.0. It ranges from 0.0 to 1.0, with a step size of 0.01. This parameter is useful for creating text with different levels of opacity, adding depth and interest to the image.
The font
parameter allows you to choose the font style for the text. This parameter is crucial for defining the visual character of the text, enabling you to select a font that aligns with your artistic vision.
The letter_spacing
parameter adjusts the space between individual letters in the text, with a default value of 0.0. It ranges from -0.5 to 2.0, adjustable in steps of 0.01. This parameter is important for fine-tuning the text's appearance and ensuring optimal readability.
The word_spacing
parameter controls the space between words, with a default value of 1.0. It ranges from 0.5 to 5.0, with a step size of 0.1. This setting is essential for adjusting the text's flow and ensuring a balanced layout.
The line_spacing
parameter sets the space between lines of text, with a default of 1.2. It ranges from 0.5 to 3.0, adjustable in steps of 0.1. This parameter is crucial for managing the vertical spacing of multiline text, contributing to the overall readability and aesthetic of the image.
The IMAGE
output parameter provides the generated text image as a tensor. This output is the primary result of the node, representing the visual content created based on the specified input parameters. It can be used directly in your projects or further processed for additional effects.
The MASK
output parameter delivers a corresponding mask for the text image, also as a tensor. This mask highlights the areas of the image where the text is present, allowing for advanced image processing techniques such as blending, compositing, or applying selective effects.
font_size
and font
combinations to achieve the desired text style and readability in your images.background_alpha
and text_alpha
parameters to create images with varying levels of transparency, adding depth and interest to your designs.letter_spacing
, word_spacing
, and line_spacing
to fine-tune the text layout, ensuring optimal readability and aesthetic appeal.canvas_width
or canvas_height
is outside the allowed range.canvas_width
and canvas_height
are within the range of 64 to 4096 pixels.font
is not available or incorrectly specified.background_color
or text_color
is not in a valid hex format.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.