CountLoop: Training-Free High-Instance Image Generation
via Iterative Agent Guidance

1University of Surrey, UK 2Computer Vision Center, UAB, Spain 3Simon Fraser University, Canada
PDF   |   Benchmark   |   Code

TL;DR: CountLoop is a training-free framework that achieves precise instance control using iterative, structured feedback. Our method alternates between synthesis and evaluation, using a VLM-guided agent as both a layout planner and a critic.

CountLoop Teaser

Abstract

Diffusion models excel at photorealistic synthesis but struggle with precise object counts, especially in high-density settings. We introduce COUNTLOOP, a training-free framework that achieves precise instance control through iterative, structured feedback. Our method alternates between synthesis and evaluation: a VLM-based planner generates structured scene layouts, while a VLM-based critic provides explicit feedback on object counts, spatial arrangements, and visual quality to refine the layout iteratively. Instance-driven attention masking and cumulative attention composition further prevent semantic leakage, ensuring clear object separation even in densely occluded scenes. Evaluations on COCO-Count, T2I-CompBench, and two newly introduced high instance benchmarks show that COUNTLOOP reduces counting error by up to 57% and achieves the highest or comparable spatial quality scores across all benchmarks, while maintaining photorealism..

Pipeline Overview

CountLoop Pipeline

CountLoop operates in three stages: (1) A Design VLM interprets the prompt to produce realistic layouts. (2) These layouts guide style-consistent image generation via a cumulative attention mechanism. (3) A Critic VLM assesses the output for counting accuracy and aesthetic quality, providing structured feedback to refine both the layout and prompt. This iterative loop runs until a target quality score is reached, enabling complex, high-instance images without retraining the diffusion model.

Visual Results

Many Figures

CountLoop consistently avoids semantic drift, grid artifacts, and count inaccuracies that outperform competitors for high-instance image generation. It scales reliably to 100+ instances per image.

Qualitative Comparison

Comparison with state-of-the-art methods. CountLoop accurately renders high counts (e.g., "17 vases", "104 hot air balloons") with natural arrangements, whereas competitors often under-generate or produce artificial clusters.

Benchmarks & Evaluation

We evaluate on four sets spanning instance count and compositional difficulty: COCO-Count, T2I-CompBenchCount, and newly proposed CountLoop-S and CountLoop-M.

Left: Counting difficulty rises with instance count. Right: Runtime curves echo the same ordering.

Counting and Aesthetic Quality Across Four Benchmarks

Comparing counting and aesthetic quality across four benchmarks across T2I, L2I, and Agentic systems. For every dataset we report Counting (MAE↓) and Spatial↑ (aesthetic quality).
Type Model Single Category Multi Categories
COCO-Count T2I-CompBench CountLoop-S CountLoop-M
Counting (MAE)↓ Spatial↑ Counting (MAE)↓ Spatial↑ Counting (MAE)↓ Spatial↑ Counting (MAE)↓ Spatial↑
T2I SDXL 2.37 0.38 2.72 0.75 29.96 0.63 9.89 0.55
FLUX 1.40 0.53 1.48 0.78 17.47 0.65 9.62 0.58
SD 3.5 1.10 0.46 1.58 0.76 21.81 0.64 8.40 0.56
SDXL-Turbo 2.50 0.23 3.76 0.53 51.14 0.39 9.95 0.37
Counting Guidance 1.68 0.63 3.90 0.56 42.49 0.47 8.43 0.41
L2I LMD 3.09 0.24 5.56 0.73 16.62 0.66 6.34 0.64
MIGC 1.83 0.36 2.96 0.65 17.54 0.65 6.28 0.62
CountGen 1.88 0.61 5.22 0.75 34.44 0.72 6.46 0.69
InstanceDiffusion 1.77 0.40 2.83 0.68 16.07 0.74 6.11 0.66
3DIS 1.56 0.42 2.56 0.70 14.55 0.76 5.75 0.69
Agentic GenArtist 1.50 0.45 1.50 0.70 32.47 0.60 4.93 0.57
SLD 1.15 0.70 1.44 0.77 29.65 0.75 3.74 0.65
RPG 1.28 0.60 1.47 0.75 31.85 0.70 4.34 0.62
Qwen-Image 1.04 0.58 1.26 0.77 17.30 0.74 6.92 0.66
CountLoop (Ours) 0.45 0.93 1.23 0.79 7.59 0.93 2.13 0.73

BibTeX Citation

@article{Mondal2024CountLoop,
  title   = {CountLoop: Training-Free High-Instance Image Generation via Iterative Agent Guidance},
  author  = {Mondal, Anindya and Banerjee, Ayan and Nag, Sauradip and
             Llados, Josep and Zhu, Xiatian and Dutta, Anjan},
  journal = {arXiv preprint},
  year    = {2024}
}

License

We release our work under the Open RAIL-S License, which prohibits exploitative applications through robust contractual obligations and liabilities. We want to encourage users to exercise reasoned scepticism towards any downstream deployment that enables the monitoring of individuals without proper legal safeguards.

Contact: [email protected]   |   GitHub

© 2025 CountLoop Project