Hugging Face Papers ↗ · 2026-11-24
MAGPIE: Agentic Multi-Reference Image Generation via Executable Scene Construction
Media reports Hugging Face Papers Source language: Chinese
MAGPIE uses a coding agent and executable Blender 3D proxy scenes to verify composition, boosting FLUX success on DreamOmni2 by 28.21 percentage points.
Full text
MAGPIE: Agentic Multi-Reference Image Generation via Executable Scene Construction
Yifan Dai ††thanks: These authors contributed equally to this work. Affiliation: School of Artificial Intelligence, Shanghai Jiao Tong University Daili Hua11footnotemark: 1 Affiliation: Peking University Bohan Zeng Affiliation: Peking University Yuran Wang Affiliation: Peking University Jialing Liu Affiliation: Renmin University of China Bozhou Li Affiliation: KlingAI Research Chengzhuo Tong Affiliation: Peking University Yang Shi Affiliation: Peking University Kai Zeng Affiliation: Peking University Liu Yang Affiliation: SJTU Xinyu Liu Affiliation: HKUST Shujie Li Affiliation: HKU Yiyan Ji Affiliation: NJU Bingyin Mei Affiliation: THU Yushuo Guan Affiliation: KlingAI Research Yuanxing Zhang Affiliation: KlingAI Research Fangcheng Fu Affiliation: School of Artificial Intelligence, Shanghai Jiao Tong University Wentao Zhang Affiliation: Peking University
Abstract
Multi-reference image generation requires a model to preserve the appearance of selected subjects while arranging them according to an instruction. Despite recent progress in reference-based generation and compositional control, reliably organizing selected subjects into the intended scene remains challenging. Although existing methods provide various forms of compositional guidance, the planned relationships are not always explicitly instantiated for inspection and refinement before image synthesis. To address this limitation, we introduce MAGPIE, which represents the intended composition as a simplified 3D scene defined by an executable Blender program. A coding agent links each scene instance to its reference, checks the geometry and rendered view against the instruction, and revises the program to correct discrepancies. The final proxy rendering serves as a visual plan for the image generator. Using MAGPIE-Instruct-3K, we train the generator to follow this plan while drawing each subject’s appearance from its reference. MAGPIE improves both Qwen and FLUX on DreamOmni2 and SconeEval. With FLUX, it improves overall success on DreamOmni2 by 28.21 percentage points over the original backbone and achieves the highest overall score among the models evaluated on SconeEval.
1 Introduction

Figure 1: Comparison of representative existing methods and MAGPIE. (a) Existing methods provide semantic or spatial guidance without necessarily exposing an explicit scene for verification. (b) In contrast, MAGPIE instantiates compositional intent as an executable 3D proxy, enabling revision before reference-grounded appearance synthesis.
Multi-reference image generation (MRIG) enables users to compose personalized images from heterogeneous visual references and natural language instructions [32, 36, 13, 30, 35, 33]. Recent advances have improved reference fidelity and instruction understanding: DreamOmni2 [35] supports multimodal generation and editing, while Scone [30] explicitly addresses subject selection among multiple candidates. However, faithfully preserving the appearance of referenced subjects does not necessarily ensure that they are composed correctly [30, 18]. As instructions require selective inclusion, multiple instances, and interactions among subjects, the generator must organize them into a scene that satisfies the requested spatial and interaction relationships.
This difficulty motivates a closer look at how direct-generation pipelines organize a scene [33, 35, 36], as illustrated in Fig. 1(a). Within this paradigm, a generative model must implicitly determine which entities should appear and how they should be organized while simultaneously synthesizing their reference-specific appearances. Without an explicit intermediate scene, compositional errors such as a missing instance or an incorrect spatial relationship become apparent only in the generated image.
Recent approaches introduce semantic or spatial guidance through textual reasoning and structural conditions [8, 6, 37, 27, 28]. However, specifying the intended composition does not necessarily instantiate its fine-grained geometry. As shown in Fig. 1(a), a plan may specify a woman holding a ring without resolving the hand–ring contact. The same bounding boxes allow different poses and depth orderings. Leaving these choices to the generator makes it difficult to verify the requested relationships or revise the geometry before synthesis. Geometry-aware approaches further explore explicit 3D scene planning and agentic revision, enabling more direct control over spatial relationships [4, 22]. While these methods primarily focus on text-driven image generation, multi-reference generation introduces an additional challenge: maintaining the correspondence between references and scene instances while transferring the planned composition into reference-faithful image synthesis.
Executable scene code lets us inspect spatial relationships in the resulting geometry and rendered views and revise individual placements and poses before image synthesis. Drawing on these properties, we introduce MAGPIE, a framework for multi-reference image generation through verifiable scene construction. MAGPIE constructs executable 3D proxies whose entities retain explicit bindings to the original visual references. As shown in Fig. 1(b), the agent executes each scene program, checks the geometry and rendered views against the requested relationships, and iteratively revises the program to correct discrepancies. The refined proxy rendering then guides composition, while the bound references provide each subject’s appearance for the final image generator.
Making verifiable scene construction useful for MRIG requires addressing two connected challenges. First, the agent must reliably construct and repair a proxy that captures the composition specified by the references and instruction. Second, the generator must learn to follow the proxy’s structure while preserving appearance from the corresponding references. To address the first challenge, we develop a structured agentic harness that integrates scene planning, procedural Blender construction, and iterative geometric and visual revision. Parameterized components and shared interaction anchors provide controllable geometry for individual entities and their interactions. Because a program can execute successfully while placing entities incorrectly, the harness checks entity visibility, camera-relative ordering, and designated contacts on the constructed geometry. A multimodal reviewer complements these measurements by examining the rendering against the references and instruction, and the agent uses the combined feedback to revise the scene.
To address the second challenge, pretrained generators must learn to use simplified proxy renderings as structural guidance without copying their placeholder appearances. However, existing MRIG datasets generally lack supervision that aligns executable scene proxies with visual references and target images. We therefore construct MAGPIE-Instruct-3K, a dataset of 3187 examples comprising reference images, instructions, executable Blender programs, proxy renderings, and target images. Through lightweight fine-tuning, pretrained generators learn to follow the proxy’s composition while preserving the appearance of the corresponding reference subjects.
Experiments on DreamOmni2 and SconeEval demonstrate improvements in overall scores with both Qwen-Image-Edit-2511 and FLUX.2-klein-base-9B. On DreamOmni2, MAGPIE raises the FLUX backbone’s overall score from 38.87% to 67.08%, and outperforms ordinary fine-tuning on the same reference–target pairs by 18.18 percentage points. The Qwen backbone likewise benefits beyond ordinary fine-tuning. These results support combining explicit scene construction with proxy-guided adaptation to improve reference-grounded image synthesis.
Our contributions are threefold:
•
We propose MAGPIE, a framework that instantiates reference-associated scene relationships in executable proxies for inspection and correction before appearance synthesis.
•
We develop a structured harness for proxy construction and revision, and construct MAGPIE-Instruct-3K to teach generators to combine proxy structure with reference-specific appearance.
•
We demonstrate improvements across two backbones and two benchmarks, including gains beyond ordinary generator fine-tuning.
2 Related Work

