How byronliang8/diffusion-geometry works
This research tool evaluates diffusion-model instability by comparing prompt-conditioned generations, estimating local geometry from finite-difference perturbations, and saving diagnostic maps or per-sample metrics. The main workflow is documented for paired in-distribution and out-of-distribution prompts; the sampled code shows SD3.5 prompt encoding, sampling, low-dimensional Jacobian estimation, and metric computation. Heatmap rendering and result writing are documented, though their complete implementations were not sampled. Both scripts support distributed execution; the graph focuses on product behavior, not execution infrastructure.
Main entry points: based_stepwise_sd.py SD3.5 analyzer · Geometry_Diffusion.py Heatmap workflow
Components 16
Geometry analysis
- ID/OOD prompts
- Heatmap workflow
Geometry_Diffusion.py - Stepwise analysis
sd35/based_stepwise_sd.py - Finite differences
sd35/based_stepwise_sd.py - LS and LC
sd35/based_stepwise_sd.py - PHFE and axis
sd35/based_stepwise_sd.py - Map geometry
Geometry_Diffusion.py
Diffusion generation
- SD3.5 analyzer
sd35/based_stepwise_sd.py - Prompt encoding
sd35/based_stepwise_sd.py - Latent sampling
sd35/based_stepwise_sd.py - SD3.5 pipeline
Diagnostics and results
- Heatmap rendering
Geometry_Diffusion.py - Sample image
sd35/based_stepwise_sd.py - Map outputs
Geometry_Diffusion.py - Metric reports
sd35/based_stepwise_sd.py
Other components
- Researcher
Connections 20
- Researcher → ID/OOD prompts: provides prompts
- ID/OOD prompts → Heatmap workflow: evaluates prompts
- ID/OOD prompts → Stepwise analysis: evaluates prompts
- Stepwise analysis → SD3.5 analyzer: runs analysis
- SD3.5 analyzer → Prompt encoding: encodes prompt
- SD3.5 analyzer → Latent sampling: samples latents
- Prompt encoding → SD3.5 pipeline: encodes with
- Latent sampling → SD3.5 pipeline: denoises with
- SD3.5 analyzer → Finite differences: estimates Jacobian
- Finite differences → Latent sampling: perturbs and samples
- SD3.5 analyzer → LS and LC: computes metrics
- SD3.5 analyzer → PHFE and axis: computes metrics
- LS and LC → Finite differences: uses derivatives
- PHFE and axis → Latent sampling: samples directions
- Stepwise analysis → Sample image: returns image
- Stepwise analysis → Metric reports: writes reports
- Heatmap workflow → Map geometry: computes maps
- Map geometry → Latent sampling: samples perturbations
- Heatmap workflow → Heatmap rendering: renders maps
- Heatmap workflow → Map outputs: saves maps