Nodes/MediaForge/πŸ”₯ Compose Burn Subtitle
ComfyUI Node

πŸ”₯ Compose Burn Subtitle

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

By leon80148Β·Created 4 months agoΒ·Updated 2 months 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β€”