This is official implementation of our paper "DeepInv: A Novel Self-supervised Learning Approach for Fast and Accurate Diffusion Inversion".
Download DeepInv Solver and Datase we used here. They are too big for github thus we upload it on HuggingFace.
- load model by "model = torch.load(model_path)"
- predict inversion noise for one timestep "noise_pred,_ = model( hidden_states=DDIM_INV_noise, timestep=timestep, encoder_hidden_states=prompt_embeds, pooled_projections=pooled_prompt_embeds, en_hds_img=latent_zt, pool_hds_img=latent_z0, if_traning = if_train, num_itr = 1 )" Here, latent_z0 is the original input image edcoded by model's VAE, while latent_zt is the latent of current timestep.
- Replace scheduling_flow_match_euler_discrete.py to .../site-packages/diffusers/schedulers/
- Run "python3 main_tst_real.py"
- We train our solver by chosen and pre-processed images from MS-COCO 2017 dataset, you could use your own dataset, or you could creat the same dataset as we did following the instruction from our previous project EasyInv.
If you feel this project to be useful, please cite this paper and star it! The bibtex citation of our paper us as following.
@article{zhang2026deepinv,
title={DeepInv: A Novel Self-supervised Learning Approach for Fast and Accurate Diffusion Inversion},
author={Zhang, Ziyue and Lin, Luxi and Hu, Xiaolin and Chang, Chao and Wang, HuaiXi and Zhou, Yiyi and Ji, Rongrong},
journal={arXiv preprint arXiv:2601.01487},
year={2026}
}