Nodes/ComfyUI_Anytext/Glyph-ByT5 Sampler
ComfyUI Node

Glyph-ByT5 Sampler

The Glyph-SDXL sampler for paragraph text

By zmwv823·Created 2 years ago·Updated about a year ago· 103
Glyph-ByT5 Sampler
  • glyph_sdxl_model
  • font_params
  • mask
  • vae
  • inpaint_image
  • masked_latent
  • latent
bg_prompt背景图提示词 The image features a green and blue globe with a factory on top of it. The factory is surrounded by trees, giving the impression of a harmonious coexistence between the industrial structure and the natural environment. The globe is prominently displayed in the center of the image, with the factory and trees surrounding it. or The image features a beautiful young 20yo woman sitting in a field of flowers, holding a little cute girl in her arms. The scene is quite serene and picturesque, with the two human being the main focus of the image. The field is filled with various flowers, creating a beautiful and vibrant backdrop for the humans.
bg_class背景类型---Posters or Cards and invitations
bg_tags背景描述(可选) green, modern, earth, world, planet, ecology, background, globe, environment, day, space, map, concept, global, light, hour, energy, power, protect, illustration or Light green, orange, Illustration, watercolor, playful, Baby shower invitation, baby boy shower invitation, baby boy, welcoming baby boy, koala baby shower invitation, baby shower invitation for baby shower, baby boy invitation, background, playful baby shower card, baby shower, card, newborn, born, Baby Shirt Baby Shower Invitation
negative_promptworst quality, watermark, author name.
lora_scale1.00
modetrue
mask_gap50
sort_radiotrue
steps8
cfg1.50
schedulerTCD
seed88888888
deviceauto
keep_model_loadedtrue
keep_model_devicetrue
inp_strength0.55
clip_visionNone

This is the sampler for the Glyph-SDXL pipeline - the node that actually generates the image, with your multilingual text laid into it. Glyph-ByT5 is a character-aware text encoder (fine-tuned ByT5, out of Microsoft research) fused with SDXL; the combination pushes design-image text accuracy from under 20% to near 90% on the paper's benchmark, and can render tens to hundreds of characters with automatic multi-line layout. This node is where that happens.

Fair warning before you wire it up: this is the least reliable corner of the pack. The author labels it "TEST FAILED ON MY PC," and the model comes with hard constraints. Go in expecting a research demo, not a workhorse.

How it works

The node takes a glyph_sdxl_model, the font_params from UL_Image_Generation_Glyph_ByT5_Font (your text lines, fonts and colors), a mask for where the text sits, and a set of background-description inputs. Glyph-ByT5's encoder handles the glyphs while SDXL renders the scene, and the node denoises the two together into a latent. The scheduler defaults to TCD at just 8 steps and CFG 1.5 - that's a distillation-style fast-sampling setup, so don't "fix" the low CFG; it's meant to run that way.

The inputs and outputs that matter

  • glyph_sdxl_model (Glyph_SDXL_Model) and font_params (Glyph_SDXL_Font_Params) - the model and your text layout. Both required; font_params comes from the Font node.
  • bg_prompt - the background scene description. Note the split: your text lives in font_params, your scene lives here.
  • bg_class and bg_tags - a design category (posters, cards, invitations…) and descriptive tags that steer the background aesthetic. These reflect how Glyph-SDXL was trained on graphic-design data.
  • mask (MASK) and mask_gap - where text goes and the spacing between regions.
  • steps (8), cfg (1.5), scheduler (TCD) - the fast-sampling defaults. Leave them unless you know why you're changing them.
  • Optional vae, inpaint_image + inp_strength, masked_latent, and clip_vision enable inpaint-style text placement into an existing image.

Output is a single latent (LATENT) - decode it to see the result.

How to install it

ComfyUI Manager, search ComfyUI_Anytext, or:

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

then restart. Place the Glyph-SDXL checkpoints in custom_nodes/ComfyUI_Anytext/Image_Generation/Glyph_SDXL/checkpoints and google/byt5-small in ComfyUI/models/text_encoders (or Auto_Download). This is a heavy SDXL-scale pipeline, so budget the VRAM.

