Nodes/ComfyUI-ZML-Image/ZML_添加图像水印
ComfyUI Node

ZML_添加图像水印

Stamp your logo on a hundred images without leaving ComfyUI

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_添加图像水印
  • 图像
  • 水印图像
  • 图像
  • Help
水印大小比例0.25
不透明度1.00
位置
水平边距30
垂直边距30
全屏水印旋转角度-30
全屏水印密度1.0
全屏水印间距10

You've got a batch of images you need to put a logo on, and the idea of opening Photoshop for each one is already making you tired. ZML_AddImageWatermark (ZML_添加图像水印) is the node that does it inside the graph. Feed it an image, feed it a watermark image, and it composites the two at whatever size, opacity, and corner you pick. It's the difference between "I'll watermark these later" and actually doing it.

What it is

A deterministic image-in-image watermark - no model, no API, nothing to download for the core feature. It's part of ComfyUI-ZML-Image, the big Chinese-authored utility pack (160+ nodes, all under the 图像 → ZML_图像 submenu). The author built it because saving and tagging his own images was the whole point of the pack, so the watermark nodes get real daily-driver attention rather than "it compiles, ship it" energy.

The inputs that actually matter are few:

  • 图像 (IMAGE) - what you're watermarking.
  • 水印图像 (IMAGE, optional) - the logo. Leave it unwired and the node draws a plain "Watermark" placeholder block instead, which is handy for testing placement before you commit a real logo.
  • 水印大小比例 (FLOAT, 0.25) - watermark width as a fraction of the host image. 0.25 = a quarter of the width. Bump it down for a subtle corner logo.
  • 不透明度 (FLOAT, 1.0) - 1 is fully opaque. 0.3–0.5 is the "still visible, doesn't wreck the image" zone.
  • 位置 - ten choices: the nine corners/edges plus 全屏 (fullscreen), which tiles your logo across the whole image.

When 位置 is 全屏, three more inputs wake up: 全屏水印旋转角度 (default −30, gives that classic diagonal stripe look), 全屏水印密度 (how tightly the tiles pack), and 全屏水印间距 (gap between tiles). 水平边距/垂直边距 are the corner offsets for the single-logo modes.

Outputs are 图像 (the composited result - wire it to a Save or Preview) and a Help string that counts how many watermarks you've added, because this pack loves a counter.

How it works

Under the hood it's PIL: your watermark tensor becomes an RGBA image, gets resized to the scale ratio, and is pasted onto a copy of the source with alpha_composite, using the opacity as alpha. The fullscreen mode builds a rotated tile and repeats it across a canvas the size of your image. It's the same compositing primitive the whole post-processing layer runs on - cheap, repeatable, runs on every image in a batch without complaint.

Install and gotchas

Install is standard for this pack: ComfyUI Manager → search ComfyUI-ZML-Image, or

cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image

then restart. No extra model downloads. One thing to know: the node's own UI is Chinese-first, and English users are meant to grab the translation patch from github.com/zml-w/ZZZ_ZML_English_Patch before they go hunting through menus.

The real gotcha with watermarking in general: PNG re-encoding strips nothing, but if you're watermarking for sharing, remember that ComfyUI embeds the full workflow in the PNG. Your watermark will survive; your workflow travels with the image too. And this being a one-person pack, the author says plainly that the nodes he doesn't personally use can have rough edges - watermark-on-image is a core use case, but if you hit something weird, GitHub issues are the way, not a forum, since this pack has essentially no English-speaking community presence.

Categoryimage/ZML_图像/工具

Inputs (10)

NameTypeDefaultDescription
图像IMAGE
水印大小比例FLOAT0.250.01–2
不透明度FLOAT1.000–1
位置COMBO10 options: 左上, 中上, 右上, 左中, 居中, 右中, +4
水平边距INT300–4096
垂直边距INT300–4096
全屏水印旋转角度INT-30-360–360
全屏水印密度FLOAT1.00.5–5
全屏水印间距INT100–200
水印图像optIMAGE

Outputs (2)

NameTypeDescription
图像IMAGE
HelpSTRING