Stegano LSB Encode
Hide a message in the pixels of an image
- images
- IMAGE
This is the node the whole pack is really about. The README admits the author started this project because an invisible-watermark node impressed him so much he wanted to make his own - and LSB steganography is the classic version of the trick: hide a message inside an image by writing it into the least significant bit of each pixel. Change the lowest bit of a color channel and the color shifts by one out of 255 - invisible to the human eye, perfectly readable to a computer.
SteganoLSBEncode takes an image and a message and returns an image that looks identical but contains your text. It's powered by the stegano library, which does the real hiding.
How it works
Inputs:
- images - the cover image (an IMAGE tensor, so anything ComfyUI generates or loads).
- message - the text to hide.
- generator_type - the interesting one. It chooses where in the image the message bits go.
Nonehides sequentially from the start; the others (LFSR, ackermann, ackermann_fast, ackermann_naive, ackermann_slow, composite, eratosthenes, identity, shi_tomashi, triangular_numbers) scatter the bits using a mathematical generator, which makes the hidden data far harder to spot statistically. The node's own description notes several generators (carmichael, fermat, fibonacci, log_gen, mersenne) are broken and excluded. - m - the primary generator parameter, needed for LFSR and the Ackermann variants.
- n - the secondary parameter, needed for the Ackermann fast/slow variants.
- encoding - UTF-8 or UTF-32LE for the message bytes.
Output: an IMAGE with the message embedded.
The m/n + generator combo is the key for steganography here: you need the exact same generator, m, n, and encoding to extract the message on the decode side. Change any of them and the bits scatter elsewhere.
The inputs that matter
For a first encode: images, message, generator_type = None, encoding = UTF-8. That's it. m/n and the generator list are for when you want harder-to-detect hiding - and the cost is that you must remember the exact settings to decode. If you want the message to survive a curious solver, choose LFSR and a non-trivial m.
Where it fits
This is the payoff stage of a workflow: generate an image, hide a clue in it, post it as-is. The solver's path is the mirror-image decode node. Pair the hidden message with the pack's encryption nodes - encrypt the text first, then hide the ciphertext - and you've built a two-layer puzzle where LSB decoding alone isn't enough.
Installing it
Part of ComfyUI ARG Toolkit - ComfyUI Manager (search "ComfyUI ARG Toolkit") or:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
Restart ComfyUI. Manager installs stegano (and its pillow/opencv deps) automatically. No model files.
Common issues
- Message too long - LSB capacity is roughly (width × height × 3) / 8 bytes for sequential hiding. Bigger image or shorter message; there's no graceful error, it just fails or truncates.
- JPEG destroys it - LSB hiding survives PNG, not lossy JPEG recompression. Save the encoded image as PNG.
- Can't decode later - you changed the generator/m/n/encoding. Write them down; decoding requires a perfect match.
- Some generators act as keys - shi_tomashi actually reads pixel data from the image, so re-encoding from a re-saved file can change results. Keep the original.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| message | STRING | Hello World! | — |
| m | INT | 1 | The primary number used when accessing certain generators. Needed for: LFSR, Ackermann (all variants). |
| n | INT | 2 | The secondary number used when accessing certain generators. Needed for: Ackermann (Slow, Fast). |
| generator_type | COMBO | 11 options: None, LFSR, ackermann, ackermann_fast, ackermann_naive, ackermann_slow, +5 | |
| encoding | COMBO | UTF-8 | Chooses the encoding format for the message. Only allows standard UTF-8 or a version with UTF-32LE |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |