CookAnything: A Framework for Flexible and Consistent Multi-Step Recipe Image Generation

Ruoxuan Zhang, Bin Wen, Hongxia Xie, Yi Yao, Songhan Zuo, Jian-Yu Jiang-Lin, Hong-Han Shuai, Wen-Huang Cheng

Abstract

Generating coherent, multi-step image sequences for procedural tasks like cooking remains a significant challenge for modern diffusion models. Standard text-to-image frameworks often suffer from semantic entanglement, where visual features bleed across steps, and lack the mechanism to maintain the continuity of small ingredients throughout a sequence. This paper introduces CookAnything, a novel framework built on the Flux.1-dev architecture that utilizes Step-wise Regional Control (SRC), Flexible Rotary Position Embedding (RoPE), and Cross-Step Consistency Control (CSCC) to generate high-fidelity, flexible-length recipe illustrations with superior procedural alignment.

Introduction

While large-scale diffusion models such as SDXL and FLUX have achieved remarkable success in generating high-fidelity single images, they frequently falter when tasked with illustrating a chronological process. In the context of cooking recipes, standard models face three primary obstacles: semantic entanglement (where raw ingredients in early steps look like the finished dish), fixed-length constraints that prevent scaling to recipes of varying lengths, and the "tiny ingredient continuity problem," where small components like chopped vegetables disappear or change appearance between steps. CookAnything addresses these limitations by treating sequence generation as a single, spatially-controlled denoising pass.

Methodology

CookAnything leverages the Diffusion Transformer (DiT) architecture of Flux.1-dev and introduces three core innovations to ensure spatial and temporal consistency.

Step-wise Regional Control (SRC)

To prevent semantic leakage between steps, the framework employs Step-wise Regional Control. Rather than generating images sequentially, the model generates the entire sequence simultaneously within a single latent space. SRC explicitly binds specific textual instructions to designated spatial regions, ensuring that the visual content of Step 1 remains isolated from the content of Step 2, thereby maintaining the integrity of the procedural flow.

Flexible Rotary Position Embedding (RoPE)

Standard RoPE mechanisms utilize a global coordinate system that often leads to "layout collapse" or blurring when applied to long sequences. CookAnything introduces Flexible RoPE, which resets the coordinate indices for each individual step in the sequence. This allows each image to maintain its own spatial integrity and sharpness, regardless of the total number of steps being generated.

Cross-Step Consistency Control (CSCC)

To maintain the visual identity of ingredients across the sequence, the framework utilizes a "Cooking Agent" powered by GPT-4o. This agent refines the recipe text to ensure consistent descriptions (e.g., ensuring "diced onions" are consistently described as such throughout). These refined descriptions are converted into Contextual Step Tokens, which are fused into the generation process to anchor the visual representation of ingredients across the entire sequence.

Experimental Setup and Datasets

The framework was evaluated using two primary benchmarks:

  1. RecipeGen: A comprehensive dataset of approximately 22,000 recipes featuring diverse cooking styles and step counts ranging from 2 to 15.
  2. VGSI (Visual Goal-Step Instruction): A dataset derived from wikiHow, providing a different distribution of procedural data to test the model's robustness across varied visual styles.

Key Results and Insights

CookAnything demonstrates a significant improvement over existing state-of-the-art models in both quantitative metrics and human preference studies.

  • Consistency and Faithfulness: On the RecipeGen dataset, CookAnything achieved a Cross-Step Consistency (CSC) score of 0.19, dramatically outperforming the In-Context LoRA baseline, which scored 9.03 (lower is better).
  • Human Evaluation: In a user study involving 53 participants, CookAnything was preferred in over 70% of cases for Goal Faithfulness and 69% for procedural continuity compared to vanilla Flux.1-dev and SD3.5.
  • Architectural Flexibility: Unlike previous models restricted to a fixed number of steps (e.g., 6 steps), CookAnything successfully generates sequences ranging from 3 to 10 steps without a loss in visual quality or coherence.

One of the primary insights of this research is that single-pass generation is inherently better for consistency. By generating all steps at once, the model can share global style and background information while the SRC and Flexible RoPE mechanisms keep the specific content of each step distinct.

Limitations and Future Directions

Despite its successes, the framework faces challenges in generating realistic fluid textures, such as soups or sauces, which lack distinct geometric shapes. Future work will focus on extending this framework to consistent video generation for recipes and developing interactive editing capabilities that allow users to modify specific steps without regenerating the entire sequence.

Summary updated

BibTeX
@inproceedings{zhang2025cookanything,
  author = {Ruoxuan Zhang and Bin Wen and Hongxia Xie and Yi Yao and Songhan Zuo and Jian-Yu Jiang-Lin and Hong-Han Shuai and Wen-Huang Cheng},
  title = {{CookAnything: A Framework for Flexible and Consistent Multi-Step Recipe Image Generation}},
  booktitle = {ACM Multimedia},
  year = {2025},
}
Figure