Nodes/ComfyUI Whisper/Resize Cropped Subtitles
ComfyUI Node

Resize Cropped Subtitles

Paste a reworked subtitle crop back onto the original frame

By yuvraj108c·Created 3 years ago·Updated 2 months ago· 252
Resize Cropped Subtitles
  • cropped_subtitles
  • original_frames
  • subtitle_coord
  • IMAGE

This is the least-visited node in the pack, and also the most specialized - it's not something you reach for on a typical run. It exists to solve one specific problem: you've cropped the subtitle region out of a frame to do something to it - restyle it, run it through an upscaler, translate the text via an image model, whatever - and now you need that reworked crop back in its exact original spot, at the right size, on the untouched full frame. That's the entire job of this node.

Where it fits in the pipeline

It's downstream of Add Subtitles To Frames, and specifically of that node's two extra outputs most people ignore: cropped_subtitles and subtitle_coord. When Add Subtitles To Frames burns captions onto your video, it also hands you the subtitle region cropped out as its own image, plus the coordinates of where that crop came from. Normally you'd just take the composited full frame and move on. But if you want to intervene on just the subtitle text - say, run it through something that changes its look, or replace it after translating - you take that cropped_subtitles output, do your processing on it externally, and then bring the result here along with the original (unmodified) frames and the recorded subtitle_coord. This node resizes your processed crop to fit the original region exactly and composites it back onto the original frames - so whatever you did to the crop lands in the right place at the right scale, on footage that never had the first composite baked in.

The inputs and outputs that matter

Three required inputs, and they need to come from the right places to make sense together:

  • cropped_subtitles - an IMAGE. This should be your processed version of the crop Add Subtitles To Frames gave you (or the crop itself, unmodified, if you're just testing the pipeline).
  • original_frames - an IMAGE batch. The clean frames - not the ones Add Subtitles To Frames already composited captions onto, since the point is to build a fresh composite from the reworked crop.
  • subtitle_coord - the pack's own subtitle_coord type, straight from Add Subtitles To Frames. This is what tells the node where and at what size to place the crop; there's no manual coordinate entry, so this input has to trace back to the same run that produced the crop you're pasting in.

One output: a composited IMAGE - the original frames with your reworked subtitle crop resized and pasted into place.

How to install it

Part of the same pack as everything else here - no separate install. ComfyUI Manager: search ComfyUI Whisper, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/yuvraj108c/ComfyUI-Whisper

then restart ComfyUI.

Common issues & troubleshooting

Composite lands in the wrong place, or subtitle looks distorted. This almost always means subtitle_coord doesn't actually correspond to the cropped_subtitles or original_frames you're feeding in - for instance, coordinates from one run wired against frames from a different run, or against a resized/cropped version of the original frames. Keep all three inputs traceable to the same Add Subtitles To Frames call and matching frame dimensions.

Nothing looks different from just using Add Subtitles To Frames directly. If you haven't actually modified cropped_subtitles in between, that's expected - this node's whole value is in whatever processing you did to the crop before bringing it back here. If you're not doing that intermediate step, you don't need this node at all; Add Subtitles To Frames' main IMAGE output already gives you a normal composited result.

Unsure whether you even need this node. You probably don't, unless your workflow specifically involves reworking the subtitle region in isolation (translation, restyling, upscaling just the caption). For a standard "burn captions onto video" workflow, Add Subtitles To Frames on its own is the whole answer - this node is the extra step for people doing something unusual with the isolated text.

Categorywhisper

Inputs (3)

NameTypeDefaultDescription
cropped_subtitlesIMAGE
original_framesIMAGE
subtitle_coordsubtitle_coord

Outputs (1)

NameTypeDescription
IMAGEIMAGE