X2Edit Dataset is a comprehensive image editing dataset that covers 14 diverse editing tasks and exhibits substantial advantages over existing open-source datasets including AnyEdit, HQ-Edit, UltraEdit, SEED-Data-Edit, ImgEdit and OmniEdit.
For the relevant data construction scripts, model training and inference scripts, please refer to X2Edit.
| Model | Size |
|---|---|
| Bagel | 502K |
| GPT-4o | 232K |
| Kontext | 2.2M |
| Step1X-Edit | 900K |
| LaMa | 200K |
| OmniConsistency | 250K |
| TextFlux | 280K |
| qwen-image-edit | 2M |
X2Edit-data/
βββ bagel/
β βββ 0/
β βββ 00000.tar
β βββ 000000.1.0.jpg # Original image
β βββ 000000.2.0.jpg # Editing image
β βββ 000000.json # information image
β βββ 000000.txt # Editing instruction
β βββ ......
β βββ 00001.tar
β βββ 00002.tar
β βββ 00003.tar
β βββ 00004.tar
β βββ ......
β βββ 1/
β βββ 2/
β βββ 3/
β βββ 4/
β βββ 5/
β βββ 6/
β βββ 7/
βββ gpt4o/
βββ kontext/
βββ kontext_subject/
βββ lama/
βββ ominiconsistencey/
βββ step1x-edit/
βββ qwen-image-edit-Asian-portrait/
βββ qwen-image-edit-NonAsian-portrait/
βββ textflux/
βββ 0/
βββ 00000.tar
βββ 000000.1.0.jpg # Original image
βββ 000000.1.1.jpg # mask image of text foregroud
βββ 000000.2.0.jpg # Editing image
βββ 000000.json # information image
βββ 000000.txt # Editing instruction
βββ ......
βββ 00001.tar
βββ 00002.tar
βββ 00003.tar
βββ 00004.tar
βββ ......
Each subfolder is named after the model used to construct the data, and each tar file contains about 5,000 sets of data.
{
"caption_en": "string", # English description of the image.
"caption_zh": "string", # Chinese description of the image.
"instruction": "string", # Editing instruction, it could be Chinese or English.
"instruction_zh": "string", # Chinese Editing instruction.
"task": "string", # Editing task type. (e.g., "reasoning", "subject deletion")
"model": "string", # Model for constructing the data. (e.g., "Kontext", "step1x-edit")
"score_7b": "string", # Score of Qwen2.5-7B evaluation. (e.g., "[5, 5]")
"liqe_score": "float", # liqe score of original image.
"liqe_score_edit": "float", # liqe score of editing image.
"liqe_score_clip": "float", # liqe clip score of original image.
"liqe_score_clip_edit": "float", # liqe clip score of editing image.
"aesthetic_score_v2_5": "float", # aesthetic score of original image.
"aesthetic_score_v2_5_edit": "float" , # aesthetic score of editing image.
}
{
"score": "string", # Score of Qwen2.5-72B evaluation.
}
{
"dino": "float", # DINOv2 score between original image and editing image.
"clipI": "float", # CLIP score between original image and editing image.
"clipT": "float", # CLIP score between editing instruction and editing image.
}
{
"instruction_ori": "string", # Chinese description of the image.
"instruction": "string", # Chinese Editing instruction.
"clipT": "float", # CLIP score between faces in original images and editing image.
"dino": "float", # DINOv2 score between faces in original images and editing image.
"confidence_in": "float", # face detection confidence of original images
"confidence_out": "float", # face detection confidence of editing images
"race": "string", # Human race. (e.g., "East Asian")
"race_conf": "float", # The probability of belonging to this human race
}
{
"font": [
[
"SHEIN",
"(43,41) (225,41) (225,79) (43,79)"
]
] # Text box coordinates
}
git lfs install
git clone https://huggingface.co/datasets/OPPOer/X2Edit-Dataset
from torchdata.datapipes.iter import FileOpener
from torchdata.dataloader2 import MultiProcessingReadingService, DataLoader2
def decode(item):
key, value = item
if key.endswith(".txt"):
return key, value.read().decode("utf-8")
if key.endswith(".jpg"):
return key, Image.open(value).convert("RGB")
if key.endswith(".json"):
return key, json.load(value)
def collate_fn(examples):
key = [example["__key__"].split("/")[-1] for example in examples]
jpg1 = [example["1.0.jpg"] for example in examples]
jpg2 = [example["2.jpg"] for example in examples]
json = [example["txt"] for example in examples]
txt = [example["json"] for example in examples]
jpg3 = [example["1.1.jpg"] for example in examples if "1.1.jpg" in example]
return {"jpg1": jpg1,"jpg2": jpg2,"txt": txt, "key": key, "json": json, "jpg3": jpg3}
tar_path = 'X2Edit-data/bagel/0/00000.tar'
rs = MultiProcessingReadingService(num_workers=1)
dataset = FileOpener([tar_name], mode="b").load_from_tar().map(decode).webdataset(). \
batch(1).collate(collate_fn=collate_fn)
dl = DataLoader2(dataset, reading_service=rs)
for obj in tqdm(dl):
for i in range(len(obj["json"])):
json = obj["json"][i]
jpg1 = obj["jpg1"][i]
jpg2 = obj["jpg2"][i]
txt = obj["txt"][i]
if "jpg3" in obj:
jpg3 = obj["jpg3"][i]
FLUX.1-Kontext-dev, Step1X-Edit, Bagel, GPT-4o, LaMa, TextFlux, OmniConsistency.
π If you find our work helpful, please consider citing our paper and leaving valuable stars
@misc{ma2025x2editrevisitingarbitraryinstructionimage,
title={X2Edit: Revisiting Arbitrary-Instruction Image Editing through Self-Constructed Data and Task-Aware Representation Learning},
author={Jian Ma and Xujie Zhu and Zihao Pan and Qirong Peng and Xu Guo and Chen Chen and Haonan Lu},
year={2025},
eprint={2508.07607},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2508.07607},
}
79 commits
1 commits
X2Edit Dataset is a comprehensive image editing dataset that covers 14 diverse editing tasks and exhibits substantial advantages over existing open-source datasets including AnyEdit, HQ-Edit, UltraEdit, SEED-Data-Edit, ImgEdit and OmniEdit.
For the relevant data construction scripts, model training and inference scripts, please refer to X2Edit.
| Model | Size |
|---|---|
| Bagel | 502K |
| GPT-4o | 232K |
| Kontext | 2.2M |
| Step1X-Edit | 900K |
| LaMa | 200K |
| OmniConsistency | 250K |
| TextFlux | 280K |
| qwen-image-edit | 2M |
X2Edit-data/
βββ bagel/
β βββ 0/
β βββ 00000.tar
β βββ 000000.1.0.jpg # Original image
β βββ 000000.2.0.jpg # Editing image
β βββ 000000.json # information image
β βββ 000000.txt # Editing instruction
β βββ ......
β βββ 00001.tar
β βββ 00002.tar
β βββ 00003.tar
β βββ 00004.tar
β βββ ......
β βββ 1/
β βββ 2/
β βββ 3/
β βββ 4/
β βββ 5/
β βββ 6/
β βββ 7/
βββ gpt4o/
βββ kontext/
βββ kontext_subject/
βββ lama/
βββ ominiconsistencey/
βββ step1x-edit/
βββ qwen-image-edit-Asian-portrait/
βββ qwen-image-edit-NonAsian-portrait/
βββ textflux/
βββ 0/
βββ 00000.tar
βββ 000000.1.0.jpg # Original image
βββ 000000.1.1.jpg # mask image of text foregroud
βββ 000000.2.0.jpg # Editing image
βββ 000000.json # information image
βββ 000000.txt # Editing instruction
βββ ......
βββ 00001.tar
βββ 00002.tar
βββ 00003.tar
βββ 00004.tar
βββ ......
Each subfolder is named after the model used to construct the data, and each tar file contains about 5,000 sets of data.
{
"caption_en": "string", # English description of the image.
"caption_zh": "string", # Chinese description of the image.
"instruction": "string", # Editing instruction, it could be Chinese or English.
"instruction_zh": "string", # Chinese Editing instruction.
"task": "string", # Editing task type. (e.g., "reasoning", "subject deletion")
"model": "string", # Model for constructing the data. (e.g., "Kontext", "step1x-edit")
"score_7b": "string", # Score of Qwen2.5-7B evaluation. (e.g., "[5, 5]")
"liqe_score": "float", # liqe score of original image.
"liqe_score_edit": "float", # liqe score of editing image.
"liqe_score_clip": "float", # liqe clip score of original image.
"liqe_score_clip_edit": "float", # liqe clip score of editing image.
"aesthetic_score_v2_5": "float", # aesthetic score of original image.
"aesthetic_score_v2_5_edit": "float" , # aesthetic score of editing image.
}
{
"score": "string", # Score of Qwen2.5-72B evaluation.
}
{
"dino": "float", # DINOv2 score between original image and editing image.
"clipI": "float", # CLIP score between original image and editing image.
"clipT": "float", # CLIP score between editing instruction and editing image.
}
{
"instruction_ori": "string", # Chinese description of the image.
"instruction": "string", # Chinese Editing instruction.
"clipT": "float", # CLIP score between faces in original images and editing image.
"dino": "float", # DINOv2 score between faces in original images and editing image.
"confidence_in": "float", # face detection confidence of original images
"confidence_out": "float", # face detection confidence of editing images
"race": "string", # Human race. (e.g., "East Asian")
"race_conf": "float", # The probability of belonging to this human race
}
{
"font": [
[
"SHEIN",
"(43,41) (225,41) (225,79) (43,79)"
]
] # Text box coordinates
}
git lfs install
git clone https://huggingface.co/datasets/OPPOer/X2Edit-Dataset
from torchdata.datapipes.iter import FileOpener
from torchdata.dataloader2 import MultiProcessingReadingService, DataLoader2
def decode(item):
key, value = item
if key.endswith(".txt"):
return key, value.read().decode("utf-8")
if key.endswith(".jpg"):
return key, Image.open(value).convert("RGB")
if key.endswith(".json"):
return key, json.load(value)
def collate_fn(examples):
key = [example["__key__"].split("/")[-1] for example in examples]
jpg1 = [example["1.0.jpg"] for example in examples]
jpg2 = [example["2.jpg"] for example in examples]
json = [example["txt"] for example in examples]
txt = [example["json"] for example in examples]
jpg3 = [example["1.1.jpg"] for example in examples if "1.1.jpg" in example]
return {"jpg1": jpg1,"jpg2": jpg2,"txt": txt, "key": key, "json": json, "jpg3": jpg3}
tar_path = 'X2Edit-data/bagel/0/00000.tar'
rs = MultiProcessingReadingService(num_workers=1)
dataset = FileOpener([tar_name], mode="b").load_from_tar().map(decode).webdataset(). \
batch(1).collate(collate_fn=collate_fn)
dl = DataLoader2(dataset, reading_service=rs)
for obj in tqdm(dl):
for i in range(len(obj["json"])):
json = obj["json"][i]
jpg1 = obj["jpg1"][i]
jpg2 = obj["jpg2"][i]
txt = obj["txt"][i]
if "jpg3" in obj:
jpg3 = obj["jpg3"][i]
FLUX.1-Kontext-dev, Step1X-Edit, Bagel, GPT-4o, LaMa, TextFlux, OmniConsistency.
π If you find our work helpful, please consider citing our paper and leaving valuable stars
@misc{ma2025x2editrevisitingarbitraryinstructionimage,
title={X2Edit: Revisiting Arbitrary-Instruction Image Editing through Self-Constructed Data and Task-Aware Representation Learning},
author={Jian Ma and Xujie Zhu and Zihao Pan and Qirong Peng and Xu Guo and Chen Chen and Haonan Lu},
year={2025},
eprint={2508.07607},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2508.07607},
}
79 commits
1 commits