Nodes/ComfyUI_Anytext/JoyType Font_Img
ComfyUI Node

JoyType Font_Img

Render the canny glyph hint for JoyType

By zmwv823·Created 2 years ago·Updated about a year ago· 103
JoyType Font_Img
  • params
  • canny_image
  • font_image
font_color_namewhite
font_color_code00ffdd
font_color_codeR-1
font_color_codeG0
font_color_codeB0
font_color_codeA0
font_color_modetrue
bg_color_nametransparent
bg_color_code00ffdd
bg_color_modetrue

JoyType is the third text-rendering approach bundled in this pack, and it's the most conventional one under the hood - the author describes it as "a typical canny controlnet implementation." Instead of a bespoke text pipeline, JoyType draws your characters as glyphs, runs canny edge detection over them, and feeds that edge map to a canny ControlNet so the diffusion model traces the letter shapes. UL_Image_Generation_JoyType_Font_Img is the node that produces that glyph-and-canny hint.

Because it's just canny control, it plays nicely with ordinary samplers - the KB's ControlNet notes cover canny as "the classic," clean thin edge maps that models follow well, and that's exactly the mechanism here.

How it works

You hand it a params object (JoyType_Params, produced by the JoyType params node upstream in the pack) plus a stack of color settings, and it renders two images: the canny edge map of your text, and the styled font image itself. The color inputs come in the pack's usual three flavors - named color, hex code, or explicit R/G/B/A channels - for both the glyphs and the background, so you can control exactly how the font image looks even though it's the canny map that drives the ControlNet.

The inputs and outputs that matter

  • params (JoyType_Params) - the text layout and positioning, from the JoyType params node. This is the required driver.
  • font_color_name / font_color_code / font_color_codeR/G/B/A - the glyph color, three ways. font_color_mode picks which is active; set font_color_codeR to −1 to defer to the name/hex.
  • bg_color_name / bg_color_code / bg_color_mode - the background, including transparent for compositing.

Two outputs:

  • canny_image (IMAGE) - the edge map. This is the one you feed to the JoyType/diffusers sampler's control input.
  • font_image (IMAGE) - the styled glyph render, for preview or compositing.

How to install it

ComfyUI Manager, search ComfyUI_Anytext, or:

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

then restart. JoyType needs its ControlNet weights: download JoyType-v1-1M (from jdh-algo/JoyType-v1-1M) into ComfyUI/models/controlnet. It's a diffusers-format canny ControlNet, so it works with a normal ComfyUI sampler as well as the pack's diffusers sampler. You'll also want fonts in ComfyUI/models/fonts.

Common issues & troubleshooting

The two outputs confuse people. canny_image is the functional one - it's the control signal. font_image is a nice-to-look-at styled render. Wire canny_image into your sampler's control input; don't accidentally feed it the pretty one.

Nothing to connect to params. JoyType_Params comes from the pack's JoyType parameters node. If your graph has no source for it, you're missing that upstream node - this Font_Img node only consumes the params.

Which sampler? The author recommends running JoyType through a normal Comfy KSampler with a canny ControlNet (sd1.5, sd2.1 and sdxl canny all work), since it's a standard diffusers canny model. The pack's own UL_Image_Generation_Diffusers_Sampler also takes it directly. Either path is legitimate - JoyType is the least exotic of the three text methods here, which is a point in its favor.

CategoryUL Group/Image Generation

Inputs (11)

NameTypeDefaultDescription
paramsJoyType_Params
font_color_nameCOMBOwhite149 options: transparent, red, green, blue, white, black, +143
font_color_codeSTRING00ffdd
font_color_codeRINT-1-1–255
font_color_codeGINT00–255
font_color_codeBINT00–255
font_color_codeAINT00–255
font_color_modeBOOLEANtrue
bg_color_nameCOMBOtransparent149 options: transparent, red, green, blue, white, black, +143
bg_color_codeSTRING00ffdd
bg_color_modeBOOLEANtrue

Outputs (2)

NameTypeDescription
canny_imageIMAGE
font_imageIMAGE