Figure 2: Overview of MAGPIE. The coding harness converts reference images and an instruction into an executable proxy scene through planning, procedural construction, and geometric and visual refinement. The generator combines the proxy’s structure with reference-specific appearance. MAGPIE-Instruct-3K supports lightweight adaptation to this conditioning.
2.1 Multi-Reference Image Generation
Unlike conventional text-to-image generation [20, 5, 11, 29], multi-reference image generation allows users to combine subjects and visual attributes drawn from different reference images following textual instructions [16, 33, 32, 3]. DreamOmni2 [35] supports generation and editing with references to concrete subjects and abstract attributes, while Scone [30] distinguishes requested subjects from distractors. AutoRef [19] further explores agentic generation by automatically optimizing the harness for reference processing, image synthesis, and output selection. A central challenge is preserving reference-specific appearance while arranging the selected subjects as instructed. This becomes more demanding when an instruction calls for multiple instances of the same subject. Each instance must retain the subject’s appearance while being placed and posed according to the instruction.
2.2 Structural Control for Image Generation
Structured planning expresses compositional intent through semantic descriptions and spatial conditions. Textual reasoning in Re-Align [8] clarifies target-scene content and reference associations, while layout-based approaches such as LayoutGPT [6] and LLM-grounded Diffusion [15] specify object placement. In reference-conditioned generation, ContextGen [37] and ConsistCompose [27] further associate subject identities with regions or coordinates. Richer conditions in ControlNet [41] and SeeThrough3D [1] extend control to pose, depth, viewpoint, and occlusion. These approaches provide increasingly detailed structural guidance, but such guidance alone does not establish that all requested relations are jointly realized. Verifying the composition and localizing necessary revisions before final synthesis remains challenging.
2.3 Executable Scene Representations
Executable scene code allows a composition to be rendered, checked against its specification, and revised before final image synthesis. Existing approaches explore procedural scenes and programmatic sketches, as in SceneCraft [9], CoCo [14] and GenClaw [38], or editable 3D scenes and layout refinement, as in MUSES [4], 3D Scratchpad [25], and SpatialGuard [22]. These methods primarily address text-driven scene construction, leaving the integration of user-provided subject identities into executable scenes less explored. To address this gap, MAGPIE grounds executable scene entities in the supplied references, enabling composition verification and revision while preserving reference-specific appearance in the final synthesis.
3 Method
Given reference images ℐ={I1,…,IN}\mathcal{I}=\{I_{1},\ldots,I_{N}\} and an instruction pp, MAGPIE generates an image that preserves reference-specific appearances while satisfying the requested composition. As illustrated in Fig. 2, a multimodal coding harness first constructs and refines an executable Blender scene specifying entity selection, instance counts, spatial arrangement, and interactions. The image generator then uses the proxy rendering for structure and the original references for appearance, with explicit bindings between reference subjects and scene entities. We detail these stages below, followed by MAGPIE-Instruct-3K and lightweight adaptation for proxy-guided synthesis.
3.1 Agentic Proxy Scene Construction
To instantiate the intended composition before image synthesis, we develop a multimodal coding harness that translates reference images and instructions into executable Blender scenes. The harness integrates reference-grounded scene planning, constrained procedural construction, and render-guided refinement, producing a structural proxy that captures the target entities and their spatial organization without requiring precise appearance reconstruction.
Reference-Grounded Scene Planning.
The coding agent selects the requested subjects from the references and creates an instance-level scene specification 𝒮\mathcal{S} with entity counts, spatial and interaction relationships, and a camera configuration. Each entity has a unique identifier, reference associations, an approximate layout and pose, and a proxy category for procedural modeling. A relational graph encodes relative positioning, containment, support, and physical contact. We validate entity identifiers, reference associations, and relational endpoints before construction. Because the specification describes individual instances, it supports selective subject inclusion and multiple instances of the same reference subject with distinct compositional roles.
Constrained Procedural Scene Construction.
Based on the scene specification, the coding agent generates a Blender program that instantiates the required entities and configures their geometry, placement, and camera viewpoint. To improve scene construction efficiency, we maintain a reusable library 𝒜\mathcal{A} of parameterized procedural modeling functions covering common entity categories, including articulated figures, animals, and structured objects. Each function exposes controllable parameters for geometry, scale, orientation, and pose. For entities not covered by the library, the agent constructs new procedural components using geometric primitives or custom meshes, which are subsequently incorporated into 𝒜\mathcal{A} for reuse in future scene construction. Guided by the assigned proxy categories, the agent generates an individual builder for each entity, together with a shared scene configuration. For entities covered by the library, each builder is required to invoke its designated procedural function. Before execution, we perform AST-based validation to ensure that all required builders are present and comply with their corresponding modeling interfaces.

