Json Input
A home for your JSON that stops mangling newlines
- json
Json Input is the node that gives you a big friendly text box for JSON and hands the string back out untouched - with one genuinely useful trick: it cleans up literal newlines and tabs that sneak inside your JSON string values, so the text you paste doesn't silently become invalid JSON.
Why you'd reach for it
ComfyUI's plain STRING inputs are fine for a prompt, but pasting a multi-line JSON blob into a single-line widget is a fight. This node gives you a multiline editor for the whole document, and its output is a clean STRING you can feed into the pack's JSON Parser, a Save String to File node, or any API-calling node that expects a JSON payload.
How it works
At its core it's a pass-through: JSON in, JSON out. The clever part is the escaped-chars handling. When you type or paste actual newlines and tabs inside a JSON string value (as opposed to the structural whitespace between keys), that's technically invalid JSON - a real line break inside quotes breaks the document. The node scans the text and converts those literal newlines/tabs inside strings to the \n / \t escape sequences, leaving the structural formatting alone. It even normalizes CRLF line endings so a Windows-pasted file works on Linux.
Current builds expose a convert_escaped_chars toggle (on by default) to turn this cleaning on or off, and the pack ships a small frontend extension that gives you a "Convert Escaped Chars" preview so you can see what the parser will actually receive before it runs.
The inputs that matter
- json - the multiline text box for your JSON document. This is the one you'll actually type into.
One output:
- json - the cleaned string, ready to wire downstream.
Installing it
Pack install, as usual: ComfyUI Manager → Install Custom Nodes → search "ComfyUI-TinyBee", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
It's under 🐝TinyBee/Strings. No extra dependencies - this one is stdlib only.
Common issues
If you hand this node a single-line JSON string it does nothing special, which is correct. Where people get confused: the output is still a string, so you can't skip the JSON Parser step if you want actual structured data out. And if you're generating JSON programmatically with real newlines inside values, leaving the convert toggle on is what keeps your output parseable - turn it off only when you have a specific reason to pass the raw bytes through.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| json | STRING | — | |
| convert_escaped_chars | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| json | STRING | — |