Coherent Zero-Shot Visual Instruction Generation

Quynh Phung, Songwei Ge, Jia-Bin HuangarXiv 2024 · DOI

Abstract

Generating consistent, step-by-step visual instructions from text remains a challenge for current text-to-image (T2I) models. This paper introduces a training-free framework that leverages Large Language Models (LLMs) for in-context planning and an adaptive feature-sharing mechanism in diffusion models. By re-captioning instructions and employing dynamic KV-sharing, the proposed method achieves high object consistency across steps while accurately depicting state changes, such as ingredients being added to a container.

Introduction: The Challenge of Sequential Consistency

While text-to-image (T2I) models like Stable Diffusion excel at generating high-quality single images, they often fail to maintain sequential consistency. In a multi-step instruction set, such as a recipe, an object like a cooking pot may change its appearance entirely between steps. Furthermore, a "distribution gap" exists between action-oriented human instructions (e.g., "Add salt") and the descriptive prompts required by T2I models (e.g., "A hand sprinkling salt into a silver pot"). Existing solutions typically require expensive fine-tuning, which limits their generalizability. This work proposes a zero-shot, training-free approach to bridge this gap.

Methodology

The proposed pipeline consists of two primary stages designed to ensure both textual alignment and visual continuity.

Stage 1: In-Context Planning with LLMs

To address the distribution gap, the framework uses an LLM (e.g., GPT-4) to "re-caption" raw instructions into detailed scene descriptions that preserve context from previous steps. Additionally, the LLM generates a state similarity matrix, which provides metadata on how much visual information should be shared between specific steps. For instance, adjacent steps in a cooking process might share significant visual features, whereas the first and last steps might differ substantially.

Stage 2: Dynamic Consistent Image Generation

The core innovation lies in the modification of the diffusion model's self-attention layers through Adaptive KV-Sharing. By sharing "Keys" and "Values" (KV) across the image sequence, the model maintains object identity. To prevent "over-consistency"—where objects fail to change state despite instructions—the system uses Grounding DINO to create masks for specific objects. The LLM-generated similarity matrix then scales the information sharing, allowing a container to remain consistent while its contents transform.

Figure 3: Visualizing the addition of ingredients while maintaining pot identity.

Results and Evaluation

The framework was evaluated using a new dataset of 200 goals across categories like cooking and gardening, as well as the GenHowTo dataset.

Quantitative Performance

Using VLMs like GPT-4V and Gemini 1.5 Pro as judges, the method outperformed "Independent" and "Concatenation" baselines across metrics including Textual Alignment, Continuity, and Consistency. Ablation studies confirmed that the combination of local masks and global similarity weights yielded the best results, achieving a CLIP-score of 0.6708, compared to 0.4929 for the independent baseline.

Qualitative Superiority

Visual results demonstrate a marked improvement in maintaining the identity of tools (e.g., pots, pans, scissors) across sequences. The model successfully balances identity preservation with the need to show progress, such as adding soil to a planter.

Figure 5: Maintaining consistency in gardening instructions during soil addition.

Conclusion and Future Work

This paper presents a robust, training-free framework for generating coherent visual instructions. By using LLMs as "visual directors" and implementing adaptive feature sharing, the method overcomes the limitations of standard T2I models in sequential tasks. While some biases in base models remain—such as a preference for "cooked" over "raw" ingredients—the framework's modular nature ensures it will benefit from future improvements in base generative models. Future work may extend this logic to video generation and more complex multi-agent tasks.

Summary updated

BibTeX
@misc{phung2024coherent,
  author = {Quynh Phung and Songwei Ge and Jia-Bin Huang},
  title = {{Coherent Zero-Shot Visual Instruction Generation}},
  year = {2024},
  eprint = {2406.04337},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.04337},
}
Figure