Nodes/Photography Nodes/Get Watermark
ComfyUI Node

Get Watermark

The other half of the pack's invisible watermark system

By TrophiHunter·Created about a year ago·Updated about a year ago· 5
Get Watermark
  • image
  • text
alias_length1
repeat_lsbtrue
print_to_consoletrue

Get Watermark is the reader half of the pack's LSB watermark pair: the Watermark node hides your alias in the least significant bits of the image, and this node pulls it back out. Wire in an image, get back the text string. It's the node you run when you need to check your own provenance - or check whether an image you were handed actually came from your pipeline. Nothing about it calls an API or needs a key; it's just reading bits.

How it works

LSB (least significant bit) watermarking stores one bit of your alias per pixel channel - the value 254 vs. 255, an invisible one-step difference. This node flattens the image's pixel data, reads the bottom bit of every channel, reassembles those bits into bytes, and converts them to characters. That recovered string is its TEXT output.

The parameters match the writer side: repeat_lsb tells it whether the alias was repeated across the whole image (which is how the Watermark node writes by default - repeat means a cropped image still decodes), and alias_length tells it how many characters to read if the alias wasn't repeated. The decoded text is cut at the null terminator so trailing garbage doesn't leak in. print_to_console (default on) also dumps the alias to ComfyUI's console output - handy, because in a batch workflow the TEXT output is the value you'd route to a display or a text log.

Inputs that matter

  • alias_length - how many characters to extract. Only matters with repeat_lsb off; match it to the alias you embedded
  • repeat_lsb - on if the watermark was repeated (default), off if not
  • print_to_console - also log the result to the console

One output: text (TEXT type). It's an output node, so it can sit at the end of a branch and report.

Install

Part of Photography Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/TrophiHunter/ComfyUI_Photography_Nodes

Restart, find it under TrophiHunter/Photography (ComfyUI Manager: "Photography Nodes"). No requirements.

Where people get burned

The honest limits of the whole LSB approach apply double here: it only survives lossless PNG round-trips. If the image went through JPEG, resizing, or any color-space conversion on its way to you, the bottom bits are gone and you'll decode garbage (or a truncated alias). Second, if you didn't repeat the LSB and you get alias_length wrong, you'll read the wrong slice of the bitstream - keep aliases a consistent length, or just use repeat_lsb on both sides and stop worrying. And remember this decodes whatever's in the bottom bits - it'll happily read your own alias back, but it's provenance metadata, not encryption, so don't treat it as security.

CategoryTrophiHunter/Photography

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
alias_lengthINT11–400
repeat_lsbBOOLEANtrue
print_to_consoleBOOLEANtrue

Outputs (1)

NameTypeDescription
textTEXT