58 lines
2.5 KiB
Python
58 lines
2.5 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
SeedVR2 Video Upscaler - Standalone CLI Interface
|
|
|
|
Command-line interface for high-quality upscaling using SeedVR2 diffusion models.
|
|
Supports single and multi-GPU processing with advanced memory optimization.
|
|
|
|
Key Features:
|
|
• Multi-GPU Processing: Automatic workload distribution across multiple GPUs with
|
|
temporal overlap blending for seamless transitions
|
|
• Memory Optimization: BlockSwap for limited VRAM, VAE tiling for large resolutions,
|
|
intelligent tensor offloading between processing phases
|
|
• Performance: Torch.compile integration, BFloat16 compute pipeline,
|
|
efficient model caching for batch processing
|
|
• Flexibility: Multiple output formats (MP4/PNG), advanced color correction methods,
|
|
directory batch processing with auto-format detection
|
|
• Quality Control: Temporal overlap blending, frame prepending for artifact reduction,
|
|
configurable noise scales for detail preservation
|
|
|
|
Architecture:
|
|
The CLI implements a 4-phase processing pipeline:
|
|
1. Encode: VAE encoding with optional input noise and tiling
|
|
2. Upscale: DiT transformer upscaling with latent space diffusion
|
|
3. Decode: VAE decoding with optional tiling
|
|
4. Postprocess: Color correction and temporal blending
|
|
|
|
Usage:
|
|
python inference_cli.py video.mp4 --resolution 1080
|
|
For complete usage examples, run: python inference_cli.py --help
|
|
|
|
Requirements:
|
|
• Python 3.10+
|
|
• PyTorch 2.4+ with CUDA 12.1+ (NVIDIA) or MPS (Apple Silicon)
|
|
• 16GB+ VRAM recommended (8GB minimum with BlockSwap)
|
|
• OpenCV, NumPy for video I/O
|
|
|
|
Model Support:
|
|
• 3B models: seedvr2_ema_3b_fp16.safetensors (default), _fp8_e4m3fn/GGUF variants
|
|
• 7B models: seedvr2_ema_7b_fp16.safetensors, _fp8_e4m3fn/GGUF variants
|
|
• VAE: ema_vae_fp16.safetensors (shared across all models)
|
|
• Auto-downloads from HuggingFace on first run with SHA256 validation
|
|
"""
|
|
|
|
# Standard library imports
|
|
import sys
|
|
import os
|
|
|
|
# =============================================================================
|
|
# DEPRECATION NOTICE - This branch is no longer supported
|
|
# =============================================================================
|
|
print("\n" + "=" * 70)
|
|
print("❌ ERROR: This nightly branch is DEPRECATED and no longer supported.")
|
|
print("=" * 70)
|
|
print("\nPlease update to the main branch:")
|
|
print(" • Remove the old SeedVR2 folder and reinstall via ComfyUI Manager (recommended)")
|
|
print(" • Or visit: https://github.com/numz/ComfyUI-SeedVR2_VideoUpscaler")
|
|
print("\n" + "=" * 70 + "\n")
|
|
sys.exit(1) |