Nodes/ComfyUI-Image-Cipher/🔒 Cipher Encode (Color Noise)
ComfyUI Node

🔒 Cipher Encode (Color Noise)

Turn Any Image Into Color Static (the 'Cipher' Is Doing Heavy Lifting)

By engineer6980·Created 7 months ago·Updated 7 months ago· 2
🔒 Cipher Encode (Color Noise)
  • images
  • cipher_image
decryption_guide📌【前端解码指南 / Frontend Guide】 本节点专为API工作流设计,前端需按以下算法还原: ------------------------------------------------ 1. 固定密钥 (Key): 999 2. 算法原理: RGB通道独立行位移 (Row Rolling) 3. 核心公式 (y=行号, w=图像宽度): R_shift = (y * 999 * 1) % w G_shift = (y * 999 * 2) % w B_shift = (y * 999 * 3) % w 4. 操作: 将对应通道的每行像素向左(反向)回滚 shift 距离 ------------------------------------------------

Here's the whole deal in one sentence: feed this node an image and it hands you back something that looks like a broken TV channel - same size, same PNG, but the content is gone, replaced by scrambled color static. It comes from the tiny ComfyUI-Image-Cipher pack by engineer6980, and despite the word "Cipher" in the name, there is no cryptography anywhere in this repo.

Why you'd reach for it

The author's stated use case, straight from the README, is privacy in API workflows. You run an encode in a remote/cloud workflow, save the noise PNG, and restore only locally - so anyone who glances at the intermediate file sees static instead of your actual image. If you're bothered by an API host displaying or storing your renders, "make it unreadable at a glance" is a legitimate workaround, and that's exactly the niche this fills.

But be honest with yourself about what it is. This is obfuscation, not encryption. The "key" is 999, hardcoded in the source, and the decode node ships in the same pack. Anyone who has the pack - which is anyone who can read the GitHub repo - can restore your image instantly. Nobody is being stopped by this. Use it to keep a human from casually recognizing your content on a server's preview thumbnail, not to keep anything actually secret.

How it works

The mechanism is embarrassingly simple, which is kind of the point. For every row of the image it takes the red channel and circularly shifts that row by (row * 999 * 1) % width pixels, green by (row * 999 * 2) % width, blue by (row * 999 * 3) % width. Circular shift means pixels that fall off one edge wrap around to the other - nothing is dropped. That wrap is exactly why the round trip is 100% lossless: encode then decode returns the original pixels bit-for-bit. That's rare in this ecosystem, where most "lossless" claims die somewhere in a VAE round trip. This one is real, because all you're doing is rearranging pixels.

The output reads as color static because the three channels get scrambled with different offsets, so edges and shapes smear into noise. Each row is still a recognizable sliver of the original if you stare long enough - this will not survive scrutiny.

Inputs and outputs

Only two inputs, and only one of them matters:

  • images (IMAGE, required): whatever came out of your VAE Decode. Batches work; each image is scrambled independently.
  • decryption_guide (STRING, optional): a multiline text field whose default is the author's own frontend decode guide - the key, the row-rolling formulas. It's informational only. ComfyUI passes it to the node and the code never touches it. Delete it, edit it, whatever; nothing changes.
  • Output cipher_image (IMAGE): the scrambled result. Save it with a Save Image node; it keeps the exact HxW of the input.

Install

No models, no downloads, and the dependencies are torch and numpy - both already present in any ComfyUI install. This is as painless as custom nodes get. Via ComfyUI Manager, search "Image-Cipher", or:

cd ComfyUI/custom_nodes
git clone https://github.com/engineer6980/ComfyUI-Image-Cipher

Restart ComfyUI and both nodes show up under CipherTools. The pack also ships a standalone restore_img.py that restores a saved PNG outside ComfyUI - handy if you're building a frontend - but note it imports OpenCV, which is not in requirements.txt. Run pip install opencv-python if you actually want to use that script.

Common issues

The big trap is resizing. The shift for each row depends on image width, so a cipher image decoded at a different width is garbage. Don't resize the noise PNG, don't crop it, don't push it through another VAE pass before decoding. And keep the whole scheme's limits in mind: the key is public, so treat this as a visual privacy screen, not a vault.

CategoryCipherTools

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
decryption_guideoptSTRING📌【前端解码指南 / Frontend Guide】 本节点专为API工作流设计,前端需按以下算法还原: ------------------------------------------------ 1. 固定密钥 (Key): 999 2. 算法原理: RGB通道独立行位移 (Row Rolling) 3. 核心公式 (y=行号, w=图像宽度): R_shift = (y * 999 * 1) % w G_shift = (y * 999 * 2) % w B_shift = (y * 999 * 3) % w 4. 操作: 将对应通道的每行像素向左(反向)回滚 shift 距离 ------------------------------------------------

Outputs (1)

NameTypeDescription
cipher_imageIMAGE