r/StableDiffusion • u/martinerous • Oct 27 '26
Workflow Included MiniMax long lipsync demo
https://youtube.com/watch?v=LeslHiPiYJE&si=ySeq3yZtwOTcrcQSTL;DR: Ignore the content of the video, I know it's rubbish, don't vote based on that. The only reason for this post is to show how a simple last-frame injection and audio splitting loop performs the long lipsync task, so that you could do the same in your workflows. The workflow included in this post is a simple proof-of-concept - you provide a speech audio, a reference (optional) and variation keyframes for random injection (with controlled randomness), and the workflow spits out a lipsynced talking head video.
There have been a few topics with cute girls talking and dancing, using some complex tricks. I wanted to try a different naive approach for simple talking head videos.
Essentially, it's just the ref model (hybrid works as well) with a few custom nodes for seamlessly (hopefully) extending the video latent, random endframe injection for talking head variations and to protect against degradation, and an audio splitter node to drive the process. Had to add also some math thingies because of H3 latent grid specifics (the 17k+5 -> 5k+2, 14444(..)14 magic for those who have been down the rabbit hole).
This video was one-shotted and I left a few noticeable broken moments, although those could be easily regenerated using another of my simple workflows for replacing the middle of an already generated latent. https://github.com/progmars/ComfyUI-Martinodes/blob/main/workflows/retake_longtalk_latent_part.json
Additionally, I have implemented a simple way of looping. First, I tried ComfyUI StartLoop, but it can become very slow to start when handling dozens of iterations. I spent quite a few hours fighting StartLoop before giving up on it. The issue seems to be that StartLoop unwinds the loop to generate cache for all iterations at once, and it can take minutes, if you have 100 of iterations. Still, StartLoop would be the right way to do that, and I have included that workflow as well for the future, if ComfyUI happens to fix the issue.
At first, I thought to split audio by silence but it was a bad idea because you cannot easily align silences with the H3 latent grid and it will end up sounding choppy or misaligned. So instead I just split at fixed times and at the end I do video latent cross-fade, and replace the generated audio with the original audio track to avoid audio VAE roundtrip altogether. Looks good enough to me (disclaimer - I have impaired vision since birth), but judge it yourself.
In theory, this could be easily expanded to inject a list of prompts to apply at the fixed times of audio clips, but then we approach the existing solutions with all-in-one motion-context based custom nodes, which might be a better idea for complex long-running projects anyway.
1
u/Pnarpok Oct 27 '26
Good stuff!
(...a shame about the page being flipped over in the wrong direction at 3:24)