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/pipelinesand 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.pyto construct the knowledge base.
-
retrieve_val10.pygives an example of generating images with ReDi one by one. -
retrieve_redi.pygives an example of generating images with ReDi in batches.