Get Int From JSON
Pull a number out of JSON by key
- json
- INT
This is a plumbing node for anyone driving ComfyUI from data rather than by hand. You've got a JSON object floating in your graph - maybe pulled from an API, maybe from a config file - and you need one integer out of it: a seed, a step count, a batch size, a width. This node reaches into the JSON by key and gives you that INT. That's it, and that's genuinely handy once your workflow is talking to the outside world.
It's one of a family - the art-venture pack ships GetTextFromJson, GetFloatFromJson, GetBoolFromJson, and GetObjectFromJson too. Same idea, different types. This is the integer one.
Where it fits
The pack has nodes that load JSON - LoadJsonFromUrl fetches it from a URL, LoadJsonFromText parses it from a text field. Those hand you a JSON object. The Get-from-JSON family is how you extract usable values out of it. So the pattern is: load JSON → pull the fields you need → wire them into your generation. It turns a workflow from a fixed recipe into one parameterized by external data, which is the foundation of any API-driven or batch-config setup.
How it works
You pass in the JSON and a key, and it returns the integer at that key. The key syntax supports nesting: the pack's format is key.[index].subkey.[sub_index], so you can dig into arrays and nested objects - settings.[0].steps reaches the steps field of the first element of settings. This is also flagged as an output node, so it'll surface the extracted value in the UI, which makes it double as a quick way to check what a key resolves to.
The inputs and outputs
- json (
JSON) - the object to read from, typically fromLoadJsonFromUrlorLoadJsonFromText. - key (
STRING) - the key or dotted path to the integer you want. - INT (output) - the extracted number, ready to wire into a seed, steps, width, or any int input.
Installing it
ComfyUI Manager: search comfyui-art-venture, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/sipherxyz/comfyui-art-venture
then restart ComfyUI. Already present on comfy.icu.
Common issues
Pack-wide: a red "missing" node in a shared workflow means art-venture isn't installed. Manager → "Install Missing Custom Nodes."
The real-world snags are all about the key and the type. If your key doesn't match a field that exists - a typo, a wrong nesting path, or a value that lives one level deeper than you think - you'll get an error or an empty result. When that happens, LoadJsonFromUrl and LoadJsonFromText both have a "print to console" option; turn it on and look at the actual JSON structure so you can see the real key path. The other thing: this node wants an integer. If the value at your key is a float like 1.0 or a string like "512", that's a mismatch - reach for GetFloatFromJson or GetTextFromJson instead, or expect it to choke. Match the extractor to the type in the data.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| json | JSON | — | |
| key | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |