Nodes/ComfyUI Invisible Watermark/Invisible Watermark Encode
ComfyUI Node

Invisible Watermark Encode

This 'Invisible Watermark' Node Hides Text in the Pixel Data — Read This Before You Trust It

By web3nomad·Created 2 years ago·Updated 2 years ago· 1
Invisible Watermark Encode
  • images
  • IMAGE
watermarkHello World!

Want to bury a short string inside an image so it survives, invisibly, when you hand the file around? That's the pitch of Invisible Watermark Encode from the ComfyUI_Invisible_Watermark pack. You feed it an image, type "Hello World!" (or whatever), and get back a pixel-for-pixel-look-alike that has your text baked into the data. No model, no API, no huge download - the whole pack is one node, a bundled font, and about a hundred lines of Python.

Just know what you're buying. This is least-significant-bit steganography, one of the oldest tricks in the digital-image book, not a forensic-grade provenance system. It's a handy "did this exact PNG pass through untouched" marker, and basically nothing more.

How it actually works

Pop the hood and the mechanism is refreshingly honest. The node renders your watermark text onto a transparent canvas using a bundled font (the pack ships a Chinese typeface, ZiTiQuanWeiJunHei-W1-2.ttf), then tiles that text across the whole image as a repeating mask. Then it plays with the lowest bit of every RGB channel:

  • where the text mask is drawn, it clears the least significant bit (& ~1)
  • everywhere else, it sets it (| 1)

That's it. Changing a value by 1/255 is invisible to the eye, which is the point, but it does mean the watermark lives entirely in the noisy bottom bit-plane of the image. There's no EXIF, no metadata, no alpha-channel smuggling - pure pixel manipulation.

The catch: because the text is tiled with a fixed layout at a fixed font size, anyone who knows the scheme could in principle read it back. More importantly, this pack ships no decoder. There's only InvisibleWatermarkEncode in the node mappings - no "decode" sibling. You can stamp your text in; this pack won't get it out for you. It's a claim marker ("this PNG came from me, verify by inspecting the bit plane"), not a two-way system.

The inputs and outputs that matter

Only two inputs, both required:

  • images (IMAGE) - whatever batch you're watermarking.
  • watermark (STRING, default Hello World!) - the text to embed. Single line, so keep it short; a long string just gets word-wrapped and tiled smaller.

Output is a single IMAGE (returned as a list/batch, so it plugs straight into a Preview Image or Save Image node and every downstream node that eats a batch). There's nothing else to configure.

Installing it

Easiest route is ComfyUI Manager - search for "ComfyUI Invisible Watermark" and hit install. Manual works too:

cd ComfyUI/custom_nodes
git clone https://github.com/web3nomad/ComfyUI_Invisible_Watermark

Then restart ComfyUI. No requirements.txt, no model files to fetch, no heavy dependencies - the font is already in the repo, and it only needs Pillow/numpy/torch, all of which ComfyUI already ships. This is about as friction-free as a custom node gets.

Where people get burned

Two gotchas, and the first one is a doozy. The node hardcodes a resize to 512×512 before watermarking - no aspect-ratio preservation, no resolution option. Feed it a 1024×1024 render and out comes a stretched, blocky 512×512 image. Wire it into a dead-end branch used only for the watermarked copy, or feed it a deliberately low-res version of your output. Don't put it on your main save path.

Second: the watermark only survives lossless PNG. Any JPEG re-encode, screenshot, resize, or re-upload wrecks the bit plane instantly - which is the same weakness the community has documented even for Google's far more sophisticated SynthID pixel watermarks (there are whole reddit threads on scrubbing those with a low-denoise re-diffusion pass). If your distribution path involves anything lossy, this watermark is gone before it ships.

So the honest use case: you want a permanent, invisible provenance tag on an exact PNG file you control. For anything more ambitious - robust provenance, or recovering the text later - this isn't the tool; you'd be better off with proper metadata or a model-based watermark. But for a dead-simple "I can prove this exact file came from me" marker, it does exactly what the name says, no dependencies required.

CategoryWATERMARK

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
watermarkSTRINGHello World!

Outputs (1)

NameTypeDescription
IMAGEIMAGE