compvis/retrieval-augmented-diffusion-models — explained in plain English
Analysis updated 2026-08-08 · repo last pushed 2023-04-05
Build a custom image retrieval database from your own image collection to steer generated outputs toward a specific visual style.
Generate images from text captions using pretrained models and demo notebooks without training anything yourself.
Experiment with swapping different retrieval databases like ImageNet versus OpenImages to change visual style while keeping model weights the same.
Train your own retrieval-augmented diffusion model on a custom dataset for domain-specific image generation.
| compvis/retrieval-augmented-diffusion-models | facebookresearch/fmmax | krishnaik06/dockers | |
|---|---|---|---|
| Stars | 138 | 147 | 128 |
| Language | Jupyter Notebook | Jupyter Notebook | Jupyter Notebook |
| Last pushed | 2023-04-05 | 2026-02-10 | 2022-09-04 |
| Maintenance | Dormant | Maintained | Dormant |
| Setup difficulty | moderate | moderate | easy |
| Complexity | 4/5 | 4/5 | 1/5 |
| Audience | researcher | researcher | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires significant compute resources and large datasets for training, though inference works with provided pretrained models and demo notebooks.
Retrieval-Augmented Diffusion Models is a research project that generates images from text prompts, but with a twist: instead of relying purely on what the model learned during training, it also pulls in real images from a reference database to guide the output. You give it a caption like "a happy bear reading a newspaper, oil on canvas" and it produces a matching picture, informed by similar images it retrieves on the fly. The key idea is that when you type a prompt, the system converts your text into a numeric representation using CLIP (a model that understands both images and text in a shared way). It then searches a pre-built database of image embeddings to find visually similar examples. Those retrieved images act as additional context for the diffusion process, which gradually builds a new image step by step. The same trained model can work with different databases, for instance, one built from ImageNet versus one from OpenImages, and swapping databases changes the visual style and capabilities of what it generates, even though the model's weights stay the same. This would appeal to AI researchers, developers exploring generative models, or anyone curious about alternative approaches to text-to-image generation. For example, if you are building an image tool and want to steer outputs toward a specific visual domain, you could prepare a custom retrieval database from your own image collection and let the model reference it at generation time. The project includes two model types: RDM for general image generation and RARM, which is demonstrated on narrower categories like dogs, mammals, or animals from ImageNet. The repo ships with pretrained models and demo notebooks so you can try inference without training anything yourself. Training your own model from scratch is supported but requires significant compute resources and large datasets. The codebase builds on existing diffusion model frameworks from OpenAI and others, so it is primarily aimed at people comfortable navigating research code rather than a polished product.
A research project that generates images from text prompts by pulling real images from a reference database to guide the output, combining retrieval with diffusion models for more controllable image generation.
Mainly Jupyter Notebook. The stack also includes Jupyter Notebook, Python, PyTorch.
Dormant — no commits in 2+ years (last push 2023-04-05).
No license information is provided in the repository, so usage rights are unclear and you would need to contact the authors for permission.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.