Datasets:
subset stringclasses 5
values | image imagewidth (px) 1.18k 1.66k | edit_instruction_en stringlengths 14 288 | rationale_short_en stringlengths 38 289 | edit_instruction stringlengths 4 96 | rationale_short stringlengths 11 118 |
|---|---|---|---|---|---|
physical | Fill the glass with orange juice | If surface tilt or distorted refraction appears, perspective inconsistency occurs. | 将玻璃杯内装满橙汁 | 若液面倾斜或折射异常,将透视与折射逻辑错误。 | |
physical | Fill the glass with cola | If surface tilt or distorted refraction appears, perspective inconsistency occurs. | 将玻璃杯内装满可乐 | 若液面倾斜或折射异常,将透视与折射逻辑错误。 | |
physical | Fill the glass with white water | If surface tilt or distorted refraction appears, perspective inconsistency occurs. | 将玻璃杯内装满白水 | 若液面倾斜或折射异常,将透视与折射逻辑错误。 | |
physical | Fill the glass with beer | If surface tilt or distorted refraction appears, perspective inconsistency occurs. | 将玻璃杯内装满啤酒 | 若液面倾斜或折射异常,将透视与折射逻辑错误。 | |
physical | Change to a nighttime scene without rain. | If the reflection in the water pit is still blurry, the light reflection logic is incorrect. | 改为未下雨的夜晚场景。 | 若水坑反射仍模糊,则光反射逻辑出错。 | |
physical | Change the shooting angle to a high-angle overhead | If table legs distort or vanishing lines misalign, perspective-geometry error occurs. | 将拍摄视角改为高视角俯拍 | 若桌腿比例失真或消失点错误,将透视逻辑不符。 | |
physical | Change the shooting angle to a flat, eye-level perspective | If table legs distort or vanishing lines misalign, perspective-geometry error occurs. | 将拍摄视角改为平视角平拍 | 若桌腿比例失真或消失点错误,将透视逻辑不符。 | |
physical | Change the woman's feet to be lifted out of the water | If either foot touches the water or there are still ripples on the water surface, the physical contact is not met. | 将女子双脚改为抬出水面 | 若双脚仍接触水面或者水面仍有波纹,则物理接触不符。 | |
physical | Change the woman's feet to be gently submerged in water | If foot not submerged or ripples mismatch contact point, physical contact is not met. | 将女子双脚改为轻轻浸入水中 | 若脚未浸或波纹不符合接触点,将物理接触不符。 | |
physical | Change the time to evening | If the light is still bright or the shadows remain unchanged, it contradicts physical reality, | 将时间改为傍晚 | 若光线仍明亮或影子仍保持不变,则与物理现实不符 | |
physical | Change the skier from a double-ski skier to a snowboarder | If the skier's feet remain in the same position or cross, it contradicts physical reality. | 将双板滑雪者改为单板滑雪者 | 若滑雪者双脚位置没有变化或交错则与物理现实不符 | |
physical | Change the snowboarding to a skier | If the skier's feet remain in the same position or cross, it contradicts physical reality. | 将单板滑雪者改为双板滑雪者 | 若滑雪者双脚位置没有变化或交错则与物理现实不符 | |
physical | Change the bonfire to an extinguished state. | If the water surface fire reflection remains unchanged, it contradicts the physical law. | 将篝火改为熄灭状态。 | 若水面的火光反射没有变化则不符合物理规律 | |
physical | Move the bonfire to the right side of the image | If the water surface fire reflection remains unchanged, it contradicts the physical law. | 将篝火移动到画面右侧 | 若水面的火光反射没有变化则不符合物理规律 | |
physical | Change the shooting angle to a straight-on view of the building on the left side of the frame | If reflection content stays identical, mirror-physics mismatch occurs. | 将拍摄角度改成画面建筑左侧正视角正拍 | 若反射内容角度未变,将视角与镜像逻辑不符。 | |
physical | Change the shooting angle to a straight-on view from the right side of the building in the frame | If reflection content stays identical, mirror-physics mismatch occurs. | 将拍摄角度改成画面建筑右侧正视角正拍 | 若反射内容角度未变,将视角与镜像逻辑不符。 | |
physical | Change the light source from the left side to the top side | If the highlight is still on the left side or the shadow direction is still facing the right, then the lighting direction is physically incorrect. | 将光源从左侧照射改为从上方照射 | 若高光仍在左侧或者影子方向仍朝向右方,则光照方向物理错误。 | |
physical | Change the light source from the left side to the right side | If the highlight is still on the right side or the shadow direction is still facing the right, then the lighting direction is physically incorrect. | 将光源从左侧照射改为从右侧照射 | 若高光仍在右侧或者影子方向仍朝向右方,则光照方向物理错误。 | |
physical | Modify to a scene of a successful slam dunk | If the body posture remains unchanged, it contradicts the physical trend. | 修改为灌篮成功的场景 | 若人物姿态未发生变化,则不符合物理趋势。 | |
physical | Change the camera angle to an upward view | If the view perspective remains unchanged, it contradicts the physical trend. | 将画面视角改为仰视 | 若视角未发生变化,则不符合物理趋势。 | |
physical | Change the view angle to top-down | If the view perspective remains unchanged, it contradicts the physical trend. | 将画面视角改为俯视 | 若视角未发生变化,则不符合物理趋势。 | |
physical | Change the vase to an oval opaque vase | If the shadow shape of the vase has not changed, it contradicts the scene. | 将花瓶改为椭圆不透明的花瓶 | 若花瓶的影子形状并未发生对应的变化则不符合场景 | |
physical | Change the vase into a square vase | If the shadow shape of the vase has not changed, it contradicts the scene. | 将花瓶改为正方形花瓶 | 若花瓶的影子形状并未发生对应的变化则不符合场景 | |
physical | Change the bouquet in the vase to a single rose | If the shadow shape of the vase has not changed, it contradicts the scene. | 将花瓶中的花束改为单独一朵玫瑰花 | 若花束的影子形状并未发生对应的变化则不符合场景 | |
physical | Change the vase to a square opaque vase, and change the bouquet to a single rose. | If the shadow shape of the vase has not changed, it contradicts the scene. | 将花瓶改为正方形不透明的花瓶,花束改为单独一朵玫瑰花 | 若花束的影子形状并未发生对应的变化则不符合场景 | |
physical | Change the vase to an oval opaque vase, and change the bouquet to a single rose. | If the shadow shape of the vase has not changed, it contradicts the scene. | 将花瓶改为椭圆不透明的花瓶,花束改为单独一朵玫瑰花 | 若花束的影子形状并未发生对应的变化则不符合场景 | |
physical | Modify the scene to show waves crashing onto the sandy beach | If the boat floats or loses ground contact, support-consistency error occurs. | 将画面修改为海浪涌上沙滩 | 若沙滩上的反光未变化则不合理。 | |
physical | Change the door to open outward | If the shadow on the ground has not changed, it contradicts the physical law. | 将门改为向外打开 | 若地面影子并为发生变化,则不符合物理规律 | |
physical | Change the door to open inward | If the shadow on the ground has not changed, it contradicts the physical law. | 将门改为向内打开 | 若地面影子并为发生变化,则不符合物理规律 | |
physical | Fill the glass with red wine | If the metal fork is still visible through the cup, it does not conform to the physical perspective law. | 将玻璃杯中装满红酒 | 若杯中仍能看到透视的金属叉子,则不符合物理透视规律 | |
physical | Fill the glass with red wine | If the transparent wooden chopsticks can still be seen in the cup, it does not conform to the physical light laws. | 将玻璃杯中装满红酒 | 若杯中仍能看到透视的木质筷子,则不符合物理光绪规律 | |
physical | Change the scene to show wind blowing | If reflections remain still, reflection-physics inconsistency occurs. | 将画面改为起风了 | 若倒影静止或形变方向错,将反射物理不符。 | |
physical | Modify the scene to a windless environment | The lake surface should return to calm, and the tree reflections should no longer be distorted. | 将画面修改为无风环境 | 湖面应恢复平静,树木倒影不再扭曲 | |
physical | Modify to a windless scene | If the fabric still moves, it contradicts the physical law. | 修改为无风场景 | 若衣角仍然飘起,则不符合物理规律 | |
physical | Change the scene to show the train departing from the platform | If the track is still bright, it does not conform to physical laws | 将画面改为列车驶离火车月台后的场景 | 若轨道仍亮,则不符合物理规律 | |
physical | Change to cyclists riding a bicycle uphill | If shadow direction conflicts, illumination-logic mismatch occurs. | 改为骑行者骑着自行车上坡 | 若阴影朝向混乱,将照射方向逻辑不符。 | |
physical | Change the white bed to a yellow bed. | If reflection unchanged, mirror-geometry inconsistency occurs. | 将白色床铺变为黄色床铺。 | 若镜中未变,将反射一致性错误。 | |
physical | Change the wooden shelf to a glass shelf | If the glass shelf has no correct perspective effect, it does not conform to physical laws. | 将木质架改为玻璃架 | 若修改后的玻璃架无正确透视效果,则不符合物理逻辑 | |
physical | Change the time to noon 12 o'clock | If shadows stay unchanged, illumination-logic inconsistency occurs. | 将时间改为正午12点 | 若阴影未随太阳位置变化,将光照逻辑错误。 | |
physical | Change the glass table to a wooden tabletop | If the reflection still exists, it does not conform to the physical laws | 将玻璃桌改为木质桌面 | 若反射仍然存在,则不符合物理规律 | |
physical | Change the glass table to a stone tabletop | If the reflection still exists, it does not conform to the physical laws | 将玻璃桌改为石质桌面 | 若反射仍然存在,则不符合物理规律 | |
physical | Change the wooden table to a glass tabletop | If there is no corresponding reflection content, it does not conform to the physical laws | 将木头桌改为玻璃桌面 | 若无对应反射内容,则不符合物理 | |
physical | Change the stone table to a glass tabletop | If there is no corresponding reflection content, it does not conform to the physical laws | 将石头桌改为玻璃桌面 | 若无对应反射内容,则不符合物理 | |
physical | Remove the umbrella held by the pedestrian | If water accumulation still exists as the umbrella's reflection, it does not conform to physics. | 去除行人手中的伞 | 若积水仍存在伞的倒影,则不符合物理。 | |
physical | Change the sky to overcast with thick clouds | If the water accumulation does not correspond to the reflection of the overcast sky, it does not conform to the physical laws. | 将天空改为阴云密布 | 若积水只未对应出现阴云的倒影,则不符合物理规律 | |
physical | Turn off the light source on the left | If the shadow does not change accordingly, it does not conform to the physical laws. | 关闭左侧灯源 | 若影子未发生对应的变化,则物理不符 | |
physical | Change the spotlight to shine from the left toward the skateboarder | If the shadow direction does not change accordingly, it does not conform to the physical laws. | 将聚光灯改为从左侧照向滑板少年 | 若影子方向未发生对应的变化,则物理不符 | |
physical | Change the spotlight to shine from the right toward the skateboarder | If the shadow direction does not change accordingly, it does not conform to the physical laws. | 将聚光灯改为从右侧照向滑板少年 | 若影子方向未发生对应的变化,则物理不符 | |
physical | Change the time to evening | If bed shadow stays centered, illumination-geometry mismatch occurs. | 将时间改为傍晚时分 | 若床阴影仍在原处,将光投射逻辑错误。 | |
physical | Turn off the streetlights | If ground remains lit, energy-decay inconsistency occurs. | 关闭路灯 | 若亮区仍存在,将能量传播逻辑错误。 | |
physical | Add two elderly people sitting on a park bench | If the shadow of the ground does not change, it does not conform to the physical laws. | 添加两位老人坐在公园长椅上 | 若地面的影子未发生变化,则物理不符 | |
physical | Adjust to a flat-angle shot | If proportions distort, perspective-geometry mismatch occurs. | 调整为平视角拍摄 | 若水果尺寸不合或透视塌陷,将比例逻辑错误。 | |
physical | Change to noon lighting | If direction unchanged, solar-time inconsistency occurs. | 改为正午光照 | 若光线角度未变,将时间光学逻辑错误。 | |
physical | Change the glass bottle to a wooden bottle | If there is still reflective light on the bottle surface, it does not meet | 将玻璃瓶均修改为木质瓶 | 若瓶面仍有反射光,则不符 | |
physical | Turn off the bus headlights | If there is still light on the road surface, it is physically inconsistent. | 关闭公交车车灯 | 若马路地面仍有光线,则物理不符 | |
physical | Turn off the bus headlights | If there is still light on the road surface, it is physically inconsistent. | 关闭公交车车灯 | 若马路地面仍有光线,则物理不符 | |
physical | Change the bus headlight color to white | If the color of the light mapped by the road does not change, it does not conform to the laws of physics. | 将公交车车灯颜色改为白色 | 若马路映射的光线颜色未变,则不符合物理规律 | |
physical | Change the bus headlight color to yellow | If the color of the light mapped by the road does not change, it does not conform to the laws of physics. | 将公交车车灯颜色改为黄色 | 若马路映射的光线颜色未变,则不符合物理规律 | |
physical | Change the camera angle to a right-side view | If the shadow is inconsistent with the light source, it is not physically consistent. | 将相机角度改为右侧面视角拍摄 | 若影子与光源不一致,则物理不符合。 | |
physical | Change the camera angle to a left-side view shot | If the shadow is inconsistent with the light source, it is not physically consistent. | 将相机角度改为左侧面视角拍摄 | 若影子与光源不一致,则物理不符合。 | |
physical | Change the glass windows inside the office into walls | If the internal light remains unchanged, it does not conform to the laws of physics. | 将办公室内部的玻璃窗户修改为墙壁 | 若内部光线仍保持不变,则不符合物理规律 | |
physical | Increase the speed to running. | The blur of the legs should be increased. | 将速度加快为快跑。 | 双腿的模糊程度应增加。 | |
physical | Increase the exposure time to make the light trails longer and brighter | If trail length or brightness does not increase, optical-exposure inconsistency occurs. | 延长曝光时间使光轨变长且更亮 | 若光轨长度或亮度未增加,将摄影光学逻辑错误。 | |
physical | Change the wind direction to blow from the left | If the sail still bulges to the original side, aerodynamic logic is inconsistent. | 将风向改为从左侧吹来 | 若帆仍朝原方向鼓起,将气动力逻辑错误。 | |
physical | Change the wind direction to blow from the right | If the sail still bulges to the original side, aerodynamic logic is inconsistent. | 将风向改为从右侧吹来 | 若帆仍朝原方向鼓起,将气动力逻辑错误。 | |
physical | Change the desktop to a glossy polished material | If no specular highlights appear, material-light interaction is inconsistent. | 将桌面改为高光抛光材质 | 若仍无高光反射,将材质能量逻辑错误。 | |
physical | Change to direct sunlight on a sunny day | If highlights are still absent, illumination logic is incorrect. | 改为晴天直射阳光 | 若仍无亮斑,将光照条件逻辑错误。 | |
physical | Let the paddle go deep into the water and create splashes | If the surface remains calm, motion-phase inconsistency occurs. | 让桨深入水中并激起水花 | 若水面仍平静,将动作阶段逻辑错误。 | |
physical | Change to the stage where the ball rises after being hit | If the ball still touches the floor, motion-phase logic error occurs. | 改为球被击中后上升阶段 | 若球仍触地,将运动阶段逻辑错误。 | |
physical | Change the fountain to a high-pressure state, with the water jet rising higher and expanding its scattering range. | If the column remains short, kinetic-energy logic is inconsistent. | 将喷泉改为高喷状态,水柱升得更高且散射范围扩大。 | 若水柱仍过低,将动能逻辑不符。 | |
physical | Change the cup to transparent glass material | If only reflection remains without refraction, optical-material mismatch occurs. | 将杯改为透明玻璃材质 | 若仍仅反射无折射,将材质光学逻辑错误。 | |
physical | Change to the hiker on a sunlit ridge | If the scene remains dim, illumination-energy logic is incorrect. | 改为登山者位于阳光直射的山脊上 | 若环境仍昏暗,将能量传播逻辑错误。 | |
physical | Change to heavy fog | If beams remain sharp, scattering-physics logic is inconsistent. | 改为浓雾笼罩 | 若光束仍清晰,将散射逻辑错误。 | |
physical | After turning off the light, retain only the faint light from outside the window | If brightness unchanged, illumination-logic mismatch occurs. | 关闭灯后只保留窗外微光 | 若桌面仍强亮,将光源逻辑错误。 | |
physical | Turn on the light | Overall light strain variable, with obvious light and shadow contrast around. | 将灯点亮 | 整体光线应变量,周围有明显的光影对比。 | |
physical | Change the time to early morning. | If shadows remain vertical, solar-angle logic is incorrect. | 将时间改为清晨。 | 若阴影仍垂直,将太阳高度逻辑错误。 | |
physical | Change the time to evening | If shadows remain vertical, solar-angle logic is incorrect. | 将时间改为傍晚时分 | 若阴影仍垂直,将太阳高度逻辑错误。 | |
physical | Change to nighttime artificial lighting | If reflections stay diffused, light-source logic is inconsistent. | 改为夜间人工灯光照明 | 若反射仍柔和,将光源能量逻辑错误。 | |
physical | Change to front-facing sunlight illumination | If lighting remains from behind, illumination-direction logic is wrong. | 改为前向阳光照射 | 若仍背光,将光照方向逻辑错误。 | |
physical | Change the floor material to polished | If no mirror reflection appears, optical-material mismatch occurs. | 将地板改为抛光材质 | 若仍无镜像,将材质光学逻辑错误。 | |
physical | Change to daytime direct sunlight | If shadows remain cool and faint, light-temperature logic fails. | 改为白天阳光直射 | 若阴影仍浅冷,将光源色温逻辑错误。 | |
physical | Change to a calm water scene with no wind | If reflection stays broken, fluid-dynamics logic fails. | 改为无风静水场景 | 若倒影仍破碎,将流体动力逻辑错误。 | |
physical | Change to a bright daylight lighting environment | If reflections stay dim and warm, light-temperature logic is wrong. | 改为白天冷光环境 | 若仍昏黄暗淡,将照明色温逻辑错误。 | |
physical | Change to windmill rotation state | If shadows stay still, motion-physics logic fails. | 改为风车旋转状态 | 若阴影不动,将运动逻辑错误。 | |
physical | Change to an overcast soft light environment | If strong highlights persist, illumination logic fails. | 改为阴天柔光环境 | 若仍强烈高对比,将光照逻辑错误。 | |
physical | Change the neon light to a blue light source | If red hue remains, color-spectrum logic is incorrect. | 将霓虹灯改为蓝色光源 | 若反射仍红,将光谱逻辑错误。 | |
physical | Change the neon light to a green light source | If red hue remains, color-spectrum logic is incorrect. | 将霓虹灯改为绿色光源 | 若反射仍红,将光谱逻辑错误。 | |
physical | Change the neon light to a purple light source | If red hue remains, color-spectrum logic is incorrect. | 将霓虹灯改为紫色光源 | 若反射仍红,将光谱逻辑错误。 | |
physical | Add a second side light to soften the shadow and create a smooth transition. | If shadow remains harsh, multiple-light physics inconsistency occurs. | 添加第二束侧光使影子减弱并形成柔和过渡。 | 若仍强硬单影,将光源逻辑错误。 | |
physical | Change to room temperature coffee | If steam remains, thermal-physics inconsistency occurs. | 改为常温的咖啡 | 若蒸汽仍明显,将热能逻辑错误。 | |
physical | Change to cooled coffee | If steam remains, thermal-physics inconsistency occurs. | 改为冷却后的咖啡 | 若蒸汽仍明显,将热能逻辑错误。 | |
physical | Change the floor to a wooden hard floor | If rebound not higher, material-elasticity logic is wrong. | 将地板改为木质硬地板 | 若弹力不增强,将材质动力学逻辑错误。 | |
physical | Change to fully open glass door | If still dim, occlusion-illumination logic fails. | 改为玻璃门完全敞开 | 若室内仍昏暗,将遮挡逻辑错误。 | |
physical | Change to still air condition | If ripples persist, hydrodynamics logic is inconsistent. | 改为无风状态 | 若仍有波纹,将流体静力逻辑错误。 | |
physical | Change the perspective to a side view under sunset lighting | If color temperature unchanged, perspective-illumination logic fails. | 将视角改为侧面并在日落光照下 | 若色温未变,将反射几何逻辑错误。 | |
physical | Turn on the light strip below the wall cabinet | If shadows stay dark, multi-light interaction logic fails. | 打开吊柜下方灯带 | 若阴影仍浓重,将光源叠加逻辑错误。 | |
physical | Change to snowy ground | If still fully flat, contact-support logic fails. | 改为积雪地面 | 若车仍浮在表面,将支撑逻辑错误。 | |
physical | Change to a sunset scene in the evening | If cool tone persists, atmospheric-light logic fails. | 改为傍晚日落场景 | 若仍冷蓝调,将气象光学逻辑错误。 | |
physical | Change to top vertical lighting | If shadows stay lateral, light-direction logic fails. | 改为顶部垂直光照 | 若阴影仍侧偏,将光源方向逻辑错误。 | |
physical | Add a gentle breeze disturbance. | If mirror remains perfect, motion-fluid logic fails. | 加入微风扰动。 | 若水面仍静止,将动力逻辑错误。 |
Is This Edit Correct? A Multi-Dimensional Benchmark for Reasoning-Aware Image Editing
Yixuan Ding1 · Wei Huang2 · Ruijie Quan1 · Xiaojun Qi2 · Yang Yi1
1ReLER Lab, CCAI, Zhejiang University, Hangzhou, China
2The University of Hong Kong, Hong Kong SAR
🔥 News
- [2026.2.12] 📄 RE-Edit paper released on arXiv.
- [2026.2.12] 📊 RE-Edit benchmark released on huggingface.
- [2026.2.12] 📊 EditRefine model weight released on huggingface.
- More updates coming soon – stay tuned and ⭐ star the repo!
TODO
- Release paper.
- Release RE-Edit benchmark.
- Release EditRefine model weight.
- Release evaluation pipeline & inference repo.
- Release project page.
📖 Abstract
In this work, we introduce RE-Edit, a benchmark for REasoning-aware image Editing that evaluates image editing systems across five complementary reasoning dimensions: physical, environmental, cultural, causal, and referential. RE-Edit comprises 1,000 carefully curated samples, each designed such that visual plausibility alone is insufficient and correct editing requires satisfying implicit logical constraints. We further present a lightweight reasoning-guided post-edit baseline (EditRefine) as an initial exploration, illustrating how inserting explicit reasoning can help mitigate such failures in a model-agnostic manner.

