Skip to content

Add node for decoding invisible watermarks from images#129

Open
Copilot wants to merge 5 commits intomainfrom
copilot/add-invisible-watermark-decoder
Open

Add node for decoding invisible watermarks from images#129
Copilot wants to merge 5 commits intomainfrom
copilot/add-invisible-watermark-decoder

Conversation

Copy link

Copilot AI commented Mar 11, 2026

Summary

Adds a workflow node to decode invisible watermarks previously embedded with the existing Add Invisible Watermark node. Returns the watermark text as a string, or an empty string if no watermark is detected or decoding fails.

invokeai/backend/image_util/invisible_watermark.py

  • Added decode_watermark(image, length=8) classmethod to InvisibleWatermark
  • Uses vendored WatermarkDecoder("bytes", length * 8) with dwtDct — mirrors the encoding path
  • Returns decoded UTF-8 string stripped of null bytes; catches all exceptions and returns ""

invokeai/app/invocations/image.py

  • Added DecodeInvisibleWatermarkInvocation node ("decode_watermark")
  • Inputs: image: ImageField, length: int (bytes, default 8 — matches the default "InvokeAI" watermark)
  • Output: StringOutput with the decoded watermark text

The length parameter must match the byte length of the text used during encoding (e.g., 8 for "InvokeAI").

Related Issues / Discussions

QA Instructions

  1. Use Add Invisible Watermark node with default text "InvokeAI" on an image ≥ 256×256.
  2. Feed the output image into the new Decode Invisible Watermark node with length=8.
  3. Verify the output string is "InvokeAI".
  4. Connect a plain (non-watermarked) image — verify output is "".

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)
Original prompt

This section details on the original issue you should resolve

<issue_title>[enhancement]: Create node for decoding invisible watermark</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Contact Details

No response

What should this feature add?

I'd like a workflow node that accepts an Image as input, attempts to decode its invisible watermark, and outputs a string with the watermark. If no watermark is detected, return an empty string.

Alternatives

No response

Additional Content

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Copilot AI changed the title [WIP] Add node for decoding invisible watermark from images Add node for decoding invisible watermarks from images Mar 11, 2026
weblate and others added 2 commits March 15, 2026 11:01
* translationBot(ui): update translation (Italian)

Currently translated at 98.0% (2205 of 2250 strings)

Co-authored-by: Riccardo Giovanetti <riccardo.giovanetti@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/
Translation: InvokeAI/Web UI

* translationBot(ui): update translation files

Updated by "Remove blank strings" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/
Translation: InvokeAI/Web UI

* translationBot(ui): update translation (Italian)

Currently translated at 97.8% (2210 of 2259 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

* translationBot(ui): update translation (Italian)

Currently translated at 97.8% (2224 of 2272 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

* translationBot(ui): update translation (Italian)

Currently translated at 98.1% (2252 of 2295 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

* translationBot(ui): update translation (Italian)

Currently translated at 98.0% (2264 of 2309 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

* translationBot(ui): update translation (Russian)

Currently translated at 60.7% (1419 of 2334 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/ru/

* translationBot(ui): update translation (Italian)

Currently translated at 98.1% (2290 of 2334 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

* translationBot(ui): update translation (Italian)

Currently translated at 97.7% (2319 of 2372 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

* translationBot(ui): update translation (Italian)

Currently translated at 97.7% (2327 of 2380 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

* translationBot(ui): update translation (Italian)

Currently translated at 97.7% (2328 of 2382 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

* translationBot(ui): update translation (Italian)

Currently translated at 97.5% (2370 of 2429 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

* translationBot(ui): update translation (Finnish)

Currently translated at 1.5% (37 of 2429 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/fi/

* translationBot(ui): update translation (Italian)

Currently translated at 97.5% (2373 of 2433 strings)

Translation: InvokeAI/Web UI
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/

---------

Co-authored-by: Riccardo Giovanetti <riccardo.giovanetti@gmail.com>
Co-authored-by: DustyShoe <warukeichi@gmail.com>
Co-authored-by: Ilmari Laakkonen <ilmarille@gmail.com>
…oke-ai#8962)

* change submenu icon to phosphor

* Use PiIntersectSquareBold
Copy link
Owner

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised.

@lstein lstein marked this pull request as ready for review March 15, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[enhancement]: Create node for decoding invisible watermark

4 participants