PettyPaintJsonRead
A dotted-path JSON getter that just works
- text
- path
- data
You've got a JSON blob and you need one value out of it. Maybe it's a config file, maybe it's the state file the petty-paint app writes, maybe it's an API response you pasted into a text node. PettyPaintJsonRead is the boring, dependable tool: hand it JSON and a dotted path, get the value at that path back. No parsing logic to wire, no Python node required.
It's part of the petty-paint pack, the ComfyUI-side integration for Petty Paint, Andrew Porter's web canvas that reimagines doodles through Stable Diffusion. The pack runs on JSON project files, and this is how you pull a field out of one.
How it works
Feed it text (the JSON) and path (a dotted key path). The node parses the JSON, splits the path on ., and walks the object key by key. So for {"setups": [{"model": "sd15"}]}, the path setups.0.model... well, almost - it handles dictionary keys; for array indexes you want the sibling PettyPaintJsonReadArray. A path like character_defaults.steps walks down character_defaults then steps and hands you the number.
Both inputs are typed any. text will be parsed as JSON if it's a string, or used directly if it's already a dict - which means you can chain two of these or feed one from another JSON node. path splits on . and only descends into a key if it exists, so a missing key silently leaves the data where it is rather than throwing.
The inputs and outputs
text-any; the JSON to read (string or already-parsed).path-any; the dotted key path.- Output:
data-any; whatever lives at that path, which can be a string, number, dict, or list.
Installing it
Same pack, same install - ComfyUI Manager, search "petty-paint-comfyui-node":
cd ComfyUI/custom_nodes
git clone https://github.com/mephisto83/petty-paint-comfyui-node
Restart ComfyUI. Declared dependency is Flask==2.1.2; no models, nothing heavy.
Common issues
Two easy stumbles. First, invalid JSON throws - if you're feeding it hand-typed text and it errors, validate the JSON elsewhere before blaming the node. Second, the any typing means you can wire in something that isn't JSON-shaped and get confusing behavior; if you're pulling from a real JSON state file, the pack's whole point is that the path string matches the file's structure, so keep the state file open while you write the path. And if the value you're after lives inside an array, remember this is the dict-path node - arrays are PettyPaintJsonReadArray's job.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | * | — | |
| path | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| data | * | — |