TLDR: Stitch is a training-free method that significantly improves the ability of modern Text-to-Image (T2I) models, particularly Multi-Modal Diffusion Transformers (MMDiT), to accurately generate images based on spatial relationships described in text prompts. It works by using LLM-generated bounding boxes to guide object generation, extracting foregrounds mid-process with attention heads, and then seamlessly stitching them together. Evaluated on the new PosEval benchmark, Stitch consistently boosts performance on complex positional tasks for models like Qwen-Image, FLUX, and SD3.5, achieving state-of-the-art results without compromising image quality or requiring additional training.
Text-to-Image (T2I) generation models have made incredible strides in recent years, allowing us to conjure images from simple text descriptions. However, a persistent challenge for these advanced models has been accurately understanding and depicting spatial relationships between objects, such as “a cup above a saucer” or “a car to the right of a tree.” While older methods existed to control object placement, they often proved incompatible with the latest, high-quality T2I architectures, particularly those based on Multi-Modal Diffusion Transformers (MMDiT).
A new research paper introduces a novel solution called Stitch, a training-free method designed to bring precise position control to modern MMDiT-based T2I models. This innovation allows for the creation of images that are not only visually stunning but also spatially accurate, addressing a critical limitation in current generative AI.
How Stitch Works: A Seamless Approach to Spatial Control
Stitch operates by breaking down a complex text prompt into manageable parts. First, it uses a Large Language Model (LLM) to analyze the full prompt and identify individual objects, assigning each a specific bounding box (a defined rectangular area) and a corresponding sub-prompt. It also generates a general background prompt for the entire image.
During the initial stages of image generation, Stitch employs a technique called “Region Binding.” This involves applying attention-masking constraints that ensure each object is generated strictly within its designated bounding box. This prevents objects from bleeding into other areas or appearing incomplete. Essentially, the model focuses its attention on creating each object in its correct place, almost like sketching individual elements on a canvas.
Once the objects are sufficiently formed, Stitch introduces a clever step called “Cutout.” Instead of relying on external segmentation tools that might not work well with partially generated images, Stitch leverages specific attention heads within the MMDiT model itself. These attention heads, it turns out, already contain enough information to isolate and extract the foreground objects from their backgrounds. The extracted object components are then seamlessly combined with the background elements to form a composite image.
Finally, for the remaining generation steps, all constraints are lifted. This allows the T2I model to refine the entire image organically, ensuring overall quality, consistency, and a natural blend between the stitched objects and the background. The result is a coherent and visually appealing image that precisely follows the spatial instructions in the original prompt.
Introducing PosEval: A New Benchmark for Positional Accuracy
To thoroughly evaluate Stitch and highlight the ongoing challenges in positional T2I generation, the researchers also developed PosEval. This new benchmark extends an existing evaluation framework, GenEval, by introducing five more complex and targeted tasks:
- Two Objects (2 Obj): The basic task of positioning two objects relative to each other.
- Three Objects (3 Obj) & Four Objects (4 Obj): Scaling up the complexity by requiring accurate positioning of three or four objects with multiple spatial relationships.
- Positional Attribute Binding (PAB): Testing the model’s ability to correctly associate attributes (like color) with specific objects while also maintaining their spatial relationships (e.g., “a yellow dining table right of a pink dog”).
- Negative Relations (Neg): Evaluating the understanding of negative spatial constraints (e.g., “a cow is not left of a laptop”).
- Relative Relations (Rel): Assessing the comprehension of relationships defined relative to other relationships (e.g., “an apple left of a computer mouse, and a teddy bear on the same side of the computer mouse as the apple”).
PosEval revealed that even state-of-the-art T2I models, while performing well on basic two-object tasks, struggle significantly with these more complex positional challenges. For instance, some top models saw their accuracy drop from over 80% on two-object tasks to as low as 2-4% on four-object tasks or relative relations.
Also Read:
- Improving Robot Navigation with Contextual Textual Descriptions in LLMs
- Decoding How AI Understands the World: A Multimodal Perspective
Stitch’s Impact: Significant Improvements Without Retraining
When tested on leading MMDiT-based models like Qwen-Image, FLUX, and SD3.5, Stitch consistently and substantially improved their positional generation capabilities. For example, Stitch boosted FLUX’s performance on GenEval’s basic Position task by 218% and on PosEval overall by 206%. With Qwen-Image, Stitch achieved state-of-the-art results on PosEval, improving over previous best models by 54%.
Crucially, these improvements are achieved without any additional training of the base T2I models, making Stitch a highly efficient and cost-effective solution. The method maintains the high visual quality and diversity of the original models while adding a layer of precise spatial control. This means users can now generate complex scenes with accurate object arrangements, pushing the boundaries of what T2I models can achieve.
The code for Stitch is available on GitHub, allowing researchers and developers to integrate this powerful training-free position control into their own projects. You can find more details about this innovative approach in the full research paper: STITCH: TRAINING-FREE POSITION CONTROL IN MULTIMODAL DIFFUSION TRANSFORMERS.