Common issues & troubleshooting

Resolution and aspect are locked. Glyph-SDXL here runs at 1024×1024, 1:1 only - the input mask and image must be square. If you're feeding a portrait or landscape mask, that's your error.

Backgrounds look worse than plain SDXL. Known limitation the author calls out. The model trades general image quality for text accuracy, and the fused pipeline doesn't match a clean SDXL checkpoint on scenery. If the background matters more than the text, this is the wrong tool.

You can't find working weights. Microsoft pulled the original Glyph-ByT5 checkpoints (private training data, pending review), and the community has spent threads just trying to relocate copies. Sourcing a functioning checkpoint is a real part of the setup cost.

Honest recommendation. For accurate multilingual text in 2026, modern base models (Flux, Qwen-Image, Ideogram-class) spell well natively and without any of this scaffolding. Glyph-ByT5 is worth a look as a curiosity or for its paragraph-layout trick, but the author's own "use the official demo instead" is good advice here.

CategoryUL Group/Image Generation

Inputs (23)

NameTypeDefaultDescription
glyph_sdxl_modelGlyph_SDXL_Model
font_paramsGlyph_SDXL_Font_Params
bg_promptSTRING背景图提示词 The image features a green and blue globe with a factory on top of it. The factory is surrounded by trees, giving the impression of a harmonious coexistence between the industrial structure and the natural environment. The globe is prominently displayed in the center of the image, with the factory and trees surrounding it. or The image features a beautiful young 20yo woman sitting in a field of flowers, holding a little cute girl in her arms. The scene is quite serene and picturesque, with the two human being the main focus of the image. The field is filled with various flowers, creating a beautiful and vibrant backdrop for the humans.背景图提示词。
bg_classSTRING背景类型---Posters or Cards and invitations背景类型。
bg_tagsSTRING背景描述(可选) green, modern, earth, world, planet, ecology, background, globe, environment, day, space, map, concept, global, light, hour, energy, power, protect, illustration or Light green, orange, Illustration, watercolor, playful, Baby shower invitation, baby boy shower invitation, baby boy, welcoming baby boy, koala baby shower invitation, baby shower invitation for baby shower, baby boy invitation, background, playful baby shower card, baby shower, card, newborn, born, Baby Shirt Baby Shower Invitation背景描述。
negative_promptSTRINGworst quality, watermark, author name.负面词。
lora_scaleFLOAT1.00-9–9Text strength.
modeBOOLEANtrueInpaint not work well, official edit code not released.
maskMASK
mask_gapINT500–10240Seperate masks from input mask.
sort_radioBOOLEANtrue控制生成文字的位置顺序,根据遮罩的顺序确认文字对应位置的顺序。水平则从左往右,最靠近画布左边的遮罩位置先开始,垂直则从上往下,最靠近画布上边的遮罩位置开始。
stepsINT81–99Standard scheduler needs more than 20 steps, for tcd scheduler set to 8 steps.
cfgFLOAT1.500–10Default 5 for standard scheduler, for TCD with lightning model: 1~1.5.
schedulerCOMBOTCDSchedulers.
seedINT888888880–18446744073709550000Seed for control.
deviceCOMBOauto6 options: auto, cuda, cpu, mps, xpu, meta
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自动选择设备(HIGH_VRAM: device, 其他: cpu)或者保留在设备专用内存上。
vaeoptVAEVAE input for inpaint.
inpaint_imageoptIMAGEImage for ip-adapter in generation mode or for inpaint in inpaint mode.
inp_strengthoptFLOAT0.550–1Inpaint strength.
masked_latentoptLATENTMasked image latent for inpaint, if input then mask will be ignored.
clip_visionoptCOMBONoneImage encoder (ip-adapter) for inpaint, Vit-H: plus, `CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors` and Vit-bigG: `CLIP-ViT-bigG-14-laion2B-39B-b160k.safetensors` in `ComfyUI\models\clip_vision`. Seems not work

Outputs (1)

NameTypeDescription
latentLATENT