Nodes/MediaForge/๐Ÿ”ฅ Compose Burn Subtitle
ComfyUI Node

๐Ÿ”ฅ Compose Burn Subtitle

Subtitles inside the Compose chain, so one encode pays for everything

By leon80148ยทCreated 7 months agoยทUpdated 6 days agoยท 0
๐Ÿ”ฅ Compose Burn Subtitle
  • overlays
  • overlays
โ—„srt_pathinput/sample.srtโ–บ
โ—„font(ๆŠŠ .ttf / .otf / .ttc ไธŸ้€ฒ plugin/font/ ๅพŒ้‡ๆ–ฐๆ•ด็†)โ–บ
โ—„font_size24โ–บ
โ—„font_color_hex#FFFFFFโ–บ
โ—„boldtrueโ–บ
โ—„italicfalseโ–บ
โ—„letter_spacing0.0โ–บ
โ—„outline_color_hex#000000โ–บ
โ—„outline_width2โ–บ
โ—„shadow_depth1โ–บ
โ—„border_style1โ–บ
โ—„back_color_hex#000000โ–บ
โ—„alignmentbottom_center (2)โ–บ
โ—„margin_v20โ–บ
โ—„margin_l50โ–บ
โ—„margin_r50โ–บ

MF_ComposeBurnSubtitle is MF_BurnSubtitle's in-chain sibling: instead of burning subtitles in its own one-shot encode, it appends a subtitle op to the Compose overlay chain so MF_ComposeVideo can burn subtitles and your watermark and your intro text in a single pass. Stack them all and you still pay exactly one decode and one encode.

That's the whole pitch, and it's worth understanding before you use it: the standalone MF_BurnSubtitle re-encodes your video by itself, so if you then run the output through Compose for a watermark, that's a second encode. Chained correctly, this node makes the "watermark + subtitle + BGM" workflow a single generation instead of three. If subtitles are your only effect, the standalone node is simpler - this one exists for when subtitle isn't the whole job.

How it works

It builds an ASS-styled subtitles filter op and appends it to the MF_COMPOSE_OPS chain (the same wire type as MF_ComposeOverlayText and MF_ComposeWatermark). The overlay list order is z-order, so a subtitle node chained after a watermark sits on top of it. MF_ComposeVideo compiles the whole chain into one filter_complex graph and encodes once. Like its sibling, it reads fonts from the plugin's font/ directory and uses fontTools to resolve family names.

The widget set is the same ASS styling as MF_BurnSubtitle - font_size, font_color_hex, bold/italic, outline_width/outline_color_hex, shadow_depth, border_style (1 = outline+shadow, 3 = opaque box), alignment (9 numpad positions), and the margin_v/margin_l/margin_r layout controls. The one thing that's deliberately not here is the encoder controls - codec, crf, preset - because those live on MF_ComposeVideo, where the one encode happens.

The inputs that matter

  • srt_path - your UTF-8 SRT.
  • font_size, font_color_hex, outline_width - the styling trio you'll actually tune. Hex #RRGGBB colors, black outline at width 2 as the baseline.
  • alignment / margin_v - placement. bottom_center (2) with a 20px vertical margin is the default and it's a good one.

Optional overlays input chains the previous overlay node in; leave it unwired to start a fresh chain. Output is overlays (MF_COMPOSE_OPS) โ†’ wire into the next overlay or into MF_ComposeVideo.

Install

Part of the MediaForge pack:

cd ComfyUI/custom_nodes
git clone https://github.com/leon80148/comfyui_MediaForge.git
# restart ComfyUI

Or ComfyUI Manager โ†’ "MediaForge". No extra deps beyond what the pack's requirements.txt installs (fontTools, ffmpeg fallbacks).

Common issues

The same font gotcha as MF_BurnSubtitle: empty font dropdown = no fonts in <plugin>/font/. And remember this node emits no video itself - if you wire its output nowhere, nothing renders. It has to reach MF_ComposeVideo (through however many intermediate overlay nodes) to matter. Paths with filter-special characters (: [ ] ' , ;) are auto-escaped by the pack, but if you hit a filter syntax error and you have such characters in the SRT path, that's the prime suspect.

CategoryMediaForge/Compose

Inputs (17)

NameTypeDefaultDescription
srt_pathSTRINGinput/sample.srtโ€”
fontCOMBO(ๆŠŠ .ttf / .otf / .ttc ไธŸ้€ฒ plugin/font/ ๅพŒ้‡ๆ–ฐๆ•ด็†)1 options: (ๆŠŠ .ttf / .otf / .ttc ไธŸ้€ฒ plugin/font/ ๅพŒ้‡ๆ–ฐๆ•ด็†)
font_sizeINT248โ€“150โ€”
font_color_hexSTRING#FFFFFFโ€”
boldBOOLEANtrueโ€”
italicBOOLEANfalseโ€”
letter_spacingFLOAT0.00โ€“20โ€”
outline_color_hexSTRING#000000โ€”
outline_widthINT20โ€“10โ€”
shadow_depthINT10โ€“10โ€”
border_styleINT11โ€“3โ€”
back_color_hexSTRING#000000โ€”
alignmentCOMBObottom_center (2)9 options: bottom_left (1), bottom_center (2), bottom_right (3), middle_left (4), middle_center (5), middle_right (6), +3
margin_vINT200โ€“500โ€”
margin_lINT500โ€“1000โ€”
margin_rINT500โ€“1000โ€”
overlaysoptMF_COMPOSE_OPSโ€”

Outputs (1)

NameTypeDescription
overlaysMF_COMPOSE_OPSโ€”