- [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! 🤗
We propose a novel pruning scheme based on the DiT architecture:
# 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
- Download the TinySR backbone and lora weights from GoogleDrive or OneDrive.
You can put the models weights into checkpoint/.
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.
- 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
- Download the TinySR lora weights
checkpoint/from GoogleDrive or OneDrive.
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
python test/test_metrics.py \
--inp_imgs outputs/DrealSR \
--gt_imgs imgs/StableSR_testsets/DrealSRVal_crop128/test_HR \
--log logs/metrics
Comprehensive comparison of recent Real-ISR models in terms of visual quality, inference time, computational cost (MACs), and parameter count:
Performance and efficiency comparison among DMs-based Real-ISR methods on an NVIDIA V100 GPU:
Comparisons of performance and efficiency for various design of efficient TinySR:
This project is released under the Apache 2.0 license.
@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}
}



