Bytes-like Object Encode
Turn text into BYTESLIKE — the gateway to every modern crypto node
- BYTESLIKE
ByteslikeEncode is the on-ramp for the ARG Toolkit's modern cryptography nodes. Half the pack - BLAKE2, the ConcatKDF family, ChaCha20Poly1305, the key loaders, constant-time compare - takes a custom BYTESLIKE datatype that ComfyUI doesn't natively produce. This node is how you get from a plain string you typed into bytes those nodes will accept. If you've ever wired text into a crypto node and watched it refuse the connection because the input type didn't match, this is the missing link.
The idea: pick an encoding, and the node converts your text string into the corresponding byte representation. UTF-8 is the "turn my sentence into raw bytes" option; Hexadecimal, Base64, and Binary take text that's already written in those formats and parse it into bytes; Raw Bytes accepts a Python bytes literal like b'\xde\xad' and evaluates it directly. Whatever comes out is a BYTESLIKE value you can feed into the whole modern half of the pack.
How it works
Each encoding mode validates and parses differently, and the validation is where beginners get caught:
Hexadecimal- strips spaces/newlines, requires even length, then parses hex pairs into bytes. Bad hex or odd length →ValueError.Base64- strict decode with validation; malformed base64 →ValueError.Binary- must be all0/1and a multiple of 8 digits, parsed 8 at a time.UTF-8- plain text encoded into bytes; the one mode where you type normal words.Raw Bytes- parses a Python bytes literal viaast.literal_eval; expects something likeb'hello'. Anything else →ValueErrorexplaining the format.
Note the naming subtlety: with Hexadecimal selected, the text you type is hex, and the output is the raw bytes it describes. So "41" becomes the single byte A, not the ASCII for "41". That's intentional and it's how you'll want it when feeding a hex blob into a hashing or encryption node.
The inputs that matter
text- the string to convert (multiline; default "Hello World!").encoding-Hexadecimal,Base64,UTF-8,Binary, orRaw Bytes.
Output: a single BYTESLIKE value (the schema names it BYTESLIKE, though you'll see it as the bytes datatype in the graph).
Installing it
Ships in the ComfyUI ARG Toolkit pack. Install via ComfyUI Manager (search "ComfyUI ARG Toolkit") or:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
Restart ComfyUI. The pack pulls cryptography, secretpy, stegano, invisible-watermark, reedsolo, and transitively heavy packages like torch and opencv-python - the first install takes a while. No models, no API keys.
Gotchas
The format-mismatch errors are the #1 stumbling block: hex that's odd-length, base64 with stray characters, binary that isn't a multiple of 8. And remember the inverse - ByteslikeDecode - turns BYTESLIKE back into a readable string (hex, base64, or UTF-8), so the natural pattern is Encode → crypto node → Decode to read the result. If a modern-crypto node refuses your input, the odds are high you tried to feed it a plain string instead of a BYTESLIKE wire from this node.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Hello World! | — |
| encoding | COMBO | UTF-8 | The type of data to be encoded into bytes. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BYTESLIKE | BYTESLIKE | — |