Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-ESRGAN-Reboot (in development)

A cleaner, modernized reboot of Real-ESRGAN focused on best practices, up-to-date hardware support, and pragmatic developer ergonomics.

This effort is based on the original Real-ESRGAN project (see README-original.md). The goal is to preserve the proven quality while improving reliability, clarity, and performance on current-generation GPUs, notably NVIDIA RTX 50‑series (Blackwell architecture, e.g., RTX 5090).

Classic entry points remain familiar while we introduce incremental, low‑risk improvements. Backward compatibility is kept where possible; new options are additive.

Features

🚀 Modern GPU Intelligence

Automatic detection and selection of your most capable GPU based on compute capability and memory, with special optimizations for RTX 50-series (Blackwell) architecture. No more manual device configuration—just plug and play.

🛡️ Enhanced Reliability

CPU-safe weight loading with explicit device routing ensures stable operation across diverse hardware configurations. Cleaner CLI with better error handling reduces setup friction and troubleshooting time.

Next-Gen Hardware Ready

Purpose-built for latest CUDA stacks and cutting-edge GPUs including RTX 5090 and future Blackwell-class hardware. Memory-aware GPU selection maximizes performance on high-end systems.

🎯 Streamlined Workflow

Quality-of-life improvements throughout the inference pipeline reduce user friction and make professional-grade upscaling more accessible to everyone.

🎨 Advanced Image Enhancement

Improved texture regeneration maintains fine detail fidelity during upsampling while preserving natural appearance. Enhanced face restoration with robust quality assurance delivers superior results.

📹 Unified Video Processing

Consistent device handling, logging, and input validation across both image and video inference paths for a seamless user experience.

📦 Clean Dependencies

Streamlined dependency management with optional extras for specific features like face enhancement, keeping installations lean and focused.

Hardware compatibility

  • Runs on modern CUDA‑capable NVIDIA GPUs, auto‑selecting the most capable GPU when not explicitly set
  • Prepared for RTX 50‑series (Blackwell) by evaluating GPU compute capability and total memory to select the best device
  • CPU execution is supported when explicitly requested

Changes in this reboot (initial pass)

The following modules are within the Reboot scope. Initial updates have been applied where noted.

  • inference_realesrgan.py

    • Added --device {gpu|cpu} (default: gpu)
    • Respects --gpu-id when provided; otherwise auto‑selects the most capable GPU
    • Safer input filtering: excludes directories and only processes image files
    • Keeps classic usage and model selection behavior intact
  • inference_realesrgan_video.py

    • In scope for alignment with the image inference path (device handling, input validation, logging). Work in progress
  • requirements.txt

    • In scope for dependency hygiene. Targeting compatibility with recent PyTorch/CUDA stacks while staying lean
  • torchvision_patch.py

    • Ensures a compatibility patch is applied early to avoid import/runtime conflicts with torchvision variants
  • realesrgan/utils.py

    • Added _get_most_capable_gpu() to rank GPUs by compute capability (major.minor) and total memory, then pick the best
    • Device selection prefers the best GPU by default, respects --gpu-id when set, and uses CPU only when explicitly requested
    • Loads weights on CPU for safety, then moves the model to the chosen device

Quick start

Requirements: Python 3.8+ recommended, recent PyTorch build (with CUDA for GPU runs)

Install (example):

# optional venv
# python -m venv .venv && source .venv/bin/activate

pip install -r requirements.txt
python setup.py develop

Image inference examples:

# Default (GPU, auto‑select best GPU)
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs

# Force CPU
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --device cpu

# Pick a specific GPU
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --gpu-id 1

# Arbitrary output scale and face enhancement
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --outscale 3.5 --face_enhance

Video inference (planned alignment):

# The video script will mirror the same device behavior (WIP)
python inference_realesrgan_video.py -n RealESRGAN_x4plus -i inputs/video --device gpu --gpu-id 0

Device selection behavior

  • --device gpu (default):
    • If --gpu-id is provided, uses that GPU
    • Otherwise, auto‑selects the “most capable” GPU based on compute capability and memory
  • --device cpu: force CPU execution, ignoring any --gpu-id

Roadmap / TODO

  • Texture regeneration: improve fidelity on fine textures during upsampling while preserving natural appearance
  • Face restoration: higher‑quality face fixes, with improved robustness and better quality assurance (QA) checks
  • Align video inference with image inference improvements (device handling, logging, input validation)
  • Dependency hygiene and optional extras (e.g., selective installs for face enhancement)

Notes

  • This reboot is iterative. We keep changes focused and low‑risk while improving defaults and clarity
  • The original documentation (README.md) remains the source of truth for full feature descriptions and background. This reboot README highlights the modernization path and practical improvements

Credits and license

  • Based on the original Real‑ESRGAN project. See README.md and upstream repository for details and citations
  • License follows the original project’s license. See LICENSE

About

A cleaner, modernized reboot of Real-ESRGAN focused on best practices, up-to-date hardware support, and pragmatic developer ergonomics. Supports RTX 50-series (Blackwell) GPUs with automatic device selection, CPU fallback, and improved inference pipelines for both images and videos.

Topics

Resources

Contributing

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages