Nodes/ComfyUI-SimpleChat/JSON Parse (16)
ComfyUI Node

JSON Parse (16)

Same JSON parsing, twice the ports

By Moeblack·Created 10 months ago·Updated 8 months ago· 8
JSON Parse (16)
    • out1
    • out2
    • out3
    • out4
    • out5
    • out6
    • out7
    • out8
    • out9
    • out10
    • out11
    • out12
    • out13
    • out14
    • out15
    • out16
    • obj
    ◄json_text►
    ◄strip_code_fencetrue►
    ◄default►
    ◄path1►
    ◄path2►
    ◄path3►
    ◄path4►
    ◄path5►
    ◄path6►
    ◄path7►
    ◄path8►
    ◄path9►
    ◄path10►
    ◄path11►
    ◄path12►
    ◄path13►
    ◄path14►
    ◄path15►
    ◄path16►

    JSON Parse (16) is exactly what it sounds like: the pack's JSON Parse node, but with sixteen path fields and sixteen out ports instead of eight. Same dot/bracket path syntax, same code-fence stripping, same default fallback, same obj output carrying the whole parsed object. If you've read the eight-port version, you've read this node; the only real difference is the headroom.

    When you actually need sixteen

    A typical LLM JSON has a handful of fields. Eight ports usually covers it - which is why the eight-port node is the pack's default. You reach for the 16-port variant when your schema genuinely sprawls: a rich character card with appearance, personality, speech style, relationships, plus image params; a big settings dump from a config-generating LLM; a multi-stage prompt where you want every segment pre-split. It's also handy when you want to route a JSON through and keep spare ports for fields you'll add later without rewiring.

    The inputs and outputs that matter

    • json_text - the JSON string (fence-stripping on by default via strip_code_fence).
    • default - what any missing path resolves to.
    • path1…path16 - the extraction paths. Empty paths just leave their output at the default.
    • Outputs out1…out16 (all STRING) plus obj (SIMPLECHAT_JSON).

    Paths work like a.b.c, items[0].name, or items[0]["name"]. Values stringify like the 8-port node: numbers become text, nested objects become JSON text. Nothing about the semantics changes - it's a strict json.loads under the hood, so feed it clean JSON or it errors.

    Installing it

    cd ComfyUI/custom_nodes
    git clone https://github.com/Moeblack/ComfyUI-SimpleChat
    

    Restart, or use Manager and search "ComfyUI-SimpleChat". Only dependency: aiohttp.

    Gotchas

    Sixteen ports of pure string output is a lot of manual wiring, and every value still lands as STRING - no INT/FLOAT conversion, so numbers heading into numeric inputs still need casting. If most of your paths are empty you're carrying dead weight; the 8-port version is tidier for small schemas, and for the fixed Anima prompt schema Prompt JSON Unpack beats both because it emits typed outputs and a vars dict in one go. Only pay the 16-port sprawl when the schema actually demands it.

    CategorySimpleChat/Utils

    Inputs (19)

    NameTypeDefaultDescription
    json_textSTRING—
    strip_code_fenceBOOLEANtrue—
    defaultSTRING—
    path1STRING—
    path2STRING—
    path3STRING—
    path4STRING—
    path5STRING—
    path6STRING—
    path7STRING—
    path8STRING—
    path9STRING—
    path10STRING—
    path11STRING—
    path12STRING—
    path13STRING—
    path14STRING—
    path15STRING—
    path16STRING—

    Outputs (17)

    NameTypeDescription
    out1STRING—
    out2STRING—
    out3STRING—
    out4STRING—
    out5STRING—
    out6STRING—
    out7STRING—
    out8STRING—
    out9STRING—
    out10STRING—
    out11STRING—
    out12STRING—
    out13STRING—
    out14STRING—
    out15STRING—
    out16STRING—
    objSIMPLECHAT_JSON—