SeedVR Documentation

repository·main·Indexed 23 days ago

https://github.com/bytedance-seed/seedvr

SeedVR and SeedVR2 are video restoration models based on Diffusion Transformers. SeedVR supports arbitrary-resolution restoration without pretrained diffusion priors, while SeedVR2 enables high-quality, one-step video restoration via diffusion adversarial post-training. The repository includes instructions for environment setup, downloading pretrained checkpoints like SeedVR2-3B, and running multi-GPU sequence parallel inference.

Tokens
763
Snippets
3
Records
4
Agent score
29%

What's inside SeedVR

  1. Download SeedVR pretrained checkpoints

    main

    Use huggingface_hub to download the model weights. The following example demonstrates how to download the SeedVR2-3B model into a ckpts/ directory.

    from huggingface_hub import snapshot_download
    
    save_dir = "ckpts/"
    repo_id = "ByteDance-Seed/SeedVR2-3B"
    cache_dir = save_dir + "/cache"
    
    snapshot_download(cache_dir=cache_dir,
      local_dir=save_dir,
      repo_id=repo_id,
      local_dir_use_symlinks=False,
      resume_download=True,
      allow_patterns=["*.json", "*.safetensors", "*.pth", "*.bin", "*.py", "*.md", "*.txt"],
    )
  2. Run SeedVR2-3B inference

    main

    Run inference using torchrun to support multi-GPU sequence parallel inference.

    GPU Requirements:

    • 1x H100-80G can handle videos up to 100x720x1280.
    • 4x H100-80G (using sp_size=4) can support 1080p and 2K videos.

    Arguments:

    • --video_path: Path to the input video folder.
    • --output_dir: Path to the output folder.
    • --seed: Random seed number.
    • --res_h: Target output height.
    • --res_w: Target output width.
    • --sp_size: Sequence parallel size (number of GPUs).
    torchrun --nproc-per-node=NUM_GPUS projects/inference_seedvr2_3b.py --video_path INPUT_FOLDER --output_dir OUTPUT_FOLDER --seed SEED_NUM --res_h OUTPUT_HEIGHT --res_w OUTPUT_WIDTH --sp_size NUM_SP
  3. Install SeedVR

    main

    To set up the SeedVR environment, clone the repository, create a Conda environment with Python 3.10, and install the required dependencies including flash_attn and apex.

    Note on Apex: If you have trouble installing apex from source, use the provided pre-built wheels for your specific Python and CUDA versions. For Python 3.10, Torch 2.4.0, and CUDA 12.1, use the apex-0.1-cp310-cp310-linux_x86_64.whl file.

    git clone https://github.com/bytedance-seed/SeedVR.git
    cd SeedVR
    conda create -n seedvr python=3.10 -y
    conda activate seedvr
    pip install -r requirements.txt
    pip install flash_attn==2.5.9.post1 --no-build-isolation
    
    # For Python 3.10, torch 2.4.0, cuda 12.1:
    pip install apex-0.1-cp310-cp310-linux_x86_64.whl