- image
- IMAGE
This is the serious half of the Me-gumin/MeComfyuiEncrypt pack. While the "Chaos" nodes just scramble pixels with a deterministic math trick, Encrypt Image does actual cryptography: your choice of ChaCha20 or AES-CTR, a passphrase stretched through PBKDF2 into a proper key, and a random nonce for every run. The ciphertext bytes get written straight into the pixels and saved as a PNG - so your output looks like TV static, but it's real encryption underneath. Reach for it when you want to send someone an image that genuinely can't be seen without the passphrase, not just a scramble.
How it works
The passphrase goes through PBKDF2 into a 32-byte key, and a random nonce is generated fresh each run, so encrypting the same image twice gives you two different-looking noise files. The encrypted bytes are packed into the RGB channels, then saved to ComfyUI's output folder with the nonce, algorithm, and shape tucked into a PNG text chunk (crypto_meta, zlib-compressed) right in the file. That metadata is what makes decryption possible later - the file carries its own key recovery info.
The inputs that matter
- passphrase (STRING, default
changeme) - the actual secret. Change the default; it's called "changeme" for a reason. Anyone with this string and the file can decrypt. - algo (ChaCha20 / AES-CTR) - both are solid stream ciphers; ChaCha20 is the modern default pick, AES-CTR if you want the household name. Either is fine here, and you'll need to remember which you chose for decryption.
- filename_prefix (STRING, default
EncImage_) - the saved file isEncImage_001.png,_002, and so on, in the output folder. - image (IMAGE) - the image to encrypt.
The single output is an IMAGE: the saved ciphertext file reloaded, so you can preview or wire it onward if you want.
Installing it
ComfyUI Manager, search "MeComfyuiEncrypt", install, restart. Manual:
git clone https://github.com/Me-gumin/MeComfyuiEncrypt.git ./custom_nodes/MeComfyuiEncrypt
cd custom_nodes/MeComfyuiEncrypt && pip install -r requirements.txt
Dependencies are torch, numpy, pycryptodome, pillow. The pycryptodome library is what provides ChaCha20 and AES, and the whole pack imports at startup - if it's missing, all four nodes disappear, so make sure requirements actually installed. No model files, no config.
Where people get burned
Three things trip people up. First, only the first frame of a batch gets encrypted - image[0] - so don't feed a 4-image batch and expect four files. Second, the output is saved as RGB, so any alpha channel is dropped on the way out. Third, files accumulate: the counter just keeps incrementing, so iterate too long and your output folder fills with EncImage_001.png through EncImage_099.png, each a new noise file. The important part: never re-save the result in an editor, because stripping that crypto_meta text chunk makes it permanently undecryptable. Keep the PNG as-is, keep the passphrase, and you're set.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| filename_prefix | STRING | EncImage_ | — |
| passphrase | STRING | changeme | — |
| algo | COMBO | 2 options: ChaCha20, AES-CTR |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |