Nodes/ComfyUI_Anytext/AnyText Sampler
ComfyUI Node

AnyText Sampler

The plain AnyText sampler for multilingual text rendering

By zmwv823·Created 2 years ago·Updated about a year ago· 103
AnyText Sampler
  • model
  • positive
  • negative
  • latent
seed88888888
steps20
cfg9.0
strength1.00
eta0.0
keep_model_loadedtrue
keep_model_devicetrue

This is the sampler at the end of an AnyText graph - the node that denoises glyph-aware conditioning into a latent with legible, correctly-placed text in it. If you're rendering Chinese, Japanese, Korean or mixed-language text on an SD 1.5 base, this is where the picture actually gets made.

Worth saying up front: the pack ships two nearly identical AnyText samplers. This underscore-named UL_AnyText_Sampler is the plain one. Its sibling UL_AnyTextSampler (no underscore) adds an attnx_scale attention knob. Everything else is the same, so which you grab is mostly a matter of which one your workflow already has wired.

How it works

AnyText's pipeline carries the text as auxiliary control alongside the normal scene conditioning - the paper describes an auxiliary latent module (glyph, position, masked image) and a text-embedding module (encoded strokes). UL_AnyText_Sampler takes the positive/negative conditioning that UL_AnyTextEncoder already stuffed the glyph hint into, plus your AnyText_Model, and runs the denoise. The strength input behaves like a ControlNet weight: it's how hard the text hint gets enforced against the base model's own tendencies.

The inputs and outputs that matter

  • model, positive, negative - the AnyText model and the two conditioning wires from the encoder. This is a closed loop; feed it AnyText's own outputs, not generic CLIP conditioning.
  • cfg (default 9) - high on purpose. AnyText needs strong guidance to keep strokes sharp. This is not a typo, and lowering it to your usual SD 1.5 value softens the text.
  • strength (default 1, range 0–2) - text-control weight. Turn it down if the letters look decal-stuck and fake; turn it up if the model is drifting off your words.
  • eta (default 0), steps (20), seed - standard sampling controls.

Output is a single latent (LATENT). Decode it with the VAE the AnyText loader gave you.

How to install it

Via ComfyUI Manager search ComfyUI_Anytext, or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/zmwv823/ComfyUI_Anytext

then restart. The models are the real work: a full AnyText checkpoint (Sanster/AnyText, or ModelScope's anytext_v1.1.ckpt) or any SD 1.5 checkpoint plus the AnyText control model, loaded through an AnyText loader - and a base font (Arial_Unicode.ttf) in ComfyUI/models/fonts.

Common issues & troubleshooting

Which sampler do I use? If you don't specifically want attention scaling, this plain one is fine. If you're following a workflow that references attnx_scale, that's the other node (UL_AnyTextSampler). They're not two different techniques - just two revisions the author left in the pack.

Text is legible but ugly / doesn't match the scene. That's strength too high (pasted-on) or too low (ignored). Sweep it between 0.6 and 1.2 before touching anything else, and keep CFG up around 9.

It rendered garbage where the text should be. Check the encoder's font_hint preview - the glyph render is decided upstream, and this node just samples against it. A bad hint in means garbage out.

Reality check on the whole approach. AnyText is a 2023 SD 1.5 model and the community verdict was always split - impressive concept, finicky in practice. It earns its keep on multilingual text and on editing text inside an existing image. For English signage in 2026, a modern base model spells better with none of this rigging.

CategoryUL Group/Image Generation

Inputs (10)

NameTypeDefaultDescription
modelAnyText_Model
positiveCONDITIONING
negativeCONDITIONING
seedINT888888880–18446744073709550000
stepsINT201–100
cfgFLOAT9.01–99
strengthFLOAT1.000–2
etaFLOAT0.00–1
keep_model_loadedBOOLEANtrueWarning: do not delete model unless this node no longer needed, it will try release device_memory and ram. if checked and want to continue node generation, use ComfyUI-Manager `Free model and node cache` to reset node state or change parameter in Loader node to activate. 注意:仅在这个节点不再需要时删除模型,将尽量释放系统内存和设备专用内存。如果删除后想继续使用此节点,使用ComfyUI-Manager插件的`Free model and node cache`重置节点状态或者更换模型加载节点的参数来激活。
keep_model_deviceBOOLEANtrueKeep model in comfy_auto_unet_offload_device (HIGH_VRAM: device, Others: cpu) or device_memory after generation. 生图完成后,模型转移到comfy自动unet选择设备(HIGH_VRAM: device, 其他: cpu)或者保留在设备专用内存上。

Outputs (1)

NameTypeDescription
latentLATENT