Nodes/comfyui_cv/CV Draw Text
ComfyUI Node

CV Draw Text

Stamps a text label onto the image or mask (cv2.putText), with an optional contrasting halo so it stays readable on any background - print a pipeline's final result (a reading, a count, a score) into its debug image. Compose dynamic text with Basic data handling string nodes ('to STRING', 'zfill', 'concat'). Empty text passes the image through unchanged.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Draw Text
  • source
  • image
text
x12.00
y42.00
font_scale1.20
color(0, 255, 0)
thickness2
outlinetrue
Categoryimage/CV/features

Inputs (8)

NameTypeDefaultDescription
sourceCOMFY_MATCHTYPE_V3Image or mask to stamp the text onto (a copy is made). Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.
textSTRINGThe label; convert to an input to feed a computed string.
xFLOAT12.00-1000000–1000000Left edge of the text baseline, in pixels.
yFLOAT42.00-1000000–1000000Baseline height, in pixels (text sits above it).
font_scaleFLOAT1.200.1–64Font size multiplier (1.0 is the base Hershey size).
colorSTRING(0, 255, 0)Color as a single value (broadcast to all channels) or BGR tuple, e.g. '255' or '(0, 255, 0)'. Shorter tuples are zero-padded; longer tuples are truncated.
thicknessINT21–64Stroke width of the glyphs in pixels.
outlineBOOLEANtrueDraw a contrasting halo behind the text: black behind a light 'color', white behind a dark one. It follows the colour, so black text on a black background is lifted off it rather than disappearing into a black halo.

Outputs (1)

NameTypeDescription
imageCOMFY_MATCHTYPE_V3Same format as the image input.