Nodes/comfyui-dreambait-nodes/Draw Mana Symbols 🎴
ComfyUI Node

Draw Mana Symbols 🎴

Turn {W}{U}{B}{R}{G} into actual Magic cards

By drmbtΒ·Created 2 years agoΒ·Updated 7 months agoΒ· 6
Draw Mana Symbols 🎴
  • img_composite
  • margins
  • textbox
  • shadow
  • image
  • mask
β—„text{W}{U}{B}{R}{G}β–Ί
β—„image_width512β–Ί
β—„image_height512β–Ί
β—„font_namemana.ttfβ–Ί
β—„font_size54β–Ί
β—„font_colorwhiteβ–Ί
β—„font_opacity1.00β–Ί
β—„background_colorblackβ–Ί
β—„background_opacity1.00β–Ί
β—„vertical_aligntopβ–Ί
β—„horizontal_alignleftβ–Ί
β—„justifyfalseβ–Ί
β—„x_percent0.00β–Ί
β—„y_percent0.00β–Ί
β—„x_offset0β–Ί
β—„y_offset0β–Ί
β—„line_spacing6β–Ί
β—„rotation_angle0.0β–Ί
β—„rotation_optionsβ–Ύβ–Ί
β—„languageen_USβ–Ί
β—„font_color_hex#000000β–Ί
β—„bg_color_hex#000000β–Ί

Draw Mana Symbols is the pack's most gloriously niche node: it renders Magic: The Gathering mana costs as actual card-art symbols. Type {W}{U}{B}{R}{G} and get white, blue, black, red, and green mana icons rendered into an image. If you generate custom card frames, alter cards, or make MTG-themed content, this is the node that exists because the author wanted it - and it's honestly the only one of its kind I've seen in the ComfyUI ecosystem.

How it works

Under the hood it's a thin wrapper around the pack's Draw Text node. You type a mana cost in curly-brace notation and the node converts it before rendering:

  • {W} {U} {B} {R} {G} - the five colors
  • {1} through {9} - generic mana
  • {X} {Y} {Z}, {C} (colorless), {H} (phyrexian), {S} (snow), plus fancy variants like {W-ORIGINAL} and {W-LIST}

Each maps to a glyph in the mana.ttf icon font that ships with the pack, so there's no model download and no external asset hunting - the font is in custom_nodes/comfyui-dreambait-nodes/fonts/. That's also why font_name defaults to mana.ttf and why the font list in the node includes the other packaged fonts (MPlantin, Gotham, horizon, etc.) for pairing body text with symbols.

Everything else is inherited from Draw Text: image_width/image_height (ignored if you composite onto an existing img_composite image), font_size, font_color, background_color, full alignment controls, x_percent/y_percent positioning, rotation_angle, even language for hyphenation. Outputs are image and mask - the mask lets you composite just the symbols onto a card frame without a colored background box. That's the workflow: render symbols with a transparent background, then use the mask to punch them into your card design.

The inputs you'll actually touch

  • text - the mana string, e.g. {1}{W}{W} for a two-white one-generic cost
  • font_size - bigger than you think; 54 is the default and reads small at card scale
  • background_color / background_opacity - set transparent (or use an 8-digit hex with alpha) if you're compositing onto a card

One tip: the whole system is case- and bracket-sensitive - {w} won't convert. Keep the braces and uppercase letters exactly as in the examples.

Install

It's part of drmbt/comfyui-dreambait-nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/drmbt/comfyui-dreambait-nodes

then restart ComfyUI (or find it via ComfyUI Manager as "comfyui-dreambait-nodes"). The pack's full dependency list installs with it, heavy ML deps included, even though this node just needs Pillow and a font file. It's a fun utility, not a serious ML node - but it's the kind of well-executed specificity that makes a grab-bag pack worth keeping around.

CategoryDreamBait/Text

Inputs (26)

NameTypeDefaultDescription
textSTRING{W}{U}{B}{R}{G}Text to render. Supports mana symbols in {W}{U}{B}{R}{G} format
image_widthINT51264–2048Width of output image. Ignored if img_composite is provided
image_heightINT51264–2048Height of output image. Ignored if img_composite is provided
font_nameCOMBOmana.ttfTTF font file to use from the fonts directory
font_sizeINT541–1024Font size in pixels
font_colorCOMBOwhiteText color. Alpha controlled by opacity unless using 8-digit hex
font_opacityFLOAT1.000–1Text opacity (ignored if using 8-digit hex color)
background_colorCOMBOblackBackground color. Alpha controlled by opacity unless using 8-digit hex
background_opacityFLOAT1.000–1Background opacity (ignored if using 8-digit hex color)
vertical_alignCOMBOtop3 options: center, top, bottom
horizontal_alignCOMBOleftHorizontal text alignment
justifyBOOLEANfalseEnable full justification (except last line of paragraph)
x_percentFLOAT0.000–100Horizontal position as percentage of image width
y_percentFLOAT0.000–100Vertical position as percentage of image height
x_offsetINT0-4096–4096Additional horizontal offset in pixels
y_offsetINT0-4096–4096Additional vertical offset in pixels
line_spacingINT6-1024–1024Additional space between lines in pixels
rotation_angleFLOAT0.0-360–360Text rotation angle in degrees
rotation_optionsCOMBO2 options: text center, image center
languageCOMBOen_USLanguage for hyphenation rules
font_color_hexoptSTRING#000000Custom hex color (6 or 8 digits). 8-digit hex overrides opacity
bg_color_hexoptSTRING#000000Custom hex color (6 or 8 digits). 8-digit hex overrides opacity
img_compositeoptIMAGEβ€”
marginsoptMARGINSβ€”
textboxoptTEXTBOXβ€”
shadowoptSHADOWβ€”

Outputs (2)

NameTypeDescription
imageIMAGEβ€”
maskMASKβ€”