ComfyUI Node

Parse JSON 🔽

Turn a JSON string into a real dict inside a ComfyUI graph

By SwissCore92·Created about a year ago·Updated 2 months ago· 9
Parse JSON 🔽
    • DICT
    json_string

    ComfyUI speaks in strings and tensors, and sometimes the string you have is a JSON document - an API response, a config block, a workflow variable serialized as text. This node parses a JSON string into an actual DICT you can wire onward. It's dead simple: one input, one output, no API calls, no network.

    It lives in the ComfyUI Telegram Suite pack under the experimental category, alongside the pack's more ambitious API Method node. If you use the suite's other nodes, DICT is a type you'll run into a lot - the send and edit nodes return message payloads as DICTs - and this is the node that gets JSON into that form.

    How it works

    It's a thin wrapper around Python's json.loads. You feed it a JSON string, it parses, and the result comes out the DICT output. That's the entire mechanism - which is exactly what you want from a converter: boring, predictable, no hidden behavior.

    The one thing to know: it expects valid JSON, and it's strict about it. A trailing comma, single quotes instead of double quotes, or a comment will throw a parse error. If you're pasting JSON from somewhere that isn't a real JSON emitter, that's the failure mode you'll hit.

    Inputs and outputs that matter

    • json_string (multiline STRING) - the JSON document as text. You can type it directly or wire it from another text source.
    • Output: DICT - the parsed object. Feed it into nodes that take a DICT input, or into APIMethod's params input if you're calling a Telegram API method with a structured payload.

    Installation

    Shared with the whole pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/SwissCore92/comfyui-telegram-suite.git
    cd comfyui-telegram-suite
    pip install -r requirements.txt
    

    or install "ComfyUI Telegram Suite" via ComfyUI Manager and restart. Then add bot tokens and chat IDs to ComfyUI/user/default/telegram-suite/config.json and restart once more. No models, no ffmpeg dependency here - this node is pure standard-library parsing.

    Troubleshooting

    • Parse errors on valid-looking JSON - check for the usual strict-JSON traps: double quotes (not single), no trailing commas, no comments.
    • DICT socket not connecting - the output is typed DICT, so it only plugs into sockets that accept DICT (or ANY). If the target node wants STRING, you'd need to serialize, not parse.
    • This node is flagged experimental by the author, so it's more likely to change than the core send/edit nodes - fine for a utility, just don't build an empire on its exact API.
    CategoryTelegram Suite 🔽/experimental

    Inputs (1)

    NameTypeDefaultDescription
    json_stringSTRING

    Outputs (1)

    NameTypeDescription
    DICTDICT