Convert YAML to JSON
YAML in, JSON out — the config file's way into your workflow
- Output JSON String
The reverse of the pack's JSON→YAML node, and arguably the more useful direction. If a config file, a service, or an LLM hands you YAML, most of the rest of ComfyUI wants JSON - every data node, HTTP sender, and JSON manipulator speaks it. Convert YAML to JSON is the adapter that closes the loop.
How it works
Mechanically it's two standard library calls in a trench coat: yaml.safe_load on the input, then json.dumps on the result. The safe_load part matters - it means no arbitrary Python objects get constructed from your YAML, which is the whole reason the YAML parsing ecosystem has a safety story at all. From there it's a plain object-to-JSON dump: 4-space indentation when pretty_enabled is on, keys alphabetized when sort_enabled is on, Unicode preserved.
Because YAML is a superset of JSON's data model (with the bonus of anchors, aliases, and multi-line literals), you can throw real-world YAML at it - nested maps, lists, quoted and unquoted strings - and get a faithful JSON mirror back. One asymmetry to keep in mind: YAML booleans and numbers come through fine, but things like unquoted timestamps or custom tags can resolve to types JSON doesn't have, in which case you'll get a stringified or error return.
Inputs and outputs
input_string- your YAML, multiline.pretty_enabled- default on; pretty-printed JSON.sort_enabled- default off; sorts object keys.
The single output is Output JSON String. Bad YAML is swallowed, not fatal: the node returns {"error": "Invalid YAML: ..."} with the parser's message, so you can wire it into a display node and actually read what went wrong.
Where it fits
Say a config file or a workflow parameter sheet lives as YAML, or an LLM node was told to respond in YAML because it's easier to make it format reliably. This node turns that into JSON you can feed a mutator (to tweak values), an HTTP request body, or just inspect. It's a small utility, but it's the one you reach for the moment your data doesn't arrive in JSON.
Install
ComfyUI Manager → search "comfy-nekonote-extensions", or:
cd ComfyUI/custom_nodes
git clone https://github.com/0nyx-networks/comfy-nekonote-extensions
Restart ComfyUI and it's under NEKONOTE → Text. It's part of the MIT-licensed comfy-nekonote-extensions pack by MINETA "m10i" Hiroki (v0.4.7): no model files, nothing heavy to install - pyyaml (its one real dependency here) ships with most ComfyUI installs already. Built on the newer comfy_api.latest backend API, so a current ComfyUI is the main requirement to see it in your node list.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| input_string | STRING | — | |
| pretty_enabled | BOOLEAN | true | — |
| sort_enabled | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Output JSON String | STRING | — |