Skip to content

Caesarhhh/SparseVAR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frequency-Aware Autoregressive Modeling for Efficient High-Resolution Image Synthesis

πŸ“Œ ICCV 2025 | Official Code Release
This repository hosts the official implementation of our ICCV 2025 paper:
"Frequency-Aware Autoregressive Modeling for Efficient High-Resolution Image Synthesis"
πŸ”₯ Up to 2Γ— speedup for high-res image synthesis with minimal quality drop.


πŸ” Abstract

Visual autoregressive modeling, based on the next-scale prediction paradigm, generates images by progressively refining resolution across multiple stages. However, the computational overhead in high-resolution stages remains a challenge due to the large number of tokens.
We introduce SparseVAR, a plug-and-play acceleration framework that dynamically excludes low-frequency tokens during inference with no extra training. On Infinity-2B, SparseVAR achieves up to 2Γ— speedup with minimal quality degradation.


πŸ–ΌοΈ Method

πŸ“„ Method Diagram:
Method Overview


πŸ’‘ Highlights

  • βœ… No retraining required
  • ⚑ Dynamic skipping of low-frequency tokens
  • 🧩 Compatible with Infinity and HART
  • πŸš€ Up to 2Γ— faster high-resolution inference

πŸ“¦ Installation

git clone https://github.com/Caesarhhh/SparseVAR.git
cd SparseVAR
pip install -r requirements.txt

πŸ“‚ Main Repository Structure

SparseVAR/
β”œβ”€β”€ infinity/                     # Infinity integration
β”‚   β”œβ”€β”€ scripts/
β”‚   β”‚   β”œβ”€β”€ eval_sparsevar.sh
β”‚   β”‚   └── eval_baseline.sh
β”‚   β”œβ”€β”€ weights/                  # place Infinity weights here
β”‚   β”œβ”€β”€ evaluation/               # evaluation configs & data
β”‚   └── cus_datasets/             
β”‚
β”œβ”€β”€ hart/                         # HART integration
β”‚   β”œβ”€β”€ scripts/
β”‚   β”‚   β”œβ”€β”€ eval_sparsevar.sh
β”‚   β”‚   └── eval_baseline.sh
β”‚   β”œβ”€β”€ weights/                  # place HART weights here
β”‚   β”œβ”€β”€ evaluation/               # evaluation configs & data
β”‚   └── cus_datasets/             
β”‚
β”œβ”€β”€ requirements.txt
└── assets/
    └── method_exit.png

⚠️ Usage: enter infinity/ or hart/ folder and run evaluation scripts.


πŸ”‘ Model Weights Setup

Infinity

  • Download from Infinity repo:
    • infinity_2b_reg.pth
    • infinity_vae_d32_reg.pth
  • Download Mask2Former:
  • Place files into:
    • infinity/weights/infinity_2b_reg.pth
    • infinity/weights/infinity_vae_d32_reg.pth
    • infinity/weights/mask2former/mask2former_swin-s-p4-w7-224_lsj_8x2_50e_coco.pth

HART

  • Download hart-0.7b-1024px
    β†’ Place into hart/weights/
  • Download Mask2Former:
    • mask2former_swin-s-p4-w7-224_lsj_8x2_50e_coco.pth β†’ Place into hart/weights/mask2former/

πŸ“Š Prepare Datasets for Evaluation

GenEval

DPG-Bench


▢️ Running Evaluation

Infinity

cd infinity
bash scripts/eval_sparsevar.sh   # SparseVAR acceleration
bash scripts/eval_baseline.sh    # Baseline

HART

cd hart
bash scripts/eval_sparsevar.sh
bash scripts/eval_baseline.sh

πŸ“– Citation

@inproceedings{chen2025sparsevar,
  title     = {Frequency-Aware Autoregressive Modeling for Efficient High-Resolution Image Synthesis},
  author    = {Chen, Zhuokun and Fan, Jugang and Yu, Zhuowei and Zhuang, Bohan and Tan, Mingkui},
  booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
  year      = {2025}
}

πŸ™ Acknowledgements

This repository is built upon and inspired by the excellent works:

We thank the authors and maintainers of these repositories for open-sourcing their code and models, which made this work possible.


οΏ½οΏ½οΏ½ License

This repository is for academic research only. For Infinity and HART code/models, please follow their respective licenses.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published