Nodes/IAMCCS-nodes/IAMCCS_WanImageMotionPro
ComfyUI Node

IAMCCS_WanImageMotionPro

The motion node that locks your end frame instead of hoping

By IAMCCS·Created 11 months ago·Updated 8 days ago· 113
IAMCCS_WanImageMotionPro
  • positive
  • negative
  • anchor_samples
  • prev_samples
  • end_samples
  • clip_vision_start_image
  • clip_vision_end_image
  • positive
  • negative
  • latent
  • trim_slots
length81
motion_latent_count1
motion1.15
motion_modemotion_only (prev_samples)
add_reference_latentsfalse
latent_precisionfp32
vram_profilenormal
include_padding_in_motionfalse
safety_presetsafe
use_end_frametrue
end_transition_frames0
end_lock_slots1
lock_start_slots1
diagnostic_logfalse
use_prev_samplestrue
end_overshoot_slots0
latent_refresh0.00
delta_max0.0
clip_vision_modeauto
raw_modefalse
prev_samples_profiledirect
prev_skip_last_slots0
prev_tail_pick_modelatest
prev_anchor_blend0.00
continuity_profileoff
preset[custom]

IAMCCS_WanImageMotionPro is the grown-up version of the WanImageMotion motion node, and the headline feature is right in the schema: an end_samples input and an end_lock_slots control that hard-lock the last latent slots to a target end frame - FLF-style first-last-frame continuity, on top of the motion amplitude boost. If you're building shot-to-shot video where every chunk is supposed to land on a specific final frame, this is the node that makes that promise stick.

It's a big node, honestly - 30+ inputs, a preset dropdown, and several families of controls. But the tiers sort themselves out:

The controls that earn their keep

  • motion / motion_mode / motion_latent_count / safety_preset - inherited from the base WanImageMotion, same behavior. The amplitude fixer upper.
  • use_end_frame + end_lock_slots - the new core. With end_samples connected, end_lock_slots = 1 locks the very last latent slot to the end image so the final frame lands exactly on target. This is what turns "continuation" into "a planned A→B transition."
  • end_overshoot_slots - the trick that avoids the hard freeze. It extends the internal generation window by a few latent slots and locks the end image at the tail of the extended range, so the visible clip converges toward the end frame instead of sitting on it. Then you cut the overshoot with the trim_slots output. Recommended 1 (+4 frames), 0 disables.
  • clip_vision_mode - how start/end CLIP vision embeddings are merged. auto (concatenate both, the original FLF behavior) is correct only for true A→B transitions. For SVI Pro continuation where anchor and end are the same image, use end_only - it prevents crossfade bleed. This is a genuinely important switch for people chaining SVI clips.
  • prev_samples_profile / prev_skip_last_slots / prev_tail_pick_mode / prev_anchor_blend - the "where do I pick the motion tail from" family, for when your prev tail comes from a non-FLF generator or a slightly earlier motion state. mixed_svi_safe ignores the last prev slot and uses the latest usable tail - the go-to for SVI-to-Pro chains.
  • latent_refresh / delta_max - AdaIN-style latent moment stabilization, same as the base node.
  • continuity_profile - raw-like continuity paths for SVI chains; most people can leave this off and use the explicit controls.
  • raw_mode - strict 1:1 parity with the original WanImageToVideoSVIProFLF behavior. Enable it to benchmark, disable for real work.
  • preset - server-side presets (raw, svi continuity, flf overshoot, parity 1:1, ...). Leave [custom] if you've set widgets by hand.

Outputs: positive, negative, latent (feed the sampler), and trim_slots (an INT telling you how many slots the overshoot added - wire it into IAMCCS_WanPrevTailPrep to clean the tail for the next segment).

Install

Same pack, same story:

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

or ComfyUI Manager → search "IAMCCS" → restart. No model downloads; the pack floor is ComfyUI ≥ 0.3.0, Python ≥ 3.12, Torch ≥ 2.8.

The gotchas worth memorizing

end_transition_frames is deprecated - keep it at 0. Values above 0 blend padding latents toward the end frame in latent space, and because VAE latent interpolation isn't linear you get static, frozen output. That's the author's own warning in the tooltip, and it's accurate.

Second: if you have KJNodes WAN attention optimizations enabled (FETA / wrapped attention), some versions crash with an einops shape mismatch when end_overshoot_slots > 0. The documented workaround is to set overshoot to 0 or update/disable that KJNodes optimization. Annoying, but knowing it saves you an afternoon of staring at a traceback.

Finally - this node's latent output is sized for sampling, so check length is in step with your WAN frame-count conventions (81 by default) or you'll encode a clip that's not the length you think.

CategoryIAMCCS/Wan

Inputs (33)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
lengthINT811–16384
anchor_samplesLATENT
motion_latent_countINT10–16
motionFLOAT1.151–2
motion_modeCOMBOmotion_only (prev_samples)2 options: motion_only (prev_samples), all_nonfirst (anchor+motion)
add_reference_latentsBOOLEANfalse
latent_precisionCOMBOfp32Output latent dtype for the empty Wan sampler latent. Kept here for backward compatibility with older WanImageMotionPro workflows.
vram_profileCOMBOnormal5 options: normal, chunked_blocks_2, chunked_blocks_4, loop_per_frame (lowest_vram), cpu_offload (slowest)
include_padding_in_motionBOOLEANfalse
safety_presetCOMBOsafebase : 1:1 with WanImageToVideoSVIProFLF — no amplitude processing at all. safe : per-channel stabilisation + tanh limiter + 2-frame ramp (active at any motion value, recommended default). safer : same as safe but tighter limiter + longer ramp (best above motion=1.5). legacy : hard clamp ±6 + frame-scalar diff centering, mirrors PainterI2V algorithm.
use_end_frameBOOLEANtrueWhen False, end_samples is ignored even if the wire is connected. Use this to safely bypass the end-frame encoder without disconnecting the node, preventing ping-pong artifacts.
end_transition_framesINT00–32⚠️ DEPRECATED — keep at 0. Values > 0 blend padding latents toward the end frame in latent space, which produces static/frozen output because VAE latent interpolation is not linear. 0 = hard cut, identical to the original FLF node behavior.
end_lock_slotsINT11–16How many final latent slots to hard-lock to end_samples. Default 1 = only the very last slot (~last 4 video frames) is locked, so the end frame appears exactly at the last frame defined by 'length'. Increase only if a single locked slot is not enough for convergence. Set 16 for 1:1 parity with the original FLF node (locks min(T_end, total_latents)).
lock_start_slotsINT10–16How many initial latent slots to hard-lock to the start image via concat_mask. Default 1 (≈ first 4 video frames) matches FLF-style start anchoring. Set 0 to allow motion immediately from the first video frame.
diagnostic_logBOOLEANfalseWhen enabled, prints compact diagnostics about concat_latent_image/mask and motion/end-lock ranges. Useful to debug 'static clip' or segment discontinuities.
use_prev_samplesBOOLEANtrueWhen False, prev_samples is ignored even if the wire is connected. Use this on the first segment when autolink forces prev_samples to be connected.
end_overshoot_slotsINT00–8Extends the internal generation window by this many latent slots when the end lock is active (use_end_frame=True + end_samples connected). The end image is locked at the tail of the EXTENDED range, so the visible clip converges toward the end frame without hard-freezing on it. Use the trim_slots output to cut the overshoot frames after sampling. 0 = disabled, original behavior. 1 = +4 video frames (recommended). 2 = +8 video frames (looser convergence). NOTE: If you have KJNodes WAN attention optimizations (FETA / wrapped_attention) enabled, some versions may crash with an einops shape mismatch when overshoot > 0. Workaround: set end_overshoot_slots=0 or disable/update that KJNodes optimization.
latent_refreshFLOAT0.000–1Latent moment stabilization strength (0=disabled, 1=full correction). Matches per-channel mean and contrast of the motion tail to the anchor latent. Spatial residuals and motion are preserved. Start with 0.5 for chains of 3+ segments.
delta_maxFLOAT0.00–5Soft-clamp on latent mean drift magnitude (0=disabled). Caps how much mean correction can be applied per channel. Use 0.5-1.0 to prevent over-correction on large motion segments.
clip_vision_modeCOMBOautoControls how clip_vision_start_image / clip_vision_end_image are merged. auto : concatenate start+end tokens (original FLF behavior). Correct ONLY when anchor=A and end=B (true A→B transition). end_only : use only clip_vision_end embedding. RECOMMENDED for SVI Pro continuation where anchor=end=same image but prev_samples comes from a different scene — prevents crossfade bleed. start_only : use only clip_vision_start embedding. none : skip clip_vision injection entirely (bypass).
raw_modeBOOLEANfalseStrict compatibility mode for the original WanImageToVideoSVIProFLF behavior. When enabled, WanImageMotionPro bypasses advanced features (motion amplitude, latent moment stabilization, overshoot, clip vision routing, reference latents, slot caps) and builds conditioning 1:1 like the original FLF+SVI node. Use this to benchmark or to get the baseline first/last frame behavior back.
prev_samples_profileCOMBOdirectHigh-level handling profile for prev_samples. direct: use the explicit prev tail controls exactly as set. mixed_svi_safe: intended for SVI-to-Pro chains; ignores the last prev slot and still uses the latest usable tail. mixed_svi_aggressive: intended for harder SVI-to-Pro chains; ignores the last prev slot and takes the earliest usable tail segment instead of the latest.
prev_skip_last_slotsINT00–16Ignore the last N temporal latent slots from prev_samples before extracting the motion tail. Useful when prev_samples comes from a non-FLF generator and you want FLF-like continuation from a slightly earlier motion state.
prev_tail_pick_modeCOMBOlatestHow to pick the motion tail from prev_samples after any tail trimming. latest: use the last usable slots (default, original behavior). first_usable: use the earliest usable slots after trimming, which can behave more like an FLF chain when SVI tails become unstable near the end.
prev_anchor_blendFLOAT0.000–1Blend the extracted prev motion tail toward the first anchor slot before conditioning. Helps when prev_samples comes from SVI and needs to behave more like a FLF-aligned predecessor.
continuity_profileCOMBOoffRaw-like continuity path for SVI chains. SVI_CONTINUITY keeps FLF+SVI raw semantics while still enabling overshoot and trim_slots. The other continuity profiles stay raw-like and selectively add only safe options: prev tail handling or end_only clip vision when anchor=end. These profiles intentionally bypass motion shaping, latent moment stabilization, start-slot normalization, and the 4-channel mask.
presetCOMBO[custom]Server-side preset for WanImageMotionPro Plus. Visible even if the frontend preset widget is not loaded. Use [custom] to keep manual widget values unchanged.
prev_samplesoptLATENT
end_samplesoptLATENT
clip_vision_start_imageoptCLIP_VISION_OUTPUT
clip_vision_end_imageoptCLIP_VISION_OUTPUT

Outputs (4)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
latentLATENT
trim_slotsINT