Skip to content
Projets

À propos

[ECCV 2026] Official repository of FlowInOne: Unifying Multimodal Generation as Image-In Image-Out Flow Matching

Design et médias

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
-1
in 15 days
-1
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original
Logo

FlowInOne: Unifying Multimodal Generation as Image-in, Image-out Flow Matching

TL;DR: The first vision-centric image-in, image-out image generation model.

Junchao Yi1*, Rui Zhao3*, Jiahao Tang2*, Weixian Lei3, Linjie Li6,
Qisheng Su4, Zhengyuan Yang6, Lijuan Wang6, Xiaofeng Zhu1†, Alex Jinpeng Wang2†

1 University of Electronic Science and Technology of China,   2 Central South University
3 National University of Singapore,   4 University of Science and Technology of China,   5 Microsoft

🌐 Homepage | 💻 Code | 📄 Paper | 📁 Dataset | 🌏 Benchmark | 🤗 Model

📢 News

  • [2026-6-18]: FlowInOne accepted by ECCV 2026💥
  • [2026-4-8]: FlowInOne has been officially released! 🎉 🎉 🎉

📑 Table of Contents

🌟 Project Overview

Fig 1. Overview of the FlowInOne. We unify the conditions as visual input and form a simple image-in, image-out framework with a single model.

📊 Dataset Overview

Fig 2. We construct VisPrompt, a comprehensive dataset that covers wide spectrum of image-to-image generation, ranging from basic text-in-image generation to compositional editing, and further to physics-aware instruction following.

🚀 Setup

  • Environment setup

1. Create conda environment

conda create -n flowinone python=3.10 -y
conda activate flowinone

2. Install required packages

git clone [email protected]:CSU-JPG/FlowInOne.git
cd FlowInOne/scripts
sh setup.sh
  • Model preparation Training the model requires downloading the Stable Diffusion VAE, along with the visual encoder of Janus-Pro-1B and other components . For your convenience, all necessary models can be downloaded directly from here

✨Inference

1. Download the pretrained checkpoint from Hugging Face

mkdir -p checkpoints
wget -O checkpoints/flowinone_256px.pth https://huggingface.co/CSU-JPG/FlowInOne/resolve/main/flowinone_256px.pth

2. Open scripts/inference.sh and directly modify these variables as needed:

  • NNET_PATH: path to the downloaded checkpoint
  • INPUT_IMAGE: input image folder (supports both relative and absolute paths)
  • OUTPUT_IMAGE: output image folder (supports both relative and absolute paths)
  • CONFIG_FILE: config file path
  • CFG_SCALE: classifier-free guidance scale (default: 7.0)
  • SAMPLE_STEPS: sampling steps (default: 50)
  • SKIP_CROSS_ATTEN: whether to skip spatially-adaptive gated network and cross attention, if you task is text2image, please set ture (true/false, default: false)
  • BATCH_SIZE: batch size during inference (default: 1)

3. Run inference with the provided script:

sh scripts/inference.sh

⏳Training FlowInOne for I2I

Training data preparation

You can either:

Download and use our dataset from Hugging Face: VisPrompt5M, or prepare your own image-pair dataset.

For custom data, organize files with paired input/ and output/ folders. Each sample must have a matching relative path/name in input and output (extension can be .png/.jpg/.jpeg):

your_source_root/
  subset_a/
    input/
      0001.png
      group1/0002.jpg
    output/
      0001.png
      group1/0002.jpg
  subset_b/
    input/
      xxx.jpeg
    output/
      xxx.jpeg

Then pack the dataset into WebDataset tar shards using scripts/wds_organize/run_unified_to_tars.sh:

  1. Open scripts/wds_organize/run_unified_to_tars.sh and modify:
  • --root: your source dataset root (the folder containing paired input/ and output/)
  • --tar-dir: output folder for generated tar shards
  • --samples-per-shard: number of samples in each tar shard (e.g., 600)
  • --key-prefix: prefix of each sample __key__ written into tar (e.g., t2i)
  • --data-type: only for text-to-image (T2I) packs, set t2i so each sample gets a type field; for any other task, omit this flag and use the script default (no type field written)
  • --read-workers: number of worker processes for image reading/packing (larger is faster but uses more CPU/RAM)

When to use --key-prefix and --data-type:

  • --key-prefix is useful when you merge multiple tar datasets and want globally distinguishable sample keys (for example, t2i_, c2i_, edit_).
  • If you only build one dataset and do not rely on key naming conventions, you can keep the default value.
  • --data-type: use **t2i only** when packing a text-to-image dataset. For editing or other tasks, do not pass --data-type (remove it from run_unified_to_tars.sh if present); the default behavior is sufficient.
  1. Run:
