依赖版本锁定较严(torch 2.6.0、transformers 4.57.1、diffusers 0.35.1、numpy 1.26.4),随意升级可能出错;模型权重需从 Hugging Face 单独下载,不在仓库内;推理脚本需先 cd 到 torch_inference 目录再运行
conda create -n i1_torch_infer python=3.11 -y
conda activate i1_torch_infer
python -m pip install torch==2.6.0 --index-url https://download.pytorch.org/whl/cu124
python -m pip install numpy==1.26.4 pillow tqdm transformers==4.57.1 diffusers==0.35.1 accelerate safetensors sentencepieceREADME 未说明具体显存要求;训练主要使用 Google TPU Research Cloud 的 TPU 资源,JAX 代码同时支持 GPU,PyTorch 推理环境安装的是 cu124 版 torch。
Princeton 开源的全流程文生图配方,含 3B 模型、训练代码与数据,可复现强文生图模型
一套完全开源的强文本到图像扩散模型训练配方,提供 JAX 和 PyTorch 实现,方便复现和二次开发。
核心能力
- 提供 3B 与 1B 模型在 1024 分辨率下的 PyTorch 和 JAX 权重
- 开源 JAX 训练与推理代码,支持 TPU 和 GPU
- 开源 PyTorch 训练与推理代码,面向 GPU
- 公开图像描述数据集与 TFRecord 数据管线
- 附带 GenEval、DPG-Bench 等 5 个基准的评测流程
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
i1: A Simple and Fully Open Recipe for Strong Text-to-Image Models
Official code for i1: A Simple and Fully Open Recipe for Strong Text-to-Image Models
i1: A Simple and Fully Open Recipe for Strong Text-to-Image Models Boya Zeng, Tianze Luo, Shu Pu, Jucheng Shen, Taiming Lu, Gabriel Sarch, Zhuang Liu Princeton University [
arXiv][model][dataset][project page]
We investigate the design space of text-to-image diffusion models to understand how modeling and data choices affect model capabilities. This exploration culminates in i1, a 3B-parameter model that performs competitively with leading models at 1024-resolution, as measured by the average percentage score across GenEval, DPG-Bench, PRISM, CVTG-2K, and LongText-Bench.
Showcase
Open-Source Plan
We fully open-source the training code, data, and recipes for reproducing our i1-3B model.
- 3B Model Checkpoint (1024-Resolution) [PyTorch] [JAX]
- 1B Model Checkpoint (1024-Resolution) [PyTorch] [JAX]
- Intermediate 256- and 512-Resolution Checkpoints [3B] [1B]
- JAX Training and Inference Code for TPUs and GPUs
- PyTorch Training and Inference Code for GPUs
- Dataset (Captions and Image-Caption TFRecords) and Data Pipelines
- Benchmark Evaluation Pipeline
- Multi-Aspect-Ratio Checkpoint, Data Pipelines, and Training Code
Quick Start
Install PyTorch inference environment
conda create -n i1_torch_infer python=3.11 -y
conda activate i1_torch_infer
python -m pip install torch==2.6.0 --index-url https://download.pytorch.org/whl/cu124
python -m pip install numpy==1.26.4 pillow tqdm transformers==4.57.1 diffusers==0.35.1 accelerate safetensors sentencepiece
Generate image with your custom prompt
git clone https://github.com/zlab-princeton/i1
cd torch_inference
python generate.py \
--prompt "Render the following text at the center of the image on a clean background: 'Flow on, river! flow with the flood-tide, and ebb with the ebb-tide! Frolic on, crested and scallop-edg'd waves!'"
Code Structure
This codebase contains five independent folders.
- benchmark_eval contains the instructions and code for running evaluations with the 5 benchmarks we use.
- data_processing contains the code for downloading images, recaptioning images, and creating TFRecord files for the image-caption pairs.
- jax contains the training and inference code for our controlled experiments and the final i1-3B model in JAX.
- torch_inference contains the inference code for the final i1-3B model in PyTorch.
- torch_train contains the training code for the final i1-3B model in PyTorch.
Acknowledgement
We gratefully thank the Google TPU Research Cloud (TRC) program for providing the primary computing resources for this project. Additional support was provided by the Princeton Research Computing resources at Princeton University, which are managed by a consortium of groups led by the Princeton Institute for Computational Science and Engineering (PICSciE) and Research Computing. We would like to thank Liang-Chieh Chen, Ishan Misra, Kaiming He, Yida Yin, Haozhe Chen, Wenhao Chai, Linrong Cai, Linzhan Mou, and Xingyu Fu for valuable discussions and feedback. We also thank Yufeng Xu, Shengbang Tong, Yiyang Lu, and Hanhong Zhao for helpful discussion on TPU. We are grateful to Cihang Xie's research group for sharing their JAX DiT codebase, which served as the launching point for our research. This repository is built using the big_vision, transformers, and diffusers codebases.
Citation
If you find this repository helpful, please consider citing:
@article{zeng2026i1,
title={i1: A Simple and Fully Open Recipe for Strong Text-to-Image Models},
author={Zeng, Boya and Luo, Tianze and Pu, Shu and Shen, Jucheng and Lu, Taiming and Sarch, Gabriel and Liu, Zhuang},
journal={arXiv preprint arXiv:2606.11289},
year={2026}
}