Decrypt PNG
Decrypt PNG undoes it
- IMAGE
Decrypt PNG is the recovery side of the Me-gumin/MeComfyuiEncrypt pack's real-crypto half. Where Encrypt Image writes ChaCha20 or AES-CTR ciphertext into a PNG's pixels and stashes the nonce in the file's metadata, this node reads that file back, grabs the metadata, and hands you the original image. If you've been sent a noise-looking PNG encrypted with this pack, this is the node that turns it back into a picture - as long as you have the passphrase and the file is intact.
How it works
The node doesn't take an image tensor the way most nodes do. Its image input is a dropdown populated from ComfyUI's output folder - the README is explicit about this: put the image you want to decrypt in ComfyUI/output first, then it shows up in the list. Decryption reads the file, pulls the crypto_meta text chunk (which holds the nonce, algorithm, and shape), re-derives the key from your passphrase with PBKDF2, and runs the cipher in reverse. The passphrase is the entire secret, so this is symmetric crypto: whoever has the passphrase and the file can decrypt.
The inputs that matter
- image - pick the encrypted PNG from the dropdown (you can upload one into the output folder too). If it's not in the list, it's not in the output folder.
- passphrase - must match the one used at encryption, exactly. Wrong passphrase, garbage pixels or a crash.
- algo (ChaCha20 / AES-CTR) - must match what was used to encrypt. The node actively checks and raises a
ValueErrorif you pick the wrong one, so at least the failure is loud.
Output is a single IMAGE - the recovered image, ready to wire into a Preview or Save node.
Installing it
Same pack, same one-time install as its siblings. ComfyUI Manager, search "MeComfyuiEncrypt", install, restart. Or:
git clone https://github.com/Me-gumin/MeComfyuiEncrypt.git ./custom_nodes/MeComfyuiEncrypt
cd custom_nodes/MeComfyuiEncrypt && pip install -r requirements.txt
torch, numpy, pycryptodome, pillow - nothing heavy, no model downloads. If the pack doesn't load, a missing pycryptodome is the usual culprit, since both module files import at startup.
Common issues
The decrypt step fails in three predictable ways. Wrong algorithm selection gives you an explicit error - just flip the dropdown. A plain (unencrypted) PNG or a re-saved one throws "No crypto_meta in PNG metadata," which means the text chunk got stripped: re-saving in an image editor, screenshotting, or uploading through a service that recompresses all destroy it, and there's no recovery. And a wrong passphrase either returns noise or errors out, so double-check that string before assuming the node is broken. Keep the file untouched and the passphrase right, and this is genuinely solid encryption - a different universe from the pack's "for fun" chaos nodes.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| passphrase | STRING | changeme | — |
| algo | COMBO | 2 options: ChaCha20, AES-CTR | |
| image | COMBO | 0 options: |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |