MAGPIE: Agentic Multi-Reference Image Generation via Executable Scene Construction
Organizations: School of Artificial Intelligence, Shanghai Jiao Tong University · Peking University · Renmin University of China · KlingAI Research ·
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.
Figures & tables
| Method / Setting | Generation | Editing | Overall | ||||
|---|---|---|---|---|---|---|---|
| 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 |
| Method / Setting | Composition | Distinction | Distinction & Composition | Average | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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 | |||||||||||||
| Method / Setting | Gen. All | Edit. All | Overall |
|---|---|---|---|
| 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 |
| Method / Setting | Gen. Con | Gen. Abs | Gen. All |
|---|---|---|---|
| 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 |
| Constraint | Operational rule |
|---|---|
| Inventory and ownership | Each planned entity has at least one executed mesh with its entity_id_ prefix. Declared contact endpoints must map to meshes of the specified subject and target. |
| Surface contact | For touch , hold , support , and wear , sample vertex-to-surface distances in both directions using bounding volume hierarchies (BVHs). The minimum sampled distance must satisfy , with . Here is the smaller world-space bounding-box diagonal and is the camera-derived world-space size of one render pixel at the contact. |
| Framing | For each frame-required entity, the union of projected mesh bounds must lie within , and no mesh vertex may lie behind the camera. |
| Entity visibility | Cast a ray grid over the clipped projected bounding box. Among rays hitting the entity in isolation, the fraction whose first full-scene hit belongs to that entity must be at least for humans and otherwise. Named head meshes, when present, receive an additional test with thresholds and , respectively. Any part of the same entity counts as visible, including for head tests; zero-hit tests fail. |
| Projected readability | Frame-required entities tagged as humans, animals, or birds must occupy at least , , or of image height, respectively, using clipped projected bounds. |
| Interaction visibility | Contact meshes named as a hand, handle, shaft, or glasses bridge require exact-part visibility of at least : the first scene hit must be that mesh. Nonhuman entities participating in hold require entity visibility of at least . |
| Benchmark | Method / Setting | Plan | Init. | Refine | Synth. | Total |
|---|---|---|---|---|---|---|
| DreamOmni2Bench | Qwen | – | – | – | 77.20 | 77.20 |
| + MAGPIE | 20.65 | 56.32 | 195.20 | 103.01 | 375.18 | |
| FLUX | – | – | – | 60.97 | 60.97 | |
| + MAGPIE | 20.65 | 56.32 | 195.20 | 84.55 | 356.72 | |
| SconeEval | Qwen | – | – | – | 78.50 | 78.50 |
| + MAGPIE | 27.33 | 85.18 | 224.72 | 107.00 | 444.23 |
| Method | COM | DIS | Overall |
|---|---|---|---|
| Qwen-Image-Edit-2511 | 8.21 | 8.23 | 8.22 |
| Budgeted base | 8.59 | 8.50 | 8.54 |
| + MAGPIE | 8.60 | 9.26 | 8.93 |
| FLUX.2-klein-base-9B | 8.20 | 7.93 | 8.07 |
| Budgeted base | 8.48 | 8.36 | 8.42 |
| + MAGPIE | 8.68 | 9.43 | 9.05 |
| Max. rounds | Edit. | Gen. | Overall | Proxy Time (s) |
|---|---|---|---|---|
| 0 | 54.63 | 51.75 | 53.61 | 76.97 |
| 3 | 60.98 | 61.40 | 61.13 | 211.44 |
| 6 | 66.83 | 67.54 | 67.08 | 272.17 |
| Task group | Correct (%) | Minor issue (%) | Major error (%) | Cohen’s | |
|---|---|---|---|---|---|
| Abstract editing | 164 | 92.07 | 7.93 | 0.00 | 0.827 |
| Concrete editing | 41 | 95.12 | 4.88 | 0.00 | 0.787 |
| Abstract generation | 90 | 86.67 | 11.11 | 2.22 | 0.854 |
| Concrete generation | 24 | 100.00 | 0.00 | 0.00 | - |
Image Generation
Image generation studies models that create or edit images from text, examples, layouts, and other structured controls.
See all 520 papers