Nodes/ComfyUI ARG Toolkit/Binary to String Converter
ComfyUI Node

Binary to String Converter

Decode That Wall of 0s and 1s

By AzelusLightvale·Created 12 months ago·Updated 4 days ago· 1
Binary to String Converter
    • converted_txt
    textHello World!
    encoding_format
    other_encoding_format

    Binary is the "cryptography" that every puzzle starts with and every puzzle maker secretly hopes you don't immediately spot - a raw wall of 0s and 1s that's not a cipher at all, just bytes wearing a scary costume. Binary2String is the node that takes that wall and turns it back into readable text. If a clue in your ARG is a string like 01001000 01100101 01101100 01101100 01101111, this is the one-shot conversion that reveals "Hello."

    The mechanism is exactly as simple as it should be: the node strips spaces and newlines, groups the remaining digits into 8-bit chunks, converts each chunk to a byte, and decodes the resulting byte string using the encoding_format you pick. That last step is the only place things can go wrong, because the same binary can decode to different text under UTF-8 versus UTF-16 versus Latin-1.

    The inputs

    • text - the binary string, with or without spaces between groups.
    • encoding_format - the dropdown: utf-8, utf-16, utf-32, ascii, latin-1, cp1252, utf-8-sig, or Other. UTF-8 is right for anything you'd actually encounter; the rest exist for legacy or non-UTF sources.
    • other_encoding_format (optional) - pick Other and type any Python codec name when your encoding isn't in the list.

    Output is converted_txt (STRING).

    Where people get burned

    The node validates strictly, which is a feature but also the source of most errors. If your binary length isn't a multiple of 8, it raises an error - so a stray space or a missing digit will stop the whole thing. Clean the input first (the pack has string nodes for that). Second: the digits must be actual 0/1 characters; if your "binary" contains letters, it's not binary and the node says so. Third: encoding mismatch - decode UTF-16 bytes as UTF-8 and you get mojibake or a crash, not a helpful message.

    The classic companion question is "what about 16-bit chunks?" - some puzzles hand out binary grouped in 16s. That's fine; the node groups by 8s because that's one byte per character for the common encodings. If you genuinely need 16-bit decoding, that's what utf-16 on the encoding side is for.

    Installing it

    Part of the ARG Toolkit pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
    

    Restart and find it under ARG Toolkit → Utilities → Converter (ComfyUI Manager: search "ComfyUI ARG Toolkit"). Pure Python stdlib, no extra dependencies beyond the pack's own. Nothing heavy, no models.

    Troubleshooting

    • "must be a multiple of 8" → stray space or missing digit; clean the input.
    • "must contain only 0 and 1" → the input has letters or symbols; it wasn't binary.
    • Mojibake output → switch encoding_format; latin-1 and cp1252 are the fallbacks for legacy text.

    Binary2String is the boring-but-essential utility that every ARG toolkit needs, because the first clue is always binary. Five seconds of setup, and the message reads itself.

    CategoryARG Toolkit/Utilities/Converter

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGHello World!
    encoding_formatCOMBOThe encoding format available for text, may yield different results when converting.
    other_encoding_formatoptSTRINGIf, for some reason, your chosen encoding format is not available in the dropdown, select "Other" in encoding_format and type in your encoding format here. Supports all format written in Python's `encoding` module.

    Outputs (1)

    NameTypeDescription
    converted_txtSTRING