Nodes/ComfyUI-Cyber-Steganography/Stego Decode (Reveal Text)
ComfyUI Node

Stego Decode (Reveal Text)

Reveal the Text Hidden Inside an Image

By sjhddh·Created 7 months ago·Updated 7 months ago· 0
Stego Decode (Reveal Text)
  • image
  • STRING
key

Stego Decode is the revealer half of the ComfyUI-Cyber-Steganography pack: feed it an image, and it digs a secret text message out of the pixels that you - or anyone who saved a PNG from Stego Encode - buried there. You wire an image in, you get a string out. The whole "spycraft" framing aside, it's one node doing one job, and it's genuinely handy when you're the person on the receiving end of a stego'd file.

It's worth knowing the context before you use it. ComfyUI normally carries workflows in PNG metadata, but image hosts strip that on upload; pixel-level steganography survives metadata scrubbing because the data lives in the color values, not the tags. That's the trick this pair of nodes exploits, and it's been a running community interest since the earliest stego threads on r/comfyui. If someone sends you an image that "just looks like a picture," this node is how you find out whether it's carrying cargo.

How it works

Stego Decode reads the first 32 bits of the flattened pixel array as a length header, then pulls that many bytes' worth of least-significant bits out of the RGB channels and reassembles them. If a key was used during encoding, it XOR-decrypts the bytes, then decodes UTF-8. The important practical consequence: decode and encode must match on two things - the key (if any) and the image's exact pixels. Change either and you get garbage.

The inputs that matter

Only two, and both are simple:

  • image (required) - the IMAGE to inspect.
  • key (optional) - must match the key used in Stego Encode, exactly. Leave it blank only if the message was encoded without one.

The output is a single STRING, which you wire into a ShowText node to see it in the UI. If you're building an automated workflow, you can also branch on the string - the node returns "Error: No valid data found or data corrupted." when it can't make sense of the pixels, so you can detect failure programmatically.

Installing it

Stego Decode comes in the same pack as Stego Encode, so one install gives you both. Easiest via ComfyUI Manager (search "ComfyUI-Cyber-Steganography"), or:

cd ComfyUI/custom_nodes/
git clone https://github.com/sjhddh/ComfyUI-Cyber-Steganography

Restart ComfyUI. No dependencies beyond numpy, torch, and Pillow - all already present - and no model files to download. This is as light an install as custom nodes get.

Where people get burned

Format first: if the image was re-encoded as JPEG, resized, or re-saved through a lossy pipeline, the message is already destroyed and no decoder can recover it. Only lossless PNG works. Key mismatches are the other classic: use the wrong key and the XOR produces garbage, which usually surfaces as the node's "Error: Could not decode text (wrong key?)" message. And one quirk worth knowing: if you feed in a batch of images, Stego Decode only inspects the first frame. That's a deliberate simplification in the source, not a bug on your end - for anything past the first image, decode them one at a time.

One honest caveat about this pack's security model: the XOR "encryption" is a repeating-key toy cipher, breakable by hand. The README is upfront that this is for educational and artistic use, not critical secrets. It'll stop a curious friend, and it won't stop anyone determined. Fine for easter eggs and watermarking experiments; not your password vault.

CategoryCyberSteganography

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
keyoptSTRING

Outputs (1)

NameTypeDescription
STRINGSTRING