Nodes/Zako EmbedText/Zako-Text (文字版块)
ComfyUI Node

Zako-Text (文字版块)

Zako-Text (文字版块)

By xiaoshengyvlin·Created 17 days ago·Updated 12 days ago· 0
Zako-Text (文字版块)
  • color
  • stroke_color
  • shadow_color
  • 图层
text海报标题
font华文中宋
size0
x0.50
y0.50
verticalfalse
angle0
spacing0.25
gap0.40
shadow0
stroke0
shadow_blur0.0

ComfyUI ships no native way to draw text on an image, and if you've tried to prompt your way to a readable Chinese headline, you know why people give up and reach for an editor. Zako-Text is the fix: a node that lays out real text - using real font files, not the model's half-trained idea of a glyph - and hands it to the pack's composer to render. It's built for Chinese poster typography, which is exactly the niche where diffusion text generation falls apart hardest.

This is the workhorse of the Zako-EmbedText trio. The typical split is a Zako-Text per block - main title, subtitle, kicker, credit line - all fanned into one Zako-Composer. You'll probably use this node more than the other two combined.

How it works

ZakoText doesn't render anything. Its execute() returns a dict describing the block - kind, text, font, size, position, angle, stroke, shadow - tagged with the pack's custom ZAKO_LAYER type. The composer is the only node that knows how to draw that dict; the layer itself is just data. The heavy lifting happens there with Pillow: glyph-by-glyph drawing, per-character rotation in vertical mode, stroke via stroke_width, shadows via offset + Gaussian blur. Rendered text layers are cached (up to 512), so re-running a workflow with unchanged text is cheap.

Two details in the source are worth knowing because they're the pack's best ideas. First, negative size values are fractions of canvas width: -25 means 2.5% of the canvas width, so a headline that looks right at 1024px still looks right when the composer renders at 768. Second, positions are canvas fractions, not pixels - x=0.5, y=0.2 means "center the block at 50% across, 20% down," which survives any canvas resize without touching a wire.

The inputs that matter

  • text - multiline. A newline makes a new line; in vertical mode, | splits columns.
  • size - pixels, 0 for the default adaptive size, or negative for the width-per-mille trick above. This is the one to reach for when something's too big or small.
  • x / y - where the block's center lands, as canvas fractions (0–1). The tooltip is explicit: 0.5 centers it.
  • vertical - turns on vertical typesetting, with half-width Latin letters and digits automatically rotated 90° clockwise so they sit upright in a vertical line. That's a real typography feature, not a gimmick.
  • spacing and gap - character spacing and line/column spacing, both as multiples of font size (0.25 default; the tooltip suggests 0.5–1.0 for eyebrow text and English headlines). Note that spacing only applies horizontally; in vertical mode the gap input controls it.
  • stroke and shadow (plus their colors and shadow_blur) - outline and drop shadow, off at 0 by default.

The single output, 图层 (layer), feeds the layers input on Zako-Composer.

Fonts

The pack ships no font files - most Chinese fonts can't legally be redistributed, and the author knows it. Instead it resolves fonts at startup: anything in the fonts/ directory wins, then it probes the system for Microsoft YaHei, SimSun, the Huawen family, Arial, Georgia, and friends. The one real trap: the probe paths are Windows (C:\Windows\Fonts) and macOS (/Library/Fonts, /System/Library/Fonts). On Linux nothing is auto-detected - drop your .ttf/.ttc/.otf into custom_nodes/Zako-EmbedText/fonts/ and restart, or you'll get Pillow's fallback bitmap font. If Chinese renders as boxes, this is why.

Installing it

Zero dependencies, no models. Via ComfyUI Manager search for Zako-EmbedText, or:

cd ComfyUI/custom_nodes
git clone https://github.com/xiaoshengyvlin/Zako-EmbedText

Restart ComfyUI and it's live. Because it targets the newer V3 node API, keep ComfyUI reasonably up to date or the nodes won't appear.

One honest caveat: a ZAKO_LAYER is only usable inside this pack, and it's a niche pack with a tiny community footprint. But if your workflow is "make posters in ComfyUI," there's nothing else that does vertical Chinese typography this cleanly.

CategoryZako-EmbedText

Inputs (15)

NameTypeDefaultDescription
textSTRING海报标题输入文字内容,换行符表示多行,竖排模式下用 | 分列
fontCOMBO华文中宋选择渲染字体(支持中英文精选海报字体)
sizeINT0-500–500字号像素大小;负值 = 按画布宽度千分比自适应(如 -25 即画布宽的 2.5%);0 为默认自适应
colorCOLOR#f2ece6文字颜色
xFLOAT0.500–1文字块中心对齐到该点的横坐标(占画布宽度比例):0.0 靠左,0.5 居中,1.0 靠右
yFLOAT0.500–1文字块中心对齐到该点的纵坐标(占画布高度比例):0.0 顶部,0.5 居中,1.0 底部
verticalBOOLEANfalse开启后为竖排排版,多列可用 | 分隔(半角英文/数字自动顺时针旋转 90°)
angleFLOAT0-180–180文字块绕定位点的旋转角度(-180 ~ 180 度)
spacingFLOAT0.250–2字符间距 = 字号 × 该值;眉题/英文标题常用 0.5 ~ 1.0(仅横排生效,竖排模式下字距由行/列间距控制)
gapFLOAT0.400–2多行文字的行距、竖排多列的列距 = 字号 × 该值(竖排模式下同时控制列内字距)
shadowFLOAT00–30文字投影的偏移像素,0 为关闭
strokeINT00–20文字描边宽度,0 为关闭
stroke_colorCOLOR#000000描边颜色(描边宽度大于 0 时生效)
shadow_colorCOLOR#000000文字投影颜色(阴影距离大于 0 时生效)
shadow_blurFLOAT0.00–20文字投影的高斯模糊半径,0 为硬阴影

Outputs (1)

NameTypeDescription
图层ZAKO_LAYER