Nodes/Comfyroll Studio/πŸ”€οΈ CR Draw Text
ComfyUI Node Runs on cloud

πŸ”€οΈ CR Draw Text

Render text onto a fresh canvas in ComfyUI

By Suzie1Β·Created 3 years agoΒ·Updated 2 years agoΒ· 1,296
πŸ”€οΈ CR Draw Text
    • IMAGE
    • show_help
    β—„image_width512β–Ί
    β—„image_height512β–Ί
    β—„texttextβ–Ί
    β—„font_nameβ–Ύβ–Ί
    β—„font_size50β–Ί
    β—„font_colorβ–Ύβ–Ί
    β—„background_colorβ–Ύβ–Ί
    β—„alignβ–Ύβ–Ί
    β—„justifyβ–Ύβ–Ί
    β—„margins0β–Ί
    β—„line_spacing0β–Ί
    β—„position_x0β–Ί
    β—„position_y0β–Ί
    β—„rotation_angle0.0β–Ί
    β—„rotation_optionsβ–Ύβ–Ί
    β—„font_color_hex#000000β–Ί
    β—„bg_color_hex#000000β–Ί

    You want text baked into an image - a title card, a caption, a watermark, a meme top-line, or a clean text layer you'll composite later. CR Draw Text does exactly that: it paints your words onto a brand-new canvas and hands you back an IMAGE. Note the distinction from its sibling CR Overlay Text, which writes onto an image you already have. Draw Text starts from blank.

    It's one of the graphics utilities in Comfyroll Studio, the big quality-of-life pack by Suzie1 and RockOfFire that grew up alongside the popular Comfyroll template workflows. Nothing here touches a model or the GPU - it's plain image drawing (PIL under the hood), so it's instant and deterministic.

    How it works

    You set a canvas size, type your text, pick a font and color, and the node lays the glyphs down according to your alignment and position settings. Because it's rendering from scratch, you control the background too - which makes it handy as a text mask source: white text on black, feed the result into a mask input, and you've got typography you can composite or use for regional tricks.

    The inputs that matter

    • text - multiline, so line breaks land where you put them.
    • font_name - a dropdown of the ~10 fonts bundled with the pack (Roboto, Oswald, Impact, comic.ttf, a pixel font, etc.). Want your own? Drop a .ttf into the pack's fonts folder and restart.
    • font_size and font_color - size in px; color is a named-color dropdown. The catch that trips everyone: to use a hex color you must set font_color to custom, then fill in the optional font_color_hex input. Pick a named color and the hex box is ignored.
    • align / justify - vertical (center/top/bottom) and horizontal (center/left/right) placement. position_x / position_y nudge from there, and rotation_angle spins it.

    Background color works the same way (background_color β†’ custom β†’ bg_color_hex). Outputs are IMAGE (wire to a save/preview or a compositing node) plus show_help, a string that just links to the node's wiki page - leave it unconnected.

    Installing it

    Easiest path is ComfyUI Manager: open the Manager, search Comfyroll Studio, install, restart. By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes
    

    then restart ComfyUI. No model downloads, no weights - the fonts ship inside the repo.

    Common issues

    Your hex color does nothing. As above - font_color (or background_color) has to be custom before the hex input is read. This is the number-one gotcha with every Comfyroll node that has a color picker.

    The whole pack refuses to load. If ComfyUI's console shows Comfyroll Studio: Failed to load Graphics nodes followed by a NameError: name 'CR_HalftoneGrid' is not defined, that's not a Draw Text bug - it's a missing graphics dependency (the pack's graphics code needs libraries like matplotlib). When the graphics module fails to import, the pack's node-mapping file references classes that never got created and the entire pack fails, Draw Text included. Scroll up in the log to the first real traceback, pip install the missing package into ComfyUI's Python (the embedded python_embeded on Windows portable), and restart. People hit exactly this in early 2025 on fresh installs.

    Font looks wrong or falls back. Only fonts the node can actually find are usable - if you added a custom .ttf, confirm it's in the pack's fonts directory and that you restarted, otherwise it silently uses a default.

    Category🧩 Comfyroll Studio/πŸ‘Ύ Graphics/πŸ”€ Text

    Inputs (17)

    NameTypeDefaultDescription
    image_widthINT51264–2048β€”
    image_heightINT51264–2048β€”
    textSTRINGtextβ€”
    font_nameCOMBO10 options: Roboto-Regular.ttf, Quicksand-Bold.ttf, Oswald-Bold.ttf, comic.ttf, AlumniSansCollegiateOne-Regular.ttf, NotoSansArabic-Regular.ttf, +4
    font_sizeINT501–1024β€”
    font_colorCOMBO30 options: custom, white, black, red, green, blue, +24
    background_colorCOMBO30 options: custom, white, black, red, green, blue, +24
    alignCOMBO3 options: center, top, bottom
    justifyCOMBO3 options: center, left, right
    marginsINT0-1024–1024β€”
    line_spacingINT0-1024–1024β€”
    position_xINT0-4096–4096β€”
    position_yINT0-4096–4096β€”
    rotation_angleFLOAT0.0-360–360β€”
    rotation_optionsCOMBO2 options: text center, image center
    font_color_hexoptSTRING#000000β€”
    bg_color_hexoptSTRING#000000β€”

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGEβ€”
    show_helpSTRINGβ€”