Keyword toggle from JSON
Prompt building with checkboxes instead of typing
- json_input
- ui_widget
- json
- keywords
- keywords_list
Some days you don't want to hand-type a prompt; you want to flip switches. LF_KeywordToggleFromJSON renders a set of clickable chips from a JSON dataset, and whatever chips you toggle on get assembled into a keyword string on the output. It turns prompt building into a UI exercise - which is exactly this pack's whole personality.
The input is a "Ketchup Lite compatible JSON dataset" - a format used by the Ketchup prompt-management ecosystem, where keyword options live as structured data. The node reads that dataset, shows each option as a toggleable chip on its widget, and concatenates your selections into a prompt-ready string using the separator you specify (default , ).
How it works
Three inputs: json_input (the dataset), separator (how keywords join in the output), and the ui_widget chip control. Nothing else - the schema is that clean. The chip widget is the star: you click to toggle keywords in and out of the active set, and the node recomputes the outputs instantly.
Outputs give you flexibility in how you consume the result:
keywords- the joined string, ready to feed into a prompt builder or CLIP encode.keywords_list- the active keywords as a list, for list-iterating nodes.json- the dataset passed through, so the node doesn't break a chain.
The real workflow win is pairing this with a JSON file on disk. Load your dataset from a file, toggle a handful of style chips, and the prompt changes without touching any text boxes. For batch experimentation - same subject, different style tags - it's the difference between editing strings and clicking buttons.
Installing it
It's part of LF Nodes, so:
cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/comfyui-lf
Restart ComfyUI after cloning, or use ComfyUI Manager and search LF Nodes. Minimal dependencies (numpy, Pillow, opencv-python, requests, torch) and no model downloads.
Gotchas
The chip UI is custom frontend, like most of this pack's widgets. If the chips don't render, the pack's frontend isn't loading - update the pack via Manager rather than hunting for a logic bug, because the node's Python side is fine.
And the dataset format has to be the Ketchup Lite shape. If your JSON isn't in that structure, the chips come up empty or the wrong things render. Grab an example dataset from the pack's example workflows before inventing your own format.
Same pack-wide footnote as everywhere: comfyui-lf is legacy (frozen Feb 2025), and the author maintains the successor lucafoscili/lf-nodes where the chips got rebuilt on the newer LF Widgets library.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| json_input | JSON | Ketchup Lite compatible JSON dataset. | |
| separator | STRING | , | Separator for keywords in the output prompt. |
| ui_widget | KUL_CHIP | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| json | JSON | — |
| keywords | STRING | — |
| keywords_list | STRING | — |