概述
可读的文字得益于更大的语言模型文本编码器、字符感知编码器、以文本为中心的训练数据以及新架构。这对所有制作海报、标志、表情包或包装模型的人都很重要。
深入探讨
Writing is an unforgiving target. A face can be slightly off and still read as a face, but one wrong stroke turns an 'e' into a 'c'. Early diffusion models learned that shop signs, book covers and T-shirts contain lettering, so they produced shapes with the rhythm of text while getting the actual letters wrong. The text encoder was a major cause. Stable Diffusion 1.x used OpenAI's CLIP text encoder, which was trained to match whole captions to images. CLIP splits words into subword tokens, so a word like 'bakery' may become a single token, and the image model receives a representation of meaning rather than a sequence of letters. Nothing in that signal says 'b, then a, then k'. Google's Imagen research in 2022 found that a large frozen T5 language-model encoder improved prompt following, and its samples rendered text noticeably better. A follow-up Google study on character-aware models showed that byte-level encoders such as ByT5, which see individual characters, spell much better. Resolution mattered too. Small letters occupy very few cells in a compressed latent, so fine strokes blur. Training data was another limit. Captions rarely wrote out the text visible in an image, so the model could not link words to letter shapes. Progress came from several directions. DeepFloyd IF and Stable Diffusion 3 paired their image models with T5 encoders. Research systems such as TextDiffuser and GlyphControl gave the model explicit layouts or pre-rendered letter images to follow. Products including Ideogram, DALL-E 3 and later autoregressive image generators made legible text routine, helped by training captions that include the words shown in the image. One misconception is that modern models read letters from a font file. They still generate letters as pixels, which is why long passages, rare words and small print still go wrong.
现实世界的实施
一个早期的 Stable Diffusion 提示用于制作写有“Fresh Bread”的面包店招牌时,会返回类似字母的乱写,如“FRESSH BRAED”,因为模型知道招牌包含文字,但不知道如何拼写。
一位使用更新模型的营销人员将海报标题限制为引号中的三个短词,并在前几次尝试中就获得了正确的拼写。
设计师先生成没有文字的插图,然后在排版软件中添加真实的文字,使字体、间距和拼写完全准确。
用户通过遮罩该区域并用正确的单词进行修补,来纠正生成的店面标识中的一个拼写错误。
AI 生成图像中文本渲染的未来
领先的模型现在能够可靠地处理短标题和标识,而更困难的问题已经转向更长的段落、多语言文字、系列作品中一致的字体以及视频中的精准文字。拥有数千字符的文字系统,如中文,或具有复杂字母连写的文字,如阿拉伯文,历来落后于英文,进展取决于这些语言的训练数据。可读的生成文字也带来了滥用担忧,因为制作逼真的假文件、收据和截图变得更容易。这使得水印和来源标记变得更加重要。
付诸实践
为什么这很重要
- 速度与规模. 视觉人工智能可以大规模自动化检查、检测和标记任务。
- 构建选择. 创意团队可以通过更少的手动修改更快地构建概念原型。
- 团队与工作流程. 操作可以使用以前难以处理的图像和视频信号。
留意
- 如果出处不明,肖像权和同意可能会成为法律风险。
- 模型性能可能因光照、人口统计和环境的不同而有所不同。
- 除非监控置信阈值,否则误报可能会被忽视。
后续步骤
- 定义精确度、召回率和错误成本的接受标准。
- 使用符合实际生产条件的数据进行测试。
- 为低置信度或高影响力的预测添加人工审核。
- 跟踪模型漂移并在相机或数据集更改后重新验证。
不断探索
常见问题
什么是 AI 生成图像中文本渲染?
AI图像生成器曾因其文本编码器(如CLIP)将提示转换为捕捉整体含义但不逐字拼写的子词标记而产生乱码文本,这使得图像模型无法获得关于字母形状的精确信号。可读文字的出现得益于更大的语言模型文本编码器、字符感知编码器、以文本为重点的训练数据和新的架构。这对任何制作海报、标志、表情包或包装模型的人都很重要。
为什么基于 CLIP 的图像模型难以正确拼写单词?
像“bakery”这样的词可以成为一个标记,因此图像模型获得了它的含义,但没有关于其各个字母的信息。
Google 的字符感知研究发现哪种编码器拼写更好?
字节级编码器公开每个字符,为图像模型提供子字标记隐藏的逐字母信息。
为什么生成的脸部可以容忍小错误,但生成的文本却不能容忍?
字母是由精确的形状定义的,因此一个微小的变化,例如将“e”变成“c”,就会破坏单词。
训练数据的哪些限制导致很难将单词与字母形状联系起来?
如果标题从未说明标志的含义,则模型无法将这些单词与它看到的字母联系起来。
TextDiffuser 和 GlyphControl 等研究系统为图像生成添加了什么?
他们提供了关于每个角色的去向和外观的空间指导,模型在生成时遵循该指导。