Papers › Improving Sample Quality of Diffusion Models Using Self-Attention Guidance

Improving Sample Quality of Diffusion Models Using Self-Attention Guidance

3 Oct 2022ICCV 2023 1arXiv:2210.00939archive 2025-07-28

Susung Hong, Gyuseong Lee, Wooseok Jang, Seungryong Kim

Denoising diffusion models (DDMs) have attracted attention for their exceptional generation quality and diversity. This success is largely attributed to the use of class- or text-conditional diffusion guidance methods, such as classifier and classifier-free guidance. In this paper, we present a more comprehensive perspective that goes beyond the traditional guidance methods. From this generalized perspective, we introduce novel condition- and training-free strategies to enhance the quality of generated images. As a simple solution, blur guidance improves the suitability of intermediate samples for their fine-scale information and structures, enabling diffusion models to generate higher quality samples with a moderate guidance scale. Improving upon this, Self-Attention Guidance (SAG) uses the intermediate self-attention maps of diffusion models to enhance their stability and efficacy. Specifically, SAG adversarially blurs only the regions that diffusion models attend to at each iteration and guides them accordingly. Our experimental results show that our SAG improves the performance of various diffusion models, including ADM, IDDPM, Stable Diffusion, and DiT. Moreover, combining SAG with conventional guidance methods leads to further improvement.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2210.00939")

Code

Syntology Ran 17 of 22 code samples harvested from 2 repositories linked to this paper; 5 have no recorded run. Of those that ran: 3 ran · honoured contract; 2 ran · violated contract; 6 ran · our draft was wrong; 6 ran with no contract checked.

By repository: official repository: 19 samples from 1 repository, 14 ran; community (archive-listed): 2 samples from 1 repository, 2 ran; 1 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

KU-CVLAB/Self-Attention-Guidance officialmentioned on GitHubpytorchMIT report
ashen-sensored/sd_webui_SAG mentioned on GitHubpytorch report
lllyasviel/fooocus mentioned on GitHubpytorchGPL-3.0 report
susunghong/seg-sdxl mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

22 samples harvested; 17 ran; 3 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · honoured contract
2ran · violated contract
6ran · our draft was wrong
6ran
5unverified

Licence: 20 of the 22 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

center_crop_arr KU-CVLAB/Self-Attention-Guidance/guided_diffusion/image_datasets.py official repository ran · our draft was wrong MIT recorded; this copy not marked cleared · pointer only · 8ab9a97df8161f31 · report
approx_standard_normal_cdf KU-CVLAB/Self-Attention-Guidance/guided_diffusion/losses.py official repository ran · our draft was wrong fingerprinted MIT recorded; this copy not marked cleared · pointer only · cfd76fd0d89574a4 · report
attention_from_qkv KU-CVLAB/Self-Attention-Guidance/guided_diffusion/unet.py official repository ran fingerprinted MIT recorded; this copy not marked cleared · pointer only · e2497fcb1db5da74 · report
betas_for_alpha_bar KU-CVLAB/Self-Attention-Guidance/guided_diffusion/gaussian_diffusion.py official repository ran · honoured contract MIT recorded; this copy not marked cleared · pointer only · 2ab2316ac6fdd869 · report
create_named_schedule_sampler KU-CVLAB/Self-Attention-Guidance/guided_diffusion/resample.py official repository ran · our draft was wrong MIT recorded; this copy not marked cleared · pointer only · 35572566acf61c78 · report
discretized_gaussian_log_likelihood KU-CVLAB/Self-Attention-Guidance/guided_diffusion/losses.py official repository ran · our draft was wrong MIT recorded; this copy not marked cleared · pointer only · cd33283d615fb3d7 · report
get_named_beta_schedule KU-CVLAB/Self-Attention-Guidance/guided_diffusion/gaussian_diffusion.py official repository ran · honoured contract MIT recorded; this copy not marked cleared · pointer only · a086d6286a40b889 · report
get_param_groups_and_shapes KU-CVLAB/Self-Attention-Guidance/guided_diffusion/fp16_util.py official repository ran MIT recorded; this copy not marked cleared · pointer only · e41367ad14ff58fd · report
make_master_params KU-CVLAB/Self-Attention-Guidance/guided_diffusion/fp16_util.py official repository ran MIT recorded; this copy not marked cleared · pointer only · e20dd5102da3b050 · report
make_output_format KU-CVLAB/Self-Attention-Guidance/guided_diffusion/logger.py official repository ran MIT recorded; this copy not marked cleared · pointer only · bcd8b4acab199405 · report
normal_kl KU-CVLAB/Self-Attention-Guidance/guided_diffusion/losses.py official repository ran · honoured contract fingerprinted MIT recorded; this copy not marked cleared · pointer only · cf2798b666b231ca · report
save_input_hook KU-CVLAB/Self-Attention-Guidance/guided_diffusion/unet.py official repository ran MIT recorded; this copy not marked cleared · pointer only · 25d9a8be93bc84f5 · report
unflatten_master_params KU-CVLAB/Self-Attention-Guidance/guided_diffusion/fp16_util.py official repository ran MIT recorded; this copy not marked cleared · pointer only · 64fff1e30802b815 · report
zero_module KU-CVLAB/Self-Attention-Guidance/guided_diffusion/nn.py official repository ran · our draft was wrong MIT recorded; this copy not marked cleared · pointer only · 129b804760b3115f · report
avg_pool_nd KU-CVLAB/Self-Attention-Guidance/guided_diffusion/nn.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · ecd0fc28815b65ae · report
conv_nd KU-CVLAB/Self-Attention-Guidance/guided_diffusion/nn.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · fe4eb545bbb728e0 · report
mpi_weighted_mean KU-CVLAB/Self-Attention-Guidance/guided_diffusion/logger.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · e515a67f7f32e76d · report
profile KU-CVLAB/Self-Attention-Guidance/guided_diffusion/logger.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · 0c6607473a4c4c55 · report
random_crop_arr KU-CVLAB/Self-Attention-Guidance/guided_diffusion/image_datasets.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · 53d5be4fdbcfac23 · report
default ashen-sensored/sd_webui_SAG/scripts/SAG.py community (archive-listed) ran · violated contract MIT (permissive) · 424012cb37b31172 · report
xattn_forward_log ashen-sensored/sd_webui_SAG/scripts/SAG.py community (archive-listed) ran · our draft was wrong MIT (permissive) · c6e4e3cadf377bdf · report
exists identical code first harvested elsewhere ran · violated contract licence of this copy not recorded · aa5486a3650902d8 · report

Tasks

DenoisingDiversityImage Generation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Introduced by this paper: SAG, Self-Attention Guidance

DiffusionSAGSelf-Attention Guidance

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections