Text Box Style
The caption box behind your ComfyUI text
- TEXTBOX
Text Box Style is the styling companion to the pack's Draw Text node. Draw Text renders the words; this node draws the box behind the words. If you've ever wanted a subtitle card, a watermark band, or a caption plate on a generated image and got tired of fiddling with masks and compositing, this is the part of the graph that stops being annoying.
The key thing to understand: this node doesn't render anything. It's a style preset. You dial in the fill, border, padding, and corner radius, and it hands a TEXTBOX object to Draw Text's optional textbox input, which does the actual drawing. Think of it as a saved theme you can wire in, tweak once, and reuse across ten workflows.
What you actually set
Most of the inputs are styling sliders, and the defaults are sensible enough to run with:
colorandopacity- the box fill. Opacity defaults to 0.2, which reads as a subtle glassy band rather than a solid slab.border_color,border_opacity,border_width- the outline, defaulting to a thin black edge at full opacity.corner_radius- rounded corners in pixels. 0 is sharp, 100 is pill-shaped.padding_left/right/top/bottom- how much breathing room between text and the box edge. Each defaults to 24px, and yes, you can go negative to shrink the box under the text.full_width- stretches the box to the margins based on text alignment instead of hugging the text.
The one subtlety worth knowing: colors can be a named preset (black, white, red, …) or a custom color_hex / border_hex. An 8-digit hex like #00000080 includes alpha, and it overrides the opacity slider. That's the author's design - opacity is the lazy path, hex gives you exact control. Use 8-digit hex when you need a precise alpha, use the sliders when you're still experimenting.
Wiring it in
Drop the TEXTBOX output into Draw Text's textbox input, then let Draw Text's own alignment options place both text and box. If you only want a translucent band across a composed image, set color to transparent and leave the border - instant caption plate.
Gotchas
Because this ships inside comfyui-dreambait-nodes, you get the whole pack's dependency list whether you like it or not - installing for one text box pulls in transformers, bitsandbytes, librosa and friends, which is a lot of weight for a caption. If you're on ComfyUI Manager, search "comfyui-dreambait-nodes" and let it handle the pip install; otherwise:
cd ComfyUI/custom_nodes
git clone https://github.com/drmbt/comfyui-dreambait-nodes
# restart ComfyUI
Two real-world traps: if Draw Text isn't in your graph the TEXTBOX wire has nowhere to go (there's no standalone output), and 8-digit hex quietly ignoring your opacity slider confuses everyone once. Neither is a bug - it's just how the alpha is meant to work. For the other text-styling helpers in the pack (Text Margins, Text Shadow, Draw Mana), you'll find the same pattern: preset nodes feeding one renderer.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| color | COMBO | black | Box fill color. Alpha controlled by opacity unless using 8-digit hex |
| opacity | FLOAT | 0.200–1 | Box opacity (ignored if using 8-digit hex color) |
| border_color | COMBO | black | Border color. Alpha controlled by border_opacity unless using 8-digit hex |
| border_opacity | FLOAT | 1.000–1 | Border opacity (ignored if using 8-digit hex color) |
| border_width | INT | 60–100 | Border width in pixels |
| corner_radius | INT | 00–100 | Corner radius in pixels |
| padding_left | INT | 24-4096–4096 | Left padding in pixels (negative values shrink the box) |
| padding_right | INT | 24-4096–4096 | Right padding in pixels (negative values shrink the box) |
| padding_top | INT | 24-4096–4096 | Top padding in pixels (negative values shrink the box) |
| padding_bottom | INT | 24-4096–4096 | Bottom padding in pixels (negative values shrink the box) |
| full_width | BOOLEAN | false | Extend box to margins based on text alignment |
| color_hexopt | STRING | #FFFFFF | Custom hex color (6 or 8 digits). 8-digit hex overrides opacity |
| border_hexopt | STRING | #000000 | Custom border hex color (6 or 8 digits). 8-digit hex overrides border_opacity |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TEXTBOX | TEXTBOX | — |