Nodes/Multi LoRA Loader/Parse JSON (MultiLoRA)
ComfyUI Node

Parse JSON (MultiLoRA)

Turn the loader's JSON into something a script can actually chew on

By phazei·Created 6 months ago·Updated 2 months ago· 19
Parse JSON (MultiLoRA)
    • data
    json_string

    The Multi LoRA Loader is generous with metadata: its lora_data output is a JSON string listing every selected LoRA, its strength, its path, whether it's enabled, even sidecar metadata. That's great - but most ComfyUI nodes can't read a JSON string. Parse JSON (MultiLoRA) is the bridge. It takes the string in and hands you a real Python object - a list of dicts - out the other side.

    This is one of those nodes that looks pointless until you need it exactly once, and then you can't live without it. The pattern: you want a filename that names the LoRAs actually used in a run, or a text overlay on the image showing style_lora: 1.0, or a conditional that only fires when a specific LoRA is enabled. Wire the loader's lora_data output into this node, feed the data output into something that accepts any-type input - the README pairs it with rgthree's Power Puter, which lets you write inline Python expressions in the graph - and you're scripting your workflow.

    How it works

    It's honest plumbing: one input, one output, one json.loads() under the hood.

    • json_string (in) - the JSON-encoded string, e.g. the loader's lora_data output. It's declared as a forced input, so you wire rather than type.
    • data (out) - type *, the ComfyUI wildcard that accepts a connection into any node that doesn't type-check its inputs.

    That wildcard type is the whole trick. ComfyUI's socket system is strict - a STRING port won't carry a list, and most nodes refuse mismatched connections. * is the escape hatch that lets a parser sit between a JSON emitter and a scripting node without the graph throwing a type error. If the string isn't valid JSON, the node raises a clear error ([Parse JSON] Invalid JSON) instead of silently passing through garbage - which is the failure you'll hit if you wire a plain text box into it by mistake.

    What's actually in the data

    The parsed object is a list of dicts, one per selected LoRA. The keys you'll use most are name, path, enabled, and strength_model. Two details trip people up:

    • Disabled LoRAs are included too, flagged enabled: false - filter with the flag, don't assume the list is only active rows.
    • The schema changes with the loader's settings: strength_clip only appears when the loader's CLIP mode is on, and the LTX layer keys (video, video_to_audio, audio, audio_to_video, other) only in LTX mode.

    The README's example is a good starting template - generate a text overlay of active LoRAs:

    '\n'.join([l['name'].split('\\')[-1].rsplit('.', 1)[0] + ': ' + str(l['strength_model']) for l in a if l['enabled']]) if a else 'No active loras'
    

    which gives you something like:

    my_training-000800: 0.75
    style_lora: 1.0
    

    Stick that expression in a Power Puter, feed the result to a Text node, and your output images start labeling themselves.

    Install

    It's a companion node in phazei/ComfyUI-MultiLoraLoader, so installing the pack gives you this, the Multi LoRA Loader, and the cycle node in one shot. ComfyUI Manager → search "Multi LoRA Loader", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/phazei/ComfyUI-MultiLoraLoader
    

    Restart ComfyUI after cloning. No extra Python dependencies, no model files - the whole pack is a JS frontend plus a thin backend.

    The honest caveat

    This node is a tiny adapter, and its whole value depends on the loader's lora_data being useful downstream. If you never want machine-readable LoRA info, you can skip it entirely and never miss it. But the moment you're generating filenames or overlays from what a run actually used, it's the difference between a five-minute hack and a half-hour fight with string parsing inside a ComfyUI expression node. Reach for it when the loader starts telling you more than the UI can show.

    Categoryloaders

    Inputs (1)

    NameTypeDefaultDescription
    json_stringSTRING

    Outputs (1)

    NameTypeDescription
    data*