LayerCraft: Enhancing Text-to-Image Generation with CoT Reasoning and Layered Object Integration
Yuyao Zhang, Jinghao Li, Yu-Wing Tai
TL;DR
LayerCraft presents a modular, three-agent system for structured text-to-image generation that leverages chain-of-thought reasoning to produce 3D-aware layouts and an image-guided inpainting network for seamless object integration. The ChainArchitect constructs background-first layouts and bounding boxes, while the Object Integration Network refines object insertions with dual-LoRA adapters and attention mixing, all orchestrated by a GPT-4o-based coordinator. Across extensive quantitative and human-evaluation benchmarks, LayerCraft achieves superior spatial coherence, object fidelity, and multi-turn editing stability, outperforming both generic diffusion models and prior agent-based approaches. The framework democratizes high-quality, controllable image synthesis and batch editing, with practical impact for creative and professional workflows, while acknowledging computational overhead and ethical considerations.
Abstract
Text-to-image (T2I) generation has made remarkable progress, yet existing systems still lack intuitive control over spatial composition, object consistency, and multi-step editing. We present $\textbf{LayerCraft}$, a modular framework that uses large language models (LLMs) as autonomous agents to orchestrate structured, layered image generation and editing. LayerCraft supports two key capabilities: (1) $\textit{structured generation}$ from simple prompts via chain-of-thought (CoT) reasoning, enabling it to decompose scenes, reason about object placement, and guide composition in a controllable, interpretable manner; and (2) $\textit{layered object integration}$, allowing users to insert and customize objects -- such as characters or props -- across diverse images or scenes while preserving identity, context, and style. The system comprises a coordinator agent, the $\textbf{ChainArchitect}$ for CoT-driven layout planning, and the $\textbf{Object Integration Network (OIN)}$ for seamless image editing using off-the-shelf T2I models without retraining. Through applications like batch collage editing and narrative scene generation, LayerCraft empowers non-experts to iteratively design, customize, and refine visual content with minimal manual effort. Code will be released at https://github.com/PeterYYZhang/LayerCraft.
