# SUPIR — Photo-Realistic Image Restoration and Upscaling > A diffusion-based image restoration system that upscales and enhances low-quality photos to high-resolution results with realistic detail synthesis. ## Install Save in your project root: # SUPIR — Photo-Realistic Image Restoration and Upscaling ## Quick Use ```bash git clone https://github.com/Fanghua-Yu/SUPIR.git cd SUPIR pip install -r requirements.txt python test.py --img_dir inputs/ --save_dir outputs/ --upscale 4 ``` ## Introduction SUPIR (Scaling Up to Photo-Realistic Image Restoration) combines large-scale diffusion models with a vision-language understanding module to restore degraded images with photo-realistic detail. It generates plausible textures and structures that traditional upscalers cannot recover. ## What SUPIR Does - Restores and upscales low-resolution or degraded photographs - Synthesizes realistic textures and fine details from low-quality input - Uses language-guided restoration for semantic-aware enhancement - Handles various degradation types including noise, blur, and compression - Supports up to 4x upscaling with high perceptual quality ## Architecture Overview SUPIR builds on SDXL as its generative backbone, adding a degradation-aware encoder that maps low-quality images into the diffusion latent space. A CLIP-based vision-language module provides semantic understanding of the image content, guiding the diffusion process to generate contextually appropriate details during the denoising steps. ## Self-Hosting & Configuration - Requires Python 3.10+ with PyTorch 2.x and CUDA - GPU with at least 24 GB VRAM due to SDXL backbone - Download SDXL base model and SUPIR adapter weights separately - Adjust denoising strength and upscale factor via command-line arguments - Batch processing supported for multiple images ## Key Features - Diffusion-based restoration producing photorealistic output - Semantic guidance via vision-language model for context-aware detail - Handles real-world degradations beyond synthetic benchmarks - Significant quality improvement over traditional upscaling methods - Compatible with SDXL ecosystem and community extensions ## Comparison with Similar Tools - **Real-ESRGAN** — GAN-based upscaler; SUPIR produces more detailed and realistic textures - **StableSR** — earlier diffusion approach; SUPIR adds language guidance for better semantics - **Upscayl** — desktop app using Real-ESRGAN; SUPIR offers higher quality at more compute cost - **SwinIR** — transformer-based; SUPIR leverages generative diffusion for richer detail synthesis ## FAQ **Q: How much VRAM does it require?** A: At least 24 GB due to the SDXL backbone; 40 GB+ recommended for large images. **Q: Is it suitable for batch processing?** A: Yes, though each image takes 30-60 seconds on a high-end GPU. **Q: Does it work on faces?** A: Yes, it handles face restoration well thanks to the semantic guidance module. **Q: Can I reduce VRAM usage?** A: Tiled processing and fp16 precision can lower requirements at some quality cost. ## Sources - https://github.com/Fanghua-Yu/SUPIR - https://supir.xpixel.group/ --- Source: https://tokrepo.com/en/workflows/asset-e05af3e7 Author: AI Open Source