Nodes/comfyui-toml-prompt/KSamplerFromJsonInfo
ComfyUI Node

KSamplerFromJsonInfo

The whole sampling recipe as one JSON blob

By morino-kumasan·Created 2 years ago·Updated a day ago· 1
KSamplerFromJsonInfo
  • model
  • positive
  • negative
  • latent_image
  • LATENT
denoise1.00
json_text
seed0

KSamplerFromString gives you a socket per setting. KSamplerFromJsonInfo goes further: it takes one string - a JSON object containing seed, steps, cfg, sampler and scheduler - and does the whole sampling configuration from it.

If your workflow's settings already live in a config, this is the tidiest way to hand them over: one wire from your config's exports to the sampler, instead of five extract nodes and five wires. It's also the node to look at when you want to archive a generation's exact recipe as text and replay it later.

How it works

info = json.loads(json_text)
seed = seed if seed is not None else int(info["seed"])
return self.sampler.sample(
    model, seed, int(info["steps"]), float(info["cfg"]),
    info["sampler"], info["scheduler"],
    positive, negative, latent_image, denoise=denoise,
)

It parses your JSON and calls core KSampler with the pieces. steps and cfg are coerced (int(), float()), so you can put them in as strings, which is handy because TOML exports arrive as strings. sampler and scheduler are passed through untouched as names.

The optional seed input is the interesting part: it's a forceInput socket, and if it's wired it wins - the seed inside your JSON is ignored. That's a deliberate override hatch. Wire a SeedGenerator (or the seed a previous stage used) when you want to lock this stage to a specific seed while the rest of the recipe still comes from the config.

There's no add_noise or return_with_leftover_noise here - that's KSamplerAdvanced territory, not this node. denoise is a normal input, so a second pass can be dialled down without touching the JSON.

Inputs and outputs

Required: model, positive, negative, latent_image, denoise (0–1, default 1.0), json_text - tooltip: "JSON text including seed, steps, cfg, sampler and scheduler". Optional: seed (a force-input INT that overrides the JSON). One LATENT output, off to VAEDecode.

The JSON shape is flat and literal:

{"seed": 958570523456296, "steps": 20, "cfg": 5.0, "sampler": "euler_ancestral", "scheduler": "karras"}

Install

Manager search for the pack name, or:

cd ComfyUI/custom_nodes
git clone https://github.com/morino-kumasan/comfyui-toml-prompt

then restart. No pip install - requirements.txt in this repo is empty. Don't follow the README's install block as written: it still refers to the pack by its old comfyui-utils name and clones over SSH. The HTTPS clone above is correct.

Where people get burned

Every key is mandatory. info["steps"], info["cfg"], info["sampler"], info["scheduler"] and info["seed"] are all direct dictionary lookups - drop one and you get a KeyError, not a default. This is stricter than the JsonExtract* nodes in the same pack, where a missing path quietly returns your default.

Misspelled sampler or scheduler names blow up at queue time. These are strings handed to core KSampler, with no dropdown to catch you. Use the exact spellings stock ComfyUI uses. If a workflow names beta57 or bong_tangent, that's not a typo - those live in RES4LYF, and you need that pack installed.

CFG 1 is the default in a lot of 2026 recipes, and it kills your negative prompt. At CFG 1 on a guidance-distilled model, ComfyUI doesn't run the unconditional pass at all, so negative is ignored. The node is working; the parameter means what it means.

A JSON blob is not free text. Smart quotes, a trailing comma after the last pair, or a sampler value written as a Python-style single-quoted string all throw on json.loads. When the node errors, print the blob before you touch the graph.

Categorysampling

Inputs (7)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONINGPositive.
negativeCONDITIONINGNegative.
latent_imageLATENT
denoiseFLOAT1.000–1
json_textSTRINGJSON text including seed, steps, cfg, sampler and scheduler
seedoptINT00–18446744073709550000

Outputs (1)

NameTypeDescription
LATENTLATENTLATENT