OPPOer/X2Edit-Dataset

Dataset

Introduction

20

80 commits

3 linked in READMEs

updated Dec 30, 2025

See the code

README

X2Edit

GitHub Β 

Introduction

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.

News

  • 2025/09/16: We are about to release a dataset constructed by Qwen-Image and Qwen-Image-Edit, with a size of 2 Million. This sub-dataset focuses on subject-driven generation with facial consistency. We employ Qwen-Image to generate the original images, utilize Qwen3 to produce editing instructions, and finally apply Qwen-Image-Edit to edit the images. Furthermore, we employ a face detection model to calculate face detection confidence, and utilize Dino and Clip to compute the degree of facial similarity between original images and editing images. Finally, the data is filtered based on these two metrics.

Dataset Statistics

Data Distribution Constructed by Each Model

ModelSize
Bagel502K
GPT-4o232K
Kontext2.2M
Step1X-Edit900K
LaMa200K
OmniConsistency250K
TextFlux280K
qwen-image-edit2M

Unified Directory Structure

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.

Json Format

Common Fields

{
    "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.
}

Dataset-Specific Fields

step1x-edit

{
    "score": "string", # Score of Qwen2.5-72B evaluation.
}

kontext_subject

{
    "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.
}

qwen-image-edit

{
    "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
}

textflux

{
    "font": [
        [
            "SHEIN",
            "(43,41) (225,41) (225,79) (43,79)"
        ]
    ] # Text box coordinates
}

Usage Guide

Download data

git lfs install
git clone https://huggingface.co/datasets/OPPOer/X2Edit-Dataset

load data

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]

Acknowledgement

FLUX.1-Kontext-dev, Step1X-Edit, Bagel, GPT-4o, LaMa, TextFlux, OmniConsistency.

Citation

🌟 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}, 
}

Contributors

CVPIE

79 commits

majian0318

1 commits

OPPOer/X2Edit-Dataset

Dataset

Introduction

20

80 commits

3 linked in READMEs

updated Dec 30, 2025

See the code

README

X2Edit

GitHub Β 

Introduction

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.

News

  • 2025/09/16: We are about to release a dataset constructed by Qwen-Image and Qwen-Image-Edit, with a size of 2 Million. This sub-dataset focuses on subject-driven generation with facial consistency. We employ Qwen-Image to generate the original images, utilize Qwen3 to produce editing instructions, and finally apply Qwen-Image-Edit to edit the images. Furthermore, we employ a face detection model to calculate face detection confidence, and utilize Dino and Clip to compute the degree of facial similarity between original images and editing images. Finally, the data is filtered based on these two metrics.

Dataset Statistics

Data Distribution Constructed by Each Model

ModelSize
Bagel502K
GPT-4o232K
Kontext2.2M
Step1X-Edit900K
LaMa200K
OmniConsistency250K
TextFlux280K
qwen-image-edit2M

Unified Directory Structure

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.

Json Format

Common Fields

{
    "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.
}

Dataset-Specific Fields

step1x-edit

{
    "score": "string", # Score of Qwen2.5-72B evaluation.
}

kontext_subject

{
    "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.
}

qwen-image-edit

{
    "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
}

textflux

{
    "font": [
        [
            "SHEIN",
            "(43,41) (225,41) (225,79) (43,79)"
        ]
    ] # Text box coordinates
}

Usage Guide

Download data

git lfs install
git clone https://huggingface.co/datasets/OPPOer/X2Edit-Dataset

load data

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]

Acknowledgement

FLUX.1-Kontext-dev, Step1X-Edit, Bagel, GPT-4o, LaMa, TextFlux, OmniConsistency.

Citation

🌟 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}, 
}

Contributors

CVPIE

79 commits

majian0318

1 commits