Cross-Attention Control for Localized Text-to-Image Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current text-to-image generative models struggle with localized generation due to their inability to incorporate location information and compositionality challenges, requiring substantial training data, resources, and extended inference time.

Innovation Solution

A cross-attention control (CAC) method that integrates localization information into pretrained models by constructing a new text input with concatenated captions and location data, computing cross-attention maps, and applying localization constraints without additional training or model modifications.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If training entirely new models or fine-tuning existing models with task-specific encoders is performed to achieve localized generation, then localization capability is improved, but training data requirements and computational resources increase substantially

Engineering Contradiction:
Improvelocalization capabilityVSAvoidtraining data requirements
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent introduces cross-attention maps as an intermediary mechanism that bridges text prompts and spatial localization without requiring task-specific encoders or retraining. The cross-attention maps naturally encode spatial relationships between text tokens and image regions, enabling localized generation through a mediator that already exists in the pretrained model architecture.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent makes the pretrained text-to-image model universally applicable to both global image generation and localized generation tasks without modification. The same model handles both tasks by simply varying the text prompt structure, eliminating the need for task-specific adaptations while maintaining high localization capability.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Measurement precision

If training entirely new models or fine-tuning existing models with additional components is performed to achieve localized generation, then localization capability is improved, but computational resources and time consumption increase substantially

Engineering Contradiction:
Improvelocalization capabilityVSAvoidcomputational resources
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent enables the pretrained model to serve itself for localized generation by utilizing its existing cross-attention mechanisms. The model's inherent attention maps are repurposed for localization without requiring additional computational components or energy-intensive fine-tuning processes, allowing the system to handle localized generation with its existing computational infrastructure.

Inventive Principle:
Principle #25Self-service

3Measurement precision

If training entirely new models or fine-tuning existing models with additional components is performed to achieve localized generation, then localization capability is improved, but inference time is extended substantially

Engineering Contradiction:
Improvelocalization capabilityVSAvoidinference time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent makes the inference process universally efficient for both global and localized generation by avoiding any model modifications. The same inference pipeline handles both tasks, with localization achieved through prompt engineering rather than additional computational steps, thus incurring no extra inference time overhead.

Inventive Principle:
Principle #6Universality (Multi-functionality)

4Productivity

If pretrained models are used without modifications for text-to-image generation, then inference efficiency is maintained, but localization capability is insufficient

Engineering Contradiction:
Improveinference efficiencyVSAvoidlocalization capability
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent dynamically adapts the use of cross-attention maps based on the localization requirements in the text prompt. When localization is needed, the system selectively utilizes the attention maps for relevant tokens, dynamically adjusting the generation process without requiring structural modifications to the model architecture.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS12387402B2System and method for localized text to image generation for free via cross attention
Publication Date: 2025.08.12 ROBERT BOSCH GMBH
  • US12387402B2 patent drawing
  • US12387402B2 patent drawing
  • US12387402B2 patent drawing

AI summary

A method discloses receiving, at a cross-attention layer of a model, first text data describing a first object and second text data describing a first scene, wherein the first text data includes a description of a location of the first object, utilizing the model with cross-attention layers, concatenating the first text data and the second text data to generate a prompt; generating, a broadcasted location mask constructed from at least the location; generating, a broadcasted all-one matrix associated with the second text data described the first scene; computing a key matrix and a value matrix utilizing separate linear projections of the prompt; computing a query matrix utilizing linear projections; generating a broadcasted location matrix in response to concatenating the broadcasted location mask and the broadcasted all-one matrix; generating a cross-attention map utilizing the query matrix, the key matrix, and the broadcasted location matrix; and outputting a final image.