Files
1hew-ComfyUI-1hewNodes/web/docs/ImageAddLabel/en.md
T

38 lines
2.2 KiB
Markdown

# Image Add Label
**Node Function:** The `Image Add Label` node is used to add text labels to images, supporting custom fonts, colors, positions and other attributes, with dynamic input value referencing, commonly used for image annotation and description.
## Inputs
| Parameter | Required | Data Type | Default | Range | Description |
|--|--|--|--|--|--|
| `image` | Required | IMAGE | - | - | Image to add labels to |
| `height_pad` | - | INT | 24 | 1-1024 | Total top and bottom padding for label area, final height auto-calculated based on actual text rendering height |
| `font_size` | - | INT | 36 | 1-256 | Font size |
| `invert_color` | - | BOOLEAN | True | True/False | Whether to invert colors, True for black text on white background, False for white text on black background |
| `font` | - | COMBO[STRING] | Alibaba-PuHuiTi-Regular.otf | Font file list | Font selection, supports multiple font files |
| `text` | - | STRING | "" | Multi-line text | Label text content, supports variable placeholders and mathematical operations, supports -- separator functionality |
| `direction` | - | COMBO[STRING] | top | top, bottom, left, right | Label position: top, bottom, left, right |
| `input1` | Optional | STRING | "" | - | Dynamic input value 1, can be referenced in text using {input1} |
| `input2` | Optional | STRING | "" | - | Dynamic input value 2, can be referenced in text using {input2} |
## Outputs
| Output Name | Data Type | Description |
|-------------|-----------|-------------|
| `image` | IMAGE | Image with labels added |
## Features
### Text Processing
- **Multi-line Support**: Supports multi-line text, separated by line breaks
- **Batch Processing**: Each line corresponds to one image when multi-line text
- **Text Cycling**: Text cycles when there are more images than text lines
- **Dash Separator**: When lines containing only dashes exist, content between -- becomes complete labels, other splitting methods are disabled
### Variable Support
- **{index}**: Batch index, starting from 0 (0, 1, 2...)
- **{idx}**: Batch index alias, starting from 0 (0, 1, 2...)
- **{range}**: Batch index, starting from 0, with auto-padding format (00, 01, 02...)
- **{input1}**: Custom input value 1
- **{input2}**: Custom input value 2