Nodes/Octo Json Presets/Load Experiment Presets from Json
ComfyUI Node

Load Experiment Presets from Json

Run a whole experiment grid from one ComfyUI workflow

By writer-in-fancy-pants·Created 12 months ago·Updated 12 months ago· 0
Load Experiment Presets from Json
    • index
    • increment_index
    • seed
    • steps
    • cfg
    • width
    • height
    • positive_prompt
    • negative_prompt
    • sampler
    • scheduler
    • filename_prefix
    json_file
    index0
    increment_indextrue
    seed4206980085
    steps20
    cfg7.0
    width512
    height512
    positive_prompthigh quality, best quality, 8k, ultra-detailed
    negative_promptlow quality, worst quality, blurry, fuzzy
    samplereuler
    schedulersimple
    filename_prefixComfyUI

    The usual way to compare settings in ComfyUI is to save five workflow variants and babysit them one at a time. "Load Experiment Presets from Json" exists to collapse that into one graph: a JSON file holds a list of experiments - each one a little bundle of seed, steps, CFG, resolution, prompts, sampler, and scheduler - and this node plays them in sequence. Queue the workflow, and every run advances to the next experiment in the file. That's the whole pitch, and it's a genuinely good idea for anyone doing checkpoint or parameter comparison.

    It's the read half of a pair. Its sibling, Save Experiment Presets to Json, writes new entries to the same file, so you can build up a batch as you go and then step through it.

    How it works

    The node reads from the pack's own presets directory - ComfyUI/custom_nodes/octo_json_presets/presets/. json_file is just a filename (it must end in .json), resolved against that folder. The file is expected to be a JSON array of objects, each with the settings you care about:

    [
      { "steps": 30, "cfg": 7.0, "width": 1024, "height": 1024,
        "positive_prompt": "a lighthouse at dusk, photorealistic",
        "sampler": "euler", "scheduler": "normal" }
    ]
    

    On each run it picks the entry at index, loads its values, and if increment_index is on (the default), advances index by one, wrapping around to zero when it hits the end. So increment_index is the automation switch: leave it on and a single workflow burns through your whole grid; switch it off and index becomes a manual picker.

    Here's the part that saves you keystrokes: the node's widgets are fallbacks, not overrides. Any field missing from the current JSON entry keeps whatever you set in the widget. So you can define just the deltas per experiment and leave the shared settings alone in the widgets - a 30-entry file can be a few keys per row instead of a full copy-paste each time.

    The outputs mirror the settings: index, increment_index, seed, steps, cfg, width, height, positive_prompt, negative_prompt, sampler, scheduler, and filename_prefix. Wire them into your sampler, empty latents, text, and KSampler nodes. The node also auto-builds a descriptive filename prefix from the resolved settings (exp_steps20_cfg7_w512_h512_euler_simple style), which keeps your output folder organized when you're running a grid - handy if you're feeding it to a save-image node.

    The catch: this node looks broken as shipped

    I want to be straight with you, because it's a 0-impression node from a single-commit pack and nobody's going to warn you. In the current code, the Load method is missing the self parameter in its signature. ComfyUI calls node functions as bound methods with keyword arguments, and with self absent, the instance gets bound to the json_file parameter - which then collides with the real json_file argument and raises TypeError: got multiple values for argument 'json_file' the moment you run it. The Save node has the same flaw. If your queue errors out immediately on these nodes, that's why, and it's a one-line fix per method (add self back to the signature) if you're comfortable hand-patching src/octo_json_presets/nodes.py. On a pack this young, it's the kind of thing that just hasn't been exercised yet.

    Installing it

    ComfyUI Manager: search Octo Json Presets, install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/writer-in-fancy-pants/octo_json_presets
    

    No extra dependencies, no model downloads - the pack only reads JSON files and passes values around. You'll find the node under octo_presets in the menu. Drop your experiments into the presets folder (or create them with the Save node) and you're set. If you're hitting the runtime error above, remember: it's the pack, not your JSON.

    Categoryocto_presets

    Inputs (13)

    NameTypeDefaultDescription
    json_fileSTRING
    indexoptINT0
    increment_indexoptBOOLEANtrue
    seedoptINT4206980085
    stepsoptINT20
    cfgoptFLOAT7.0
    widthoptINT512
    heightoptINT512
    positive_promptoptSTRINGhigh quality, best quality, 8k, ultra-detailed
    negative_promptoptSTRINGlow quality, worst quality, blurry, fuzzy
    sampleroptCOMBOeuler41 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +35
    scheduleroptCOMBOsimple9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
    filename_prefixoptSTRINGComfyUI

    Outputs (12)

    NameTypeDescription
    indexINT
    increment_indexBOOLEAN
    seedINT
    stepsINT
    cfgFLOATINT
    widthINT
    heightSTRING
    positive_promptSTRING
    negative_promptSTRING
    samplerSTRING
    schedulerSTRING
    filename_prefixSTRING