Vector Lab · a research instrument
Diffusion Atlas
Manifold geometry and benchmarking for diffusion models. One instrument, two views: an Atlas view that reads the shape of the latent space, and a Bench view that scores compositional fidelity. Both run on the same generated images.
Diffusion Atlas is a vector-native research instrument for studying how diffusion models generate images geometrically. Where Manifold Atlas reads the static manifold of a frozen embedding model, Diffusion Atlas reads the generative trajectory of a denoising model: the path through latent space that produces an image. Four operations run across hosted APIs (Replicate, Fal) and a local FastAPI backend (CUDA or Apple Silicon). Everything persists in the browser; nothing leaves your machine unless you call out to a hosted provider.
What it does
| Operation | View | Backend | Core question |
|---|---|---|---|
| Denoise Trajectory | Atlas | Local only | What path does the model take through latent space? |
| Guidance Sweep | Atlas | Hosted or Local | How does CFG bend the trajectory? Where does mode collapse? |
| Latent Neighbourhood | Atlas | Hosted or Local | What does the local manifold look like around an anchor? |
| Compositional Bench | Bench | Hosted or Local | How well does the model bind, count, and place? |
Quick start
Diffusion Atlas is a Next.js frontend plus an optional Python backend. If you only want hosted operations (Sweep, Neighbourhood, Bench), the frontend alone is enough. For Denoise Trajectory and true latent-space neighbourhoods you need the local backend as well.
1. Clone and install the frontend
git clone https://github.com/vector-lab-tools/diffusionatlas.git
cd diffusionatlas
npm install
npm run dev
Open http://localhost:3000. The app loads with an empty state; click Settings (top right) to configure a provider.
2. (Optional) Install the local backend
Required for Denoise Trajectory. Needs a GPU (CUDA) or Apple Silicon (MPS) with at least 12 GB of available memory for SDXL-sized models.
cd backend
python3 -m venv .venv
source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install -r requirements.txt
uvicorn main:app --reload
The backend listens on http://127.0.0.1:8000. In Diffusion Atlas Settings, switch the backend to Local and confirm the URL. The first run of a given model downloads weights to ~/.cache/huggingface/ (a few GB for SDXL, more for SD3 / FLUX).
Loopback-only by design. The local backend binds to 127.0.0.1. Do not expose it to the public internet without replacing the self-identification header with real authentication — see the Security Model section in the repository README.
Getting API keys to work
Hosted providers return final images via API. Each needs its own key. The frontend stores keys in your browser only (localStorage); no key is ever sent anywhere except the provider it belongs to. Below are step-by-step instructions for the two wired providers.
Replicate wired
Broad model selection (SDXL, SD3, FLUX). Aggressive rate limits on the free tier — expect retry banners.
Fal wired · recommended
Order-of-magnitude more permissive rate limits than Replicate. Best for sweep- and bench-heavy work.
HuggingFace local only
Needed only to download gated weights (SD3, FLUX-dev) for the local backend. Not entered in the app.
Together · Stability planned
Provider stubs exist; wiring not complete.
Replicate
- Create a free account at replicate.com. Sign in with GitHub if you have one.
- Go to replicate.com/account/api-tokens.
- Click Create token, give it a name (e.g.
diffusion-atlas), and copy the token. It starts withr8_. - In Diffusion Atlas, open Settings, choose Hosted → Replicate, and paste the token into the API key field. Save.
- The model id field auto-fills with a sensible SDXL preset. You can swap in any Replicate model using its
owner/model[:version]form.
Billing. Replicate charges per generation and per second of GPU time. The free tier gives a small running credit; after that you need to add a payment method at replicate.com/account/billing. A single Guidance Sweep at five CFG values typically costs a few cents on SDXL.
Fal
- Create an account at fal.ai.
- Go to fal.ai/dashboard/keys.
- Click Add key, name it, copy the key. Fal keys have the form
<key-id>:<key-secret>; paste the whole thing including the colon. - In Diffusion Atlas, open Settings, choose Hosted → Fal, and paste. Save.
- The model id auto-fills with a Fal-flavoured preset (
fal-ai/<model>). Overrides work the same way as Replicate.
Choosing a model
The Model field in Settings offers suggestions for the selected provider, but it is free text: any model id from the provider's catalogue can be typed in and is used as entered. If a suggested model is withdrawn or renamed, type the current id from the provider's model page (Replicate: owner/model; Fal: fal-ai/<model>; local: a Hugging Face id such as stabilityai/sdxl-turbo). Reset to default restores the provider's starting model.
If a key is rejected, the first thing to check is that you copied the colon-joined pair as one string. A key-id without its secret produces a 401 that reads like a bad key.
HuggingFace (local backend only)
You need this only if you want to run the local backend on a gated model (SD 3 / 3.5, FLUX-schnell or FLUX-dev). SD 1.5 (stable-diffusion-v1-5/stable-diffusion-v1-5), SDXL and SDXL-turbo are ungated and work without a HuggingFace account.
- Create an account at huggingface.co/join.
- Visit the gated model page, e.g. stabilityai/stable-diffusion-3.5-medium, and accept the licence. For FLUX visit black-forest-labs/FLUX.1-schnell or black-forest-labs/FLUX.1-dev.
- Create an access token at huggingface.co/settings/tokens. A read-scope token is enough.
- With the backend venv activated, run
huggingface-cli loginand paste the token. The token is stored in~/.cache/huggingface/token; you do not paste it into Diffusion Atlas. - Restart the backend. The next load of a gated model will succeed instead of 403.
If a download 403s, the licence was not accepted on the model page under the account the token belongs to. Visit the model page while signed in, click Agree and access repository, then re-try.
Working through the operations
Denoise Trajectory
Traces the iterative denoising path through latent space. The local backend streams per-step latents over NDJSON, with a thumbnail decoded through the VAE every Nth step. The client projects the latents to 3D via PCA (or UMAP, or a 35 mm Film view that renders every captured step as a contact sheet). Local backend required; hosted providers do not expose intermediate latents.
Guidance Sweep
Generates the same prompt and seed across a list of CFG values (default 1, 2.5, 4, 7.5, 12). A drift curve above the grid plots normalised perceptual-hash distance from the baseline (CFG nearest 7.5), making the controllability surface, and the point where mode collapse begins, visible at a glance.
Latent Neighbourhood
Perturbs a chosen latent and renders a grid of neighbours. Two modes: seed-jitter (hosted-friendly) and true latent-space sampling (local only). Supports cross-backend comparison.
Compositional Bench
GenEval-lite task pack: four categories (single object, two objects, counting, colour binding) by three prompts each. Each result is marked pass or fail manually, or auto-scored with CLIP (ViT-B/32) at a configurable cosine threshold.
Troubleshooting
- Settings panel says "no provider configured". Open Settings, pick a provider, paste a key. The panel will not let you leave until a provider is selected.
- Replicate requests fail with 402. The free credit has run out. Add a payment method at replicate.com/account/billing.
- Fal 401 with a key that looks right. Fal keys are
<id>:<secret>. The colon-joined pair is the key; the id alone is not. - Backend unreachable. The frontend expects the backend on
http://127.0.0.1:8000. Confirm http://127.0.0.1:8000/health returns JSON. Common cause: the venv is not activated. - Local backend 403 on model download. Gated model. Accept the licence on HuggingFace while signed in, run
huggingface-cli loginin the activated venv. - Out of memory on local backend. Pick a smaller model (SD1.5 fits in 8 GB, SDXL wants 12+ GB, SD3 and FLUX want 24 GB). The backend logs the required and available memory on load.
- Denoise Trajectory shows no thumbnails. The Preview every field is zero. Set it to 1 (every step) or 5 (every fifth step).
If it is not on this page, open an issue on the tool's repository to report the problem. If you have a fix, a pull request is welcome.
FAQ
When was Diffusion Atlas first created?
The first commit, an initial scaffold tagged v0.1, is dated 26 April 2026. Concept and design are by David M. Berry (University of Sussex); the code was written with Claude Code.
Built at Copenhagen Business School, Denmark, during an Otto Mønsted Visiting Professorship in 2026. The support of the Otto Mønsted Fond (grant 25-12-1849) is gratefully acknowledged.
How has it developed?
- v0.1 (26–27 April 2026). Hosted generation through Replicate, a Guidance Sweep with rate-limit retry, Latent Neighbourhood, Compositional Bench with manual scoring, and a Library of saved runs.
- v0.2 (27 April 2026). The local FastAPI backend, Denoise Trajectory streamed step by step over NDJSON and drawn as a 3D PCA path, CLIP auto-scoring for the Bench, Fal as a second hosted provider, and a UMAP projection option.
- v0.3 (27–28 April 2026). Cross-backend comparison in Sweep, Neighbourhood and Bench; Deep Dive panels; the film contact-sheet view; temporary and locked layers; stop buttons on every operation; memory fixes for 24 GB Apple Silicon machines; scheduler changes that stopped black images at CFG 7.5; and a self-identification header on the local backend.
- v0.4.0 (9 August 2026). Relicensed from MIT to GPL-3.0-or-later, with all earlier versions included.
- v0.4.1 (27 October 2026). The first GitHub release, archived on Zenodo with a DOI.
- Since v0.4.1. This documentation site, links to the Vector Lab FAQ, and model suggestions in Settings alongside the free-text Model field, with the Stable Diffusion 1.5 id updated after it moved on Hugging Face.
The full history is in the commit log and the Roadmap section of the README.
Where is the code?
- Repository: github.com/vector-lab-tools/diffusionatlas
- Releases: github.com/vector-lab-tools/diffusionatlas/releases
- Issues: github.com/vector-lab-tools/diffusionatlas/issues
- Archived releases: Zenodo, DOI 10.5281/zenodo.23715023
Where are the questions common to all Vector Lab tools?
API keys, free local routes and common problems across the Vector Lab tools are covered in the Vector Lab FAQ.
Citation
If you use Diffusion Atlas in published research, please cite the archived release. The concept DOI below always resolves to the latest version; use the version DOI for a specific release.
@software{berry_diffusionatlas,
author = {Berry, David M.},
title = {Diffusion Atlas: Manifold geometry and benchmarking for diffusion models},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.23715023},
url = {https://github.com/vector-lab-tools/diffusionatlas}
}
Licence
GNU General Public License, version 3 or later (GPL-3.0-or-later). All prior versions of Diffusion Atlas are retroactively relicensed under the same terms. See LICENSE and COPYING.