We-Want-GPU/diffusers-cross-attention-map-SDXL-t2i

Space

5

stars

55

commits

1

linked in READMEs

Aug 7, 2026

updated

gradio

README

SDXL Attention Explorer

Generate an SDXL image and inspect the two attention relations exposed by its denoiser:

  • image→text: one image-shaped cross-attention overlay per active prompt token
  • image→image: spatial self-attention from the center query patch

The demo uses attention-map-diffusers==1.0.0 instead of copying or monkey patching Diffusers internals. It captures only the final denoising timestep, averages attention heads, keeps Q/K tensors on CPU, and limits self-attention to one query patch so it fits the Space's T4 GPU.

The default MODEL_VARIANT=fp16 downloads the smaller half-precision SDXL checkpoint. Set the Space variable MODEL_ID only when intentionally replacing the checkpoint.

Raw .pt tensors are not written. Returned images use Gradio's temporary cache instead of a persistent result directory.

Local development

Publish attention-map-diffusers==1.0.0 first, then run:

python -m pip install -r requirements.txt
python app.py

Project: https://github.com/wooyeolbaek/attention-map-diffusers

Contributors

WO
wooyeolbaek

55 commits

We-Want-GPU/diffusers-cross-attention-map-SDXL-t2i

Space

5

stars

55

commits

1

linked in READMEs

Aug 7, 2026

updated

gradio

README

SDXL Attention Explorer

Generate an SDXL image and inspect the two attention relations exposed by its denoiser:

  • image→text: one image-shaped cross-attention overlay per active prompt token
  • image→image: spatial self-attention from the center query patch

The demo uses attention-map-diffusers==1.0.0 instead of copying or monkey patching Diffusers internals. It captures only the final denoising timestep, averages attention heads, keeps Q/K tensors on CPU, and limits self-attention to one query patch so it fits the Space's T4 GPU.

The default MODEL_VARIANT=fp16 downloads the smaller half-precision SDXL checkpoint. Set the Space variable MODEL_ID only when intentionally replacing the checkpoint.

Raw .pt tensors are not written. Returned images use Gradio's temporary cache instead of a persistent result directory.

Local development

Publish attention-map-diffusers==1.0.0 first, then run:

python -m pip install -r requirements.txt
python app.py

Project: https://github.com/wooyeolbaek/attention-map-diffusers

Contributors

WO
wooyeolbaek

55 commits