ComfyUI Node

PIP Text Preview

Styled text with its own alpha mask, ready to composite

By chenpipi0807·Created about a year ago·Updated 6 days ago· 30
PIP Text Preview
    • image
    • alpha_mask
    text
    seed0
    seed_mode
    style
    width1440
    height1440

    The PIP Artistic Text Generator bakes text straight into your background image. PIP Text Preview does the opposite: it renders styled text onto a transparent canvas and hands you the text image and its alpha mask separately. You get to decide where, how, and onto what the text lands - composite it yourself, blend it with a gradient, or use the mask for a completely different effect.

    What it does

    You give it text, a style, and a seed; it returns:

    • image (IMAGE) - the styled text rendered on a fully transparent background at your chosen canvas size.
    • alpha_mask (MASK) - a single-channel mask of the text area, ready for any mask-aware node.

    Since the background is transparent, you can wire the image into any composite/blend node and paste it over your render. The mask is the more powerful output: mask nodes let you feather, blur, or animate the text region, and you can even route it into an inpainting workflow so the model fills behind your typography.

    The inputs that matter

    • text - what to render (multiline).
    • style - the same 15-option list as the Generator: random or one of the 14 SVG styles (new-cyberpunk, new-luxury-gold, new-matrix-code, …).
    • seed - controls the random style/font pick when style is random.
    • seed_mode - the one input the Generator lacks. random = new seed each run; fixed = keep using your seed value; increment / decrement = step the seed by 1 each run. That's a really useful trick for scanning through style variants: set increment and queue, and every run shows you a different random style until you find one you like.

    Optional: width and height (128–4096, default 1440, step 8). Keep them multiples of 8 to play nice with the rest of ComfyUI.

    How it works

    Same engine as everything else in the pack: StyleManager loads the SVG styles, TextRenderer fits and wraps your text into a safe area (it reserves 10% margins automatically, and expands them if the style has a glow so the glow isn't clipped), EffectsProcessor applies fill/outline/shadow/inner-shadow, and the result stays on an RGBA transparent canvas instead of being composited over your image. The mask output is extracted straight from that alpha channel.

    Where it fits

    Reach for this when you want typography that feels placed rather than stamped on. Composite the image over your render for full control of position and scale, or use the alpha_mask with a blur node for a soft-edged title that sits in the image instead of on top of it. If you just want text burned in with minimal fuss, the Generator is the simpler tool - this one is for when you want to be the compositor.

    Installing it

    Same pack, same one-time setup:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chenpipi0807/PIP_ArtisticWords.git
    cd PIP_ArtisticWords
    pip install -r requirements.txt
    

    Or search "PIP Artistic Words" in ComfyUI Manager, then restart. Only Pillow, numpy, opencv-python, and webcolors - no models, no GPU load worth mentioning.

    Gotchas

    • The safe-area is hardcoded at 10%. Unlike the Generator, you can't tune the margins here - the node fixes them at 10% per side (more if the style glows). Text near the edge may clip if you render long strings, so leave breathing room in your text.
    • Chinese UI for the sibling nodes, English here. This one's labels are the pack's English originals (image, alpha_mask), which is a relief if the Chinese labels elsewhere are giving you trouble.
    • seed: 0 behaves like random even in fixed mode, matching the Generator's "0 means random" convention. Set a nonzero seed if you want fixed to actually be fixed.
    • Styles still need a restart after editing. Drop a new SVG into the pack's SVG/ folder and it only shows up in the style list after a ComfyUI reload.
    CategoryPIP

    Inputs (6)

    NameTypeDefaultDescription
    textSTRING
    seedINT00–18446744073709550000
    seed_modeCOMBO4 options: random, fixed, increment, decrement
    styleCOMBO15 options: random, new-platinum-chrome, new-luxury-gold, new-retro-vintage, new-royal-purple, new-kawaii-bubble, +9
    widthoptINT1440128–4096
    heightoptINT1440128–4096

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    alpha_maskMASK