Papers › Compositional Text-to-Image Synthesis with Attention Map Control of Diffusion Models

Compositional Text-to-Image Synthesis with Attention Map Control of Diffusion Models

23 May 2023arXiv:2305.13921archive 2025-07-28

Ruichen Wang, Zekang Chen, Chen Chen, Jian Ma, Haonan Lu, Xiaodong Lin

Recent text-to-image (T2I) diffusion models show outstanding performance in generating high-quality images conditioned on textual prompts. However, they fail to semantically align the generated images with the prompts due to their limited compositional capabilities, leading to attribute leakage, entity leakage, and missing entities. In this paper, we propose a novel attention mask control strategy based on predicted object boxes to address these issues. In particular, we first train a BoxNet to predict a box for each entity that possesses the attribute specified in the prompt. Then, depending on the predicted boxes, a unique mask control is applied to the cross- and self-attention maps. Our approach produces a more semantically accurate synthesis by constraining the attention regions of each token in the prompt to the image. In addition, the proposed method is straightforward and effective and can be readily integrated into existing cross-attention-based T2I generators. We compare our approach to competing methods and demonstrate that it can faithfully convey the semantics of the original text to the generated content and achieve high availability as a ready-to-use plugin. Please refer to https://github.com/OPPOMente-Lab/attention-mask-control.

PaperPDFCodeCode 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="2305.13921")

Code

Syntology Ran 3 of 14 code samples harvested from 1 repository linked to this paper; 11 have no recorded run. Of those that ran: 1 ran · violated contract; 1 ran · our draft was wrong; 1 ran with no contract checked.

By repository: official repository: 14 samples from 1 repository, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

OPPO-Mente-Lab/attention-mask-control officialmentioned on GitHubpytorchMIT 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

14 samples harvested; 3 ran; 0 honoured the contract we drafted; 11 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.

1ran · violated contract
1ran · our draft was wrong
1ran
11unverified

Licence: 0 of the 14 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 OPPO-Mente-Lab/attention-mask-control. “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.

dice_loss OPPO-Mente-Lab/attention-mask-control/boxnet_models/segmentation.py official repository ran · violated contract fingerprinted MIT (permissive) · ac8fe530cdad4d8c · report
sigmoid_focal_loss OPPO-Mente-Lab/attention-mask-control/boxnet_models/segmentation.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · 5c0711aada67957e · report
tokenize OPPO-Mente-Lab/attention-mask-control/train_boxnet.py official repository ran MIT (permissive) · 534b549a2186b672 · report
build_transformer OPPO-Mente-Lab/attention-mask-control/boxnet_models/transformer.py official repository unverified MIT (permissive) · 9083e7dd88fe1570 · report
custom_decoder OPPO-Mente-Lab/attention-mask-control/custom_dataset.py official repository unverified MIT (permissive) · 2948eb1d2e3a4170 · report
cv2ImgAddText OPPO-Mente-Lab/attention-mask-control/p2p.py official repository unverified MIT (permissive) · 8569a155ef139702 · report
expand_text OPPO-Mente-Lab/attention-mask-control/custom_dataset.py official repository unverified MIT (permissive) · 156b5fef80b6fc81 · report
get_consume_samples OPPO-Mente-Lab/attention-mask-control/universal_datamodule.py official repository unverified MIT (permissive) · ff6b336fe24b3a0e · report
load_bbox OPPO-Mente-Lab/attention-mask-control/coco_preprocess.py official repository unverified MIT (permissive) · 4ceef3594b69a5ef · report
load_captions OPPO-Mente-Lab/attention-mask-control/coco_preprocess.py official repository unverified MIT (permissive) · 75fc999b2834b581 · report
save_input_hook OPPO-Mente-Lab/attention-mask-control/train_boxnet.py official repository unverified MIT (permissive) · ae52c3450f164ea5 · report
save_out_hook OPPO-Mente-Lab/attention-mask-control/train_boxnet.py official repository unverified MIT (permissive) · bd578666f3556b90 · report
text_under_image OPPO-Mente-Lab/attention-mask-control/p2p.py official repository unverified MIT (permissive) · 75f3f5c72eded945 · report
view_images OPPO-Mente-Lab/attention-mask-control/p2p.py official repository unverified MIT (permissive) · 9911847e9b3e81ac · report

Tasks

AttributeImage Generation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ALIGNDiffusionfail

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