Apply Bends from JSON
Apply Bends from JSON
- model
- MODEL
This is the "share your work without a screenshot" node of the pack. The Interactive Bending WebUI is where you discover bends by playing with layers in the browser; this node is where you pin them down - you paste a chunk of JSON describing the bends and it applies them to your model, deterministically, on every run.
The format is exactly what the web UI's "Copy Bends" button puts on your clipboard: a JSON object with a bends array plus steps_min, steps_max, and max_denoising_steps. Each bend is { "path", "module_type", "module_args" } - where to hook, what kind of module (noise, scalar, rotate, erosion, whatever), and its parameters. If the web UI is the studio, this node is the sheet music: you can email a bend setup to a friend and they'll reproduce it exactly.
How it works under the hood is worth knowing because it explains the safety: the node clones your model, builds each bending module from the JSON, and registers the hooks per-forward inside a finally block, so nothing persists on the shared model between steps or runs. Your base model stays untouched - you get a patched clone, and each queue resets cleanly. Two inputs, model and a multiline bends_json string. If you paste nothing, it just passes the model through, no harm done. If the JSON is malformed, you get a Bends JSON error telling you what's wrong instead of a silent failure.
This pairs with InteractiveBendingWebUI, but it's genuinely useful standalone: because the bends are data, you can keep a text file of your favorite bends, tweak the JSON directly, and version them like any other workflow asset. You don't need the web UI running to use them - which matters, because the web UI needs a session and a browser tab; this node is the reproducible, headless version of the same idea.
Install: ComfyUI Manager → search "ComfyUI-Model-Bending" → install → restart and refresh. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/abuzreq/ComfyUI-Model-Bending
Pack dependencies: kornia and scikit-learn.
One realistic catch: the JSON format is the pack's own, and it's only as stable as the pack is. This is an experimental project (v0.2.1) with zero community footprint - don't expect tutorials, and if you update the pack, re-copy your JSON from the web UI rather than assuming old clips still parse. Get the exact field names from a "Copy Bends" output and you'll be fine.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| bends_json | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |