Nodes/TrentNodes/Mouth Shape Loader
ComfyUI Node

Mouth Shape Loader

The Boring Node That Keeps Lip Sync From Breaking (9 Mouths, In Order)

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Mouth Shape Loader
  • images
  • mouth_shapes
validatetrue

Every lip-sync pipeline has an unglamorous dependency: a set of mouth drawings, and a guarantee they're all there and in the right order. That's the whole job of this node. It takes your batch of mouth-shape images, checks that you actually gave it nine of them in the A-H plus X (silence) order the rest of the pack expects, and hands the validated batch on to the compositor.

Why it exists

ComfyUI is happy to let you wire a two-image batch into a compositor and discover the problem three nodes later as a confusing error deep in the render. This node catches that at the source. It's the pack's way of enforcing a contract: the Mouth Shape Compositor and the Tracked variant both assume exactly nine shapes, index 0 through 8 mapping to A through X. The loader is where that contract gets checked, which makes it the sensible entry point for your mouth art.

It also plays nicely with the rest of the lip-sync flow because it's just a loader - no background removal, no compositing, no resizing. If your mouth shapes sit on solid backgrounds and you'd rather cut them out later, you can. If you need them cut out first, the pack's Remove Mouth Background or the Tracked compositor's own BiRefNet pass handles it downstream.

What you actually set

  • images (required) - your batch of 9 mouth images, A through H followed by X. In practice you'll typically load them as a batch from a folder and let this node confirm the ordering and count.
  • validate (optional, default on) - the check that exactly 9 images arrived. Turn it off only if you're doing something deliberately weird, like feeding a different count to a custom downstream node that doesn't follow the pack convention. Leave it on.

The single output, mouth_shapes, is the same batch that went in, so this node costs you almost nothing at runtime - the work is the validation, and it's cheap.

Installing it

It's part of TrentNodes, a single pack that ships the whole lip-sync and PSD toolset (69 nodes total). Install via ComfyUI Manager (search "Trent Nodes") or manually:

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

One thing worth knowing before Manager: the author renamed the repo on its first day, which briefly left two entries in the registry and made Manager flag the pack as "unsafe" for some people. If you hit that, the manual clone above is the reliable path. There are no model downloads for this specific node - it's pure plumbing.

Gotchas

If you see the validation error, the fix is almost always that your folder's natural sort order isn't alphabetical. A.png … H.png, X.png sorts fine, but names like shape10.png will land in the wrong slot. Rename your files to the A-H/X convention the node expects, and the same folder will load cleanly every time.

CategoryTrent/LipSync

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEBatch of 9 mouth shape images in A-H, X order
validateoptBOOLEANtrueValidate that exactly 9 images are provided

Outputs (1)

NameTypeDescription
mouth_shapesIMAGE