Motivation:
Scene text editing is a challenging task that aims to modify or add text in images while maintaining the fidelity of newly generated text and visual coherence with the background. The main challenge of this task is that we need to edit multiple line texts with diverse language attributes (e.g., fonts, sizes, and styles), language types (e.g., English, Chinese), and visual scenarios (e.g., poster, advertising, gaming).
Contribution:
We propose FLUX-Text, a novel text editing framework for editing multi-line texts in complex visual scenes. By incorporating a lightweight Condition Injection LoRA module, Regional text perceptual loss, and two-stage training strategy, we significantly significant improvements on both Chinese and English benchmarks.
News
2025-07-16
: 🔥 Update comfyui node. We have decoupled the FLUX-Text node to support the use of more basic nodes. Due to differences in node computation in ComfyUI, if you need more consistent results, you should set min_length to 512 in the
code
.
workflow/FLUX-Text-Basic-Workflow.json
2025-07-13
: 🔥 The training code has been updated. The code now supports multi-scale training.
2025-07-13
: 🔥 Update the low-VRAM version of the Gradio demo, which It currently requires 25GB of VRAM to run. Looking forward to more efficient, lower-memory solutions from the community.
2025-07-08
: 🔥 ComfyUI Node is supported! You can now build an workflow based on FLUX-Text for editing posters. It is definitely worth trying to set up a workflow to automatically enhance product image service information and service scope. Meanwhile, utilizing the first and last frames enables the creation of video data with text effects. Thanks to the
community work
, FLUX-Text was run on 8GB VRAM.
workflow/FLUX-Text-Workflow.json
original image
edited image
original image
edited image
last frame
video
2025-07-04
: 🔥 We have released gradio demo! You can now try out FLUX-Text.
Example 1
Example 2
2025-07-03
: 🔥 We have released our
pre-trained checkpoints
on Hugging Face! You can now try out FLUX-Text with the official weights.
2025-06-26
: ⭐️ Inference and evaluate code are released. Once we have ensured that everything is functioning correctly, the new model will be merged into this repository.
Todo List
Inference code
Pre-trained weights
Gradio demo
ComfyUI
Training code
🛠️ Installation
We recommend using Python 3.10 and PyTorch with CUDA support. To set up the environment:
# Create a new conda environment
conda create -n flux_text python=3.10
conda activate flux_text
# Install other dependencies
pip install -r requirements.txt
pip install flash_attn --no-build-isolation
pip install Pillow==9.5.0
🤗 Model Introduction
FLUX-Text is an open-source version of the scene text editing model. FLUX-Text can be used for editing posters, emotions, and more. The table below displays the list of text editing models we currently offer, along with their foundational information.
Download training dataset
AnyWord-3M
from ModelScope, unzip all *.zip files in each subfolder, then open
*.json
and modify the
data_root
with your own path of
imgs
folder for each sub dataset.
(Optional) Download the pretrained weight in
HuggingFace
.
Run the training scripts. With 48GB of VRAM, you can train at 512×512 resolution with a batch size of 2.
bash train/script/train_word.sh
📊 Evaluation
For
Anytext-benchmark
, please set the
config_path
,
model_path
,
json_path
,
output_dir
in the
eval/gen_imgs_anytext.sh
and generate the text editing results.
bash eval/gen_imgs_anytext.sh
For
Sen.ACC, NED, FID and LPIPS
evaluation, use the scripts in the
eval
folder.
If you find our paper and code helpful for your research, please consider starring our repository ⭐ and citing our work ✏️.
@misc{lan2025fluxtext,
title={FLUX-Text: A Simple and Advanced Diffusion Transformer Baseline for Scene Text Editing},
author={Rui Lan and Yancheng Bai and Xu Duan and Mingxing Li and Lei Sun and Xiangxiang Chu},
year={2025},
eprint={2505.03329},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Runs of RedbeardNZ FLUX-Text on huggingface.co
0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About FLUX-Text huggingface.co Model
FLUX-Text huggingface.co is an AI model on huggingface.co that provides FLUX-Text's model effect (), which can be used instantly with this RedbeardNZ FLUX-Text model. huggingface.co supports a free trial of the FLUX-Text model, and also provides paid use of the FLUX-Text. Support call FLUX-Text model through api, including Node.js, Python, http.
FLUX-Text huggingface.co is an online trial and call api platform, which integrates FLUX-Text's modeling effects, including api services, and provides a free online trial of FLUX-Text, you can try FLUX-Text online for free by clicking the link below.
RedbeardNZ FLUX-Text online free url in huggingface.co:
FLUX-Text is an open source model from GitHub that offers a free installation service, and any user can find FLUX-Text on GitHub to install. At the same time, huggingface.co provides the effect of FLUX-Text install, users can directly use FLUX-Text installed effect in huggingface.co for debugging and trial. It also supports api for free installation.