sh scripts/wds_organize/run_unified_to_tars.sh

After packing, tar shards like pairs-000000.tar, pairs-000001.tar will be written to --tar-dir.

Data examples

We provide data examples for various I2I tasks. The I2I dataset is sampled within VisPrompt5M, and packaged into a tar shard files using the script from the previous section.

We offer examples in both raw-image folder and tar shard formats. For other data formats, you can use our dataset code as a template and extend it as needed.

  1. Download the sample dataset:
wget -O flowinone_demo_dataset.tar.gz https://huggingface.co/CSU-JPG/FlowInOne/resolve/main/flowinone_demo_dataset.tar.gz
tar -xzvf "flowinone_demo_dataset.tar.gz" -C "/path/to/flowinone_demo_dataset"

Hierarchy:

flowinone_demo_dataset/
├── train_tar_pattern/                    # tar shards for training
│   ├── class2image/
│   │   └── pairs-000000.tar
│   ├── doodles_edit/
│   │   └── pairs-000000.tar
│   ├── force_understand/
│   │   └── pairs-000000.tar
│   ├── text_box_edit/
│   │   └── pairs-000000.tar
│   ├── text_in_image_edit/
│   │   └── pairs-000000.tar
│   ├── text2image/
│   │   └── pairs-000000.tar
│   ├── trajectory_understand/
│   │   └── pairs-000000.tar
│   └── visual_marker_edit/
│       └── pairs-000000.tar
├── test_tar_pattern/                     # tar shards for evaluation (usually fewer tar shards)
│   ├── pairs-000000.tar
│
└── vis_imgs/
    ├── input/                            # source/condition images
    └── output/                           # target images; matched with input by filename
  1. Edit every placeholder in run_train.sh: --train_tar_pattern, --test_tar_pattern, and --vis_image_root.

  2. (Optional) Extend with your own tar shards to mix extra data.

Training

Detailed training instructions are available in TRAIN.md, including:

  • full run_train.sh script with inline comments
  • all key parameter meanings
  • train_tar_pattern / test_tar_pattern format and multi-source example

Then run:

bash run_train.sh

📈 Evaluation

Evaluates image generation quality on the VPBench benchmark using a VLM judge (OpenAI-compatible API: GPT-5.2, etc.).

The benchmark is loaded directly from HuggingFace via load_dataset. You only need to provide your model's generated images.

Usage

Evaluate all subsets

python evaluate_vpbench.py \
    --generated_dir /path/to/your/generated/images \
    --output_dir    ./results \
    --model         gpt-5.2 \
    --api_key       YOUR_OPENAI_API_KEY

Evaluate specific subsets only

python evaluate_vpbench.py \
    --generated_dir /path/to/your/generated/images \
    --output_dir    ./results \
    --model         gpt-5.2 \
    --api_key       YOUR_OPENAI_API_KEY \
    --subsets class2image text2image doodles

(You can also use the environment variable OPENAI_API_KEY instead of passing --api_key)

Generated Image Directory Layout

The script recursively searches generated_dir for a file whose stem (filename without extension) matches the benchmark image name. Both flat and nested layouts are supported — no subset subfolders required.

Flat layout (simplest):

generated/
    img_001.png
    img_002.png
    ...

Nested layout (also fine):

generated/
    class2image/
        img_001.png
    doodles/
        img_002.png

NOTE: Generated images must share the same filename stem as the benchmark source images (case-insensitive, any extension is accepted). Example: benchmark image cat_001.png → match cat_001.jpg or cat_001.png.

🎓 BibTex

If you find our work can be helpful, we would appreciate your citation:

@article{yi2026flowinoneunifyingmultimodalgenerationimagein,
      title={FlowInOne:Unifying Multimodal Generation as Image-in, Image-out Flow Matching}, 
      author={Junchao Yi and Rui Zhao and Jiahao Tang and Weixian Lei and Linjie Li and Qisheng Su and Zhengyuan Yang and Lijuan Wang and Xiaofeng Zhu and Alex Jinpeng Wang},    
      journal={arXiv preprint arXiv:2604.06757},
      year={2026}
}

📧 Contact

Please send emails to [email protected] if there is any question

🙏 Acknowledgements

This codebase is built upon the CrossFlow.We would like to thank for their great work.

Explorer des projets similaires

Chargement…