Glyph-ByT5 Sampler
The Glyph-SDXL sampler for paragraph text
- glyph_sdxl_model
- font_params
- mask
- vae
- inpaint_image
- masked_latent
- latent
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) andfont_params(Glyph_SDXL_Font_Params) - the model and your text layout. Both required;font_paramscomes from the Font node.bg_prompt- the background scene description. Note the split: your text lives infont_params, your scene lives here.bg_classandbg_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) andmask_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, andclip_visionenable 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.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| glyph_sdxl_model | Glyph_SDXL_Model | — | |
| font_params | Glyph_SDXL_Font_Params | — | |
| bg_prompt | STRING | 背景图提示词 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 | STRING | 背景类型---Posters or Cards and invitations | 背景类型。 |
| bg_tags | STRING | 背景描述(可选) 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_prompt | STRING | worst quality, watermark, author name. | 负面词。 |
| lora_scale | FLOAT | 1.00-9–9 | Text strength. |
| mode | BOOLEAN | true | Inpaint not work well, official edit code not released. |
| mask | MASK | — | |
| mask_gap | INT | 500–10240 | Seperate masks from input mask. |
| sort_radio | BOOLEAN | true | 控制生成文字的位置顺序,根据遮罩的顺序确认文字对应位置的顺序。水平则从左往右,最靠近画布左边的遮罩位置先开始,垂直则从上往下,最靠近画布上边的遮罩位置开始。 |
| steps | INT | 81–99 | Standard scheduler needs more than 20 steps, for tcd scheduler set to 8 steps. |
| cfg | FLOAT | 1.500–10 | Default 5 for standard scheduler, for TCD with lightning model: 1~1.5. |
| scheduler | COMBO | TCD | Schedulers. |
| seed | INT | 888888880–18446744073709550000 | Seed for control. |
| device | COMBO | auto | 6 options: auto, cuda, cpu, mps, xpu, meta |
| keep_model_loaded | BOOLEAN | true | Warning: 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_device | BOOLEAN | true | Keep model in comfy_auto_unet_offload_device (HIGH_VRAM: device, Others: cpu) or device_memory after generation. 生图完成后,模型转移到comfy自动选择设备(HIGH_VRAM: device, 其他: cpu)或者保留在设备专用内存上。 |
| vaeopt | VAE | VAE input for inpaint. | |
| inpaint_imageopt | IMAGE | Image for ip-adapter in generation mode or for inpaint in inpaint mode. | |
| inp_strengthopt | FLOAT | 0.550–1 | Inpaint strength. |
| masked_latentopt | LATENT | Masked image latent for inpaint, if input then mask will be ignored. | |
| clip_visionopt | COMBO | None | Image 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)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |