Nodes/comfyui-fvmtools/Sign Split Lines
ComfyUI Node

Sign Split Lines

One region per LINE instead of per object. SAM3 returns a whole shopfront legend as a single region; one region gets one word, and that word is then stretched over the whole block. Put this between the selector and the proposer so every line gets named separately.

By ping1979ping·Created 6 months ago·Updated 2 days ago· 1
Sign Split Lines
  • sign_data
  • image
  • sign_data
  • region_count
  • report
◄enabledtrue►
◄min_gap0.055►
◄min_line_px8►
◄max_lines4►
◄pad_px2►
CategoryFVMtools/signs

Inputs (7)

NameTypeDefaultDescription
sign_dataSIGN_DATAStraight from Sign Selector SAM3, BEFORE the proposer — each new line needs its own word.
imageIMAGEThe picture the selector scanned. Lines are found in the PICTURE, not in the mask: SAM3's mask is a solid blob over the whole lettered area and has no gaps to find.
enabledBOOLEANtrueOff: pass everything through untouched, so the effect of splitting can be measured on its own.
min_gapFLOAT0.0550.01–0.4How large a horizontal gap must be, as a share of the region's height, before it counts as a line break. Too small and an ascender splits a line in two; too large and two lines stay welded.
min_line_pxINT83–200A band thinner than this cannot hold readable text and is merged into its neighbour instead of becoming a region of its own.
max_linesINT41–12Upper bound per region. A region that seems to hold more lines than this is left whole — beyond a few lines it is a paragraph, and a paragraph is not signage.
pad_pxINT20–32Rows added above and below each band. The mask must cover every stroke: what it misses is restored unchanged and stands there as leftover scribble.

Outputs (3)

NameTypeDescription
sign_dataSIGN_DATA—
region_countINT—
reportSTRING—