A unified visual generation data synthesis factory supporting multiple backends (diffusers, xDiT, OpenAI API)
Project description
Diffgentor
A unified visual generation data synthesis tool for batch image generation and editing, designed for GenArena evaluation and beyond.
Abstract
Diffgentor is an efficient pipeline for batch image generation using various image generation and editing models. It supports multiple backends including diffusers, OpenAI API, Google GenAI (Gemini), and third-party models like Step1X-Edit, BAGEL, and Emu3.5.
Key features:
- Multiple Backends: diffusers, xDiT (multi-GPU), OpenAI, Google GenAI, and third-party models
- Batch Processing: Efficient batch inference with multi-process/multi-thread support
- GenArena Integration: Generate model outputs for GenArena pairwise evaluation
- Optimization Suite: VAE slicing/tiling, torch.compile, attention backends, and more
Quick Start
Installation
Option 1: pip install
pip install diffgentor
Option 2: From source with third-party models
git clone --recursive https://github.com/ruihanglix/diffgentor.git
cd diffgentor
pip install -e .
The
--recursiveflag initializes git submodules for third-party models (Step1X-Edit, BAGEL, Emu3.5, DreamOmni2, etc.)
Download GenArena Dataset
hf download rhli/genarena --repo-type dataset --local-dir ./data
Generate Images for MultiRef Subset
Example using FLUX.2 [klein] 4B model:
diffgentor edit --backend diffusers \
--model_name black-forest-labs/FLUX.2-klein-4B \
--input ./data/multiref/ \
--output_dir ./output/multiref/FLUX2-klein-4B/
Supported Backends
| Backend | Type | Description |
|---|---|---|
diffusers |
T2I / Editing | HuggingFace diffusers with auto pipeline detection |
xdit |
T2I | Multi-GPU inference with xDiT parallelism |
openai |
T2I / Editing | OpenAI API (GPT-Image, DALL-E) |
google_genai |
T2I / Editing | Google GenAI (Gemini native image models) |
step1x |
Editing | Step1X-Edit model |
bagel |
Editing | ByteDance BAGEL model |
emu35 |
Editing | BAAI Emu3.5 model |
dreamomni2 |
Editing | DreamOmni2 (FLUX.1-Kontext + Qwen2.5-VL) |
flux_kontext_official |
Editing | BFL official Flux Kontext |
hunyuan_image_3 |
Editing | Tencent HunyuanImage-3.0-Instruct |
Documentation
| Document | Description |
|---|---|
| Image Editing Guide | Comprehensive guide for image editing |
| Text-to-Image Guide | Text-to-image generation guide |
| Optimization Guide | Memory and speed optimization |
| Prompt Enhancement | LLM-based prompt enhancement |
| Environment Variables | Configuration via environment variables |
Backend-Specific Guides
- Diffusers Models - Qwen, FLUX, LongCat
- Step1X-Edit - Step1X-Edit v1.0/v1.1
- BAGEL - ByteDance BAGEL
- Emu3.5 - BAAI Emu3.5
- DreamOmni2 - DreamOmni2
- Flux Kontext - BFL official
- HunyuanImage-3.0 - Tencent HunyuanImage
- OpenAI - GPT-Image API
- Google GenAI - Gemini
Environment Variables
Model-specific parameters are configured via DG_* environment variables:
# Step1X-Edit
DG_STEP1X_VERSION=v1.1
DG_STEP1X_SIZE_LEVEL=512
# BAGEL
DG_BAGEL_CFG_TEXT_SCALE=3.0
DG_BAGEL_CFG_IMG_SCALE=1.5
# API backends
OPENAI_API_KEY=your_key
GEMINI_API_KEY=your_key
See Environment Variables for the complete list.
Citation
@misc{li2026genarenaachievehumanalignedevaluation,
title={GenArena: How Can We Achieve Human-Aligned Evaluation for Visual Generation Tasks?},
author={Ruihang Li and Leigang Qu and Jingxu Zhang and Dongnan Gui and Mengde Xu and Xiaosong Zhang and Han Hu and Wenjie Wang and Jiaqi Wang},
year={2026},
eprint={2602.06013},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2602.06013},
}
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diffgentor-0.1.0.tar.gz.
File metadata
- Download URL: diffgentor-0.1.0.tar.gz
- Upload date:
- Size: 383.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29c0faa46dd48ad5c156fc05cef55b44a8b6856ccd085f389b5475c2f318a7fc
|
|
| MD5 |
b33a8d072fa2046de7e2d1656ac92d00
|
|
| BLAKE2b-256 |
57f3bbce121d153b4ef50b8d24f8e0c6d54296d3afa337ba81945e05e5472605
|
Provenance
The following attestation bundles were made for diffgentor-0.1.0.tar.gz:
Publisher:
publish.yml on ruihanglix/diffgentor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffgentor-0.1.0.tar.gz -
Subject digest:
29c0faa46dd48ad5c156fc05cef55b44a8b6856ccd085f389b5475c2f318a7fc - Sigstore transparency entry: 928420285
- Sigstore integration time:
-
Permalink:
ruihanglix/diffgentor@1d10f17cd30751de7dc3e3ac0910125a84c17f39 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ruihanglix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1d10f17cd30751de7dc3e3ac0910125a84c17f39 -
Trigger Event:
push
-
Statement type:
File details
Details for the file diffgentor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: diffgentor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 132.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
991565e7aea113fcb7929fb3f7fff230c1fabf963e426bc30bbfafe63ece67fe
|
|
| MD5 |
66e5f0b197911d977ab85175ed8f8546
|
|
| BLAKE2b-256 |
63658884a6fac3b09f8a48cdc734061a6a84cf3e457dc752b709e791517cb255
|
Provenance
The following attestation bundles were made for diffgentor-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ruihanglix/diffgentor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffgentor-0.1.0-py3-none-any.whl -
Subject digest:
991565e7aea113fcb7929fb3f7fff230c1fabf963e426bc30bbfafe63ece67fe - Sigstore transparency entry: 928420286
- Sigstore integration time:
-
Permalink:
ruihanglix/diffgentor@1d10f17cd30751de7dc3e3ac0910125a84c17f39 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ruihanglix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1d10f17cd30751de7dc3e3ac0910125a84c17f39 -
Trigger Event:
push
-
Statement type: