Nodes/ComfyUI_Anytext/JoyType Sampler
ComfyUI Node

JoyType Sampler

The SD1.5 diffusers sampler (JoyType's)

By zmwv823·Created 2 years ago·Updated about a year ago· 103
JoyType Sampler
  • diffusers_model
  • diffusers_control
  • image
promptbeautiful landscape, many peaks, clear lake,
a_promptbest quality, extremely detailed, 4k, HD, supper legible text, clear text edges, clear strokes, neat writing, no watermarks,
n_promptlow-res, bad anatomy, extra digit, fewer digits, cropped, worst quality, low quality, watermark, unreadable text, messy words, distorted text, disorganized writing, advertising picture
steps20
cfg7.5
schedulerEuler a
width512
height512
batch_size1
seed88888888
deviceauto
keep_model_loadedtrue
keep_model_devicetrue

This is a self-contained SD 1.5 sampler that runs through HuggingFace's diffusers library rather than ComfyUI's native sampling. Its display name in the menu is "JoyType Sampler," and that's its main job - pairing an SD 1.5 diffusers checkpoint with the JoyType canny control image to render text into a picture. But the control input is optional, so it also works as a plain text-to-image sampler.

The reason it exists as a separate node is that JoyType (and the diffusers path generally) doesn't slot into Comfy's normal MODEL/CONDITIONING wiring - it wants a diffusers pipeline. This node wraps that whole pipeline into one box.

How it works

You feed it a diffusers_model (from UL_DiffusersCheckpointLoader), your prompts, and optionally a diffusers_control - which is the canny_image from the JoyType Font_Img node. The node runs the diffusers denoise loop and returns a finished IMAGE directly (not a latent - it does the VAE decode internally). Because it's diffusers, it exposes its own scheduler list (28 options, Euler a by default) and a device selector, and it manages model residency with its own keep_model_loaded flags rather than Comfy's.

The inputs and outputs that matter

  • diffusers_model (Diffusers_Model) - the checkpoint, from the diffusers loader. Required.
  • prompt - your main scene text. The a_prompt (appended quality terms) and n_prompt (negative) come pre-filled with sensible text-rendering defaults ("supper legible text, clear text edges…") - leave them unless you have a reason.
  • steps (20), cfg (7.5), scheduler (Euler a) - standard SD 1.5 sampling values, and standard here.
  • width / height (default 512) and batch_size - SD 1.5 wants ~512; push resolution too far and you get the usual SD 1.5 duplication.
  • diffusers_control (optional, Diffusers_Control) - the JoyType canny hint. Connect it for text rendering; leave it off for plain text-to-image.

Output is image (IMAGE) - ready to save or post-process.

How to install it

ComfyUI Manager, search ComfyUI_Anytext, or:

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

then restart. For the JoyType use case, download the JoyType-v1-1M canny ControlNet into ComfyUI/models/controlnet and an SD 1.5 checkpoint for the diffusers loader. The diffusers library itself comes in with the pack's requirements.

Common issues & troubleshooting

It ignores my ControlNet. diffusers_control is optional, so if it's not connected the node just does text-to-image. For JoyType text rendering, wire the canny_image output of the Font_Img node into it.

Slow first run. Diffusers loads and compiles its pipeline separately from Comfy's model manager. The first generation after loading is slower; keep_model_loaded keeps it warm for subsequent runs. Turn that off if you're short on VRAM and swapping models.

Duplicated subjects / mangled composition at high res. Classic SD 1.5 behavior above ~512–768px. Keep the base resolution modest and upscale afterward rather than sampling large.

Why diffusers instead of a native KSampler? Only because JoyType ships as a diffusers pipeline. If you'd rather stay in native ComfyUI, the author notes JoyType's canny model also works with a normal Comfy KSampler + ControlNet - this node is just the batteries-included option.

CategoryUL Group/Image Generation

Inputs (15)

NameTypeDefaultDescription
diffusers_modelDiffusers_Model
promptSTRINGbeautiful landscape, many peaks, clear lake,
a_promptSTRINGbest quality, extremely detailed, 4k, HD, supper legible text, clear text edges, clear strokes, neat writing, no watermarks,
n_promptSTRINGlow-res, bad anatomy, extra digit, fewer digits, cropped, worst quality, low quality, watermark, unreadable text, messy words, distorted text, disorganized writing, advertising picture
stepsINT201–100
cfgFLOAT7.51–99
schedulerCOMBOEuler a28 options: PNDM from pretrained, Euler, Euler Karras, Euler a, DPM++ 2M, DPM++ 2M Karras, +22
widthINT512256–10240
heightINT512256–10240
batch_sizeINT11–960
seedINT888888880–18446744073709550000
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)或者保留在设备专用内存上。
diffusers_controloptDiffusers_Control

Outputs (1)

NameTypeDescription
imageIMAGE