Instructions to use OmniGen2/OmniGen2-EditScore7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use OmniGen2/OmniGen2-EditScore7B with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("OmniGen2/OmniGen2-EditScore7B", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Improve model card for EditScore: Add comprehensive details and usage
Browse filesThis PR updates the model card to accurately reflect the **EditScore** model, which is a state-of-the-art reward model for instruction-guided image editing, as presented in the paper "[EditScore: Unlocking Online RL for Image Editing via High-Fidelity Reward Modeling](https://huggingface.co/papers/2509.23909)".
Key changes include:
- **Updated Metadata**: Added `pipeline_tag: image-to-image`, `library_name: transformers` (due to the use of a Transformers-compatible backbone model like Qwen-VL-2.5), and relevant `tags` (`reward-model`, `image-editing`) to enhance discoverability and proper integration with the Hugging Face ecosystem.
- **Comprehensive Content**: Replaced the previous `OmniGen2`-focused content with detailed information about `EditScore`, including its abstract, key highlights, links to the paper, project page, and GitHub repository, a clear Python usage example, and citation information, all sourced from the official `EditScore` GitHub repository.
- **Visuals**: Incorporated relevant images from the `EditScore` repository to illustrate its capabilities and benchmark results.
This update ensures the model card accurately describes `EditScore` and provides users with essential information for its understanding and use.
|
@@ -1,89 +1,82 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
|
| 5 |
<p align="center">
|
| 6 |
-
<img src="assets/
|
| 7 |
</p>
|
| 8 |
|
|
|
|
|
|
|
| 9 |
<p align="center">
|
| 10 |
-
<a href="https://vectorspacelab.github.io/
|
| 11 |
-
<a href="https://
|
| 12 |
-
<a href="https://
|
| 13 |
-
<a href="https://
|
| 14 |
-
<a href="https://huggingface.co/
|
| 15 |
-
<a href="https://huggingface.co/datasets/
|
| 16 |
-
<a href="https://huggingface.co/datasets/OmniGen2/X2I2"><img src="https://img.shields.io/badge/Dataset-🤗-yellow" alt="model"></a>
|
| 17 |
</p>
|
| 18 |
|
| 19 |
<h4 align="center">
|
| 20 |
<p>
|
| 21 |
<a href=#-news>News</a> |
|
| 22 |
<a href=#-quick-start>Quick Start</a> |
|
| 23 |
-
<a href=#-
|
| 24 |
-
<a href=#-limitations-and-suggestions>Limitations</a> |
|
| 25 |
-
<a href=#-gradio-demo>Online Demos</a> |
|
| 26 |
<a href=#%EF%B8%8F-citing-us>Citation</a>
|
| 27 |
<p>
|
| 28 |
</h4>
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
## 🔥 News
|
| 31 |
-
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
-
|
| 40 |
-
|
| 41 |
-
-
|
| 42 |
-
- 2025-06-23: We’ve updated our code and HF model—OmniGen2 now runs *without* `flash-attn`. Users can still install it for optimal performance.
|
| 43 |
-
- 2025-06-20: Updated [resource requirements](#-resources-requirement), adding CPU offload support for devices with limited VRAM.
|
| 44 |
-
- 2025-06-16: [Gradio](https://github.com/VectorSpaceLab/OmniGen2?tab=readme-ov-file#-gradio-demo) and [Jupyter](https://github.com/VectorSpaceLab/OmniGen2/blob/main/example.ipynb) is available. Online Gradio Demo: [Demo1](https://9c4426d27c3b9ecbed.gradio.live); [Chat-Demo1](https://0351497834a4d7226c.gradio.live); see more demo links in [gradio section](https://github.com/VectorSpaceLab/OmniGen2?tab=readme-ov-file#-gradio-demo)
|
| 45 |
-
- 2025-06-16: We release **OmniGen2**, a multimodal generation model, model weights can be accessed in [huggingface](https://huggingface.co/OmniGen2/OmniGen2) and [modelscope](https://www.modelscope.cn/models/OmniGen2/OmniGen2).
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
## Introduction
|
| 49 |
-
**OmniGen2** is a powerful and efficient generative model. Unlike OmniGen v1, OmniGen2 features two distinct decoding pathways for text and image modalities, utilizing unshared parameters and a decoupled image tokenizer. OmniGen2 has competitive performance across four primary capabilities:
|
| 50 |
-
|
| 51 |
-
- **Visual Understanding**: Inherits the robust ability to interpret and analyze image content from its Qwen-VL-2.5 foundation.
|
| 52 |
-
- **Text-to-Image Generation**: Creates high-fidelity and aesthetically pleasing images from textual prompts.
|
| 53 |
-
- **Instruction-guided Image Editing**: Executes complex, instruction-based image modifications with high precision, achieving state-of-the-art performance among open-source models.
|
| 54 |
-
- **In-context Generation**: A versatile capability to process and flexibly combine diverse inputs—including humans, reference objects, and scenes—to produce novel and coherent visual outputs.
|
| 55 |
-
|
| 56 |
-
**We will release the training code and dataset. Stay tuned!**
|
| 57 |
-
|
| 58 |
-
Some good cases of OmniGen2:
|
| 59 |
-
<p align="center">
|
| 60 |
-
<img src="assets/teaser.jpg" width="95%">
|
| 61 |
-
<br>
|
| 62 |
-
<em>Demonstrations.</em>
|
| 63 |
-
</p>
|
| 64 |
|
| 65 |
<p align="center">
|
| 66 |
-
<img src="assets/
|
| 67 |
<br>
|
| 68 |
-
<em>
|
| 69 |
</p>
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
<p align="center">
|
| 72 |
-
<img src="assets/
|
| 73 |
<br>
|
| 74 |
-
<em>
|
| 75 |
</p>
|
| 76 |
|
| 77 |
|
| 78 |
-
|
| 79 |
## 📌 TODO
|
| 80 |
-
|
| 81 |
-
-
|
| 82 |
-
-
|
| 83 |
-
- [ ] Integration of diffusers.
|
| 84 |
-
- [x] Training datasets.
|
| 85 |
-
- [ ] Training data construction pipeline.
|
| 86 |
-
- [ ] ComfyUI Demo (**commuity support will be greatly appreciated!**).
|
| 87 |
|
| 88 |
## 🚀 Quick Start
|
| 89 |
|
|
@@ -93,180 +86,88 @@ Some good cases of OmniGen2:
|
|
| 93 |
|
| 94 |
```bash
|
| 95 |
# 1. Clone the repo
|
| 96 |
-
git clone git@github.com:VectorSpaceLab/
|
| 97 |
-
cd
|
| 98 |
|
| 99 |
# 2. (Optional) Create a clean Python environment
|
| 100 |
-
conda create -n
|
| 101 |
-
conda activate
|
| 102 |
|
| 103 |
# 3. Install dependencies
|
| 104 |
# 3.1 Install PyTorch (choose correct CUDA version)
|
| 105 |
-
pip install torch==2.
|
| 106 |
|
| 107 |
# 3.2 Install other required packages
|
| 108 |
pip install -r requirements.txt
|
| 109 |
|
| 110 |
-
#
|
| 111 |
-
|
| 112 |
-
# OmniGen2 runs even without flash-attn, though we recommend install it for best performance.
|
| 113 |
-
pip install flash-attn==2.7.4.post1 --no-build-isolation
|
| 114 |
```
|
| 115 |
|
| 116 |
#### 🌏 For users in Mainland China
|
| 117 |
|
| 118 |
```bash
|
| 119 |
# Install PyTorch from a domestic mirror
|
| 120 |
-
pip install torch==2.
|
| 121 |
|
| 122 |
# Install other dependencies from Tsinghua mirror
|
| 123 |
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
| 124 |
|
| 125 |
-
#
|
| 126 |
-
|
| 127 |
-
# OmniGen2 runs even without flash-attn, though we recommend install it for best performance.
|
| 128 |
-
pip install flash-attn==2.7.4.post1 --no-build-isolation -i https://pypi.tuna.tsinghua.edu.cn/simple
|
| 129 |
```
|
| 130 |
|
| 131 |
---
|
| 132 |
|
| 133 |
-
###
|
| 134 |
-
|
| 135 |
-
```
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
#
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
#
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
```
|
| 148 |
|
| 149 |
---
|
| 150 |
|
| 151 |
-
##
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
[Chat-Demo1](https://0351497834a4d7226c.gradio.live), [Chat-Demo2](https://032160099388d1d10c.gradio.live), [Chat-Demo3](https://cf9f2797e92cfa2767.gradio.live), [Chat-Demo4](https://b87b82fd14215affc2.gradio.live)
|
| 158 |
-
|
| 159 |
-
* **Web Application**: You can also try the self-hosted OmniGen2 web application by visiting [this link](https://genai.baai.ac.cn/) or scanning the QR code below:
|
| 160 |
-
<p align="center">
|
| 161 |
-
<img src="assets/qr-code.PNG" width="30%">
|
| 162 |
-
<br>
|
| 163 |
-
<em> OmniGen2 web.</em>
|
| 164 |
-
</p>
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
<!-- [Available on Hugging Face Spaces 🚀](https://huggingface.co/spaces/Shitao/OmniGen2) -->
|
| 168 |
-
|
| 169 |
-
* **Run Locally**:
|
| 170 |
-
```bash
|
| 171 |
-
# for only generating image
|
| 172 |
-
pip install gradio
|
| 173 |
-
python app.py
|
| 174 |
-
# Optional: Share demo with public link (You need to be able to access huggingface)
|
| 175 |
-
python app.py --share
|
| 176 |
-
|
| 177 |
-
# for generating image or text
|
| 178 |
-
pip install gradio
|
| 179 |
-
python app_chat.py
|
| 180 |
-
```
|
| 181 |
-
|
| 182 |
-
## 💡 Usage Tips
|
| 183 |
-
To achieve optimal results with OmniGen2, you can adjust the following key hyperparameters based on your specific use case.
|
| 184 |
-
- `text_guidance_scale`: Controls how strictly the output adheres to the text prompt (Classifier-Free Guidance).
|
| 185 |
-
- `image_guidance_scale`: This controls how much the final image should resemble the input reference image.
|
| 186 |
-
- **The Trade-off**: A higher value makes the output more faithful to the reference image's structure and style, but it might ignore parts of your text prompt. A lower value (~1.5) gives the text prompt more influence.
|
| 187 |
-
- **Tip**: For image editing task, we recommend to set it between 1.2 and 2.0; for in-context generateion task, a higher image_guidance_scale will maintian more details in input images, and we recommend to set it between 2.5 and 3.0.
|
| 188 |
-
- `max_pixels`: Automatically resizes images when their total pixel count (width × height) exceeds this limit, while maintaining its aspect ratio. This helps manage performance and memory usage.
|
| 189 |
-
- **Tip**: Default value is 1024*1024. You can reduce this value if you encounter memory issues.
|
| 190 |
-
- `max_input_image_side_length`: Maximum side length for input images.
|
| 191 |
-
- `negative_prompt`: Tell the model what you don't want to see in the image.
|
| 192 |
-
- **Example**: blurry, low quality, text, watermark
|
| 193 |
-
- **Tip**: For the best results, try experimenting with different negative prompts. If you're not sure, just use the default negative prompt.
|
| 194 |
-
- `enable_model_cpu_offload`: **Reduces VRAM usage by nearly 50% with a negligible impact on speed**.
|
| 195 |
-
- This is achieved by offloading the model weights to CPU RAM when they are not in use.
|
| 196 |
-
- See: [Model Offloading](https://huggingface.co/docs/diffusers/optimization/memory#model-offloading)
|
| 197 |
-
- `enable_sequential_cpu_offload`: Minimizes VRAM usage to less than 3GB, but at the cost of significantly slower performance.
|
| 198 |
-
- This works by offloading the model in submodules and loading them onto the GPU sequentially as needed.
|
| 199 |
-
- See: [CPU Offloading](https://huggingface.co/docs/diffusers/optimization/memory#cpu-offloading)
|
| 200 |
-
- `cfg_range_start`, `cfg_range_end`: Define the timestep range where CFG is applied. Per this [paper](https://arxiv.org/abs/2404.07724), reducing `cfg_range_end` can significantly decrease inference time with a negligible impact on quality.
|
| 201 |
-
- `scheduler`: Choose between `[euler, dpmsolver++]`. Default is `euler`. For potentially better performance with fewer steps, try `dpmsolver++`.
|
| 202 |
-
- `num_inference_step`: Number of discretization steps for the ODE solver. Default is `50`.
|
| 203 |
-
- `enable_teacache`: Whether or not enable [teacache](https://github.com/ali-vilab/TeaCache) for faster inference.
|
| 204 |
-
- `teacache_rel_l1_thresh`: The threshold for accumulated L1 distance for the timestep embedding-modulated noisy input. It serves as an indicator of whether to cache the model output. You can modify the `teacache_rel_l1_thresh` parameter to achieve your desired trade-off between latency and visual quality. The default value of 0.05 provides approximately a **30% speedup** compared to the baseline. Increasing this value can further reduce latency, but may result in some loss of detail.
|
| 205 |
-
- `enable_taylorseer`: Whether or not enable [taylorseer](https://github.com/Shenyi-Z/TaylorSeer) for faster inference. When enabled, inference speed can improve by up to **2X**, with negligible quality loss compared to the baseline.
|
| 206 |
-
|
| 207 |
-
**Some suggestions for improving generation quality:**
|
| 208 |
-
1. Use High-Quality Images
|
| 209 |
-
- Provide clear images, preferably with a resolution **greater than 512×512 pixels**.
|
| 210 |
-
- Small or blurry inputs will result in low-quality outputs.
|
| 211 |
-
2. Be Specific with Instructions
|
| 212 |
-
- Clearly describe both **what to change** and **how you want it changed**.
|
| 213 |
-
|
| 214 |
-
3. Prioritize English
|
| 215 |
-
The model currently performs best with **English** prompts.
|
| 216 |
-
|
| 217 |
-
4. Change instructions to enhance subject consistency.
|
| 218 |
-
When the generated image does not align well with the input image, you can try the following methods to improve subject consistency:
|
| 219 |
-
- **Use images with larger size, as well as images in which people occupy a larger proportion of the frame.**
|
| 220 |
-
- **Increase the Image Guidance Scale**, for example to 3.0. The trade-off may be slight overexposure or a greasy look in the image.
|
| 221 |
-
- **When using a single input image**, you can try to use the following prompt template: "she/he ..., maintaining her/his facial features, hairstyle, and other attributes."
|
| 222 |
-
- **Increase the parameter--Number of images per prompt** to generate more outputs, giving you a better chance to find one with stronger subject consistency and a more satisfactory result.
|
| 223 |
-
- **Longer prompts generally yield better results than shorter ones.** More detailed descriptions of the scene and character interactions can provide additional benefits.
|
| 224 |
-
|
| 225 |
-
5. For in-context edit (edit based multiple images), we recommend using the following prompt format: "Edit the first image: add/replace (the [object] with) the [object] from the second image. [descripton for your target image]."
|
| 226 |
-
For example: "Edit the first image: add the man from the second image. The man is talking with a woman in the kitchen". The descition for your target image should be as detailed as possible.
|
| 227 |
-
|
| 228 |
-
## 🎨 Fine-tune
|
| 229 |
-
See [fine-tuning](docs/FINETUNE.md) for details.
|
| 230 |
-
|
| 231 |
-
## ❌ Limitations and Suggestions
|
| 232 |
-
The current model sometimes does not follow instructions. You can increase the "Number of images per prompt" to generate multiple images at once, so you can choose the result you are satisfied with, or try different prompts. In our own experience, being as detailed as possible tends to work better.
|
| 233 |
-
|
| 234 |
-
The current model cannot decide the output image size by itself; the default size is 1024×1024. You need to set a specific size if you require a different one. When you input an image, we will set the output size to match the input image (this works best for editing tasks). If you want to modify just one image out of several, you should also set the output size to match the image you want to edit; otherwise, it may lead to low-quality outputs.
|
| 235 |
-
|
| 236 |
-
The in-context generation capability sometimes produces objects that differ from the original ones. Some suggested improvements are: increasing `image_guidance_scale` (it is recommended to set it to 3) can help alleviate this issue; using high-resolution images, increasing the size of the input image, and ensuring that the object to be used occupies a larger proportion of the image; and modifying the prompt. However, there is still a gap compared to GPT-4o.
|
| 237 |
-
|
| 238 |
-
Compared to OmniGen 1.0, although OmniGen 2 has made some improvements, many issues still remain. It may take multiple attempts to achieve a satisfactory result.
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
## 💻 Resources Requirement
|
| 242 |
-
OmniGen2 natively requires an **NVIDIA RTX 3090** or an equivalent GPU with approximately **17GB of VRAM**. For devices with less VRAM, you can enable **CPU Offload** to run the model.
|
| 243 |
-
|
| 244 |
-
**Performance Tip**: To improve inference speed, consider decreasing the `cfg_range_end` parameter. Within a reasonable range, this has a negligible impact on output quality.
|
| 245 |
-
|
| 246 |
-
The following table details the inference performance of OmniGen2 on an **A800 GPU**:
|
| 247 |
-
<p align="center">
|
| 248 |
-
<img src="assets/efficiency.png" width="95%">
|
| 249 |
-
<br>
|
| 250 |
-
<em>Inference Efficiency of OmniGen2.</em>
|
| 251 |
-
</p>
|
| 252 |
|
| 253 |
-
#
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
- [ComfyUI Official](https://comfyanonymous.github.io/ComfyUI_examples/omnigen/)
|
| 257 |
-
- [https://github.com/Yuan-ManX/ComfyUI-OmniGen2](https://github.com/Yuan-ManX/ComfyUI-OmniGen2)
|
| 258 |
-
- [https://github.com/neverbiasu/ComfyUI-OmniGen2](https://github.com/neverbiasu/ComfyUI-OmniGen2)
|
| 259 |
-
- Quantization:
|
| 260 |
-
- [DFloat11, a lossless compression using 11 bits](https://github.com/LeanModels/OmniGen2-DFloat11)
|
| 261 |
|
| 262 |
## ❤️ Citing Us
|
| 263 |
If you find this repository or our work useful, please consider giving a star ⭐ and citation 🦖, which would be greatly appreciated:
|
| 264 |
|
| 265 |
```bibtex
|
| 266 |
-
@article{
|
| 267 |
-
title={
|
| 268 |
-
author={
|
| 269 |
-
journal={arXiv preprint arXiv:
|
| 270 |
year={2025}
|
| 271 |
}
|
| 272 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
pipeline_tag: image-to-image
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- reward-model
|
| 7 |
+
- image-editing
|
| 8 |
---
|
| 9 |
|
| 10 |
<p align="center">
|
| 11 |
+
<img src="assets/logo.png" width="65%">
|
| 12 |
</p>
|
| 13 |
|
| 14 |
+
This repository contains **EditScore**, a series of state-of-the-art open-source reward models (7B–72B) designed to evaluate and enhance instruction-guided image editing. This model is presented in the paper [EditScore: Unlocking Online RL for Image Editing via High-Fidelity Reward Modeling](https://huggingface.co/papers/2509.23909).
|
| 15 |
+
|
| 16 |
<p align="center">
|
| 17 |
+
<a href="https://vectorspacelab.github.io/EditScore"><img src="https://img.shields.io/badge/Project%20Page-EditScore-yellow" alt="project page"></a>
|
| 18 |
+
<a href="https://huggingface.co/papers/2509.23909"><img src="https://img.shields.io/badge/HuggingFace%20Paper-2509.23909-b31b1b.svg" alt="HuggingFace paper"></a>
|
| 19 |
+
<a href="https://arxiv.org/abs/2509.23909"><img src="https://img.shields.io/badge/arXiv%20paper-2509.23909-b31b1b.svg" alt="arxiv"></a>
|
| 20 |
+
<a href="https://github.com/VectorSpaceLab/EditScore"><img src="https://img.shields.io/badge/GitHub%20Repo-EditScore-blue.svg?logo=github&" alt="github repo"></a>
|
| 21 |
+
<a href="https://huggingface.co/collections/EditScore/editscore-68d8e27ee676981221db3cfe"><img src="https://img.shields.io/badge/EditScore-🤗-yellow" alt="model collection"></a>
|
| 22 |
+
<a href="https://huggingface.co/datasets/EditScore/EditReward-Bench"><img src="https://img.shields.io/badge/EditReward--Bench-🤗-yellow" alt="dataset"></a>
|
|
|
|
| 23 |
</p>
|
| 24 |
|
| 25 |
<h4 align="center">
|
| 26 |
<p>
|
| 27 |
<a href=#-news>News</a> |
|
| 28 |
<a href=#-quick-start>Quick Start</a> |
|
| 29 |
+
<a href=#-benchmark-your-image-editing-reward-model>Benchmark Usage</a> |
|
|
|
|
|
|
|
| 30 |
<a href=#%EF%B8%8F-citing-us>Citation</a>
|
| 31 |
<p>
|
| 32 |
</h4>
|
| 33 |
|
| 34 |
+
## Abstract
|
| 35 |
+
Instruction-guided image editing has achieved remarkable progress, yet current models still face challenges with complex instructions and often require multiple samples to produce a desired result. Reinforcement Learning (RL) offers a promising solution, but its adoption in image editing has been severely hindered by the lack of a high-fidelity, efficient reward signal. In this work, we present a comprehensive methodology to overcome this barrier, centered on the development of a state-of-the-art, specialized reward model. We first introduce EditReward-Bench, a comprehensive benchmark to systematically evaluate reward models on editing quality. Building on this benchmark, we develop EditScore, a series of reward models (7B-72B) for evaluating the quality of instruction-guided image editing. Through meticulous data curation and filtering, EditScore effectively matches the performance of learning proprietary VLMs. Furthermore, coupled with an effective self-ensemble strategy tailored for the generative nature of EditScore, our largest variant even surpasses GPT-5 in the benchmark. We then demonstrate that a high-fidelity reward model is the key to unlocking online RL for image editing. Our experiments show that, while even the largest open-source VLMs fail to provide an effective learning signal, EditScore enables efficient and robust policy optimization. Applying our framework to a strong base model, OmniGen2, results in a final model that shows a substantial and consistent performance uplift. Overall, this work provides the first systematic path from benchmarking to reward modeling to RL training in image editing, showing that a high-fidelity, domain-specialized reward model is the key to unlocking the full potential of RL in this domain.
|
| 36 |
+
|
| 37 |
+
## ✨ Highlights
|
| 38 |
+
- **State-of-the-Art Performance**: Effectively matches the performance of leading proprietary VLMs. With a self-ensembling strategy, **our largest model surpasses even GPT-5** on our comprehensive benchmark, **EditReward-Bench**.
|
| 39 |
+
- **A Reliable Evaluation Standard**: We introduce **EditReward-Bench**, the first public benchmark specifically designed for evaluating reward models in image editing, featuring 13 subtasks, 11 state-of-the-art editing models (*including proprietary models*) and expert human annotations.
|
| 40 |
+
- **Simple and Easy-to-Use**: Get an accurate quality score for your image edits with just a few lines of code.
|
| 41 |
+
- **Versatile Applications**: Ready to use as a best-in-class reranker to improve editing outputs, or as a high-fidelity reward signal for **stable and effective Reinforcement Learning (RL) fine-tuning**.
|
| 42 |
+
|
| 43 |
## 🔥 News
|
| 44 |
+
- **2025-09-30**: We release **OmniGen2-EditScore7B**, unlocking online RL For Image Editing via high-fidelity EditScore. LoRA weights are available at [Hugging Face](https://huggingface.co/OmniGen2/OmniGen2-EditScore7B) and [ModelScope](https://www.modelscope.cn/models/OmniGen2/OmniGen2-EditScore7B).
|
| 45 |
+
- **2025-09-30**: We are excited to release **EditScore** and **EditReward-Bench**! Model weights and the benchmark dataset are now publicly available. You can access them on Hugging Face: [Models Collection](https://huggingface.co/collections/EditScore/editscore-68d8e27ee676981221db3cfe) and [Benchmark Dataset](https://huggingface.co/datasets/EditScore/EditReward-Bench), and on ModelScope: [Models Collection](https://www.modelscope.cn/collections/EditScore-8b0d53aa945d4e) and [Benchmark Dataset](https://www.modelscope.cn/datasets/EditScore/EditReward-Bench).
|
| 46 |
+
|
| 47 |
+
## 📖 Introduction
|
| 48 |
+
While Reinforcement Learning (RL) holds immense potential for this domain, its progress has been severely hindered by the absence of a high-fidelity, efficient reward signal.
|
| 49 |
+
|
| 50 |
+
To overcome this barrier, we provide a systematic, two-part solution:
|
| 51 |
+
|
| 52 |
+
- **A Rigorous Evaluation Standard**: We first introduce **EditReward-Bench**, a new public benchmark for the direct and reliable evaluation of reward models. It features 13 diverse subtasks and expert human annotations, establishing a gold standard for measuring reward signal quality.
|
| 53 |
+
|
| 54 |
+
- **A Powerful & Versatile Tool**: Guided by our benchmark, we developed the **EditScore** model series. Through meticulous data curation and an effective self-ensembling strategy, EditScore sets a new state of the art for open-source reward models, even surpassing the accuracy of leading proprietary VLMs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
<p align="center">
|
| 57 |
+
<img src="assets/table_reward_model_results.png" width="95%">
|
| 58 |
<br>
|
| 59 |
+
<em>Benchmark results on EditReward-Bench.</em>
|
| 60 |
</p>
|
| 61 |
|
| 62 |
+
We demonstrate the practical utility of EditScore through two key applications:
|
| 63 |
+
|
| 64 |
+
- **As a State-of-the-Art Reranker**: Use EditScore to perform Best-of-*N* selection and instantly improve the output quality of diverse editing models.
|
| 65 |
+
- **As a High-Fidelity Reward for RL**: Use EditScore as a robust reward signal to fine-tune models via RL, enabling stable training and unlocking significant performance gains where general-purpose VLMs fail.
|
| 66 |
+
|
| 67 |
+
This repository releases both the **EditScore** models and the **EditReward-Bench** dataset to facilitate future research in reward modeling, policy optimization, and AI-driven model improvement.
|
| 68 |
+
|
| 69 |
<p align="center">
|
| 70 |
+
<img src="assets/figure_edit_results.png" width="95%">
|
| 71 |
<br>
|
| 72 |
+
<em>EditScore as a superior reward signal for image editing.</em>
|
| 73 |
</p>
|
| 74 |
|
| 75 |
|
|
|
|
| 76 |
## 📌 TODO
|
| 77 |
+
We are actively working on improving EditScore and expanding its capabilities. Here's what's next:
|
| 78 |
+
- [ ] Release RL training code applying EditScore to OmniGen2.
|
| 79 |
+
- [ ] Provide Best-of-N inference scripts for OmniGen2, Flux-dev-Kontext, and Qwen-Image-Edit.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
## 🚀 Quick Start
|
| 82 |
|
|
|
|
| 86 |
|
| 87 |
```bash
|
| 88 |
# 1. Clone the repo
|
| 89 |
+
git clone git@github.com:VectorSpaceLab/EditScore.git
|
| 90 |
+
cd EditScore
|
| 91 |
|
| 92 |
# 2. (Optional) Create a clean Python environment
|
| 93 |
+
conda create -n editscore python=3.12
|
| 94 |
+
conda activate editscore
|
| 95 |
|
| 96 |
# 3. Install dependencies
|
| 97 |
# 3.1 Install PyTorch (choose correct CUDA version)
|
| 98 |
+
pip install torch==2.7.1 torchvision --extra-index-url https://download.pytorch.org/whl/cu126
|
| 99 |
|
| 100 |
# 3.2 Install other required packages
|
| 101 |
pip install -r requirements.txt
|
| 102 |
|
| 103 |
+
# EditScore runs even without vllm, though we recommend install it for best performance.
|
| 104 |
+
pip install vllm
|
|
|
|
|
|
|
| 105 |
```
|
| 106 |
|
| 107 |
#### 🌏 For users in Mainland China
|
| 108 |
|
| 109 |
```bash
|
| 110 |
# Install PyTorch from a domestic mirror
|
| 111 |
+
pip install torch==2.7.1 torchvision --index-url https://mirror.sjtu.edu.cn/pytorch-wheels/cu126
|
| 112 |
|
| 113 |
# Install other dependencies from Tsinghua mirror
|
| 114 |
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
| 115 |
|
| 116 |
+
# EditScore runs even without vllm, though we recommend install it for best performance.
|
| 117 |
+
pip install vllm -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
|
|
|
| 118 |
```
|
| 119 |
|
| 120 |
---
|
| 121 |
|
| 122 |
+
### 🧪 Usage Example
|
| 123 |
+
Using EditScore is straightforward. The model will be automatically downloaded from the Hugging Face Hub on its first run.
|
| 124 |
+
```python
|
| 125 |
+
from PIL import Image
|
| 126 |
+
from editscore import EditScore
|
| 127 |
+
|
| 128 |
+
# Load the EditScore model. It will be downloaded automatically.
|
| 129 |
+
# Replace with the specific model version you want to use.
|
| 130 |
+
model_path = "Qwen/Qwen2.5-VL-7B-Instruct"
|
| 131 |
+
lora_path = "EditScore/EditScore-7B"
|
| 132 |
+
|
| 133 |
+
scorer = EditScore(
|
| 134 |
+
backbone="qwen25vl", # set to "qwen25vl_vllm" for faster inference
|
| 135 |
+
model_name_or_path=model_path,
|
| 136 |
+
enable_lora=True,
|
| 137 |
+
lora_path=lora_path,
|
| 138 |
+
score_range=25,
|
| 139 |
+
num_pass=1, # Increase for better performance via self-ensembling
|
| 140 |
+
)
|
| 141 |
+
|
| 142 |
+
input_image = Image.open("example_images/input.png")
|
| 143 |
+
output_image = Image.open("example_images/output.png")
|
| 144 |
+
instruction = "Adjust the background to a glass wall."
|
| 145 |
+
|
| 146 |
+
result = scorer.evaluate([input_image, output_image], instruction)
|
| 147 |
+
print(f"Edit Score: {result['final_score']}")
|
| 148 |
+
# Expected output: A dictionary containing the final score and other details.
|
| 149 |
```
|
| 150 |
|
| 151 |
---
|
| 152 |
|
| 153 |
+
## 📊 Benchmark Your Image-Editing Reward Model
|
| 154 |
+
We provide an evaluation script to benchmark reward models on **EditReward-Bench**. To evaluate your own custom reward model, simply create a scorer class with a similar interface and update the script.
|
| 155 |
+
```bash
|
| 156 |
+
# This script will evaluate the default EditScore model on the benchmark
|
| 157 |
+
bash evaluate.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
+
# Or speed up inference with VLLM
|
| 160 |
+
bash evaluate_vllm.sh
|
| 161 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
## ❤️ Citing Us
|
| 164 |
If you find this repository or our work useful, please consider giving a star ⭐ and citation 🦖, which would be greatly appreciated:
|
| 165 |
|
| 166 |
```bibtex
|
| 167 |
+
@article{luo2025editscore,
|
| 168 |
+
title={EditScore: Unlocking Online RL for Image Editing via High-Fidelity Reward Modeling},
|
| 169 |
+
author={Xin Luo and Jiahao Wang and Chenyuan Wu and Shitao Xiao and Xiyan Jiang and Defu Lian and Jiajun Zhang and Dong Liu and Zheng Liu},
|
| 170 |
+
journal={arXiv preprint arXiv:2509.23909},
|
| 171 |
year={2025}
|
| 172 |
}
|
| 173 |
+
```
|