Skip to content
/ UiG Public

Code for "Understanding-in-Generation:Reinforcing Generative Capability of Unified Model via Infusing Understanding into Generation"

Notifications You must be signed in to change notification settings

QC-LY/UiG

Repository files navigation

Understanding-in-Generation: Reinforcing Generative Capability of Unified Model via Infusing Understanding into Generation

Paper

Yuanhuiyi Lyu1, Chi-Kit Wong1, Chenfei Liao1, Lutao Jiang1, Xu Zheng1, Zexin Lu4, Linfeng Zhang2, Xuming Hu4,

1The Hong Kong University of Science and Technology (Guangzhou)
2Shanghai Jiao Tong University
3The Hong Kong University of Science and Technology
4Huawei Hong Kong Research Center

image

Requirements

  • Clone the repository:
    git clone https://github.com/qc-ly/UiG
    
    cd UiG
    
  • Create an environment:
    conda create -n UiG python==3.10 -y
    
    conda activate UiG
    
  • Install the required packages:
    pip install -r requirements.txt
    
    pip install flash_attn==2.5.8 --no-build-isolation
    

Inference

  1. Please follow official instruction to download the BAGEL-7B-MoT checkpoint and save the checkpoint to ./ckpts.

  2. Generate images from the prompts in ./prompts/test_prompt.txt:

    bash scripts/infer.sh

    for slurm:

    bash scripts/infer_slurm.sh
  3. Generate images from input prompts:

    python infer.py --prompt_text "A larger person in yellow clothing is partially hidden by a smaller person in a different color."

Evaluation

We follow the official settings of TIIF-Bench and WISE-Bench to evaluate UiG.

The evaluation results are provided in Google Drive

Acknowledgement

Our codes are built on open-source codes, thanks to the following projects:

Thanks for their outstanding works and open-source!

Citation

If you find this repository useful, please consider giving stars ⭐ and citations

@article{lyu2025understanding,
  title={Understanding-in-Generation: Reinforcing Generative Capability of Unified Model via Infusing Understanding into Generation},
  author={Lyu, Yuanhuiyi and Wong, Chi Kit and Liao, Chenfei and Jiang, Lutao and Zheng, Xu and Lu, Zexin and Zhang, Linfeng and Hu, Xuming},
  journal={arXiv preprint arXiv:2509.18639},
  year={2025}
}

Contact

If you have questions, suggestions, and bug reports, please email:

ryan.lyu.mail@gmail.com

About

Code for "Understanding-in-Generation:Reinforcing Generative Capability of Unified Model via Infusing Understanding into Generation"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •