Wan2.1 VACE First-Last Frame
Generate smooth video transitions by defining start and end frames. Supports custom keyframe sequences.
概要
Wan2.1 VACE First–Last Frame introduces endpoint-anchored video synthesis: you provide a starting frame and an ending frame, and the model plans a temporally coherent path between them. Instead of naive optical-flow interpolation, the workflow synthesizes intermediate content in latent space using Wan2.1’s VACE prior, guided by your prompt and optional LoRA. This delivers stable identity, style continuity, and believable motion planning across the entire sequence.
In ComfyUI, the pipeline pairs WanVaceToVideo with a ModelSamplingSD3 profile, KSampler, and a strict frame/layout regimen: spatial dimensions must be divisible by 16, and the total frame count follows a 4n+1 rule (Length − 1 divisible by 4). This structure, plus TrimVideoLatent for exact clip length, produces transitions that are both smooth and controllable. The 14B model supports clean 480p and 720p outputs, while the lighter 1.3B is optimized for 480p. With optional LoRA (e.g., CausVid), you can cut sampling steps dramatically while maintaining temporal coherence.
入力するもの
- ワークフローを読み込み中
ComfyUI で実行できます。 このワークフローはこのページでは実行できません。すべてが読み込まれた状態でComfy Cloudで開くか、ご自身のComfyUI用にダウンロードしてください。
Cloudで試すワークフローの内部
ノードグラフの読み取り専用プレビューです。ノードを編集するには、Comfy Cloudで開くかダウンロードしてください。
Loading the graph
Open full-size workflow preview- 作成者
- ComfyUI
カスタムノードが必要です
- ワークフローを読み込み中
コードからこのワークフローを使用する
可能な場合はワークフローグラフと入力から生成されます。それ以外の場合は保存された例が表示されます。料金が発生する場合があるため、コードを実行する前に認証情報とエンドポイントを確認してください。
What you need
- Runs on
- Comfy Cloud
- キー
- COMFY_API_KEY
有料の Cloud プランとクレジットが必要です。
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"3": {
"class_type": "KSampler",
"inputs": {
"cfg": 6,
"denoise": 1,
"latent_image": [
"49",
2
],
"model": [
"48",
0
],
"negative": [
"49",
1
],
"positive": [
"49",
0
],
"sampler_name": "uni_pc",
"scheduler": "simple",
"seed": 95385376145355,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"38",
0
],
"text": "A girl is dancing in a sea of flowers, slowly moving her hands, stretching her arms. There is a super close - up and a close - up of the upper body. The character is surrounded by other transparent glass flowers in the style of Nicoletta Ceccoli, creating a beautiful, surreal, and emotionally expressive movie scene. It has a white and transparent feeling, is dreamy, and in close range. "
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"38",
0
],
"text": "过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走,过曝,"
},
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"58",
0
],
"vae": [
"39",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "umt5_xxl_fp8_e4m3fn_scaled.safetensors",
"device": "default",
"type": "wan"
},
"_meta": {
"title": "Load CLIP"
}
},
"39": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "wan_2.1_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"48": {
"class_type": "ModelSamplingSD3",
"inputs": {
"model": [
"140",
0
],
"shift": 8.000000000000002
},
"_meta": {
"title": "ModelSamplingSD3"
}
},
"49": {
"class_type": "WanVaceToVideo",
"inputs": {
"batch_size": 1,
"control_masks": [
"191:156",
0
],
"control_video": [
"191:145",
0
],
"height": [
"194",
0
],
"length": [
"131",
0
],
"negative": [
"7",
0
],
"positive": [
"6",
0
],
"strength": 1,
"vae": [
"39",
0
],
"width": [
"193",
0
]
},
"_meta": {
"title": "WanVaceToVideo"
}
},
"58": {
"class_type": "TrimVideoLatent",
"inputs": {
"samples": [
"3",
0
],
"trim_amount": [
"49",
3
]
},
"_meta": {
"title": "Trim Video Latent"
}
},
"68": {
"class_type": "CreateVideo",
"inputs": {
"bit_depth": "auto",
"codec": "none",
"color_space": "sRGB",
"fps": 16,
"images": [
"8",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"69": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/wan2.1_vace",
"format": "auto",
"format.codec": "h264",
"video": [
"68",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"131": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 81
},
"_meta": {
"title": "Length"
}
},
"140": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "wan2.1_vace_14B_fp16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"144": {
"class_type": "LoadImage",
"inputs": {
"image": "video_wan_vace_flf2v_start_image.png"
},
"_meta": {
"title": "first frame"
}
},
"147": {
"class_type": "LoadImage",
"inputs": {
"image": "video_wan_vace_flf2v_end_image.png"
},
"_meta": {
"title": "Last frame"
}
},
"171": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 79
},
"_meta": {
"title": "Length"
}
},
"193": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 512
},
"_meta": {
"title": "Width"
}
},
"194": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 512
},
"_meta": {
"title": "Height"
}
},
"191:145": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"191:150",
0
],
"image2": [
"147",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"191:146": {
"class_type": "SolidMask",
"inputs": {
"height": [
"194",
0
],
"value": 1,
"width": [
"193",
0
]
},
"_meta": {
"title": "Create Solid Mask"
}
},
"191:148": {
"class_type": "MaskToImage",
"inputs": {
"mask": [
"191:146",
0
]
},
"_meta": {
"title": "Convert Mask to Image"
}
},
"191:149": {
"class_type": "RepeatImageBatch",
"inputs": {
"amount": [
"171",
0
],
"image": [
"191:148",
0
]
},
"_meta": {
"title": "Repeat Image Batch"
}
},
"191:150": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"144",
0
],
"image2": [
"191:149",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"191:151": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"191:145",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"191:152": {
"class_type": "SolidMask",
"inputs": {
"height": [
"194",
0
],
"value": 0,
"width": [
"193",
0
]
},
"_meta": {
"title": "Create Solid Mask"
}
},
"191:153": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"191:154",
0
],
"image2": [
"191:149",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"191:154": {
"class_type": "MaskToImage",
"inputs": {
"mask": [
"191:152",
0
]
},
"_meta": {
"title": "Convert Mask to Image"
}
},
"191:155": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"191:153",
0
],
"image2": [
"191:154",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"191:156": {
"class_type": "ImageToMask",
"inputs": {
"channel": "red",
"image": [
"191:155",
0
]
},
"_meta": {
"title": "Convert Image to Mask"
}
},
"191:157": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"191:155",
0
]
},
"_meta": {
"title": "Preview Image"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)よくある質問
Rather than warping pixels between frames, WanVaceToVideo synthesizes intermediate content in latent space using the Wan2.1 VACE prior. This yields more stable identity, fewer artifacts on large disocclusions, and better adherence to your text prompt or LoRA style.
The VACE transition and UNet operate on stride-aligned temporal and spatial blocks. Using a 4n+1 frame count (e.g., 5, 9, 13…) and dimensions divisible by 16 ensures the sampler and decoder align correctly, preventing artifacts and dropped frames.
VACE-1.3B is optimized for 480p and is lighter to run. VACE-14B supports both 480p and 720p and typically delivers stronger detail and motion coherence. Choose 14B for higher fidelity or 720p; use 1.3B when resources are limited or for fast previews.
With LoraLoader enabled, you can guide style or motion while reducing steps. For a CausVid-style LoRA, set steps to 2–4 and cfg ≈ 1.0; otherwise, defaults like 20 steps and cfg ≈ 6.0 work well. Start LoRA strength at 0.3–0.7 to balance guidance and temporal stability.