百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

brush-your-text

> 编程语言
开源

刷你的文本: 通过扩散模型合成图像中的任何场景文本 (AAAI2024) 章令军,陈欣元,王耀辉,卢悦和余文杰

99 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

刷你的文本: 通过扩散模型合成图像中的任何场景文本 (AAAI2024) 章令军,陈欣元,王耀辉,卢悦和余文杰

Brush Your Text: Synthesize Any Scene Text on Images via Diffusion Model (AAAI2024)

Lingjun Zhang*, Xinyuan Chen*, Yaohui Wang, Yue Lu and Yu Qiao (* indicates equal contribution)

This is the official PyTorch implementation of the AAAI 2024 paper "Brush Your Text: Synthesize Any Scene Text on Images via Diffusion Model".

Getting Start

Installation

bash
git clone https://github.com/ecnuljzhang/brush-your-text.git
cd brush-your-text

Environment

bash
conda create -n difftext python=3.8.5
conda activate difftext
pip install -r requirements.txt

Checkpoints

The pre-trained checkpoints can be downloaded from Hugging Face. Please download "runwayml/stable-diffusion-v1-5" and "lllyasviel/sd-controlnet-canny" models and put them into the "checkpoints" folder. The file structures could be as follows:

Diff-text
|--- checkpoints
|          |--- stable-diffusion-v1-5/
|          |--- sd-controlnet-canny/
|--- ...

How to Run

1. Prepare Sketch Images

You may prepare the sketch image yourself (as shown in the first row of the image below) along with the corresponding bounding box text file (please use the ICDAR2013 or ICDAR2015 dataset annotation format), or utilize our sketch image synthesis code. The synthesis code can be executed with the following command:

bash
python controlnet_util/synthtext.py

Before running the synthesis code, please make the necessary modifications to the "controlnet_util/Textgen/text_cfg.yaml" file, following the instructions provided in the file comments.

2. Prepare Prompts

You can create a text file containing prompts, with the file extension ".txt".

3. Modify Configurations

Remember to make the necessary modifications to the "configs/control_gen.yaml", following the instructions provided in the file comments.

4. Run

bash
python predict.py

Citation

If you find this code useful in your research, please consider citing:

bibtex
@article{zhang2023brush,
      title={Brush Your Text: Synthesize Any Scene Text on Images via Diffusion Model}, 
      author={Lingjun Zhang, Xinyuan Chen, Yaohui Wang, Yue Lu, Yu Qiao},
      year={2023},
      eprint={2312.12232},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言