Nodes/comfyui-save-image-watermark/Extract Hidden Watermark πŸ”
ComfyUI Node

Extract Hidden Watermark πŸ”

Reading back the secret your Save node buried

By aicuaiΒ·Created 9 months agoΒ·Updated 2 days agoΒ· 3
Extract Hidden Watermark πŸ”
  • image
  • hidden_message
β—„max_length1000β–Ί

This is the other half of the LSB trick. ExtractInvisibleWatermark (category AICU/Watermark, same aicuai/comfyui-save-image-watermark pack as Save Image (Watermark) πŸ’§) does exactly one thing: it digs the hidden message out of an image's least significant bits. If you embedded an invisible_watermark on the save side, this is how you get it back - verify your own output, check whether an image you received is watermarked, or just demystify what's hiding in the pixels.

Wiring is two nodes long:

[LoadImage] β†’ [Extract Hidden Watermark πŸ”] β†’ [ShowText]

You can also chain it straight off the save node's image output instead of reloading the file, which makes a tidy self-checking workflow.

How it works

No AI, no model, no API - pure pixel math. The node takes the first frame of your image tensor, converts it to RGB, flattens it, and reads the least significant bit of every channel sequentially from the top-left pixel, reassembling bytes until it hits a null terminator, then decoding UTF-8. The read order is a mirror of the write order in LocalSaveImageWithWatermark, and since that node embeds the LSB message last (after the visible logo and text passes), those overlays don't corrupt what this one reads.

Inputs and output

  • image (IMAGE, required) - the watermarked image, straight from LoadImage or the save node's image pin.
  • max_length (INT, default 1000, range 1–10000) - caps how many characters it bothers to read. The default covers any realistic message; bump it if you're embedding long strings.
  • Output: hidden_message (STRING) - wire it into ShowText or any node that takes a STRING.

That's the whole interface. One input pin, one string out.

The honest limits

This is fragile by design. Read-back only works if the image reached you unchanged: no JPEG or lossy WebP, no resize, no crop, no rotation, no color correction. Each of those shuffles LSBs and the message is gone - the README's own limitation table is refreshingly blunt about it. Even on PNG, the LSB block sits at the top-left of the frame, so heavy edits in that corner can eat it. And there's no encryption and no secret key: anyone running this node (or any generic LSB extractor) can read your message. Fine for a watermark demo or a hidden easter egg, not a channel for anything you need private.

One quirk worth knowing: extracting from an image that was never watermarked doesn't error out - you just get garbage text until a null byte stops the read. "Empty-ish gibberish output" usually means "no LSB message here," not "your node is broken."

Install

Same pack, same one-time install. Via ComfyUI Manager, search watermark or aicu; or:

cd ComfyUI/custom_nodes
git clone https://github.com/aicuai/comfyui-save-image-watermark.git

Restart ComfyUI and it appears under AICU β†’ Watermark. No extra dependencies - Pillow, NumPy and PyTorch are all bundled with ComfyUI.

If you're hiding a message, save as PNG and don't touch the file afterward. That's the whole contract of LSB steganography - and the reason the author flags DCT/DWT methods as the real future. For now, treat it as a fun experiment, not a tamper-proof signature.

CategoryAICU/Watermark

Inputs (2)

NameTypeDefaultDescription
imageIMAGEβ€”
max_lengthINT10001–10000β€”

Outputs (1)

NameTypeDescription
hidden_messageSTRINGβ€”