A longer video in parts
Lesson "anchor-parts", in the group Video: the anchor picture of the lesson list. Steps: 12.
Consent first
Only someone who agrees may be brought to life this way: yourself, a made-up character, or a person who gave permission. Obtain permission for the source material and follow local law. For adult (18+) use, obtain consent and follow local law. See Content rules.
What you will be able to do
Two parts of a clip join through a shared anchor frame into one longer video.
What you need
- It goes on from Two anchors: first and last frame. The card says so; it is a hint, not a lock.
- Nodes: ModelSamplingSD3, CLIP Text Encode (Prompt), Load VAE, Load Image, WanFirstLastFrameToVideo, KSampler (Advanced), VAE Decode / VAE Decode (Tiled), Create Video, Batch Images.
- The app downloads and installs nothing. The step texts below say which files and folders, and which ComfyUI template names them.
The steps
The words of each step, as the lesson shows them. Node names are in bold.
Before you start (reading)
Only someone who agrees may be brought to life this way: yourself, a made-up character, or a person who gave permission. Obtain permission for the source material and follow local law. For adult (18+) use, obtain consent and follow local law. Exclude anyone under 18 or who appears underage; label synthetic depictions so they do not mislead others. The lessons teach technique in factual, non-graphic terms.
A video model makes a few seconds at a time. A longer clip is made in parts, and the frame that ends one part is the anchor that starts the next. This lesson adds a second part to the graph of "Two anchors: first and last frame", as the official template with six key frames does.
What it costs: each part costs as much as the whole graph before, so two parts take twice the time. The memory stays the same: the parts run one after the other.
The first part is needed
The canvas must hold the graph of "Two anchors: first and last frame": the two shift nodes, the prompts, Load VAE, the image Load Image at the end of the clip, WanFirstLastFrameToVideo, the two samplers KSampler (Advanced) and KSampler (Advanced), VAE Decode and Create Video. If it is not there, do that lesson first.
Load the next key frame
Add a Load Image node and choose in
imagethe picture the second part ends with. The last picture of the first part is where the second one starts.The start of the second part
Add a second WanFirstLastFrameToVideo node. Connect the prompts and the VAE as for the first; connect Load Image to its
start_imageand Load Image to itsend_image. Setwidth,heightandlengththe same as in the first.The shared picture is the seam: the first part ends on it and the second starts on it, so the joint does not jump.
Two passes for the second part
Add two more KSampler (Advanced) nodes. The first takes the
high_noisemodel through its shift node and the three outputs of WanFirstLastFrameToVideo; the second takes thelow_noisemodel through its own shift node, the prompts of WanFirstLastFrameToVideo and the output of the first. The models are loaded once and serve both parts.The same split of steps
Give the new pair the settings of the first part:
add_noiseenableanddisable, the samestepsandcfg, the first stops at the sameend_at_stepwhere the second has itsstart_at_step,return_with_leftover_noiseenableanddisable.The same seed
Set
noise_seedof KSampler (Advanced) to the same number as in KSampler (Advanced).With the same seed and settings the parts start from the same kind of noise, and colour and texture change less at the seam. A part that went wrong can still be redone with another seed.
Turn the second part into frames
Add a VAE Decode node. Connect the output of the second new sampler to its
samplesinput and the VAE to itsvaeinput.Join the parts
Add a Batch Images node. Connect the frames of VAE Decode to its
image1input and those of VAE Decode toimage2. Then connect its output to theimagesinput of Create Video in place of the first part alone.The template joins its parts with Batch Images in the same way. The shared key frame appears twice at the seam, which at 16 fps is not seen.
Why colour and face drift from part to part, and what holds them (reading)
- Each part only sees its two anchors. Anything they do not show (the back of a head, a hand) is invented again in each part, a little differently.
- What holds: the same reference for every part (key frames made from one picture, or the same character LoRA), the same prompt words for the subject, the same seed and settings.
- Colour: a colour-match node after decoding brings every part to the colours of one reference frame. The Color Match node of KJNodes does this; the official SCAIL extension template matches each part to the last frame of the one before.
- Detail: a light detail pass on the frames, or an upscale of the joined clip (the lesson "A larger, sharper video: SeedVR2"), evens out small differences.
- Without key frames: the last frame as the next anchor (reading)
When you have no picture for the end of each part, take the last frame of the finished part as the start image of the next one: Image From Batch with batch_index -1 and length 1 picks it. The next part is plain image to video from that frame.
Each handover passes through a decoded frame, so small losses add up: after a few parts the face and the colours drift more than with key frames. Keep the chain short, or save each part with Save Video and join the files afterwards in a video editor.
- The graph is ready (reading)
Save the graph with "File ▸ Save workflow for ComfyUI…", open the file in ComfyUI and run it there. This app runs nothing in ComfyUI itself.
What the lesson checks
A reading step is done when you press Got it, next. A doing step ticks itself off when the canvas holds:
- Step 2, The first part is needed:
- a ModelSamplingSD3 node.
- a ModelSamplingSD3 node.
- a CLIP Text Encode (Prompt) node.
- a CLIP Text Encode (Prompt) node.
- a Load VAE node.
- a Load Image node.
- a WanFirstLastFrameToVideo node.
- a KSampler (Advanced) node.
- a KSampler (Advanced) node.
- a VAE Decode or VAE Decode (Tiled) node.
- a Create Video node.
IMAGEof Load Image (last frame of the first part) intoend_imageof WanFirstLastFrameToVideo (start of the first part) (a Upscale Image or Upscale Image By or ImageFromBatch or ImageResizeKJv2 or Resize Image or GetImageRangeFromBatch or ResizeImageMaskNode in between is accepted).latentof WanFirstLastFrameToVideo (start of the first part) intolatent_imageof KSampler (Advanced) (first part, first pass).LATENTof KSampler (Advanced) (first part, first pass) intolatent_imageof KSampler (Advanced) (first part, second pass).LATENTof KSampler (Advanced) (first part, second pass) intosamplesof VAE Decode or VAE Decode (Tiled) (first part).
- Step 3, Load the next key frame:
- a Load Image node.
imageof Load Image (next key frame) is not the same file asimageof Load Image (last frame of the first part).
- Step 4, The start of the second part:
- a WanFirstLastFrameToVideo node.
CONDITIONINGof CLIP Text Encode (Prompt) (prompt) intopositiveof WanFirstLastFrameToVideo (start of the second part).CONDITIONINGof CLIP Text Encode (Prompt) (negative prompt) intonegativeof WanFirstLastFrameToVideo (start of the second part).VAEof Load VAE intovaeof WanFirstLastFrameToVideo (start of the second part).IMAGEof Load Image (last frame of the first part) intostart_imageof WanFirstLastFrameToVideo (start of the second part) (a Upscale Image or Upscale Image By or ImageFromBatch or ImageResizeKJv2 or Resize Image or GetImageRangeFromBatch or ResizeImageMaskNode in between is accepted).IMAGEof Load Image (next key frame) intoend_imageof WanFirstLastFrameToVideo (start of the second part) (a Upscale Image or Upscale Image By or ImageFromBatch or ImageResizeKJv2 or Resize Image or GetImageRangeFromBatch or ResizeImageMaskNode in between is accepted).widthof WanFirstLastFrameToVideo (start of the second part) equalswidthof WanFirstLastFrameToVideo (start of the first part).heightof WanFirstLastFrameToVideo (start of the second part) equalsheightof WanFirstLastFrameToVideo (start of the first part).lengthof WanFirstLastFrameToVideo (start of the second part) equalslengthof WanFirstLastFrameToVideo (start of the first part).
- Step 5, Two passes for the second part:
- a KSampler (Advanced) node.
- a KSampler (Advanced) node.
MODELof ModelSamplingSD3 (shift of the first pass) intomodelof KSampler (Advanced) (second part, first pass) (a LoraLoaderModelOnly or EasyCache in between is accepted).positiveof WanFirstLastFrameToVideo (start of the second part) intopositiveof KSampler (Advanced) (second part, first pass).negativeof WanFirstLastFrameToVideo (start of the second part) intonegativeof KSampler (Advanced) (second part, first pass).latentof WanFirstLastFrameToVideo (start of the second part) intolatent_imageof KSampler (Advanced) (second part, first pass).MODELof ModelSamplingSD3 (shift of the second pass) intomodelof KSampler (Advanced) (second part, second pass) (a LoraLoaderModelOnly or EasyCache in between is accepted).positiveof WanFirstLastFrameToVideo (start of the second part) intopositiveof KSampler (Advanced) (second part, second pass).negativeof WanFirstLastFrameToVideo (start of the second part) intonegativeof KSampler (Advanced) (second part, second pass).LATENTof KSampler (Advanced) (second part, first pass) intolatent_imageof KSampler (Advanced) (second part, second pass).
- Step 6, The same split of steps:
add_noiseof KSampler (Advanced) (second part, first pass) isenable.stepsof KSampler (Advanced) (second part, first pass) equalsstepsof KSampler (Advanced) (first part, first pass).cfgof KSampler (Advanced) (second part, first pass) equalscfgof KSampler (Advanced) (first part, first pass).end_at_stepof KSampler (Advanced) (second part, first pass) equalsend_at_stepof KSampler (Advanced) (first part, first pass).return_with_leftover_noiseof KSampler (Advanced) (second part, first pass) isenable.add_noiseof KSampler (Advanced) (second part, second pass) isdisable.stepsof KSampler (Advanced) (second part, second pass) equalsstepsof KSampler (Advanced) (first part, first pass).cfgof KSampler (Advanced) (second part, second pass) equalscfgof KSampler (Advanced) (first part, first pass).start_at_stepof KSampler (Advanced) (second part, second pass) equalsend_at_stepof KSampler (Advanced) (second part, first pass).return_with_leftover_noiseof KSampler (Advanced) (second part, second pass) isdisable.
- Step 7, The same seed:
noise_seedof KSampler (Advanced) (second part, first pass) equalsnoise_seedof KSampler (Advanced) (first part, first pass).
- Step 8, Turn the second part into frames:
- a VAE Decode or VAE Decode (Tiled) node.
LATENTof KSampler (Advanced) (second part, second pass) intosamplesof VAE Decode or VAE Decode (Tiled) (second part).VAEof Load VAE intovaeof VAE Decode or VAE Decode (Tiled) (second part).
- Step 9, Join the parts:
- a Batch Images node.
IMAGEof VAE Decode or VAE Decode (Tiled) (first part) intoimage1of Batch Images.IMAGEof VAE Decode or VAE Decode (Tiled) (second part) intoimage2of Batch Images.IMAGEof Batch Images intoimagesof Create Video.