Skip to main content

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

# Core installation (diffusers, OpenAI, Google GenAI backends)
pip install diffgentor

# Install with all optional backends
pip install "diffgentor[all]"

GPU users: PyPI's default torch package is CPU-only. To use CUDA-enabled PyTorch, add the PyTorch index:

pip install diffgentor --extra-index-url https://download.pytorch.org/whl/cu126

flash-attn: The flash-attn optional dependency requires CUDA compilation. It is recommended to install a pre-built wheel manually:

pip install flash-attn --no-build-isolation

Or download a pre-built wheel from the flash-attention releases.

Option 2: From source (for development)

git clone https://github.com/ruihanglix/diffgentor.git
cd diffgentor
pip install -e ".[all]"

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffgentor-0.1.1.tar.gz (298.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffgentor-0.1.1-py3-none-any.whl (371.9 kB view details)

Uploaded Python 3

File details

Details for the file diffgentor-0.1.1.tar.gz.

File metadata

  • Download URL: diffgentor-0.1.1.tar.gz
  • Upload date:
  • Size: 298.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for diffgentor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cefdbf0e50940fb1452e2f3564d8a2e89f22f4e1202e18b914cbeab9325557ff
MD5 e63c3ed3eb8e60ed195616362d2eee41
BLAKE2b-256 f290a095374223f63be05048ee6ee55f7a04b92ce4834383c565774f4a22b4c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for diffgentor-0.1.1.tar.gz:

Publisher: publish.yml on ruihanglix/diffgentor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diffgentor-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: diffgentor-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 371.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for diffgentor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cfb324f8e50c88eeff7f71fa4c153bd7be4ecf1e43b00606273a9c4d5ae240b0
MD5 a4cab8d1ac0ab9eab426436a04127d5f
BLAKE2b-256 0752f19cb9c215021fda84080825f3efd4a58b231eede1fb403579947628ceed

See more details on using hashes here.

Provenance

The following attestation bundles were made for diffgentor-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ruihanglix/diffgentor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page