Watermark
An invisible watermark and a visible one, in the same node
- image
- IMAGE
If you batch-generate images to share, at some point you want a way to prove they're yours. This node does both kinds of watermarking at once: it can stamp a visible tiled text mark on the image and bake an invisible one into the least significant bits of the pixel data. The invisible part is the interesting trick - it survives being re-saved as PNG (mostly) and lets you later extract the author string with the pack's companion Get Watermark node. It's niche, but for a solo creator shipping batches it's a neat self-contained solution that needs no external service.
How it works
Two independent systems, both toggled:
LSB watermarking (use_lsb). The alias text - which can be anything, the author notes it could be your entire prompt - gets converted to bytes and written into the lowest bit of each channel's value. Visually it's a one-step-in-255 change per pixel, which is invisible. repeat_lsb writes the alias over and over across the whole pixel data so a cropped or truncated image still carries it.
Visual watermark (use_visual_watermark). Text drawn with PIL, positioned via visual_watermark_location (top left/right, bottom left/right, all corners, or tiled), optionally rotated (rotate_text, rotation_angle), colored with text_red/green/blue, scaled by text_scale, and blended at alpha. The text_spacing_x/y knobs control the tiled pattern's density.
Inputs that matter
- alias - the string to embed. Keep it short if you use LSB (long aliases eat pixel data) unless
repeat_lsbis on - use_lsb / use_visual_watermark - the two on/off switches. You can run one, the other, or both
- visual_watermark_location - "tiled" is the default and the most theft-resistant since cropping can't remove it
- alpha - 0–1 blend of the visible text; 0.25 default is subtle, not obnoxious
One IMAGE in, one IMAGE out.
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, no models.
Where people get burned
Three honest caveats. First, LSB watermarking is fragile by nature - JPEG compression, resizing, or any lossy step nukes it. It only reliably survives lossless PNG round-trips, so watermark at the very end of your chain, after every other effect, and save PNG. Second, the visual text uses whatever default font PIL can find (it tries arial.ttf and falls back), so the visible mark may look different across machines - don't rely on exact typography. Third, the extraction node needs to know alias_length if you didn't repeat the LSB, so keep your aliases a consistent length across a batch. And remember the alias you embed isn't encryption - treat LSB as provenance metadata, not copy protection.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| alias | STRING | — | |
| use_lsb | BOOLEAN | true | — |
| repeat_lsb | BOOLEAN | true | — |
| use_visual_watermark | BOOLEAN | true | — |
| visual_watermark_location | COMBO | tiled | 6 options: top left, top right, bottom left, bottom right, all corners, tiled |
| rotate_text | BOOLEAN | true | — |
| rotation_angle | INT | 45-360–360 | — |
| text_spacing_x | INT | 11–40 | — |
| text_spacing_y | INT | 41–40 | — |
| text_scale | INT | 204–72 | — |
| text_red | INT | 2550–255 | — |
| text_green | INT | 2550–255 | — |
| text_blue | INT | 2550–255 | — |
| alpha | FLOAT | 0.2500–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |