New feature: seamless looping
ComfyUI Frontend Compatibility Notice
Affected versions: ComfyUI_frontend 1.40.x – 1.42.9 (known good: <= 1.39.19 or >= 1.42.10)
Recent ComfyUI frontend updates have introduced significant issues with subgraph functionality that affect this workflow.
If you are affected, this message appears in your ComfyUI console right after you start a workflow run:
Failed to validate prompt for output 499:
* ColorMatch 587:586:
- Required input is missing: image_target
* Basic data handling: IfElse 598:
- Required input is missing: if_falseThe workflow may appear to run correctly, but only parts of it will actually produce output. It won't finish with a properly joined video.
If you see this warning and the workflow isn't running as expected, downgrade your ComfyUI frontend to 1.39.19 or upgrade to 1.42.10, and reload a fresh copy of the workflow.
What it Does
Point this workflow at a directory of clips and it will automatically stitch them together. It's designed to work well with a few clips or dozens. At each transition, Wan VACE generates new frames guided by context on both sides, replacing the seam with motion that flows naturally between the clips. Noisy or artifacted frames at clip boundaries get replaced in the same pass. How many context frames and generated frames are used is configurable.
The workflow runs with either Wan 2.1 VACE or Wan 2.2 Fun VACE. Input clips can come from anywhere - Wan, LTX-2, phone footage, stock video, whatever you have.
If you want the result to loop cleanly, there's a toggle for that.
Usage
Put your input clips in their own directory, named so they sort in the order you want them joined.
Configure the workflow parameters. The notes in the workflow have full details on each one.
Set the index to 0.
Queue the workflow. You need to queue it once per transition. That's N-1 times for N clips, or N times if looping is enabled.
Setup
This is not a ready to run workflow. You need to configure it to fit your system.
What runs well on my system will not necessarily run well on yours. Configure this workflow to use a VACE model of the same type that you use in your standard Wan workflow. Detailed configuration and usage instructions can be found in the workflow. Please read carefully.
Dependencies
I've used native nodes and tried to keep the custom node dependencies to a minimum. The following packages are required. All of them are installable through the Manager.
ComfyUI-Wan-VACE-Prep v1.0.12 or higher
Note: I have not tested this workflow under the new Nodes 2.0 UI.
Configuration and Models
You'll need some combination of these models to run the workflow. As already mentioned, this workflow will not run properly on your system until you configure it properly. You probably already have a Wan video generation workflow that runs well on your system. You need to configure this workflow similarly to your generation workflow.
Wan 2.2 Fun VACE
Wan 2.1 VACE
Kijai’s extracted Fun Vace 2.2 modules, for loading along with standard T2V models. Native use examples here.
The Sampler subgraph contains KSampler nodes and model loading nodes. Inference is isolated in subgraphs, so it should be easy to modify this workflow for your preferred setup. Replace the provided sampler subgraph with one that implements your setup, then plug it into the workflow. Have your way with these until it feels right to you.
Just make sure all the subgraph inputs and outputs are correctly getting and setting data, and crucially, that the diffusion model you load is one of Wan2.2 Fun VACE or Wan2.1 VACE. GGUFs work fine, but non-VACE models do not. An example alternate sampler subgraph for VACE 2.1 is included.
Enable sageattention and torch compile if you know your system supports them.
Troubleshooting
The size of tensor a must match the size of tensor b at non-singleton dimension 1 - Check that both dimensions of your input videos are divisible by 16 and change this if they're not. Fun fact: 1080 is not divisible by 16!
Brightness/color shift - VACE can sometimes affect the brightness or saturation of the clips it generates. I don't know how to avoid this tendency, I think it's baked into the model, unfortunately. Disabling lightx2v speed loras can help, as can making sure you use the exact same lora(s) and strength in this workflow that you used when generating your clips. Some people have reported success using a color match node before output of the clips in this workflow. I think specific solutions vary by case, though. The most consistent mitigation I have found is to interpolate framerate up to 30 or 60 fps after using this workflow. The interpolation decreases how perceptible the color shift is. The shift is still there, but it's spread out over 60 frames instead over 16, so it doesn't look like a sudden change to our eyes any more.
Regarding Framerate - The Wan models are trained at 16 fps, so if your input videos are at some higher rate, you may get sub-optimal results. At the very least, you'll need to increase the number of context and replace frames by whatever factor your framerate is greater than 16 fps in order to achieve the same effect with VACE. I suggest forcing your inputs down to 16 fps for processing with this workflow, then re-interpolating back up to your desired framerate.
IndexError: list index out of range - Your input video may be too small for the parameters you have specified. The minimum size for a video will be
(context_frames + replace_frames) * 2 + 1. Confirm that all of your input videos have at least this minimum number of frames.If you can't make the workflow work, update ComfyUI and try again. If you're not willing to update ComfyUI, I can't help you. We have to be working from the same starting point.
Feel free to open an issue on github. This is the most direct way to engage me. If you want a head start, paste your complete console log from a failed run into your issue.
Changelog
v2.5
Seamless Loops - Enable the
Make Looptoggle and the workflow will generate a smooth transition between your final input video and the first one, allowing the video to be played on a loop.Much lower RAM usage during final assembly - Enabled by default, VideoHelperSuite's Meta Batch Manager drastically reduces the amount of system RAM consumed while concatenating frames. If you were running out of RAM on the final step because you were joining hundreds or thousands of frames, that shouldn't be a problem any more. Additional details in the workflow notes.
v2.4 Minor tweaks. Adjust sage attention, torch compile defaults.
v2.3 This release prioritizes workflow reliability and maintainability. Core functionality remains unchanged. These changes reduce surface area for failures and improve debuggability. Stability and deterministic operation take priority over convenience features.
Looping workflow discontinued – While still functional, the loop-based approach obscured workflow status and complicated targeted reruns for specific transitions. The batch workflow provides better visibility and control.
Reverted to lossless fv1 intermediate files – The 16-bit PNG experiment provided no practical benefit and made addressing individual joins more cumbersome. Returning to the proven method.
New custom nodes for cleaner workflows – WAN VACE Prep Batch and VACE Batch Context encapsulate operations that are awkward to express in visual nodes but straightforward in Python. Load Videos From Folder (simple) replaces the KJNodes equivalent to eliminate problematic VideoHelperSuite dependencies that fail in some environments.
Enhanced console logging – Additional diagnostic output when
Debug=Trueto aid troubleshooting.Fewer custom node dependencies
The Lightweight Workflow has moved to its own page. Check it out if you just need to quickly join two clips without the overhead required by the full workflow.
v2.2 Complexity Reduction Release
Removed fancy model loader which was causing headaches for safetensors users without any gguf models installed, and vice-versa.
Removed the MOE KSampler and TripleKSampler subgraphs. You can still use these samplers, but it's up to you to bring them and set them up.
Custom node dependencies reduced.
Un-subgraphed some functions. Sadly, this powerful and useful feature is still too unstable to distribute to users on varying versions of ComfyUI.
Updated documentation.
v2.1
Add Prune Outputs to Video Combine nodes, preventing extra frames from being added to the output
v2.0 - Workflow redesign. Core functionality is the same, but hopefully usability is improved
(Experimental) New looping workflow variant that doesn't require manual queueing and index manipulation. I am not entirely comfortable with this version and consider it experimental. The ComfyUI-Easy-Use For Loop implementation is janky and requires some extra, otherwise useless code to make it work. But it lets you run with one click! Use with caution. All VACE join features are identical between the workflows. Looping is the only difference.
(Experimental) Added cross fade at VACE boundaries to mitigate brightness/color shift
(Experimental) Added color match for VACE frames to mitigate brightness/color shift
Save intermediate work as 16 bit png instead of ffv1 to mitigate brightness/color shift
Integrated video join into the main workflow. It will run automatically after the last iteration. No more need to run the join part separately.
More documentation
Inputs and outputs are logged to the console for better progress tracking
v1.2 - Minor Update 2025-Oct-13
Sort the input directory list.
v1.1 - Minor Update 2025-Oct-11
Preserve input framerate in workflow VACE outputs. Previously, all output was forced to 16fps. Note, you must manually set the framerate in the Join & Save output.
Changed default model/sampler to Wan 2.2 Fun VACE fp8/KSampler. GGUF, MoE, 2.1 are still available in the bypassed subgraphs.
Description
v2.2 Complexity Reduction Release
Removed fancy model loader which was causing headaches for safetensors users without any gguf models installed, and vice-versa.
Removed the MOE KSampler and TripleKSampler subgraphs. You can still use these samplers, but it's up to you to bring them and set them up.
Custom node dependencies reduced.
Un-subgraphed some functions. Sadly, this powerful and useful feature is still too unstable to distribute to users on varying versions of ComfyUI.
Documentation updates.
FAQ
Comments (21)
I've been trying to get this to work for a while now without success. I'm not great with ComfyUI so there may well be something obvious I'm missing.
Currently I'm at version 2.2 set up (started with a previous version and had different errors but this is where I'm at now), the various models downloaded and put in the correct folders, all the nodes installed, comfyui updated but when I try and run the workflow I get the following error:
Virtual node failed to resolve parent [435:420] slot [0]
Hi, sorry you're having trouble. Let's see if we can figure it out.
Can you tell me what flavor of ComfyUI you're running (portable, desktop, etc), and what numeric version?
Also, which workflow are you trying to run, batch or loop? Does the same error occur with both?
Are there any additional messages in your console log?
@__Bob__ Thank you for responding so quickly. I actually got it working, it was my own fault, thought I had updated comfyui correctly but apparently not. Once I got the newest version installed and restarted everything then the error was gone and I was able to figure out the last couple kinks. Follow up question: is there a way to get it to empty the vace-work folder automatically after its done with a generation or do you just have to do that manually?
@Helpful_Science The thing is, sometimes we might still want those intermediate work files after the workflow runs. We might have a transition that didn’t get generated well. Rather than redoing the entire batch, we can just regenerate that one transition. Also, code that deletes stuff in somebody else’s output folder creates a risk. I don’t want a bug in my little workflow to be the reason your entire folder got deleted!
I got the exact same problem... I'm not going to update my comfyui because the latest is extremely instable. Happens with any workflow, loop, batch, v2.1 and v2.2.
I'm using comfyui desktop 5.5
Hi, i have 2 comfyui's installed.
My older one gets the same issue
the newer one doesnt.
Go to Pixorama on youtube.
Go to their discord
Get the easy installer for comfyUI - all free (no patreon bla bla bla)
This also includes the new torch and cuda + sageattn 2.2
It has provided add-on which will allow you to point to your other models folder in your other comfyui where you dont have to get extra models.
Installed it.
and use the new comfyui and this workflow provided by bob will work.
got comfyui portable now. With that it works. Though I'm not sure this should be a problem in older comfyuis. Seems like a trivial error causing this workflow not to work in older comfyuis.
Thanks for your workflow, the transitions work very well most of the time, well done.
It's great, really appreciate the work, thank you. Joyeux noël !
Absolutly awesome. it works like a charm. thanks
hmmm how do you load the vace module with native (always been using the wrapper) (i dont have the vace full models only the extractation)
KJNodes provides a native node for loading the VACE modules. Check the readme, I have a link to an example in there.
using Batch. It was crashing for me, due to the sageattn set wrong it in the paragraph settings. Now it ran past the error. but it stops after saving out the PNG's and doesnt output a video. it doesnt give me any error. also in the CMD interface it just says its done. no error. Any clue on why that is?
Im using:
Py version 3.12.10
Py torch 2.9.1+CU130
sage 2.2
Do you see “Failed to validate prompt” warnings in your console at the start of a run?
Check out this issue and its solution: https://github.com/stuttlepress/ComfyUI-Wan-VACE-Video-Joiner/issues/1#issuecomment-3662172020
The most recent workflow release did away with the fancy model loader subgraph that was the source of most of these errors, so try updating if you haven’t yet.
If that’s not your problem, let me know. The best way to help me help you is to open an issue on github and paste your console log there.
https://github.com/stuttlepress/ComfyUI-Wan-VACE-Video-Joiner/issues
@__Bob__ thanks for your reply. as previously stated i didnt have any errors or warnings. But with only changing the output work dir (again) to a new, and rebooting it some how worked.
the cross fade is good i guess when wanting to move in 2 complete different scenes or camera angle. I left it off. A real smooth AWESOME result with context frame to 12, replace frame with 24 and new frames to 8.
I had videos where i did last frame / first frame.
so taken the last frame of a generated video, and took that frame to create a new video.
And i now have Mind blowingly beautifull seamless transitions.
Game changer!!!
THANK YOU SOO SOO MUCH!
Is there a specific size or length that works only with this?
Cause its so weird...
Movie01 Movie02 will merge
But when doing Movie03 and Movie04 it wont merge and just stops after generating the png's
All the clips have the same fps also the same.
I tried changing the input path and out put path.
I cleared cash vram what not more.
Even did Win + CTRL + SHIFT + B in windows to clear out Vram.
i can try other videos, same issue doesnt work.
only 2 specific videos work... the rest doesnt.
Any explanation cause im at a total loss?
Is there a minimum or maxium frames a video can have?
does FPS matter? (i know 2 vids need to be the same)
let me know. THanks
in addition:
What i've also find out is apart from making a new output folder or changing the output folders name, and setting the index back to zero, i also need to name a new input folder.
This is not described in your workflow. but that seems to be working for me now after several videos done.
Only then will it accept any video.
Videos must be long enough to accommodate the context and replace parameters you have specified. That is the only restriction.
It sounds like you are trying some unnecessary changes, and maybe one of these is causing additional problems for you without you realizing it.
I am sure you have already tried this, but I recommend starting from a clean slate:
- remove your vace-work directory
- set index to 0
- clear the ComfyUI execution cache, or restart ComfyUI
- Queue the workflow to run for (number of input files - 1) times.
If you have problems, please open a github issue and paste your complete console log. I’ll help you work through it.
https://github.com/stuttlepress/ComfyUI-Wan-VACE-Video-Joiner/issues
@__Bob__ ohwell, as i discribbed its the only way that work for me.
all my videos are 5 to 6 seconds long, so no issues there.
Just wanted to say I and many others TRULY appreciate how organized this workflow is despite its complexity. I couldn't begin to create something so beautiful and hierarchically tidy. Thank you for your detailed documentation and contributions! 💝
(NSFW) Comparison video included
Awesome workflow, it made my clips really smooth without hiccups.
See my comparison video here: