ComfyUI Node

LikeShare Encrypt

Scramble your own images on purpose with LikeShare Encrypt

By Miqingzi·Created 4 months ago·Updated 2 months ago· 2
LikeShare Encrypt
  • image
  • IMAGE

Sometimes you want a picture that people can't just save and reuse. That's the entire job of LikeShare Encrypt: it turns an image into visual noise using the same deterministic pixel shuffle as the LikeShare/Tomato sharing flow, so you can publish an unreadable preview and restore it later with the paired LikeShare Decrypt node. Think "viewable only after a deliberate step," not "encryption" - more on that in a second.

What it does

One required input, image (IMAGE), and one output (IMAGE). No parameters, no key field, nothing to configure. The "key" is fixed internally at 1.0 and you can't - and don't need to - change it. Drop a generated image in, get scrambled pixels out, and send that output to a SaveImage when you want to publish the noise version.

How the scramble works

The algorithm (a port of the Java TomatoScramble utility, the "big tomato pixel shuffle") does two things. First it builds a 2D Hilbert-curve ordering that visits every pixel of the image exactly once. Then it rotates the pixel list along that order by an offset derived from the golden-ratio conjugate: round(0.618 * W * H). Every pixel lands in a new, deterministic spot. Run the result through LikeShare Decrypt at the same dimensions and you get the exact original back - the two nodes are literal inverses.

Batches work fine: each image is scrambled independently and the output tensor keeps the input's shape, so the whole flow slots into batched workflows without special handling.

What it's actually for

Honest answer: this is obfuscation, not protection. A pure pixel permutation defeats casual save-and-reuse and trips up naive reverse-image search, which is exactly what the originating image-sharing flow wants from its previews. But the code is open source and the key is fixed and public - anyone can run the decrypt node, so this stops the lazy, not the determined. Use it for "preview that shouldn't be trivially re-usable," not for anything sensitive. If you genuinely need encryption, reach for something else; this is a privacy garnish, not a lock.

Where people get burned

  • Forgetting to decrypt before you save. Wire Encrypt straight into SaveImage and you've saved a noise file. The scrambled output looks like streaky static, so keep the Decrypt node in your graph - or run the inverse pass before saving a usable copy.
  • Lossy re-encoding wrecks the restore. Scrambled images compress terribly, and JPEG in particular mangles them. Since the restore is exact by construction, any lossy pass means permanent noise. Save scrambled files as PNG, not JPEG.
  • Resize between encrypt and decrypt and you lose it. The shuffle order depends on the image's width and height, so the two nodes only invert each other at identical dimensions.

Install

Easiest route is ComfyUI Manager - open it, search likeshare (published to the registry as "LikeShare Image Obfuscator"), install, restart. Or do it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/Miqingzi/likeshare

Then restart ComfyUI. That's the whole install: no requirements.txt, no model files to download, no hidden dependencies - just torch and numpy, which ComfyUI already has, plus a tiny JS file that labels the node on the canvas. It's one of those rare custom nodes where the hardest part is deciding what you're actually going to use it for.

CategoryLikeShare

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE