Comfy-Org / Comfy-Org/comfy-cli
[Enhancement] workflow set-slot: support toggling node mode (bypass/mute)
- Dominant language
- Python
- Stars
- 968
- Forks
- 151
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 77
Description
## Motivation
`comfy workflow slots` / `set-slot` cover widget values, which makes value-level presets (resolution, steps, checkpoint name) fully scriptable against one canonical frontend-format file. But a very common preset dimension is **structural**: switching a node on/off — the canonical example being a LoRA loader that a "draft" preset enables and a "finals" preset disables.
The GUI answer is bypass (Ctrl+B, litegraph `mode` 4) and `workflow_to_api.py` already resolves bypassed/muted nodes correctly at conversion — the only missing piece is a CLI verb to set the mode.
Setting a LoRA's `strength_model=0` is not a substitute: ComfyUI registers zero-strength patches unconditionally (`model_patcher.add_patches` has no short-circuit), so under weight streaming you still pay the full per-step re-merge for a patch with zero effect. On an 11 GB card we measured that tax at ~20% of a whole render — a silent perf trap that mode toggling avoids.
## Proposal
Either of:
1. Extend the `set-slot` address space with a pseudo-input, e.g.
`comfy workflow set-slot wf.json '105/200._mode=bypass'` (accepting `normal|mute|bypass`), or
2. A sibling verb: `comfy workflow set-mode wf.json 105/200=bypass`.
Subgraph-interior addressing (`instance/inner`) already exists in `slots`, so either form composes with it naturally. `slots` output could also list each node's current mode so agents can discover toggleable structure.
## Current workaround
We generate preset variants by running `set-slot --stdout` for values and then patching `node.mode = 4` for a declared `bypass:` list in a ~40-line script — it works, but it reaches into the file format where everything else goes through the CLI, and we'd happily delete it.
Contributor guide
Research direction
Start with the existing `comfy workflow set-slot` and `slots` entry points, then read `workflow_to_api.py` to understand how bypassed or muted nodes are resolved. Trace the existing `instance/inner` addressing before choosing between the proposed interfaces. Done means the CLI can set a node to `normal`, `mute`, or `bypass` while preserving subgraph addressing and removing the need for the workaround script.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100