Figure 3: Overview of MAGPIE-Instruct-3K. Across five compositional tasks, the dataset pairs reference images and instructions with proxy renderings and target images to teach generators to follow the proxy’s structure while preserving reference-specific appearance.
Independently constructed entities must also interact coherently. The components therefore use stable entity-specific mesh identifiers and shared world-space anchors to align interacting parts, such as a hand with an object’s grasping region or a seated character with a supporting surface. Geometric feasibility checks, including articulated-limb reachability, identify inconsistent configurations during construction. Executing and rendering the program produces an initial proxy, while the mesh identifiers and anchors allow subsequent checks and revisions to target individual entities and interactions.
Geometry and Vision Guided Refinement.
Although the initial program instantiates the planned scene, its rendered composition may still contain errors in entity visibility, spatial arrangement, or physical interactions. We therefore introduce a render guided refinement loop that combines geometric verification with multimodal visual review to identify discrepancies and guide code revision.
The geometric verifier examines the executed Blender meshes to assess whether the constructed scene satisfies the specified structural constraints. It first checks the presence and visibility of planned entities through mesh identifiers, projected bounding boxes, and ray-based visibility estimation. Camera-relative spatial relationships are then examined using projected positions and depth ordering to detect incorrect left-right or front-back arrangements. For interactions involving physical contact, the verifier evaluates surface distances between designated mesh components and checks the visibility of relevant contact regions. These measurements provide localized feedback on geometric inconsistencies in the rendered composition.
To detect semantic errors beyond these geometric measurements, a multimodal reviewer examines the proxy rendering and localized crops alongside the references, instruction, scene specification, and geometric feedback. It checks entity inventory, reference associations, relative placement, poses, and interactions. At round kk, let c(k)c^{(k)} denote the Blender program, ℳ(k)\mathcal{M}^{(k)} its executed meshes, and D(k)D^{(k)} its rendering. The refinement loop is
g(k)\displaystyle g^{(k)} =Geom(𝒮,ℳ(k),D(k)),\displaystyle=\operatorname{Geom}(\mathcal{S},\mathcal{M}^{(k)},D^{(k)}), (1)
f(k)\displaystyle f^{(k)} =Review(ℐ,p,𝒮,D(k),g(k)),\displaystyle=\operatorname{Review}(\mathcal{I},p,\mathcal{S},D^{(k)},g^{(k)}),
c(k+1)\displaystyle c^{(k+1)} =Revise(c(k),g(k),f(k)),\displaystyle=\operatorname{Revise}(c^{(k)},g^{(k)},f^{(k)}),
D(k+1)\displaystyle D^{(k+1)} =Render(c(k+1)),\displaystyle=\operatorname{Render}(c^{(k+1)}),
where g(k)g^{(k)} and f(k)f^{(k)} are geometric and visual feedback, respectively. The agent uses both to revise geometry, placement, interaction anchors, and camera configuration; the resulting rendering is evaluated in the next round. The harness retains the best candidate according to the verification results and performs at most six refinement rounds, stopping early when all verification criteria are satisfied.
Cross-Example Harness Refinement.
Instance-level revision corrects individual scenes; recurring errors also inform offline improvements to the harness. We construct proxies for over 200 randomly sampled training examples and compare their renderings with the corresponding target images. Common failure patterns guide changes to scene planning and code generation to improve initial proxy quality and reduce repeated repairs. Target images are used for this offline development; at inference, the harness receives only the references and instruction.
3.2 Proxy-Guided Reference-Grounded Synthesis
Building upon the proxy scene constructed in the preceding stage, we use its final rendering D⋆D^{\star} to provide explicit structural guidance for reference-grounded image synthesis. The proxy specifies entity arrangement, approximate geometry, poses, and interactions, while the original references ℐ\mathcal{I} supply identity and appearance details. We combine these inputs through
Y^=Gθ+Δθ(ℐ,D⋆,p~),\hat{Y}=G_{\theta+\Delta\theta}(\mathcal{I},D^{\star},\tilde{p}), (2)
where Y^\hat{Y} is the generated image, GG is the image generator, and θ\theta and Δθ\Delta\theta denote its pretrained parameters and LoRA updates, respectively. The proxy-aware prompt p~\tilde{p} is derived from the instruction pp and the reference-to-entity bindings. It assigns each input its role: follow the proxy’s placement, poses, and spatial relationships; preserve each subject’s appearance from its bound reference; and avoid reproducing the proxy’s simplified materials and colors.
Table 1: Quantitative comparison on DreamOmni2. Small green numbers show percentage-point changes in the three summary metrics relative to the corresponding backbone. Best scores in each group are highlighted in bold.
Method / Setting Generation ↑\uparrow Editing ↑\uparrow Overall ↑\uparrow
Concrete Abstract All Concrete Abstract All
Proprietary Models
Gemini-2.5-flash-Image [7] 50.00 55.56 54.39 68.29 64.63 65.37 61.44
Seedream-4.0 [26] 66.67 73.33 71.93 73.17 65.85 67.32 68.97
Open Weight Models
UNO [34] 0.00 3.33 2.63 0.00 0.61 0.49 1.25
DreamO [16] 4.17 6.67 6.14 2.44 1.83 1.95 3.45
OmniGen2 [33] 20.83 10.00 12.28 21.95 4.27 7.80 9.40
FLUX.1 Kontext [12] 25.00 5.56 9.65 4.88 1.83 2.44 5.02
Qwen-Image-Edit-2509 [32] 12.50 11.11 11.40 26.83 4.88 9.27 10.03
DreamOmni2 [35] 58.33 57.78 57.89 58.54 58.54 58.54 58.31
Different Base Models (MAGPIE)
Qwen-Image-Edit-2511 [32] 62.50 41.11 45.61 56.10 35.98 40.00 42.01
+ MAGPIE 62.50 68.89 67.54 +21.93 63.41 62.20 62.44 +22.44 64.26 +22.25
FLUX.2-klein-base-9B [13] 70.83 26.67 35.96 68.29 33.54 40.49 38.87
+ MAGPIE 70.83 66.67 67.54 +31.58 73.17 65.24 66.83 +26.34 67.08 +28.21
Table 2: Quantitative comparison on SconeEval. Scores range from 0 to 10 (higher is better). COM and DIS denote composition and distinction. Best scores in each group are highlighted in bold.
Method / Setting Composition ↑\uparrow Distinction ↑\uparrow Distinction & Composition ↑\uparrow Average ↑\uparrow
Single Multi Cross Intra Cross Intra
COM COM COM DIS COM DIS COM DIS COM DIS COM DIS Overall
Proprietary Models
Gemini-2.5-Flash-Image [7] 8.87 7.94 9.12 9.15 9.00 8.50 8.27 8.87 8.17 8.85 8.56 8.84 8.70
GPT-4o [17] 8.92 8.51 9.18 8.55 9.45 9.01 8.83 8.49 8.99 9.56 8.98 8.90 8.94
Open-Weight Models
UNO [34] 7.53 5.38 7.27 7.90 6.76 6.53 5.27 7.02 5.61 6.27 6.31 6.93 6.62
Qwen-Image-Edit-2509 [32] 8.54 6.85 8.85 8.57 7.32 6.86 7.53 8.13 7.49 7.02 7.76 7.65 7.70
BAGEL [3] 7.14 5.55 7.49 7.95 6.93 6.21 6.44 7.38 6.87 7.27 6.74 7.20 6.97
OmniGen2 [33] 8.00 6.59 8.31 8.99 6.99 6.80 7.28 8.30 7.14 7.13 7.39 7.81 7.60
Echo-4o [39] 8.58 7.73 8.36 8.33 7.74 7.18 7.87 8.72 8.01 8.33 8.05 8.14 8.09
Scone [30] 8.52 7.40 8.98 9.73 7.97 7.74 8.20 9.25 8.21 8.44 8.21 8.79 8.50
Different Base Models (MAGPIE)
Qwen-Image-Edit-2511 [32] 8.73 7.65 8.81 8.36 8.22 7.71 7.99 8.89 7.88 7.95 8.21 8.23 8.22
+ MAGPIE 8.44 8.11 8.83 9.56 8.71 8.85 8.69 9.57 8.83 9.08 8.60 9.26 8.93
FLUX.2-klein-base-9B [13] 8.69 8.03 9.11 8.97 7.39 6.75 8.22 8.59 7.75 7.42 8.20 7.93 8.07
+ MAGPIE 8.67 7.93 9.07 9.74 9.17 9.33 8.45 9.29 8.76 9.35 8.68 9.43 9.05
3.3 MAGPIE-Instruct-3K and Model Adaptation
Although proxy renderings provide explicit structural guidance, pretrained image generators may not interpret them as compositional constraints. As shown in Tab. 3, introducing proxy guidance into Qwen-Image-Edit-2511 without adaptation substantially degrades generation quality, motivating adaptation to this form of structural conditioning. However, existing multi-reference generation datasets generally lack paired executable proxy scenes and target images.
We therefore construct MAGPIE-Instruct-3K using the scene construction harness. Source examples come primarily from Echo-4o [39] and the Scone [30] training set, supplemented by Pico-Banana [21], MICo-150K [31], and other public multi-reference generation datasets. Source details are provided in the supplementary material. We retain examples with identifiable entities and requirements expressible through proxy geometry, such as shape, poses and spatial arrangements. During construction, the coding agent receives the target image to align the proxy with the intended composition. We then use Qwen3.8-27B [24] as a multimodal judge to filter proxy–target pairs based on entity inclusion and counts, spatial arrangements, poses and interactions, and framing and visibility. The evaluation prompt appears in the supplementary Material. The dataset contains 3187 examples, each comprising references, an instruction, an executable Blender program, a proxy rendering, and a target image. Fig. 3 presents the source and task distributions, representative examples, and the proxy-aware prompt template.
Using this dataset, we adapt pretrained image generators through lightweight low-rank adaptation (LoRA), enabling them to leverage proxy-based structural guidance while preserving reference-specific appearances. Following the flow-matching formulation, let z0=ℰ(Y)z_{0}=\mathcal{E}(Y) denote the latent representation of the target image YY, and let ϵ∼𝒩(0,I)\epsilon\sim\mathcal{N}(0,I) denote Gaussian noise. The training objective is
zt\displaystyle z_{t} =(1−t)z0+tϵ,\displaystyle=(1-t)z_{0}+t\epsilon, (3)
ℒFM\displaystyle\mathcal{L}_{\mathrm{FM}} =𝔼t,ϵ,𝒟[‖vθ+Δθ(zt,t,ℐ,D⋆,p~)−(ϵ−z0)‖22],\displaystyle=\mathbb{E}_{t,\epsilon,\mathcal{D}}\left[\left\|v_{\theta+\Delta\theta}(z_{t},t;\mathcal{I},D^{\star},\tilde{p})-(\epsilon-z_{0})\right\|_{2}^{2}\right],
where 𝒟\mathcal{D} denotes MAGPIE-Instruct-3K, D⋆D^{\star} is the proxy rendering, and p~\tilde{p} is the proxy-aware synthesis prompt introduced in the preceding section. Here, θ\theta represents the frozen pretrained parameters, while Δθ\Delta\theta denotes the trainable LoRA updates.

