The code for the ICML 2023 paper ReDi: Efficient Learning-Free Diffusion Inference via Trajectory Retrieval.
- Install diffusers from source.
git clone https://github.com/huggingface/diffusers.git
cd diffusers
git checkout 25f1142
pip install -e .
- Put the pipeline_re_sd.py in
./src/diffusers/pipelines
and import it in./src/diffusers/__init__.py
.
-
Follow this (instruction)[https://github.com/facebookresearch/faiss/blob/main/INSTALL.md] to install
faiss-cpu
. -
Run
traj.py
to construct the knowledge base.
-
retrieve_val10.py
gives an example of generating images with ReDi one by one. -
retrieve_redi.py
gives an example of generating images with ReDi in batches.