⟲ Create a looping video from scratch (T2AV, I2AV, Ref2AV) or loop an existing one! Output blends both video and audio to create a seamless transition from one loop to another. ⟲
⚙️ How it works:
Very simple! First, a small clip is created from prompt to act as an "anchor" for the main video generation. Both of its ends are encoded into the latent of the next sampler and masked against denoising. Then the main video clip ("bridge") is generated using the same prompt: it starts with the end frames of the anchor and ends with its beginning frames, thus, completing the loop. Finally, the anchor and the bridge are combined with overlapping crossfade of both video frames and audio.
Workflow also includes a function to use an existing video as an anchor (must have 24 fps). This way you can generate a bridge that will loop your video onto itself.
Other functions include precise control over video resolution, anchor and bridge duration, overlap size, number of combined loops, as well as RTX upscaling and interpolation of the final output. All of MiniMax-H3 capabilities are preserved, allowing to use T2AV, I2AV and Ref2AV modes. Works with any finetuned H3 and any LoRA stack. Workflow itself is set up to run Larryvrh's turbo LoRA with 6 steps and CK+SLA hybrid attention for both the bridge and the anchor. However, feel free to experiment with sampling parameters or use other turbo LoRAs!
Detailed guide can be found inside the workflow.
📝 Prompting tips
The workflow is perfect for looping uhh... simple repeating motions ( ͡° ͜ʖ ͡°)
However, for something more complicated, 100% looping chance is not guaranteed. The model needs to figure out a way to continuously connect encoded frames without making a hard cut in between. To help it do that, you will need to write a good prompt that will guide it. I included a template inside the workflow, though each case requires its own prompting tricks. For example:
1) Character X is performing Z on the spot. Static camera.
2) Character X moves forward to do Z and then returns back. Camera follows the character.
3) Characters X and Y are dancing together. Camera does a full orbit around the scene.
4) A continuous row of sheep runs from left side of the view to the right. Each of them jumps over a fence.or something like that. Example prompts are included in some of the attached videos above.
Note that the looping cycle must be possible not only spatially, but also temporally, preserving the amplitude of the encoded motion. If it's not, the generated bridge will have a hard cut (usually before the encoded end frames) even if it seamed easy to loop. I recommend experimenting with the duration of the video if it doesn't loop the first try. Or simply try a different seed for the bridge or the anchor.
Also, try to avoid generating music because it is very unlikely (but not impossible) that the beat timings would match through the blending phase. If you want music, just find a normal track and put it over the looped video.
Finally, if you want to loop an existing video, specify in the prompt how the generated bridge should transition from its end to its start frames. With enough prompting practice, you can consistently generate loops within 1-2 tries.
🛠️ Required custom nodes
Most of required custom nodes can be easily installed through the Manager (“Install missing custom nodes” button).
Manual pack installation links:
https://github.com/CoolBreeze164/ComfyUI-CoolB-Nodes (updated to V1.1.0)
https://github.com/Comfy-Org/ComfyUI_Nvidia_VFX_Nodes (upscale + interpolation + HDR nodes; interpolation requires RTX 40xx+ Nvidia GPU. Other stuff needs cu130+ PyTorch; if you don't have that, just replace them with other upscaler/interpolator nodes that you like)
https://github.com/seitanism/ComfyUI-H3-Motion-Context-MultiRef (⚠️not available in the Manager; download manually!)
📂 Models used
For T2V, I2V and Ref2V I personally use unified and finetuned Minimax H3 Singularity:
Minimax-h3_Singularity_ref2va_Pruned_v1.3_int8.safetensors. Any other H3 will work too.
Text encoder and VAE come from the official repo:
For turbo LoRA I strongly recommend the one from Larryvrh. Here is a link for the ComfyUI-optimized version:
Additional notes
⚠️Saving the looped video through the VHS node will leave a bit of empty audio in the end! So if you would later want to combine more loops from a VHS-saved output (in ComfyUI or in something like Adobe Premiere) trim 2-3 ms of empty audio from the end before concatenating it to itself, otherwise you might have a sudden audio bump between loops.
Workflow tested on latest versions of all custom nodes and ComfyUI 0.42.0/0.43.0 with PyTorch 2.14.0+cu130 and Python 3.12.7 on RTX 4080 SUPER and 64 GB of RAM. Current uploaded version features exact settings for one of the showcase examples (with the plane; 0.7 MP, 7 sec output). Total time to run the uploaded workflow for me was 156 sec (excluding model loading), of which actual sampling only took 17 and 84 sec for stage1 and stage2 respectively. Enabling upscaling + interpolation adds roughly +25 sec.
Feel free to comment if you have any issues! But please specify the problem/error you are encountering in great detail. Also, remember to update comfy/nodes and thoroughly read the documentation inside the workflow.
Description
V1.1 changes:
Fixed tensor size mismatch error (hopefully) by swapping the turbo LoRA for its ComfyUI-optimized version. Download link updated. Custom node pack for the old LoRA is no longer needed. If you are still getting the error, try updating comfy.
Tweaked sampling parameters for much better image quality.
Swapped video VAE for int8 for faster generation.
Added mute toggle for STAGE 2 so you can reroll STAGE 1 with different seeds to find a good base for the loop first.