Convert to Dictionary
Turn text that looks like a Python dict into a real DICT
- DICT
VixDictionaryConvert is a string-to-dict converter, and the catch is in the fine print: the string has to be a valid Python dict literal, because the node runs Python's ast.literal_eval on it. Feed it {"model": "flux", "steps": 30} and you get a real DICT out. Feed it "hello world" and it throws a parse error.
It's part of the ComfyUI-Visionatrix dictionary family - the bridge that takes dict-shaped text from anywhere (a file read, a metadata string, another node's output) and turns it into a structured DICT the rest of the toolkit can use with VixDictionaryGet and VixDictionaryUpdate.
Inputs
- dictionary_text (STRING,
forceInput) - the text to parse. It must be a Python literal: double-quoted strings, real booleans and numbers, no variable names, no functions.{"a": 1, "b": True}parses;{"a": x}does not.
Outputs
One DICT output. Unlike VixDictionaryNew, this path can carry typed values - 1 comes back as an int, True as a bool, because ast.literal_eval actually evaluates the literals rather than treating everything as strings.
How it works
ast.literal_eval is the key detail, and it's worth understanding because it's both the power and the limit. It only evaluates literals - dicts, lists, strings, numbers, booleans, None - and refuses anything executable. That's a good thing: this node is safe to run on untrusted text, which is more than you can say for a generic eval. It also means the accepted syntax is exactly Python's: keys and strings in double or single quotes, True/False capitalized, JSON's lowercase true/false will fail.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Visionatrix/ComfyUI-Visionatrix
Restart ComfyUI, or install ComfyUI-Visionatrix via ComfyUI Manager. No model downloads; deps are torch, pillow, numpy - already present.
Gotchas
The two failure modes are syntax and type expectations. Syntax: if your upstream text isn't perfectly valid Python-literal syntax, this node errors and takes down the run - validate the source before wiring it in. Type expectations: if your text came from a node that serialized values as strings ("30" instead of 30), the dict comes back with string values and numeric consumers may balk. And don't try to feed it JSON with lowercase booleans or null - convert to Python's True/False/None first. When the input is well-formed, though, this is the smoothest way to get structured data into your graph from a text source.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| dictionary_text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DICT | DICT | — |