Skip to content

Controlling camera path with first and last frames ​

💡 One-sentence summary: use the first-and-last-frame video workflow to pin down both the start point and the end point of a shot — pick the right shot, prepare two frame images, and verify both ends.

4.1's image-to-video pins down the beginning, but the ending is still left open: in "Still Pretty After the Collapse," when Old Chen takes this fall, whether he falls into the puddle or onto the steps is entirely a gacha roll. This page adds the second anchor — Wan2.2's first-and-last-frame workflow: the workflow section of the official tutorial is called Wan 2.2 14B First-Last Frame to Video, the template library search name is "Wan2.2 14B FLF2V", and the official positioning for it is "define the starting frame and ending frame to generate a smooth video transition" (docs.comfy.org Wan2.2 tutorial). With both ends locked, the model only handles how the middle goes, and the endpoint goes from a gacha item to a setting item.

Set the applicable boundary first (design note for this course): what it controls is moving within a single shot from frame A to frame B; only transition and displacement shots are worth it. It is not a universal transition tool — any two arbitrary images cannot be stitched into one shot.

What you'll be able to do after this lesson ​

  • Pick out from the storyboard the shots that should use first and last frames, and be able to answer each of the three criteria (in "Still Pretty After the Collapse," at least 06's fall)
  • Prepare both a first-frame and a last-frame vertical image for a shot, knowing when to use each of the three sources
  • Run the Wan2.2 14B FLF2V workflow in ComfyUI: upload one image into each of the two Load Image nodes, and start with the official default size
  • Write a mid-segment action prompt for "from A to B," verify only the two ends, and keep retries to 3 per shot

Why pin down the first and last frames instead of continuing to gacha? ​

CapabilityKeep gacha-ing (image-to-video)Lock down both ends (first and last frames)
Opening✅ Pinned down by the first-frame image✅ Pinned down by the first-frame image
Ending❌ Model is random, the endpoint is up to fate✅ Pinned down by the last-frame image, the endpoint becomes a setting item
How the middle goesModel improvises freelyStill performed by the model, but it can't escape the two ends
Images to prepare in advanceOne first frameTwo: first frame + last frame
Suitable shotsMost shotsTransition and displacement shots: the start and end can each be drawn as one image
Retry costIf the endpoint is wrong, redo the whole clipBoth ends are guaranteed correct; retries only gamble on the middle

Your current predicament ​

  • "The storyboard says 'falls into the puddle,' but after eight gacha rolls, Old Chen lands on the steps one time and out of frame the next — the endpoint is pure luck"
  • "In the previous shot his sole slips, and in the next shot he's already sitting in the puddle — no matter how the bit in between is generated, it doesn't connect"
  • "You want the shot to go from frame A to frame B, but the model adds its own drama halfway: a spin, a look back, a slow-motion moment"

When to use this technique ​

When you need:

  • Transition control: pin down the endpoint of transition and displacement shots — where the fall lands, where they stop, where the gaze falls
  • The tightest-connecting shot pairs continue along the edit points — for the tight-connection shot pairs named in 2.5, prioritize this page when generating

And you don't want to:

  • Keep gacha-ing the endpoint, with every retry burning into the 1.4 cost table
  • Leave both ends to the model's randomness, only to find they don't connect when editing

The practice film is a vertical AI video, and the frame is already narrow — an endpoint that's even slightly off is glaring. For shots where both ends can be locked down, don't leave them to gacha.

🎒 Preparation before starting ​

Follow along with me ​

The following example continues with "Still Pretty After the Collapse": under a pedestrian bridge in a rainstorm, delivery rider Old Chen shields the birthday cake for his daughter. 2.5 names 05→06 and 06→07 as the two pairs with the tightest action continuity; this page works entirely on 06 (wide shot · he falls into a puddle together with the box). You can follow along with your own storyboard.

Step 1: Pick the shots—only transition and displacement shots are worth first-and-last frames ​

Why: First and last frames require preparing two images in advance, so only give them to shots that deserve it; pick wrong, and the images are prepared for nothing and the time is burned for nothing.

How: Go through 2.4 the storyboard table shot by shot against three criteria (this course's teaching template):

CriterionPass-line questionThe answer for 06
The start and end can each be drawn as a single imageCan you state one complete subject-verb-object sentence each for the beginning and the endBeginning: he leans forward off balance on the steps holding the cake box; end: he falls into the puddle sitting down, together with the box ✅
One continuous motion can complete itIs the motion between the two frames within a single stepLosing balance, toppling, sitting into the puddle—one fall ✅
The landing point must be accurateIf the landing point is off, can this shot still be usedIf the fall lands in the wrong spot, the box-lid close-up in 07 won't connect ✅

Take a look at counterexamples too: "emotion going from panic to resignation" can't be drawn as two images; "runs to the puddle, falls, gets up" spans three separate events—go back to the storyboard table and split the shot instead of forcing it into first-and-last frames.

You should see: One or two shots circled on the storyboard table, with a first-frame state sentence and a last-frame state sentence written next to each.

  • For the circled shots, the two frame states are each a complete subject-verb-object sentence

Step 2: Prepare the two frame images—where the first and last frames come from ​

Why: The two ends of first-and-last frames are the two images you upload, not the prompt—if the images don't match, everything after is wasted.

How: Pick from three sources as needed (this course's teaching template):

SourceWhen to use itHow to choose for 06
Generate images using the 3.4 four-part formulaMost cases: draw both frames yourselfGenerate both images yourself; see the code block below for the single-shot task line
Screenshot of the previous shot's final frame as the last frameSame subject on both sides of the edit point, similar shot size (the "continue from the previous shot's last frame" in 3.2)05 ends with a sole-of-shoe close-up while 06 is a wide shot—the shot sizes differ too much, so don't reuse it, but paint the "sole slipping" moment into the first frame
Use a scene image as the last frame (the foreshadowing planted in 3.3)A transition ending with no characters06 Not usable for 06, which has characters; not needed for now for a single-scene practice film—come back when your second film has more scenes

For 06's two frame images, paste the three fixed segments as-is; only the single-shot task line differs:

text
First-frame image = fixed description segment (3.1) + fixed environment segment (3.3) + fixed style segment (3.4)
       + Vertical wide shot, he stands on the slippery steps holding the cake box, leaning forward off balance

Last-frame image = the three fixed segments (paste as-is)
       + Vertical wide shot, he has fallen sitting into a rain puddle together with the box, water splashing up

Check the two images side by side against the pass line: vertical, same subject, same scene, same lighting, same art style, consistent color tone—the four items of aspect ratio, lighting, art style, and color tone are exactly the four items you need to judge against the side-by-side images in the checklist of 3.4. For how to attach reference images when generating, go back to 3.2.

You should see: Two new vertical images in your folder—viewed side by side, they read as "the same person in the same world, just one fall apart".

  • The two frame images pass side by side: vertical, same subject, same scene, same lighting, same art style, consistent color tone

Step 3: Run the FLF2V workflow—upload one image to each of the two Load Image nodes ​

Why: The official workflow is already built; the only thing you need to do is upload the right images—swap them, and the shot runs backward.

How:

  1. Search ComfyUI's template library for "Wan2.2 14B FLF2V" (the template search name from the official tutorial). The model files are the same set as 14B I2V, so if you ran 14B I2V in 4.1, no re-download is needed; if you've only run 5B, see the FLF2V workflow page for the download list.
  2. Upload the first-frame image to the first Load Image and the last-frame image to the second Load Image—in the official example workflow these are nodes 62 and 68.
  3. Cloud users: Comfy Cloud has the same template video_wan2_2_14B_flf2v, no need to download models locally.@@I18N_KEEP_000023@

💡 Upload by the label, not by the example image

The Load Image nodes in the template may come preloaded with official example images. Before uploading, check the node labels or group names to confirm which is the first frame and which is the last frame—don't just upload to whichever node happens to have an image in it.

You should see: The thumbnails of the two Load Image nodes are your first frame and last frame respectively, in the right order.

  • First and last frames each in place, order confirmed with thumbnails side by side

Step 4: Adjust the size and write the middle-segment prompt—tell the model how to get from A to B ​

Why: The size determines VRAM usage, and the prompt determines how the middle plays out. The official requirement for the prompt is stated plainly: write an appropriate prompt based on your first and last frames.

How:

  1. Adjust the size in the WanFirstLastFrameToVideo node. The official default is already the smaller size, set specifically for low-VRAM users; with ample VRAM you can try resolutions around 720P. The official tutorial gives no fixed numbers for vertical—reference point: the 720P vertical size Wan2.2 README lists for TI2V-5B is 704*1280 (GitHub Wan-Video/Wan2.2). Run the default size first, then try larger once it works; fill in width and height for vertical, with width smaller than height.@@I18N_KEEP_000024@
  2. Assemble the prompt following the four-part formula of 3.4; for the single-shot task line, write "the motion process from the first frame to the last frame," and pick verbs from 4.2. 06 full shot line:
text
A Chinese delivery rider around 40 years old, square face, short black hair, dark and rough skin, a layer of short stubble on his chin,
fine wrinkles at the corners of his eyes, gentle eyes and brows, mouth corners slightly pressed down; wearing a yellow rider vest, a dark blue long-sleeve top, black long pants,
and worn gray-white sneakers; holding a white cake box tied with a red ribbon in his arms
Under a city overpass, during a rainstorm, overcast diffuse light; gray concrete steps beneath the bridge, with a puddle of standing water below the steps,
rough bridge piers, wet and reflective ground, rain streaks clearly visible
Realistic style, cinematic image; cool tones, low saturation
Vertical full shot: his foot slips and his body pitches forward; he plunges forward together with the box, falls, and lands sitting in the puddle below the steps, water splashing up
  1. Click Run, or press Ctrl(cmd) + Enter to run.

You should see: the progress completes, and the preview shows a video of "going from off-balance pitch-forward to falling seated into the puddle," with both ends matching the two images you uploaded.

  • A run completed with the default size; the prompt has all four parts, and the single-shot task line describes the motion process

Step 5: Only check the two ends—compare the first frame and last frame against the images once each ​

Why: Checking a first-and-last-frame shot is easier than image-to-video—with images to compare at both ends, you don't need to nitpick frame by frame.

How to do it: three checks (this course's teaching template):

What to checkHow to judgeWhat to do if it fails
Opening frame vs. first-frame imagePut the first frame and the first-frame image side by side: subject, pose, and shot size matchIf the first frame doesn't match: it's a frame-image problem—go back to step 2 to redo the images; editing images is free, don't burn generation
Closing frame vs. last-frame imagePut the final frame and the last-frame image side by side: the landing point matchesIf both ends match but the middle is off: it's a prompt problem—revise the single-shot task line and retry
The middle is one continuous motionNo jump cuts in the middle, no extra spins or head-turns addedIf it fails twice in a row: take the symptoms to 4.4 failure diagnosis and check against the table

Retries follow the cap of 4.5: at most 3 retries per shot; record the count in the 1.4 cost table; archive the kept versions following the 3.5 naming convention, with version numbers only increasing, never overwriting (the archiving convention of 3.2).

You should see: in the folder, shot 06 has a finished take with both ends matching, with a version number in the filename.

  • Shot 06 has a video with both ends matching; retries did not exceed 3, and it has been archived per 3.5

📋 Magic Prompt ​

Both templates are Prompts designed for this course (teaching examples); any conversational AI assistant will do—no restriction on tools.

📝 First/Last Frame Decomposer ​

Expected result: hand a storyboard row to the AI and get back the first frame, the last frame, the differences between the two frames, and a mid-segment motion prompt; after you finalize the edits, prepare the images and write the prompts accordingly.

## Role
You are a short-film storyboard artist who excels at breaking a shot down into a start frame, an end frame, and the motion process in between.

## Task
Break my one-line storyboard into: first-frame image, last-frame image, differences between the two frames, and a mid-section action prompt.

## Input
### Required
- Storyboard line: [shot number + shot size + image, e.g., "06 full shot: he falls into the puddle together with the box"]
- Fixed description block: [paste the character card from 3.1]
- Fixed environment block: [paste the scene card from 3.3]
### Optional
- Fixed style block: [paste the style card from 3.4?]
- End state of the previous shot: [e.g., "05 ending: his soles slip on the wet steps"?]

## Output specification
Four parts: ① First-frame image (one sentence, including shot size and subject state) ② Last-frame image (one sentence, including the subject's landing point) ③ Differences (what is moving, and how many things in total) ④ Mid-section action prompt (the motion process from the first frame to the last frame, starting with a verb).

## Constraints
- ✅ Only one continuous motion separates the two frames; if two or more things separate them, explicitly recommend that I split the shot
- ✅ Describe only what can be filmed: complete subject-verb-object; abstract words are forbidden
- ❌ Do not change my three fixed blocks, and do not invent character or scene details
- ❌ Do not write unfilmable start/end states like "emotion goes from X to Y"

🔧 First/Last Frame Cross-Check Assistant ​

Expected result: hand the AI the prompts for the two frame images plus the mid-section prompt, and get back a five-item issue table—catch discrepancies before generation, instead of discovering after burning through GPU time that the two frames don't come from the same source.

## Role
You are a shot continuity reviewer who excels at verifying whether two frame images and one video prompt come from the same source.

## Task
Compare the first-frame image prompt, the last-frame image prompt, and the mid-section action prompt, and find the discrepancies that would derail first/last-frame generation.

## Input
### Required
- First-frame image prompt: [paste the whole thing]
- Last-frame image prompt: [paste the whole thing]
- Mid-section action prompt: [paste the whole thing]
### Optional
- Whole-film conventions: [e.g., "rainstorm, overcast diffuse light; realistic cool tones; vertical format"?]

## Output specification
One issue table: check item | result (✓ or ✗) | explanation. The check items are fixed at five: subject consistency, scene consistency, lighting consistency, art-style consistency, and only one continuous motion between the two frames.

## Constraints
- ✅ Judge only based on the text provided, and give evidence for each item
- ✅ Point out separately any mid-section prompt that doesn't echo the last frame's landing point
- ❌ Do not judge image quality; only report discrepancies
- ❌ Do not rewrite the prompts

💡 The limits of AI assistance

The cross-check works at the text layer: whether two prompts share the same source is something AI can verify quickly. But "the two images don't look like the same world" is an image-layer matter, and the AI hasn't seen your images—the final call is always yours, made against the side-by-side images (3.4 check line).

Checkpoint ✅ ​

  • Can explain the difference between first/last-frame and image-to-video: image-to-video fixes the start, first/last-frame fixes both ends
  • Used the three criteria to pick the shots that should use first/last frames from the storyboard; circled at least 06 in "Still Pretty After the Collapse"
  • The two frame images pass side by side: vertical, same subject, same scene, same lighting, same art style, consistent color tone
  • Shot 06 produced a take with both ends matching, archived per the 3.5 naming convention, with no more than 3 retries
  • Can state the boundary: first/last frames handle one shot's internal A-to-B, not a universal transition tool

Pitfall reminders ​

❌ Three things separate the two frames, so the model can only force a hard twist ​

Symptom: In the first frame he is standing fine; in the last frame he is already sitting in the puddle, the cake box has burst open, and the rain has stopped—the generated middle looks like fast-forward with dropped frames.

Cause: The official positioning is "define the start frame and end frame, and generate a smooth video transition"—the premise of smoothness is that the two frames differ by only one continuous motion. When the states differ too much, the model has to cram three things into a few seconds.

Correct approach: Go back to the criteria in step 1: if one motion can't cover it, split the shot; environmental changes like "the rain stopped" should never appear between the two frames in the first place (2.5 lighting line).

❌ The prompt only describes the first frame's appearance ​

Symptom: The prompt copies the first-frame image's "he stands on the steps holding the cake box," and the generated result has him literally just standing—the last frame got ignored.

Reason: The official guidance requires the prompt to be written based on your first frame and last frame. Describing only the starting point is like telling the model the ending doesn't matter.

Correct approach: For the single-shot task line, write the motion process: "Foot slips, body pitches forward, the person and box tumble forward together, landing in a puddle" — cover both start and end, and pick verbs from 4.2.

❌ Forcing 720P on low VRAM ​

Symptom: As soon as the resolution is pushed up, it won't run or breaks halfway.

Reason: The official tutorial sets the default resolution small precisely to prevent low-VRAM users from running out of resources; forcing a larger size with insufficient VRAM will only end in failure.

Correct approach: Start with the default resolution, and only try around 720P once it runs successfully; if that's still not enough, the low-VRAM fallback route is in 4.4 Failure Diagnosis (includes community quantized versions, marked "community resource").

Advanced Tips (Optional) ​

Continue from the previous shot's last frame to rescue face drift: As explained in 3.2 — if a character's face drifts in some shot, don't just close your eyes and reroll: save a screenshot of the last frame of the previous shot's final footage and use it as this shot's first frame; draw this shot's own landing point as the last frame as usual. The character's state carries over across the cut, so the edit doesn't jump. Best for pairs where the same subject appears on both sides of the cut with similar framing.

For multi-scene films, prepare last frames in advance: The foreshadowing planted in 3.3 pays off here: the second film has more scenes, so the next shot's scene image can be prepared in advance as the last frame — the camera moves naturally from "wrapping up the old scene" to "establishing the new scene." For the practice film with a single scene, just knowing this route exists is enough for now.

Lesson Summary ​

✅ This page on first and last frames fills in the second anchor that image-to-video was missing:

  • Image-to-video fixes the start; first and last frames fix both ends — the landing point goes from a reroll gamble to a deliberate setting
  • Three criteria for picking a shot: start and end can each be drawn as one image, a single continuous motion can cover it, and the landing point must be precise
  • Three sources for the two frame images: the four-part formula for image generation, a screenshot of the previous shot's last frame, or a scene image as the last frame — both must be vertical and from the same source
  • Workflow: search the templates for "Wan2.2 14B FLF2V", the first Load Image is the first frame, the second is the last frame; start with default resolution, and write the prompt as "from A to B"
  • Boundary: it handles one shot's interior move from A to B; it is not a universal transition tool; at most 3 retries per shot

Key conventions recap:

ConventionRecommended valueNotes
Applicable shotsTransitions, displacement: start and end each drawable as one imageNot a universal transition tool (course design boundary)
Sources of the two framesGenerated image / screenshot of previous shot's last frame / scene imageVertical; same subject, same scene, same lighting, same art style, consistent color tone
WorkflowSearch the template library for "Wan2.2 14B FLF2V"Same model set as 14B I2V; the two Load Image nodes take first frame then last frame
ResolutionStart with the default small sizeSet by the official source for low VRAM; try around 720P once VRAM allows; vertical reference 704*1280 (TI2V-5B convention)
PromptFour-part formula + single-shot task describing the motion processThe official guidance requires the prompt to echo both the first and last frames
RetriesAt most 3 per shotBeyond that, follow the 4.5 downgrade route and record the count in 1.4

Next Lesson Preview ​

Even with both ends locked down, generation can still fail: it won't run, stalls halfway, or the output footage falls apart. The next lesson, 4.4 Shot Failure Diagnosis: Pinpoint Problems in 60 Seconds, sorts these failures into categories.

You will learn:

  • What to check first when generation fails or stalls — cloud and local each have their own checklist
  • How to triage three types of content problems — broken visuals, wrong characters, mismatched actions — against a reference table
  • Which downgrade route to take when VRAM is insufficient (community quantized versions marked "community resource")

Related Tutorials ​

gaodong.aiAboutPrivacyContact

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.