TL;DR
Current text-to-layout-to-image pipelines rely on large language models (LLMs) that struggle when given simple, unconstrained prompts like "a beach" or "living room," frequently producing repetitive or completely empty (degenerate) scene layouts. SLayR solves this by using a lightweight (~4M parameter) Diffusion Transformer trained via rectified flow to map open-ended global scene prompts directly into plausible, diverse intermediate layouts of bounding boxes and continuous CLIP embeddings. The resulting pipeline achieves state-of-the-art image quality and variety while remaining controllable, editable, and significantly smaller than existing baselines.
What Problem Does This Paper Address?
Two-stage text-to-layout-to-image generation provides transparency and controllability: users can inspect, move, or edit object bounding boxes before generating a final image. While recent works use LLMs to translate prompts into bounding boxes, they are almost exclusively designed to parse detailed, multi-object instructions (e.g., "two dogs sitting next to a cat").
When handed ambiguous, open-ended global scene prompts (e.g., "street" or "hotel room"), existing LLM methods fail dramatically. Prior systems like LLM-grounded Diffusion and LLM Blueprint collapse into degenerate layouts (generating 0 or 1 bounding box) in 90% to 99% of cases. Even when LLMs succeed, they produce rigid, repetitive layouts with minimal spatial diversity. Adapting user interface (UI) layout generators is also inadequate, as UI models rely on small, fixed label sets and lack global scene context.
Methods
SLayR introduces a unified framework to generate scene layouts via rectified flow:
- Token Representation: A layout consists of up to $J$ object tokens, $x^j = (b^j \parallel c^j \parallel \alpha^j)$, containing:
- $b^j \in \mathbb{R}^4$: Bounding box coordinates $(x, y, w, h)$, sinusoidally encoded into $\mathbb{R}^{72}$.
- $c^j \in \mathbb{R}^{30}$: Object semantics represented by top PCA-reduced CLIP text embeddings (capturing 77.35% of dataset variance).
- $\alpha^j \in \mathbb{R}$: An opacity score (encoded into $\mathbb{R}^{18}$) indicating whether an object exists; tokens with $\alpha < 0.5$ at $t=1$ are discarded.
- Rectified Flow Diffusion Transformer: Built with 20 Adaptive Layer Normalization (AdaLN) transformer blocks (12 attention heads). The network conditions on the global prompt's CLIP embedding and time step $t \in [0, 1]$, learning straight velocity trajectories from Gaussian noise to clean layout tokens.
- Controllability & Editing:
- Partial Layout Conditioning: An adapted RePaint algorithm allows users to specify partial bounding boxes or a "bag-of-words" object checklist.
- Directional Drift: Adding directed drift vectors during inference enforces spatial constraints (e.g., "place object A to the left of B").
- Intermediate Editing: Users can move, delete, or re-label boxes and regenerate images with the original noise seed.
- Image Synthesis: Unprojected CLIP features and bounding boxes feed into off-the-shelf layout-to-image generators (InstanceDiffusion, GLIGEN, BoxDiff, or LMD+).
[Prompt: "Dining Room"] ──> [Global CLIP] ──┐
▼
[Gaussian Noise Tokens] ───────────> [Rectified Flow DiT] ──> [Intermediate Layout] ──> [Layout-to-Image] ──> [Final Image]
(4M parameters) (Boxes + CLIP + Opacities) (e.g., InstanceDiff)
Datasets
- ADE20K: Contains ~27K images spanning complex indoor and outdoor scenes. The authors pad or truncate samples to the top 30 largest bounding boxes.
- Evaluation Benchmark: 20 scene categories (15 most frequent categories + 5 randomly selected long-tail categories). For each model, 30 layouts are generated per prompt (600 images per model-generator combination).
- Novel Layout Metrics Suite:
- Object Numeracy ($O_{\text{Num}}$): Normalized KL-divergence between generated and ground-truth object frequency distributions.
- Positional Likelihoods ($l_{\text{Pos}}^{(1)}, l_{\text{Pos}}^{(2)}$): First-order (single box location) and second-order (relative pairwise box placement) likelihoods estimated using Kernel Density Estimation (KDE).
- Positional Variance ($\sigma_{\text{Pos}}^2$): Nearest-neighbor Euclidean distance variance measuring layout diversity.
Key Insights and Ideas
- Rectified Flow vs. Traditional Diffusion: Standard DDIM struggled severely to synthesize continuous CLIP embeddings in early experiments, yielding semantic drift and nonsense layouts. Rectified flow's straight-line trajectories proved critical for joint modeling of continuous spatial coordinates and dense visual-semantic embeddings.
- Bimodal Opacities Solve Variable Token Lengths: Rather than resorting to autoregressive token stopping, the continuous opacity variable $\alpha^j$ naturally bifurcates toward 0 and 1 during inference, creating a clear decision boundary at 0.5.
- Bigger is Not Always Better: At only 4M parameters, SLayR's dedicated transformer outperforms multi-billion parameter models (e.g., GPT-4o, Ranni-2.7B) in both variety and spatial plausibility because it learns the structural priors of natural scenes rather than trying to hallucinate them from text prompt parsing.
Key Results
- Human Evaluation: Across 60 participants evaluating plausibility and variety on 5-point Likert scales, SLayR demonstrated an equal or superior Pareto trade-off across all tested image generators (InstanceDiffusion, GLIGEN, BoxDiff, LMD+).
- Image Quality Metrics: Best-in-class generation metrics against all baselines:
- FID: 0.17 (vs. LayoutTransformer: 0.44, Ranni: 0.71, GPT-4o: 0.94, LayoutGPT: 2.83)
- CMMD: 0.03 (vs. LayoutTransformer: 0.06, GPT-4o: 0.09, LayoutFlow: 0.25)
- KID ($10^{-2}$): 0.16 (vs. 0.30 for Ranni/LayoutTransformer)
- Layout Fidelity: Achieved the highest 1st-order (4.76) and 2nd-order (2.03) positional likelihoods and highest mIoU (0.17). While LayoutTransformer scored higher on positional variance, qualitative inspections confirmed its layouts were physically implausible (e.g., floors placed on ceilings).
- Efficiency: Generates batches of 30 layouts in 15.5 seconds on an Nvidia A6000 GPU—roughly $5\times$ faster than LayoutGPT (81s) and $14\times$ faster than Ranni (214s).
Limitations and Future Work
- Dataset Scale: Trained strictly on ADE20K. It has not yet been scaled to large-scale open-domain datasets such as MS COCO or LAION-5B due to compute limitations and the inability of UI baselines to support open-vocabulary captions.
- Embedding Inversion: SLayR predicts PCA-reduced CLIP vectors instead of discrete text tokens. Interpreting or querying the layout requires finding the nearest neighbor against a text dictionary.
- Full Split Evaluation: Experiments evaluated on the full ADE20K dataset to maintain statistical stability across split categories, leaving broader cross-dataset generalization for future investigation.
Summary updated