https://github.com/Munkyfoot/ComfyUI-TextOverlay
A custom node for ComfyUI that allows users to overlay text on images with support for custom fonts and style.
https://github.com/Munkyfoot/ComfyUI-TextOverlay
Last synced: 4 months ago
JSON representation
A custom node for ComfyUI that allows users to overlay text on images with support for custom fonts and style.
- Host: GitHub
- URL: https://github.com/Munkyfoot/ComfyUI-TextOverlay
- Owner: munkyfoot
- Created: 2024-02-27T22:53:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T05:57:03.000Z (over 1 year ago)
- Last Synced: 2024-12-19T03:03:11.852Z (about 1 year ago)
- Language: Python
- Size: 8.79 KB
- Stars: 23
- Watchers: 1
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-comfyui - **ComfyUI-TextOverlay**
- awesome-comfyui - **ComfyUI-TextOverlay**
README
# TextOverlay Node for ComfyUI
The TextOverlay node allows users to overlay text on images. The node supports adjustments for font size, type, color, alignment, and position, making it versatile for various applications.
Originally inspired by the [Text Overlay Plugin by mikkel](https://github.com/mikkel/ComfyUI-text-overlay), this node has been rebuilt and expanded to include additional features and improvements.
## Features
- **Font Customization**: Choose from different font sizes and types to match your design.
- **Color Selection**: Specify text and stroke colors in hex format for perfect matching.
- **Alignment and Positioning**: Align your text horizontally and vertically, with options for precise position adjustments.
- **Stroke Customization**: Add a stroke to your text with customizable color and thickness.
- **Supports Single and Batch Processing**: Process single images or multiple images in a batch.
## Installation
To use the TextOverlay node, ensure this repo is included in your ComfyUI `custom_nodes` directory.
1. Find the `custom_nodes` directory in your ComfyUI installation.
2. Clone this repository into the `custom_nodes` directory using the following command:
```bash
git clone https://github.com/Munkyfoot/ComfyUI-TextOverlay
```
## Usage
After installation, the TextOverlay node will be available in the ComfyUI interface under the `image/text` category. To use the node:
1. Add the TextOverlay node to your workflow.
2. Connect an image source to the node's image input.
3. Configure the node parameters in the UI, including text content, font specifications, color, alignment, and positioning adjustments.
4. Connect the node's output to your desired destination in the workflow.
### Custom Fonts
To use a custom font, ensure the font file is included in the `fonts` directory within this directory. Then, specify the font file name (e.g., `arial.ttf`) in the `font` parameter of the TextOverlay node. If using a system-installed font, you can specify the font name directly without the file path. If the font file is not found, the node will default to a system-installed font.
## Input Parameters
The TextOverlay node requires the following inputs:
- `image`: The input image(s) to overlay text on.
- `text`: The text content to overlay.
- `font_size`: Size of the font.
- `font`: Name of the font file (e.g., `arial.ttf`).
- `fill_color_hex`: Hex code for the text color.
- `stroke_color_hex`: Hex code for the text stroke color.
- `stroke_thickness`: Thickness of the stroke.
- `padding`: Padding around the text.
- `horizontal_alignment`: Horizontal text alignment (`left`, `center`, `right`).
- `vertical_alignment`: Vertical text alignment (`top`, `middle`, `bottom`).
- `x_shift`, `y_shift`: Adjustments for text positioning.
- `line_spacing`: Spacing between lines of text.
## Output
The node overlays the specified text according to the configured parameters and output the modified input image(s).