📊 Primary Evaluation on RE-Edit
Representative open-source and commercial editors evaluated on five reasoning dimensions and two general metrics (IF, SC) by Qwen3-VL-30B; Executor-F and Executor-Q denote the FLUX.2 Dev and Qwen-Image-Edit executors, respectively.

🚀 Usage
Project Structure
RE-Edit_EditRefine/
├── README.md # Documentation
├── requirements.txt # Dependencies
├── main.py # RE-Edit Pipeline entry
├── run_editrefine_inference.py # EditRefine Inference entry
│
├── config/ # EditRefine standalone module
│ ├── config_iterative_refinement.yaml # RE-Edit Pipeline config
│ ├── config_editrefine_inference.yaml # EditRefine Inference config
│ └── DIFFUSION_FRAMEWORK_ENV_SUMMARY.md
│
├── editrefine_inference/ # EditRefine standalone module
│ ├── __init__.py
│ ├── config_loader.py
│ └── runner.py
│
└── src/ # Source code
├── pipeline.py
├── iterative_pipeline_v7.py # Pipeline implementation
├── data/ # Data loading
│ ├── benchmark_loader.py
│ ├── iterative_data.py
│ └── data_types.py
├── models/ # Models
│ ├── diffusion/ # Image editing models (11 types)
│ │ ├── base_diffusion.py
│ │ └── implementations/
│ ├── mllm/ # MLLM for analysis cot & re-edit
│ │ ├── base_mllm.py
│ │ └── implementations/
│ └── reward/ # Reward models
│ ├── base_reward.py
│ └── implementations/
├── evaluation/ # Evaluation & reporting
│ ├── scorer.py
│ └── reporter.py
└── utils/ # Utilities
├── image_utils.py
├── logger.py
└── prompt_manager.py
Quick Start
1. Install Dependencies
git clone https://github.com/Yixuan-Ding-ZJU/RE-Edit.git
conda create -n RE-Edit python==3.12
conda activate RE-Edit
cd RE-Edit
pip install -r requirements.txt
2. Download RE-Edit & EditRefine
Download RE-Edit:
hf download Yixuan-Ding-ZJU/RE-Edit --repo-type dataset
After downloading, locate RE-Edit.json in the downloaded directory (typically datasets--Yixuan-Ding-ZJU--RE-Edit/RE-Edit.json) and fill the path into config/config_iterative_refinement.yaml → data-path.
Download EditRefine:
hf download Yixuan-Ding-ZJU/EditRefine
Fill the downloaded path into config/config_iterative_refinement.yaml → mllm.
3. RE-Edit Pipeline (Full Evaluation)
# Edit config to select model & settings
nano config/config_iterative_refinement.yaml
# Run evaluation
python main.py --config config/config_iterative_refinement.yaml --mode iterative
4. EditRefine Standalone Inference (Single Image)
python run_editrefine_inference.py \
--editrefine-config config/config_editrefine_inference.yaml \
--image /path/to/image.png \
--instruction "Add a red hat"
RE-Edit Pipeline
Full evaluation pipeline for RE-Edit benchmark with 5 stages.
Pipeline Stages
| Stage | Description |
|---|---|
| Stage 1 | Primary Editing: initial edit with target diffusion model |
| Stage 2 | EditRefine Reasoning Agent: analyze result, generate CoT reasoning & re-edit instruction |
| Stage 3 | EditRefine Executor Engine: refine with re-edit instruction |
| Stage 4 | Comparative Scoring: evaluate both primary & refined images |
| Stage 5 | Statistics: aggregate metrics & generate report |
Key Configuration
Evaluation Settings:
evaluation:
output_dir: "./results_iterative"
save_images: true
primary_images_dir: null # Skip Stage 1 if non-empty , load primary image from dir
primary_image_suffix: "_primary.png"
skip_stage4: false # Skip scoring if true
############################# Key Point #############################
skip_refinement: false # Skip EditRefine (Stage 2-3) if true, just perform evaluation of specific image edit model on RE-Edit
Diffusion Models (11 types supported, detailed see config/DIFFUSION_FRAMEWORK_ENV_SUMMARY.md):
diffusion_model:
primary: # Model under evaluation
type: step1x_edit_v1p1 # Options: multi_gpu_qwen_edit, flux2_dev,
# step1x_edit_v1p1, step1x_edit_v1p2_preview,
# janus, ovis_u1, hidream_e1, omnigen2,
# flux_kontext, dreamomni2, qwen_image_edit_2511
params:
model_name: "/path/to/model"
device_ids: [0, 1, 2, 3]
seed: 42
num_inference_steps: 28
refinement: # Fixed two EditRefine Executor Engines
type: multi_gpu_qwen_edit
params:
model_name: "/path/to/qwen-edit"
device_ids: [0, 1, 2, 3]
seed: 42
num_inference_steps: 1
MLLM (Reasoning Agent):
mllm:
type: qwen25_vl
params:
model_name: "/path/to/qwen2.5-vl"
device: "auto"
batch_size: 16
max_new_tokens: 512
Reward Model (vLLM recommended for speed):
reward_model:
type: qwen3_vl_vllm_subprocess
params:
model_name: "/path/to/Qwen3-VL-30B"
tensor_parallel_size: 4 # Must be divisor of 32 (attn heads)
batch_size: 8
conda_env: "yx_vllm"
timeout: 1200
EditRefine Standalone Inference
Single-image inference: Image + Instruction → Primary Edit → EditRefine Reasoning Agent Analysis → EditRefine Execution Engine One-step Refinement → Save 4 outputs.
Features
- Config:
config_editrefine_inference.yamlreferencesbase_config: config_iterative_refinement.yaml(reusesdiffusion_model,mllm) - Outputs: 4 files per run
{prefix}_primary.png- primary edited image{prefix}_refined.png- refined edited image by EditRefine{prefix}_cot.txt- chain-of-thought reasoning{prefix}_re_edit.txt- re-edit instruction
- Module:
editrefine_inference/(config_loader,runner)
Usage
With Custom Output:
python run_editrefine_inference.py \
--editrefine-config config/config_editrefine_inference.yaml \
--image img.png \
--instruction "Change the sky to sunset" \
--output-dir ./my_output \
--output-prefix experiment_01
Optional Arguments:
--output-dir- overrideeditrefine.output_dirin config--output-prefix- output filename prefix (default: "editrefine")
How to Switch Image Edit Model
Edit config/config_iterative_refinement.yaml and uncomment desired model in diffusion_model.primary section. 11 models supported (see config/DIFFUSION_FRAMEWORK_ENV_SUMMARY.md for environment requirements).
Configuration Reference
Diffusion Models
11 models supported:
multi_gpu_qwen_edit- Qwen-Image-Editqwen_image_edit_2511- Qwen-Image-Edit-2511step1x_edit_v1p1- Step1X-Edit v1p1step1x_edit_v1p2_preview- Step1X-Edit v1p2flux_kontext- FLUX.1-Kontextflux2_dev- FLUX.2-devjanus- Janus-4o-7Bovis_u1- Ovis-U1-3Bhidream_e1- HiDream-E1.1omnigen2- OmniGen2dreamomni2- DreamOmni2
Evaluation Metrics
Control which metrics to evaluate:
evaluation:
enable_sc_metric: true # Semantic Consistency
enable_instruction_following_metric: true # Instruction Following
enable_primary_scoring: true # Score primary images (compute improvement_rate)
Extension Guide
Add New Diffusion Model
- Create implementation in
src/models/diffusion/implementations/ - Inherit from
BaseDiffusionModel - Implement
edit_image()and optionallybatch_edit() - Register in
iterative_pipeline_v7.pyloaders - Add config template to
config/config_iterative_refinement.yaml
Add New Reward Model
- Create implementation in
src/models/reward/implementations/ - Inherit from
BaseRewardModel - Implement
score()method - Register in pipeline loader
License
MIT License
- Downloads last month
- 44