CountDiffusion: Text-to-Image Synthesis with Training-Free Counting-Guidance Diffusion
Yanyu Li, Pencheng Wan, Liang Han, Yaowei Wang, Liqiang Nie, Min Zhang
TL;DR
This work tackles the challenge of generating images with accurate object quantities in text-to-image diffusion models. It introduces CountDiffusion, a training-free framework that first evaluates an intermediate denoising result to count objects and then applies a correction stage that modifies attention maps via universal guidance to adjust counts, enabling plug-and-play compatibility with diffusion models. Key contributions include a two-stage counting framework, a multi-class correction strategy, and a dataset built with LLMs for evaluation, with results showing substantial gains in accuracy, MAE, CLIP similarity, and human preferences. The approach offers a practical path to more quantitatively faithful T2I generation, though it notes limitations with large object sets and points to future improvements in scalability and counting robustness.
Abstract
Stable Diffusion has advanced text-to-image synthesis, but training models to generate images with accurate object quantity is still difficult due to the high computational cost and the challenge of teaching models the abstract concept of quantity. In this paper, we propose CountDiffusion, a training-free framework aiming at generating images with correct object quantity from textual descriptions. CountDiffusion consists of two stages. In the first stage, an intermediate denoising result is generated by the diffusion model to predict the final synthesized image with one-step denoising, and a counting model is used to count the number of objects in this image. In the second stage, a correction module is used to correct the object quantity by changing the attention map of the object with universal guidance. The proposed CountDiffusion can be plugged into any diffusion-based text-to-image (T2I) generation models without further training. Experiment results demonstrate the superiority of our proposed CountDiffusion, which improves the accurate object quantity generation ability of T2I models by a large margin.
