ComfyUI Node

PIP SVG Recorder

Design a text style in ComfyUI and ship it as a reusable SVG

By chenpipi0807·Created about a year ago·Updated 7 days ago· 30
PIP SVG Recorder
  • 背景颜色
  • 填充颜色
  • 填充渐变颜色1
  • 填充渐变颜色2
  • 描边颜色
  • 描边渐变颜色1
  • 描边渐变颜色2
  • 阴影颜色
  • 内阴影颜色
  • 外发光颜色
  • 预览图
  • 信息
文本内容艺术字
字体名称Knewave-Regular
字体大小72
操作模式测试模式
文件名称my_style
预览宽度512
预览高度512
背景透明度0.0
启用填充true
填充类型渐变
填充渐变类型线性渐变
填充渐变方向从上到下
启用描边true
描边宽度5
描边透明度1.0
描边类型渐变
描边渐变类型线性渐变
描边渐变方向从左到右
启用阴影true
阴影透明度0.6
阴影X偏移5
阴影Y偏移5
阴影模糊10
启用内阴影false
内阴影透明度0.7
内阴影X偏移2
内阴影Y偏移2
内阴影模糊2
启用外发光false
外发光透明度0.8
外发光模糊10
外发光强度1.0

Every style in the PIP_ArtisticWords pack is an SVG file. That's the entire architecture: drop an SVG in, restart, and it shows up in the style dropdowns of the text nodes. So how do you make your own style without hand-editing XML? PIP SVG Recorder. It renders styled text to a preview image, and if you switch it to save mode, it writes a ready-to-use SVG template straight into the pack's SVG/ folder. Design loop, closed.

What it does

Give it some text, a font, a size, and as many effect parameters as you can stand, and it returns:

  • 预览图 (IMAGE) - your text rendered with the current effect settings on a (default transparent) background.
  • 信息 (STRING) - a text dump of every applied setting, so you can see what you actually built.

The one input that changes its behavior entirely: 操作模式. In 测试模式 (test mode) it only previews. In 保存模式 (save mode) it also writes SVG/<文件名称>.svg (default filename my_style) and - after a ComfyUI restart - that style appears in the Generator and Preview nodes' style lists.

The inputs that matter

Required: 文本内容 (the sample text), 字体名称 (the five bundled fonts), 字体大小 (8–500, default 72), 操作模式, 文件名称, and 预览宽度/预览高度 (128–2048, default 512).

Then the optional effects, all in Chinese labels:

  • 启用填充 / 填充类型 - fill as 纯色 (solid), 渐变 (gradient), or 无填充 (none). Gradients take two colors plus a direction (8 options, 从左到右 through 右上到左下).
  • 启用描边 - outline with width (0–50), opacity, color, and its own gradient option.
  • 启用阴影 - drop shadow with color, opacity, X/Y offset, and blur (0–100).
  • 启用内阴影 - inner shadow (off by default) with the same controls plus its own offsets.
  • 启用外发光 - outer glow (off by default) with color, opacity, blur, and intensity.
  • 背景颜色 / 背景透明度 - only for the preview, so you can see a light or dark style against something.

How it works

The node builds a style dict from all those options, renders the preview through the same TextRenderer / EffectsProcessor pipeline the other nodes use, and in save mode hands the dict to an SVG generator that writes a properly structured SVG - <defs> with gradient/filter definitions, <path> with the fill and stroke references - matching what the README documents for hand-authored styles. It's the same format designers export from Sketch after converting text to outlines, so the two paths converge.

Installing it

Part of the PIP_ArtisticWords pack, one-time install:

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 and restart. Dependencies are Pillow, numpy, opencv-python, and webcolors - nothing else.

Gotchas

  • Saved styles need a restart to appear. The dropdowns are populated at startup, so a freshly saved SVG won't show until you reload ComfyUI. Slightly annoying, fully intentional.
  • Save mode overwrites silently. A filename that already exists in SVG/ gets clobbered with no warning. Give styles unique names (the default my_style will collide on the second save).
  • Only the saved SVG matters, not the preview. If the rendered preview and the later Generator output differ slightly, that's the same effect pipeline, so they should match - but the SVG is the source of truth.
  • Chinese UI, again. All labels are Chinese (操作模式, 文件名称, 启用填充…). The 测试/保存 mode toggle is the one you must find, so bookmark this page if your ComfyUI doesn't translate them.
  • Font licensing applies to anything you design here - the bundled 方正风雅宋 is a commercial font, and the README's warning covers it.
CategoryPIP艺术字

Inputs (42)

NameTypeDefaultDescription
文本内容STRING艺术字
字体名称COMBOKnewave-Regular5 options: Knewave-Regular, Lobster-Regular, PermanentMarker-Regular, Yesteryear-Regular, 方正风雅宋
字体大小INT728–500
操作模式COMBO测试模式2 options: 测试模式, 保存模式
文件名称STRINGmy_style
预览宽度INT512128–2048
预览高度INT512128–2048
背景颜色optCOLOR#FFFFFF
背景透明度optFLOAT0.00–1
启用填充optBOOLEANtrue
填充类型optCOMBO渐变3 options: 纯色, 渐变, 无填充
填充颜色optCOLOR#4096FF
填充渐变类型optCOMBO线性渐变1 options: 线性渐变
填充渐变方向optCOMBO从上到下8 options: 从左到右, 从右到左, 从上到下, 从下到上, 左上到右下, 右下到左上, +2
填充渐变颜色1optCOLOR#EE2883
填充渐变颜色2optCOLOR#FFDC7D
启用描边optBOOLEANtrue
描边宽度optINT50–50
描边透明度optFLOAT1.00–1
描边类型optCOMBO渐变2 options: 纯色, 渐变
描边颜色optCOLOR#000000
描边渐变类型optCOMBO线性渐变1 options: 线性渐变
描边渐变方向optCOMBO从左到右8 options: 从左到右, 从右到左, 从上到下, 从下到上, 左上到右下, 右下到左上, +2
描边渐变颜色1optCOLOR#EE2883
描边渐变颜色2optCOLOR#FFDC7D
启用阴影optBOOLEANtrue
阴影颜色optCOLOR#000000
阴影透明度optFLOAT0.60–1
阴影X偏移optINT5-100–100
阴影Y偏移optINT5-100–100
阴影模糊optINT100–100
启用内阴影optBOOLEANfalse
内阴影颜色optCOLOR#9900FF
内阴影透明度optFLOAT0.70–1
内阴影X偏移optINT2-50–50
内阴影Y偏移optINT2-50–50
内阴影模糊optINT20–50
启用外发光optBOOLEANfalse
外发光颜色optCOLOR#00FF00
外发光透明度optFLOAT0.80–1
外发光模糊optINT100–20
外发光强度optFLOAT1.00–1

Outputs (2)

NameTypeDescription
预览图IMAGE
信息STRING