Figure 4: Qualitative comparison of existing models on DreamOmni2 benchmark.
4 Experiments
We evaluate MAGPIE with two image generation backbones on multi-reference generation and editing benchmarks, then examine the contributions of generator adaptation, scene representation, and proxy refinement.
4.1 Experimental Setting
Training.
We adapted Qwen-Image-Edit-2511 [32] and FLUX.2 [klein] [13], referred to as Qwen and FLUX, respectively, on the 3187 examples in MAGPIE-Instruct-3K. We used Qwen3.8-flash [23] for agentic scene construction and visual review during both offline data construction and inference. We trained rank-32 LoRA adapters for five epochs with a learning rate of 10−410^{-4} and a batch size of one, using images up to 1024×10241024\times 1024 resolution. The pretrained generator parameters remained frozen. At inference, the agent receives only the references and instruction, and the harness performs at most six refinement rounds with early stopping, as described in Sec. 3.1.
Evaluation.
We evaluate on DreamOmni2 [35] and SconeEval [30] using their official evaluation scripts, scoring prompts, and aggregation procedures. DreamOmni2 covers generation and editing with concrete objects and abstract attributes. Its evaluation measures whether the output successfully satisfies the multimodal instruction; we report success rates for both categories, their aggregate within each task, and an overall score, all as percentages. SconeEval evaluates composition, distinction, and their combination, including cross-category and intra-category subject selection. Its composition score (COM) combines prompt following and subject consistency through their per-example geometric mean. Its distinction score (DIS) averages subject-selection accuracy and F1, rescaled to the same 0–10 range. We report the benchmark’s subtask scores and aggregate COM, DIS, and Overall, with higher values indicating better performance.
4.2 Quantitative and Qualitative Evaluation
Quantitative evaluation.
On DreamOmni2, MAGPIE improves both generation and editing success with either backbone (Tab. 1). Qwen gains 22.25 percentage points in overall success over the original backbone. The gain is larger for FLUX, whose success rate rises from 38.87% to 67.08%, a 28.21-point increase. Both variants outperform the strongest open-weight baseline, DreamOmni2 [35], and exceed the 61.44% overall success rate of the proprietary Gemini-2.5-Flash-Image.
On SconeEval, MAGPIE improves both composition and subject distinction with either backbone (Tab. 2). With FLUX, the average composition score rises from 8.20 to 8.68 and the average distinction score from 7.93 to 9.43. These gains bring the overall score to 9.05, the highest among all models compared, ahead of the proprietary GPT-4o (8.94) and Gemini 2.5 Flash Image (8.70). Together, these results support using executable 3D scene proxies to guide composition in multi-reference image generation.
Qualitative evaluation.
Figure 4 compares Qwen-Image-Edit-2511 and FLUX.2 [klein], each with and without MAGPIE, on DreamOmni2Bench. We also include results from Gemini 2.5 Flash Image, Seedream 4.0, and DreamOmni2. With MAGPIE, both backbones follow the requested compositions and edits more closely while preserving the visual identity of the referenced subjects. This consistency is visible even when the instructions call for a change in a subject’s position or pose.
Table 3: Ablation study of MAGPIE and SFT on DreamOmni2Bench. We report aggregated generation, editing, and overall scores. Bold indicates the best result within each backbone group.
Method / Setting Gen. All ↑\uparrow Edit. All ↑\uparrow Overall ↑\uparrow
Qwen-Image-Edit-2511 45.61 40.00 42.01
+ Proxy only 35.09 26.34 29.47
+ Standard SFT 42.11 46.34 44.83
+ MAGPIE 67.54 62.44 64.26
FLUX.2-klein-base-9B 35.96 40.49 38.87
+ Proxy only 40.35 49.27 46.08
+ Standard SFT 46.49 50.24 48.90
+ MAGPIE 67.54 66.83 67.08
Table 4: Comparison of different scene planning strategies on DreamOmni2Bench. We report generation scores on concrete and abstract tasks and their sample-weighted aggregate. Bold numeric values denote MAGPIE.
Method / Setting Gen. Con ↑\uparrow Gen. Abs ↑\uparrow Gen. All ↑\uparrow
Qwen-Image-Edit-2511 62.50 41.11 45.61
+ Text Scene 54.17 54.44 54.39
+ 2D Scene 50.00 56.67 55.26
+ 3D Scene (MAGPIE) 62.50 68.89 67.54
FLUX.2-klein-base-9B 70.83 26.67 35.96
+ Text Scene 58.33 58.89 58.77
+ 2D Scene 33.33 51.11 47.37
+ 3D Scene (MAGPIE) 70.83 66.67 67.54
4.3 Ablation Study
Effect of proxy-conditioned adaptation.
We disentangle the effects of additional training data, inference-time proxy guidance, and proxy-conditioned adaptation in Tab. 3. Standard SFT uses the same references, instructions, and target images as MAGPIE but excludes proxy renderings during both training and inference. It improves the overall score from 42.01% to 44.83% for Qwen and from 38.87% to 48.90% for FLUX, confirming that the training pairs themselves are beneficial. Conditioning on proxies during both adaptation and inference further raises the scores to 64.26% and 67.08%, outperforming standard SFT by 19.43 and 18.18 percentage points, respectively. In contrast, supplying the proxy only at inference without adaptation produces inconsistent effects: it substantially degrades Qwen to 29.47%, while improving FLUX to 46.08%. These results show that proxy renderings are not universally effective as zero-shot guidance; their structural benefit is realized most reliably when the generator is trained to interpret them.
Effect of scene representation.
We compare three representations of the scene plan (Tab. 4). Text Scene uses the entity-level plan produced by the first stage of the MAGPIE harness as textual guidance, while 2D Scene converts that plan into labeled bounding boxes. For each variant, we used this pipeline to construct training examples from MAGPIE-Instruct-3K and trained a separate LoRA adapter for each backbone. At inference, the same pipeline produces the corresponding guidance from the input references and instruction. With a rendered Blender proxy as guidance, 3D Scene achieves the highest aggregate generation score on both backbones (67.54%), exceeding the best alternative planning variant by 12.28 percentage points on Qwen and 8.77 on FLUX.
Figure 5: Generation and editing performance across refinement rounds. We visualize the progressive improvement in MAGPIE’s aggregate generation and editing scores on DreamOmni2Bench across 0, 3, and 6 rounds of proxy refinement.
Effect of proxy refinement.
Using the adapted FLUX backbone, we evaluate generation and editing performance by setting the maximum number of proxy refinement rounds to 0, 3, or 6. At zero rounds, the generator uses the initial proxy before render-guided refinement. Figure 5 reports DreamOmni2Bench scores for concrete and abstract examples in both generation and editing, along with the aggregate score for each task and the overall score. Both task aggregates rise across the three budgets, and the overall score increases from 53.61% at zero rounds to 67.08% at six rounds. The supplementary material also provides proxy construction reliability statistics, qualitative comparisons across refinement rounds, proxy quality assessments, and runtime analysis.
5 Conclusion
In this work, we introduce MAGPIE, a framework for multi-reference image generation that represents the requested composition as an executable 3D scene. A coding agent arranges the selected subjects in this scene, checks its geometry and rendered view against the instruction, and revises the scene as needed. We also curate MAGPIE-Instruct-3K for lightweight fine-tuning so the generator learns to follow the refined rendering for composition and the original references for appearance. Experiments on DreamOmni2 and SconeEval show that MAGPIE improves overall performance with both Qwen and FLUX. We hope this work encourages further study of how executable scene representations can give users finer control over multi-reference image generation.
6 LLM Usage Statement
Qwen3.8-Flash-Next powered the scene construction and refinement agent, while Qwen3.8-27B supported quality filtering during the construction of MAGPIE-Instruct-3K. Gemini-2.5-Flash and GPT-4.1 served as judges for evaluation on DreamOmni2Bench and SconeEval, respectively. AI tools also assisted with implementation and experimental workflows, as well as language polishing and clarity improvements during manuscript preparation. The authors made all research decisions and drew all conclusions, and take full responsibility for the methodology, experimental design, validation and interpretation of results, and final content of the manuscript.
References
[1] V. Agrawal, R. Parihar, P. S. Bhat, R. K. Sarvadevabhatla, and V. B. Radhakrishnan (2026) Seethrough3d: occlusion aware 3d control in text-to-image generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 25403–25414. Cited by: §2.2.
[2] Z. Chen, Y. Wang, M. Zhang, and X. Liu (2026) MACRO: advancing multi-reference image generation with structured long-context data. arXiv preprint arXiv:2603.25319. Cited by: §7.1.
[3] C. Deng, D. Zhu, K. Li, C. Gou, F. Li, Z. Wang, S. Zhong, W. Yu, X. Nie, Z. Song, G. Shi, and H. Fan (2025) Emerging properties in unified multimodal pretraining. arXiv preprint arXiv:2505.14683. Cited by: §2.1, Table 2.
[4] Y. Ding, S. Zhuang, K. Li, Z. Yue, Y. Qiao, and Y. Wang (2025) Muses: 3d-controllable image generation via multi-modal agent collaboration. Proceedings of the AAAI Conference on Artificial Intelligence 39 (3), pp. 2753–2761. External Links: Document Cited by: §1, §2.3.
[5] P. Esser, S. Kulal, A. Blattmann, R. Entezari, J. Müller, H. Saini, Y. Levi, D. Lorenz, A. Sauer, F. Boesel, D. Podell, T. Dockhorn, Z. English, and R. Rombach (2024) Scaling rectified flow transformers for high-resolution image synthesis. In Proceedings of the 41st International Conference on Machine Learning, R. Salakhutdinov, Z. Kolter, K. Heller, A. Weller, N. Oliver, J. Scarlett, and F. Berkenkamp (Eds.), Proceedings of Machine Learning Research, Vol. 235, pp. 12606–12633. Cited by: §2.1.
[6] W. Feng, W. Zhu, T. Fu, V. Jampani, A. Akula, X. He, S. Basu, X. E. Wang, and W. Y. Wang (2023) Layoutgpt: compositional visual planning and generation with large language models. Advances in neural information processing systems 36, pp. 18225–18250. Cited by: §1, §2.2.
[7] Google (2025) Introducing gemini 2.5 flash image, our state-of-the-art image model. Cited by: Table 1, Table 2.
[8] R. He, Y. Cheng, T. Hang, Z. Li, Y. Xu, Z. Yin, S. Zhang, W. Dai, P. Du, A. Ma, C. Wang, Q. Lu, J. Han, and J. Dai (2026) Re-align: structured reasoning-guided alignment for in-context image generation and editing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 9051–9062. Cited by: §1, §2.2.
[9] Z. Hu, A. Iscen, A. Jain, T. Kipf, Y. Yue, D. A. Ross, C. Schmid, and A. Fathi (2024) SceneCraft: an llm agent for synthesizing 3d scenes as blender code.. In ICML, pp. 19252–19282. Cited by: §2.3.
[10] W. Huang, Y. Fu, J. Wang, M. Huang, Y. Li, G. Liu, J. Cai, Y. He, and Z. Tian (2026) Scaling multi-reference image generation with dynamic reward optimization. In European Conference on Computer Vision, pp. 490–507. Cited by: §7.1.
[11] D. JIANG, Z. Guo, R. Zhang, Z. ZONG, H. Li, L. Zhuo, S. Yan, P. Heng, and H. Li (2025) T2I-r1: reinforcing image generation with collaborative semantic-level and token-level cot. In Advances in Neural Information Processing Systems, D. Belgrave, C. Zhang, H. Lin, R. Pascanu, P. Koniusz, M. Ghassemi, and N. Chen (Eds.), Vol. 38, Main Conference, pp. 39856–39890. External Links: Document Cited by: §2.1.
[12] B. F. Labs, S. Batifol, A. Blattmann, F. Boesel, S. Consul, C. Diagne, T. Dockhorn, J. English, Z. English, P. Esser, S. Kulal, K. Lacey, Y. Levi, C. Li, D. Lorenz, J. Müller, D. Podell, R. Rombach, H. Saini, A. Sauer, and L. Smith (2025) FLUX.1 kontext: flow matching for in-context image generation and editing in latent space. External Links: 2506.15742, Link Cited by: Table 1.
[13] B. F. Labs (2025) FLUX.2: Frontier Visual Intelligence. Cited by: §1, Table 1, Table 2, §4.1.
[14] H. Li, C. Qing, H. Zhang, D. Jiang, Y. Zou, H. Peng, D. Li, Y. Dai, Z. Lin, J. Tian, et al. (2026) Coco: code as cot for text-to-image preview and rare concept generation. In European Conference on Computer Vision, pp. 57–75. Cited by: §2.3.
[15] L. Lian, B. Li, A. Yala, and T. Darrell (2023) Llm-grounded diffusion: enhancing prompt understanding of text-to-image diffusion models with large language models. arXiv preprint arXiv:2305.13655. Cited by: §2.2.
[16] C. Mou, Y. Wu, W. Wu, Z. Guo, P. Zhang, Y. Cheng, Y. Luo, F. Ding, S. Zhang, X. Li, et al. (2025) Dreamo: a unified framework for image customization. In Proceedings of the SIGGRAPH Asia 2025 Conference Papers, pp. 1–12. Cited by: §2.1, Table 1.
[17] OpenAI (2025) Hello gpt-4o. Cited by: Table 2.
[18] Y. Oshima, D. Miyake, K. Matsutani, Y. Iwasawa, M. Suzuki, Y. Matsuo, and H. Furuta (2026) MultiBanana: a challenging benchmark for multi-reference text-to-image generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 448–460. Cited by: §1.
[19] Y. Oshima, K. Onoda, Y. Iwasawa, M. Suzuki, Y. Matsuo, and H. Furuta (2026) AutoRef: harness optimization for agentic multi-reference image generation. arXiv preprint arXiv:2609.35530. Cited by: §2.1.
[20] D. Podell, Z. English, K. Lacey, A. Blattmann, T. Dockhorn, J. Müller, J. Penna, and R. Rombach (2024) SDXL: improving latent diffusion models for high-resolution image synthesis. In International Conference on Learning Representations, B. Kim, Y. Yue, S. Chaudhuri, K. Fragkiadaki, M. Khan, and Y. Sun (Eds.), Vol. 2024, pp. 1862–1874. Cited by: §2.1.
[21] Y. Qian, E. Bocek-Rivele, L. Song, J. Tong, Y. Yang, J. Lu, W. Hu, and Z. Gan (2026) Pico-banana-400k: a large-scale dataset for text-guided image editing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 37226–37235. Cited by: §3.3, §7.1.
[22] Z. Qian, Z. Chen, Y. Liu, M. Sun, D. Yang, and L. Zhang (2026) SpatialGuard: harness-guided verifiable spatial reasoning for text-to-image generation. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, H. Lee, S. Dev, J. J. Li, and D. Elliott (Eds.), Budapest, Hungary, pp. 15022–15032. External Links: Document, ISBN 979-8-89176-459-0 Cited by: §1, §2.3.
[23] Qwen Team (2026) Qwen3.8-Flash-Next: a new architecture, towards ultimate cost-efficiency. Cited by: §4.1.
[24] Qwen Team (2026) Qwen3.8-Max: a new bar for coding and cowork. External Links: Link Cited by: §3.3.
[25] O. Saha, V. Krs, R. Mech, S. Maji, M. Gadelha, and K. Blackburn-Matzen (2026) 3D space as a scratchpad for editable text-to-image generation. arXiv preprint arXiv:2601.14602. Cited by: §2.3.
[26] T. Seedream, Y. Chen, Y. Gao, L. Gong, M. Guo, Q. Guo, Z. Guo, X. Hou, W. Huang, Y. Huang, et al. (2025) Seedream 4.0: toward next-generatio
Images from the source


