Nodes/Zako EmbedText/Zako-Composer (海报合成)
ComfyUI Node

Zako-Composer (海报合成)

Zako-Composer renders the whole layout

By xiaoshengyvlin·Created 17 days ago·Updated 12 days ago· 0
Zako-Composer (海报合成)
  • image
  • bg_color
  • layers
  • 海报图像
canvas_ratio0.00
mask
image_h1.00

Of the three nodes in the Zako-EmbedText pack, this is the one that actually touches pixels. Zako-Text and Zako-Deco just describe layers in your head; Zako-Composer is where those descriptions become an image. You wire your base image into one side, plug a few text and decoration layers into the other, and out comes a finished poster - title, kicker, corner ornaments, the works - without ever exporting to Photoshop or pasting text on with an editor.

It exists because ComfyUI is genuinely bad at putting text on images. Generate text into the diffusion model and Chinese characters come out as garbled mush more often than not; the sane alternatives were a PIL script or a trip to an image editor. This trio is the "do it in the graph" answer, and the Composer is the sink every layer flows into.

How it works

The mechanism is refreshingly simple once you read the source. Each Zako-Text and Zako-Deco node returns a lightweight dict - a description of a layer, tagged with a custom ZAKO_LAYER type - not a rendered image. ZakoComposer collects them, then draws everything on the CPU with Pillow in one pass:

  1. The base image is resized and cropped to fit your target canvas (see canvas_ratio below), with the extra band filled by bg_color.
  2. If you picked a mask, the image band gets a rounded-rectangle or ellipse cutout so the background color shows through around it.
  3. Each layer is drawn in order - and here's the subtle part: layer order is z-order. The layers are sorted by the numeric suffix of the input slot you plugged them into, so 图层_2 draws on top of 图层_1. Change stacking by re-plugging, not by hiding nodes.

It returns a normal IMAGE tensor, batched too - feed it a batch of base images and it renders all of them. Because the pack targets ComfyUI's newer V3 node API (io.ComfyNode + comfy_entrypoint), all of this is one clean classmethod instead of the old dictionary-based registration.

The inputs that matter

  • image - your base image, straight from a LoadImage or any generation.
  • layers - the autogrow input. It starts showing three sockets; connect a fourth Zako layer and it expands automatically, up to 20. This is the whole pitch of the pack: edit copy, add a layer, and the wires never move.
  • canvas_ratio - 0 keeps the base image at its original size. Anything above 0 means canvas height = width × value, and the image is fitted into a band on that canvas. The tooltip gives the poster ratios people actually want: 1.5 for 2:3, 1.33 for 3:4, 1.78 for 9:16, 0.56 for 16:9.
  • image_h - when you extend the canvas, how much of that height the image band takes (1 = full height). A value like 0.7 leaves headroom for a headline on a plain background.
  • mask - / 圆角 / 椭圆, and bg_color - the color outside the band and the mask.

The only output is the poster image; wire it into Preview Image or Save Image.

Installing it

This pack has zero dependencies - no requirements.txt, nothing in pyproject.toml except torch/numpy/Pillow, which ComfyUI already ships. Install it like any custom node:

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

Then restart ComfyUI. If you use ComfyUI Manager, search for Zako-EmbedText and click install - same result, and Manager will offer updates for it. There are no model files to download, and the fonts are handled at runtime (more on that in the Zako-Text article).

Gotchas

  • ZAKO_LAYER is a pack-private type - a layer from Zako-Text or Zako-Deco only plugs into this composer. You can't feed it into anything else, and you can't save a layer as an image on its own.
  • Because the pack uses the V3 node API, it needs a reasonably recent ComfyUI build. If the nodes don't show up after install, update ComfyUI before debugging anything else.
  • Change canvas_ratio and the whole composition re-fits - that's by design (positions are canvas fractions, so they survive the resize), but it also means a ratio you liked at 2:3 isn't preserved at 9:16.

It's a niche tool - poster text in ComfyUI is a niche workflow - but for that workflow it's the closest thing to a finished product the ecosystem ships.

CategoryZako-EmbedText

Inputs (6)

NameTypeDefaultDescription
imageIMAGE输入的原始底图
canvas_ratioFLOAT0.000–30 = 使用底图原始尺寸;大于 0 = 画布高 = 宽 × 该值。常用值:2:3=1.5、3:4=1.33、1:1=1.0、9:16=1.78、16:9=0.56
bg_colorCOLOR#000000扩展画布/遮罩外的底色
maskCOMBO对底图带(image_h 小于 1 时的图像区域)做形状遮罩,遮罩外露出画布底色
image_hFLOAT1.000.05–1画布高宽比大于 0 时:底图带占画布高度的比例(1 = 全高)
layersoptCOMFY_AUTOGROW_V3并联接入的文字与装饰图层,默认显示 3 个,连接后可自动扩展至最多 20 个

Outputs (1)

NameTypeDescription
海报图像IMAGE