Chaos Encrypt
Scramble any image with a math trick (don't call it encryption)
- image
- IMAGE
The name oversells it, and knowing that up front saves you a headache. Chaos Encrypt doesn't do real encryption - the node's own source says so in so many words ("NOT cryptographically secure"). What it does is turn an image into deterministic static using a classic chaos-theory trick from the image-processing textbooks: a logistic map. It's the fun half of the tiny Me-gumin/MeComfyuiEncrypt pack, alongside the genuinely crypto-grade ChaCha20/AES nodes. Reach for it when you want to scramble a preview for a reveal, hide a work-in-progress from anyone glancing over your shoulder, or just demonstrate to a friend that yes, math can mangle a PNG into noise and put it back.
How it works
Your integer key becomes a seed, and that seed drives the logistic map x = r·x·(1−x) with r = 3.99, iterated hundreds of times to spit out a pseudo-random byte stream. The node XORs that stream with the raw bytes of the image (or adds them mod 256, see mode). Same key, same stream, every time - which is exactly why it's reversible. There's no model, no network, no API key; it's pure arithmetic on the image tensor, so it runs on CPU in milliseconds.
The inputs that matter
Only three, and two of them are the whole game:
- key (INT, default
123456) - the seed that picks the scramble pattern. Any non-negative integer works. One quirk worth knowing:0collapses to a fixed seed, so every image scrambled with key 0 shares the same static. - mode (xor / addmod, default
xor) - XOR is the classic choice.addmodwraps each byte addition at 256 instead. You must remember which one you used; decryption with the wrong mode gives garbage. - image (IMAGE) - feed it from a Load Image or the tail of any generation workflow.
Output is a single IMAGE: the scrambled tensor. Wire it into a Save Image node, because the chaos nodes don't save anything themselves.
Installing it
MeComfyuiEncrypt is a three-second install. Easiest path is ComfyUI Manager - search "MeComfyuiEncrypt" and hit install. Or from your ComfyUI root:
git clone https://github.com/Me-gumin/MeComfyuiEncrypt.git ./custom_nodes/MeComfyuiEncrypt
cd custom_nodes/MeComfyuiEncrypt && pip install -r requirements.txt
Then restart ComfyUI. Requirements are just torch, numpy, pycryptodome, pillow - no model downloads, nothing to configure. The one that might bite is pycryptodome: both Python files are imported at startup, so if it's missing the whole pack silently fails to load and all four nodes vanish. Manager installs requirements for you; manual cloners should run the pip line above.
Where people get burned
The classic failure: scramble an image, save it as a JPEG or repost it through any lossy re-encode, then decrypt. Chaos mode needs the exact byte values - the same key, the same mode, and the file untouched. Any recompression and you get colorful snow instead of your picture. Also internalize the honest caveat: because it's deterministic and has no key derivation, anyone who has the same key and mode can undo it. Treat this as obfuscation for fun, not security for your art. That's what the pack's other half is for.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| key | INT | 123456 | — |
| mode | COMBO | xor | 2 options: xor, addmod |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |