Nodes/TrentNodes/Mouth Shape Preview
ComfyUI Node

Mouth Shape Preview

Reading a Mouth-Shape Sequence Without Rendering a Single Frame

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Mouth Shape Preview
  • mouth_sequence
  • preview
max_display100

Debugging lip sync is misery when your only tool is watching the rendered video and guessing. This node gives you the same information in one line of text: which mouth shape (A-H, X) plays on which frame. Wire your mouth_sequence in, look at the preview output in a text display, and you can see the whole animation's mouth timeline at a glance - including the places where your phoneme-to-shape mapping went wrong.

What it does

It's deliberately tiny. One required input, mouth_sequence (the same MOUTH_SEQUENCE type that Phoneme To Mouth Shapes outputs), one optional max_display (how many frames of the sequence to show, default 100, up to 1000), and a single STRING output with the letters laid out per frame. Set max_display high enough to cover your whole clip and you get the full pattern; leave it low and it trims to the head of the sequence, which is enough for most spot-checks.

Because it's just text, it works anywhere a string output works - wire it into a Show Text node, or into a Save Text node if you want the timeline recorded next to your renders. There's no image preview involved, so it's effectively free at runtime.

Why you'll actually use it

Two failure modes show up constantly in this pack's lip-sync chain, and this is the fastest way to catch both:

  • Flicker. If smoothing was off or hold_frames was too low upstream, you'll see the letters cycling rapidly (like B H B H B H) instead of holding. Spot it here, go fix the upstream node, re-run.
  • Wrong mapping. If your audio is English but mapping_type was left mismatched upstream, certain phonemes map to the wrong viseme. A text timeline of a word you know ("hello" → H E L O) tells you instantly which letters are off and where.

It's also just a good way to sanity-check that a mouth sequence and a video of matching length actually agree on frame count before you spend a GPU pass compositing.

Installing it

Part of TrentNodes. ComfyUI Manager (search "Trent Nodes") or manual clone:

cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes.git
cd TrentNodes
pip install -r requirements.txt

Known quirk with Manager: the author renamed the repo on day one, which left two registry entries and made Manager flag the pack as "unsafe" for some installs. If that happens, the clone above is the workaround. No models, no downloads for this node - it's pure text formatting.

The one thing to remember

max_display truncates, it doesn't summarize. If your sequence is longer than the display cap and something's wrong past frame 100, you'll miss it. If a render still looks off after a clean-looking preview, check that the frame count of the sequence matches the frame count of your video - the preview is honest about the sequence, not about whether the sequence lines up with the footage.

CategoryTrent/LipSync

Inputs (2)

NameTypeDefaultDescription
mouth_sequenceMOUTH_SEQUENCEMouth shape sequence from PhonemeToMouthShapes
max_displayoptINT10010–1000Maximum frames to display

Outputs (1)

NameTypeDescription
previewSTRING