Revive Your Videos: AI-Driven Frame-Level Restoration and Enhancement

CN
ComfyUI.org
2025-03-24 14:07:36

πŸ› οΈ Workflow Overview

m8n534wccsxmn06c919f37a73d7e2c8c4fc9b435e9dbb8289ad3fd88e05bb25d2ca36936ea90c6d3a77.jpg

Purpose and Function:
This workflow utilizes AI to repair blurry videos by performing frame-level restoration and enhancement. It combines video loading, frame processing, video control embeddings, VAE encoding and decoding, sampling, Lora models, and video synthesis to achieve high-quality video restoration, re-rendering, or style migration.

Core Features:

  1. Video Loading and Parsing: Extracts frames from the video and pre-processes them.

  2. Video Enhancement and Re-rendering: Repairs blurry frames or applies new visual styles using AI models.

  3. Video Synthesis and Output: Combines the processed frames into the final video output.


πŸ”₯ Core Models

  1. Wan2_1-T2V-1_3B_bf16.safetensors

    • Function:

      • The core model used for video generation and repair. It enables video re-rendering or high-definition restoration.

    • Installation:

      • Place the .safetensors file into the models/WanVideo directory.

      • Alternatively, install it via ComfyUI Manager.

  2. Video Lora Model: Video-to-Video Control

    • Model Name:

      • θ§†ι’‘θ½¬θ§†ι’‘ζŽ§εˆΆ_wan2.1-1.3b-control-lora-tile-v0.2_comfy.safetensors

    • Function:

      • Enhances video restoration and style consistency during processing.

    • Installation:

      • Place the Lora model into the models/Lora folder.

  3. VAE Model: Wan2_1_VAE_bf16.safetensors

    • Function:

      • Encodes and decodes video frames, generating high-resolution textures.

    • Installation:

      • Place the VAE model in the models/WanVAE directory.


βš™οΈ Nodes Explanation

  1. VHS_LoadVideo

    • Function:

      • Loads and parses the video into frame images, audio, and metadata.

    • Parameters:

      • Frame loading cap: 50

      • Skip first frames: 0

      • Select every nth frame: 1

    • Output:

      • Frame images, audio, frame count, and video information.

  2. WanVideoVAELoader

    • Function:

      • Loads the VAE model for encoding and decoding frames.

    • Parameters:

      • Model path: Wan2_1_VAE_bf16.safetensors

    • Output:

      • VAE model data.

  3. WanVideoModelLoader

    • Function:

      • Loads the Wan video generation model.

    • Parameters:

      • Model path: Wan2_1-T2V-1_3B_bf16.safetensors

    • Output:

      • Video generation model.

  4. WanVideoLoraSelect

    • Function:

      • Loads the Lora model to enhance video consistency.

    • Parameters:

      • Lora model path: θ§†ι’‘θ½¬θ§†ι’‘ζŽ§εˆΆ_wan2.1-1.3b-control-lora-tile-v0.2_comfy.safetensors

    • Output:

      • Lora model data.

  5. WanVideoTextEncode

  • Function:

    • Encodes text prompts into embeddings.

  • Parameters:

    • Positive prompt:

      a chinese woman dancing, dress

    • Negative prompt:

    • oversaturated tones, overexposure, static, blurry details, subtitles, grayish image, worst quality, low quality, JPEG artifacts, ugly, deformed limbs

  • Output:

    • Text embedding data.

  1. WanVideoSampler

    • Function:

      • Samples video frames using the embeddings and model data.

    • Parameters:

      • Sampling steps: 30

      • CFG scale: 5

      • Sampling method: unipc

    • Output:

      • Enhanced video frames.

  2. WanVideoDecode

    • Function:

      • Decodes latent space images into video frames.

    • Parameters:

      • Resolution: 272x272

    • Output:

      • Restored or generated frames.

  3. VHS_VideoCombine

    • Function:

      • Combines the video frames into a final video with optional audio.

    • Parameters:

      • Format: H264-MP4

      • Frame rate: 16

      • CRF: 19

    • Output:

      • The restored video file.


🧩 Workflow Structure

βœ… Group 1: Video Loading and Parsing

  • VHS_LoadVideo β†’ Loads and parses the video into frames.

  • WanVideoVAELoader β†’ Loads the VAE model.

  • WanVideoModelLoader β†’ Loads the video generation model.

  • WanVideoLoraSelect β†’ Loads the Lora model.

βœ… Group 2: Text and Image Embeddings

  • WanVideoTextEncode β†’ Encodes the text prompts.

  • WanVideoControlEmbeds β†’ Processes image embeddings.

βœ… Group 3: Video Generation and Restoration

  • WanVideoSampler β†’ Samples frames based on the embeddings.

  • WanVideoDecode β†’ Decodes the sampled frames into video images.

βœ… Group 4: Video Synthesis and Output

  • VHS_VideoCombine β†’ Merges the frames into the final video.

  • Output format: MP4


πŸ”₯ Inputs & Outputs

βœ… Inputs:

  • Blurry video file.

  • VAE and video generation models.

  • Lora model.

  • Positive and negative text prompts.

  • Video sampling parameters.

βœ… Outputs:

  • High-definition, restored video.

  • Option to include audio.


⚠️ Considerations

  1. Hardware Requirements:

    • This workflow involves intensive video decoding and reconstruction, requiring a GPU with at least 16GB VRAM for optimal performance.

  2. Resolution Limitations:

    • High-resolution input videos (above 1080p) may cause memory overflow.

    • To avoid crashes, keep the resolution at or below 1080p.

  3. Model Compatibility:

    • Ensure that the model and ComfyUI versions are compatible to prevent rendering errors.

  4. Output Quality Control:

    • Use negative prompts to reduce artifacts, blurriness, and inconsistent frame details.