Master Video Creation: A Workflow for First/Last Frame Generation and Enhancement

CN
ComfyUI.org
2025-04-07 16:01:51

1. Workflow Overview

m979ef2ndi2otalqs4fd98095e7f27d7d4eceaf03bf189d90abbf8cd06cdad558ccbc266d1518dfbc8e.gif

This workflow is designed for first/last frame video generation and enhancement, featuring:

  • Dynamic video synthesis from start/end images

  • 4x super-resolution upscaling (using 4xRealWebPhoto_v4)

  • Frame interpolation (10x via RIFE VFI)

  • Auto frame labeling (e.g., "start_frame"/"end_frame")

  • Dual-format output (MP4 + GIF)

2. Core Models

Model Name

Function

Source/Installation

Wan2.1-Fun-InP-14B

Main video gen model (FP8)

Manual .safetensors download

umt5-xxl-enc-bf16

Multilingual text encoder

Loaded via LoadWanVideoT5TextEncoder

4xRealWebPhoto_v4

Image upscaler

Install via ComfyUI Manager

RIFE 4.7

Optical flow interpolation

Requires rife47.pth weights

3. Key Nodes

Node Name

Function

Installation

WanVideoImageToVideoEncode

Encodes frames to latent space

Built-in

WanVideoSampler

Controls video sampling process

Requires ComfyUI-WanVideoWrapper

RIFE VFI

Frame interpolation (10x)

Requires ComfyUI-VideoHelperSuite

ImageResizeKJ

Dynamic image resizing

Requires ComfyUI-KJNodes

4. Workflow Groups

  • Group 1: Start Frame Processing

    • Input: 1288x1024 PNG

    • Nodes: LoadImage β†’ ImageResizeKJ (480x640) β†’ AddLabel ("start_frame")

  • Group 2: End Frame Processing

    • Input: 1288x1024 PNG

    • Nodes: LoadImage β†’ ImageResizeKJ β†’ AddLabel ("end_frame")

  • Group 3: Video Generation

    • Core: WanVideoSampler (30 steps, UniPC) β†’ WanVideoDecode (to image sequence)

  • Group 4: Post-Processing

    • Upscale: ImageUpscaleWithModel (4x)

    • Interpolation: RIFE VFI (10x)

    • Output: VHS_VideoCombine (MP4 16fps + GIF 32fps)

5. Inputs & Outputs

  • Inputs:

    • Required: Start/End frame images (drag-and-drop)

    • Optional: Seed (default: 999), Prompt (e.g., "change clothes"), Negative prompt (pre-configured)

  • Outputs:

    • output.mp4 (H.264, 16fps)

    • AnimateDiff.gif (32fps loop)

6. Notes

  • VRAM: Recommended β‰₯16GB GPU (FP8 optimization reduces usage to ~12GB)

  • Troubleshooting:

    • Check ImageResizeKJ parameters if image dimensions mismatch

    • Verify rife47.pth path if RIFE fails

  • Optimization:

    • Enable torch.compile (configured with inductor mode)

    • Use easy cleanGpuUsed for manual VRAM release