[CVPR 2026 Highlight] GlyphPrinter: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering
104
stars
8
commits
Python
primary language
Apr 9, 2026
updated
Xincheng Shuai1,*, Ziye Li1,*, Henghui Ding1,✉, Dacheng Tao2
* Equal Contribution, ✉ Corresponding Author
1Fudan University, 2Nanyang Technological University

GlyphPrinter is a preference-based text rendering framework designed to eliminate the reliance on explicit reward models for visual text generation. It addresses the common failure cases in existing T2I models, such as stroke distortions and incorrect glyphs, especially when rendering complex Chinese characters, multilingual text, or out-of-domain symbols.

The training of GlyphPrinter consists of two stages:
cd GlyphPrinter
conda create -n GlyphPrinter python=3.11.10 -y
conda activate GlyphPrinter
pip install --upgrade -r requirements.txt
python app.py
Default server port: 7897.
saved_conditions directory, you can manually construct the npz-format condition through app.py)# list available saved conditions
python3 inference.py --list-conditions
# run inference using the latest condition in saved_conditions/
python3 inference.py \
--prompt "The colorful graffiti font <sks1> printed on the street wall" \
--save-mask
# run inference using a specific condition file
python3 inference.py \
--condition condition_1.npz \
--output-dir outputs_inference
Please first download our regional preference dataset GlyphCorrector.
Then, place it under dataset/GlyphCorrector:
mkdir -p dataset
huggingface-cli download FudanCVL/GlyphCorrector GlyphCorrector.zip \
--repo-type dataset \
--local-dir dataset \
--local-dir-use-symlinks False
unzip -q dataset/GlyphCorrector.zip -d dataset
After extraction, verify the folder structure:
dataset/GlyphCorrector/
├── annotated_mask/
│ ├── batch_0/
│ │ ├── generated_0_mask.jpg
│ │ └── ...
│ └── batch_1/
└── inference_results/
├── batch_0/
│ ├── generated_0.png
│ ├── glyph_0.png
│ ├── mask_0.png
│ ├── prompt.txt
│ └── ...
└── batch_1/
Use the provided script for R-GDPO training:
bash dpo/train_dpo_group.bash
black-forest-labs/FLUX.1-devpretrained/pretrained_stage1_attn_mask_transformer-stage-1-2pretrained/dpo-checkpoint@inproceedings{GlyphPrinter,
title={{GlyphPrinter}: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering},
author={Shuai, Xincheng and Li, Ziye and Ding, Henghui and Tao, Dacheng},
booktitle={CVPR},
year={2026}
}
Python
100.0%
[CVPR 2026 Highlight] GlyphPrinter: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering
104
stars
8
commits
Python
primary language
Apr 9, 2026
updated
Xincheng Shuai1,*, Ziye Li1,*, Henghui Ding1,✉, Dacheng Tao2
* Equal Contribution, ✉ Corresponding Author
1Fudan University, 2Nanyang Technological University

GlyphPrinter is a preference-based text rendering framework designed to eliminate the reliance on explicit reward models for visual text generation. It addresses the common failure cases in existing T2I models, such as stroke distortions and incorrect glyphs, especially when rendering complex Chinese characters, multilingual text, or out-of-domain symbols.

The training of GlyphPrinter consists of two stages:
cd GlyphPrinter
conda create -n GlyphPrinter python=3.11.10 -y
conda activate GlyphPrinter
pip install --upgrade -r requirements.txt
python app.py
Default server port: 7897.
saved_conditions directory, you can manually construct the npz-format condition through app.py)# list available saved conditions
python3 inference.py --list-conditions
# run inference using the latest condition in saved_conditions/
python3 inference.py \
--prompt "The colorful graffiti font <sks1> printed on the street wall" \
--save-mask
# run inference using a specific condition file
python3 inference.py \
--condition condition_1.npz \
--output-dir outputs_inference
Please first download our regional preference dataset GlyphCorrector.
Then, place it under dataset/GlyphCorrector:
mkdir -p dataset
huggingface-cli download FudanCVL/GlyphCorrector GlyphCorrector.zip \
--repo-type dataset \
--local-dir dataset \
--local-dir-use-symlinks False
unzip -q dataset/GlyphCorrector.zip -d dataset
After extraction, verify the folder structure:
dataset/GlyphCorrector/
├── annotated_mask/
│ ├── batch_0/
│ │ ├── generated_0_mask.jpg
│ │ └── ...
│ └── batch_1/
└── inference_results/
├── batch_0/
│ ├── generated_0.png
│ ├── glyph_0.png
│ ├── mask_0.png
│ ├── prompt.txt
│ └── ...
└── batch_1/
Use the provided script for R-GDPO training:
bash dpo/train_dpo_group.bash
black-forest-labs/FLUX.1-devpretrained/pretrained_stage1_attn_mask_transformer-stage-1-2pretrained/dpo-checkpoint@inproceedings{GlyphPrinter,
title={{GlyphPrinter}: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering},
author={Shuai, Xincheng and Li, Ziye and Ding, Henghui and Tao, Dacheng},
booktitle={CVPR},
year={2026}
}
Python
100.0%