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 tokenimage→image: spatial self-attention from the center query patchThe 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.
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
55 commits
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 tokenimage→image: spatial self-attention from the center query patchThe 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.
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
55 commits