Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

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 Yi 1*, Rui Zhao 3*, Jiahao Tang 2*, Weixian Lei 3, Linjie Li 6,
Qisheng Su 4, Zhengyuan Yang 6, Lijuan Wang 6, Xiaofeng Zhu 1†, Alex Jinpeng Wang 2†

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 git@github.com: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 junchaoyi52@gmail.com if there is any question

πŸ™ Acknowledgements

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

About

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

Topics

Resources

Stars

119 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /