Detection-Driven Object Count Optimization for Text-to-Image Diffusion Models
On the map: Diffusion models → Image generation, text-to-image and editing
Abstract (arXiv)
Accurately controlling object count in text-to-image generation remains a key challenge. Supervised methods often fail, as training data rarely covers all count variations. Methods that manipulate the denoising process to add or remove objects can help; however, they still require labeled data, limit robustness and image quality, and rely on a slow, iterative process. Pre-trained differentiable counting models that rely on soft object density summation exist and could steer generation, but employing them presents three main challenges: (i) they are pre-trained on clean images, making them less effective during denoising steps that operate on noisy inputs; (ii) they are not robust to viewpoint changes; and (iii) optimization is computationally expensive, requiring repeated model evaluations per image. We propose a new framework that uses pre-trained object counting techniques and object detectors to guide generation. First, we optimize a counting token using an outer-loop loss computed on fully generated images. Second, we introduce a detection-driven scaling term that corrects errors caused by viewpoint and proportion shifts, among other factors, without requiring backpropagation through the detection model. Third, we show that the optimized parameters can be reused for new prompts, removing the need for repeated optimization. Our method provides efficiency through token reuse, flexibility via compatibility with various detectors, and accuracy with improved counting across diverse object categories.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Placed in Image generation, text-to-image and editing, one of 14 directions in Diffusion models. Builds on 33 of its 39 references that are in the map. First posted on arXiv 21 Aug 2024.
Builds on
33 of 39 references.
Closest ancestors · 13
Same direction, newest first
- 2024Make It Count: Text-to-Image Generation with an Accurate Number of Objects14 Jun
- 2024InitNO: Boosting Text-to-Image Diffusion Models via Initial Noise Optimization6 Apr
- 2023Counting Guidance for High Fidelity Text-to-Image Synthesis30 Jun
- 2023Uni-ControlNet: All-in-One Control to Text-to-Image Diffusion Models25 May
- 2023Generating images of rare concepts using pre-trained diffusion models27 Apr
- 2023Discriminative Class Tokens for Text-to-Image Diffusion Models30 Mar
- 2023Adding Conditional Control to Text-to-Image Diffusion Models10 Feb
- 2023Attend-and-Excite: Attention-Based Semantic Guidance for Text-to-Image Diffusion Models31 Jan
- 2023GLIGEN: Open-Set Grounded Text-to-Image Generation17 Jan
- 2022Null-text Inversion for Editing Real Images using Guided Diffusion Models17 Nov
- 2022DreamBooth: Fine Tuning Text-to-Image Diffusion Models for Subject-Driven Generation25 Aug
- 2022Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding23 May
1 more
Other references · 20
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2020Denoising Diffusion Probabilistic Modelscited by 20,851
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
- 2021Diffusion Models Beat GANs on Image Synthesiscited by 8,185
- 2022Classifier-Free Diffusion Guidancecited by 5,717
- 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,290
- 2022Prompt-to-Prompt Image Editing with Cross Attention Controlcited by 2,409
- 2021CLIPScore: A Reference-free Evaluation Metric for Image Captioningcited by 2,388
- 2022An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversioncited by 2,231
- 2023Zero-1-to-3: Zero-shot One Image to 3D Objectcited by 1,483
- 2022Scaling Autoregressive Models for Content-Rich Text-to-Image Generationcited by 1,287
- 2023Training Diffusion Models with Reinforcement Learningcited by 939
8 more
- 2023Adversarial Diffusion Distillationcited by 741
- 2022CogView2: Faster and Better Text-to-Image Generation via Hierarchical Transformerscited by 305
- 2022VQGAN-CLIP: Open Domain Image Generation and Editing with Natural Language Guidancecited by 285
- 2023Teaching CLIP to Count to Tencited by 194
- 2021Learning To Count Everythingcited by 149
- 2023CLIP-Count: Towards Text-Guided Zero-Shot Object Countingcited by 82
- 2018Learning to Count Objects in Natural Images for Visual Question Answeringcited by 40
- 2024AFreeCA: Annotation-Free Counting for Allcited by 12
Built on by
Citing papers per year: 2024: 2; 2025: 1; 2026: 1.
4 papers.
- 2024Attention Overlap Is Responsible for The Entity Missing Problem in Text-to-image Diffusion Models!cited by 8
- 2024Diffusion Beats Autoregressive: An Evaluation of Compositional Generation in Text-to-Image Modelscited by 4
- 2025CARINOX: Inference-time Scaling with Category-Aware Reward-based Initial Noise Optimization and Explorationcited by 2
- 2026ATHENA: Adaptive Test-Time Steering for Improving Count Fidelity in Diffusion Modelscited by 0
- 2026ATHENA: Adaptive Test-Time Steering for Improving Count Fidelity in Diffusion Models20 Mar 2026
- 2025CARINOX: Inference-time Scaling with Category-Aware Reward-based Initial Noise Optimization and Exploration22 Sep 2025
- 2024Diffusion Beats Autoregressive: An Evaluation of Compositional Generation in Text-to-Image Models30 Oct 2024
- 2024Attention Overlap Is Responsible for The Entity Missing Problem in Text-to-image Diffusion Models!28 Oct 2024
Similar, not cited
Close in wording, no citation either way
- 2025CountDiffusion: Text-to-Image Synthesis with Training-Free Counting-Guidance Diffusion
- 2025CountSteer: Steering Attention for Object Counting in Diffusion Models
- 2025CountCluster: Training-Free Object Quantity Guidance with Cross-Attention Map Clustering for Text-to-Image Generation
- 2025T2ICount: Enhancing Cross-modal Understanding for Zero-Shot Counting
- 2025Demystifying Numerosity in Diffusion Models -- Limitations and Remedies
- 2026Test-Time Training for Robust Text-Guided Open-Vocabulary Object Counting
- 2025Text-to-Image Diffusion Models Cannot Count, and Prompt Refinement Cannot Help
- 2025CoDi -- an exemplar-conditioned diffusion model for low-shot counting