Skip to content

Microtreei/TinySR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinySR: Pruning Diffusion for Real-World Image Super-Resolution [PyTorch]

1Zhejiang University, 2Vivo Mobile Communication Co. Ltd, 3Zhejiang Lab

  
  

🚩Accepted by CVPR2026 Findings


🔥 News

  • [2026.04] Release the TinySR, including the inference codes and pretrained models.
  • [2026.04] This repo is created.

🤗 If TinySR is helpful to your projects, please help star this repo. Thanks! 🤗

🎬 Overview

We propose a novel pruning scheme based on the DiT architecture:

overview

⚙️ Dependencies and Installation

# git clone this repository
https://github.com/Microtreei/TinySR.git
cd TinySR

# create an environment 
conda create -n tinysr python=3.9
conda activate tinysr
pip install -r requirements.txt

🚀 Quick Start

Step 1: Download the models

You can put the models weights into checkpoint/.

Step 2: Run testing command

python test/test_tinysr.py  \
--pretrained_model_name_or_path="/your/path/to/checkpoint/tinybackbone/prune-12-merge-tinysr" \
--vae_path="/your/path/to/checkpoint/vae/separable" \
--lora_dir="/your/path/to/checkpoint/tinysr" \
--embedding_dir="dataset/default/" \
--output_dir="outputs/tinysr/" \
--input_dir="dataset/test_image/" \
--rank=64 \
--rank_vae=64 \
--is_use_tile=False \
--vae_decoder_tiled_size=224 \
--vae_encoder_tiled_size=1024 \
--latent_tiled_size=64 \
--latent_tiled_overlap=8 \
--device=cuda \
--seed=42 \
--upscale=4 \
--process_size=512 \
--mixed_precision=fp16 \
--align_method=adain

You can modify the --input_dir to select the folder you want to process.

🌈 Evaluation

Step 1: Download the StableSR test datasets

  • Download StableSR testsets (DrealSRVal_crop128, RealSRVal_crop128, DIV2K_V2_val) from GoogleDrive or OneDrive. We sincerely thank the authors of StableSR for their well-curated test dataset.
  • Unzip them into imgs/StableSR_testsets/, the data folder should be like this:
├── imgs
    ├── StableSR_testsets
        ├── DIV2K_V2_val
        │   ├── test_LR
        │   ├── test_HR
        ├── DrealSRVal_crop128
        │   ├── test_LR
        │   ├── test_HR
        ├── RealSRVal_crop128
            ├── test_LR
            ├── test_HR

Step 2: Download the pretrained models

Step 3: Run testing command

Use DRealSRVal_crop128 as an example.

python test/test_tinysr.py  \
--pretrained_model_name_or_path="/your/path/to/checkpoint/tinybackbone/prune-12-merge-tinysr" \
--vae_path="/your/path/to/checkpoint/vae/separable" \
--lora_dir="/your/path/to/checkpoint/tinysr" \
--embedding_dir="dataset/default/" \
--output_dir="outputs/DrealSR" \
--input_dir="imgs/StableSR_testsets/DrealSRVal_crop128/test_LR" \
--rank=64 \
--rank_vae=64 \
--is_use_tile=False \
--vae_decoder_tiled_size=224 \
--vae_encoder_tiled_size=1024 \
--latent_tiled_size=64 \
--latent_tiled_overlap=8 \
--device=cuda \
--seed=42 \
--upscale=4 \
--process_size=512 \
--mixed_precision=fp16 \
--align_method=adain

Step 4: Run testing metrics command

python test/test_metrics.py \
--inp_imgs outputs/DrealSR \
--gt_imgs imgs/StableSR_testsets/DrealSRVal_crop128/test_HR \
--log logs/metrics

🔎 Results

Comprehensive comparison of recent Real-ISR models in terms of visual quality, inference time, computational cost (MACs), and parameter count:

teaser

Performance and efficiency comparison among DMs-based Real-ISR methods on an NVIDIA V100 GPU:

bubble

Comparisons of performance and efficiency for various design of efficient TinySR:

bar

🎫 License

This project is released under the Apache 2.0 license.

🎓 Citation

@article{dong2025tinysr,
  title={TinySR: Pruning Diffusion for Real-World Image Super-Resolution},
  author={Dong, Linwei and Fan, Qingnan and Yu, Yuhang and Zhang, Qi and Chen, Jinwei and Luo, Yawei and Zou, Changqing},
  journal={arXiv preprint arXiv:2508.17434},
  year={2025}
}

About

[CVPR 2026 Findings] Official implementation of the paper "TinySR: Pruning Diffusion for Real-World Image Super-Resolution".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors