Model Selection
How do I select the right model for my use case?
How do I select the right model for my use case?
Different models are optimized for different types of content:
- RealESRGAN_x4plus: General purpose model for real-world images
- RealESRGAN_x4plus_anime_6B: Optimized for anime and illustration images
- RealESRGANv2-animevideo-xsx2: For anime videos at 2x upscaling
- RealESRGANv2-animevideo-xsx4: For anime videos at 4x upscaling
- RealESRNet_x4plus: Suitable when you want less texture enhancement
Face Enhancement
Can I use face_enhance for anime images or animation videos?
Can I use face_enhance for anime images or animation videos?
The face enhancement feature uses models trained specifically on real human faces and will not work properly on anime characters or illustrations. Using this option on anime content will:
- Waste GPU memory unnecessarily
- Not improve the output quality
- Potentially introduce artifacts
--face_enhance flag when processing anime images or animation videos to save GPU memory and avoid potential issues.Common Errors
Error: slow_conv2d_cpu not implemented for Half
Error: slow_conv2d_cpu not implemented for Half
This error occurs when running Real-ESRGAN inference on CPU with half precision (fp16), which is the default setting for memory efficiency.Or with the executable:
Error Message
Cause
Real-ESRGAN uses half precision (fp16) by default to:- Reduce GPU memory consumption
- Speed up inference
Solution
Add the--fp32 option to your command to use full precision (fp32) instead:Using
--fp32 will increase memory usage but is required for CPU inference.Out of memory errors during inference
Out of memory errors during inference
If you encounter GPU out-of-memory errors, try these solutions:
-
Use tile mode: Process the image in smaller tiles
-
Disable face enhancement (if enabled):
-
Reduce tile size: Lower the tile parameter value
Smaller tile sizes use less memory but may take longer to process.
Installation Issues
How do I verify my installation is working correctly?
How do I verify my installation is working correctly?
After installing Real-ESRGAN, test your installation with a simple command:If you see output images generated without errors, your installation is working correctly.For dependency issues, ensure you have:
- Python 3.7+
- PyTorch 1.7+
- basicsr
- facexlib (if using face enhancement)
- gfpgan (if using face enhancement)
Which Python version should I use?
Which Python version should I use?
Real-ESRGAN is compatible with Python 3.7 or higher.Check your Python version:If you have multiple Python versions installed, you may need to use
python3 explicitly:Performance
How can I improve inference speed?
How can I improve inference speed?
Several options can improve Real-ESRGAN’s inference speed:
- Use GPU acceleration: Ensure CUDA is properly installed
-
Use the ncnn implementation: Faster for CPU inference
-
Disable unnecessary features:
- Remove
--face_enhanceif not needed - Use appropriate tile sizes (larger = faster but more memory)
- Remove
- Choose the right model: Smaller models like RealESRGANv2 variants may be faster
The ncnn implementation offers better performance on both CPU and mobile devices.