Nodes/Run Once Group Toggle/Run Once Group Toggle
ComfyUI Node

Run Once Group Toggle

Bypass a Group for Exactly One Run — and Skip the Ctrl+B Two-Step

By ssain3d-lgtm·Created about a month ago·Updated 25 days ago· 0
Run Once Group Toggle
      enabledtrue
      group_titles
      mode_during_runBypass

      You know the dance. Your graph has a 4x upscale, a face detailer and an interpolation chain that cost ten minutes and a pile of VRAM between them, and this time you only want the base plate. So you marquee the group, hit Ctrl+B, run, then hunt the group down and Ctrl+B it back - and one day you forget, and the next three runs are quietly wrong.

      Run Once Group Toggle deletes both Ctrl+B presses. Tick the groups you want switched, press Run, and they run in the mode you asked for for that submit only; when the queue empties, every node returns to the mode it actually had - not to some guessed default.

      People have been asking for this for years, and the standing answers - rgthree's Fast Groups Bypasser, or keeping the expensive stage in its own workflow - both depend on you clicking back. This node flips the graph before the submit leaves the browser and undoes it when the queue empties. It's plumbing, not pixels.

      How it actually works

      Bypass is a litegraph concept: mode 4 on the node object, resolved away in the browser by graphToPrompt(), so the server never learns the bypassed node existed. A Python node therefore cannot change the bypass state of the run it belongs to - by the time Python runs, the decision is long made. So the shipped run_once_group.py is only a settings holder (no outputs, not an OUTPUT_NODE, so it never enters the execution schedule) and the behaviour lives in the extension JS.

      That JS hooks app.queuePrompt, and the timing is the whole trick. Switching happens in beforeQueued, because graphToPrompt() runs immediately after it - change anything later and you've missed this submit. Releasing waits for queue_remaining == 0 rather than one completion event, so a batch of two restores once, at the end. It also checks for scoped runs before acting, leaving core "Queue Selected Output Nodes" and rgthree's group ▶ alone: bypassing the group you asked to run would leave nothing to execute.

      The three inputs that matter

      Three widgets, and only one needs thought.

      • enabled - plain boolean. Off means the node does nothing; reach for it when you suspect the toggle is what's breaking your run.
      • group_titles - one group per line, and here's the trap: newline is the only separator. Commas never separate, because real titles are full of punctuation (D. Upscale · Interpolate would get shredded). Blank lines, duplicates and stray spaces are cleaned for you.
      • mode_during_run - the default for every line: Bypass, Mute or Active. Bypass is what you want most of the time; Active is the neat inverse, for running a group you normally keep off.

      Any line can override that default with an = Mode suffix, so one node covers a mixed run:

      Warmup = Active
      Upscale
      Face fix = Mute
      

      The suffix only counts when what follows the = is exactly a mode word, so a title like A = B Group survives intact.

      You don't have to type it: the node grows a Pick groups button (right-click does the same) where clicking an unticked group adds it and a ticked one offers its per-run mode or removal. The title-bar badge saves the console archaeology - 3 groups, 1/2 groups when a title matched nothing, holding 12 mid-run.

      Install

      Search Run Once Group Toggle in ComfyUI Manager, or:

      cd ComfyUI/custom_nodes
      git clone https://github.com/ssain3d-lgtm/comfyui-run-once-group
      

      Restart ComfyUI, then hard-refresh with Ctrl+F5. Not superstition - extension JS caches hard and a restart alone can leave you on the old build. No dependencies, no models; the project's pyproject.toml declares an empty dependency list on purpose.

      Where people get burned

      No Pick groups button? Cached old build. Ctrl+F5.

      Groups inside subgraphs aren't targets - root level only. If a group never shows in the picker, that's usually why.

      Renames don't break your list. Groups carry a stable litegraph id and the node remembers which id each line meant (saved with the workflow under properties["sain3.runOnce.ids"]), so renaming a group heals its line to the new title with the mode suffix intact. A row now means the group is genuinely gone. Two groups sharing a title still collapse to one line and match the first.

      Overlapping groups are handled: when a node sits in two selected groups, the first line claims it, records its real original mode, and restores it exactly once - line order is priority order. Toggles also refuse to target each other, deliberately: bypassing one whose turn hasn't come would make it silently do nothing, in a way that shifts with graph order.

      Saving mid-run is safe. Ctrl+S or AutoSave during a held run writes the graph you built, every node in its real mode; only the workflow embedded beside the output images records what actually ran.

      Interrupts, errors and rejected submits all restore. A rejected submit comes back half a second later; a queue you clear while your prompt is pending gets swept after a 1.5-second grace. The one real edge is another extension replacing api.queuePrompt without chaining to it - then the POST result never reaches this node, and it has to infer the run from a growing queue instead.

      The verdict

      Small single-purpose pack, MIT, tested on every push. If you spend your day switching the same two groups around an upscaler, this turns a ritual into a tick box - and unlike a manual Ctrl+B, it can't forget to put things back. Two caveats: no outputs means no wiring (it's a canvas-side switch), and it's frontend code, so it lives at the mercy of ComfyUI's UI rewrites. The badge is what keeps that debuggable.

      Categoryutils

      Inputs (3)

      NameTypeDefaultDescription
      enabledBOOLEANtrueTurn this off and the node does nothing at all.
      group_titlesSTRINGOne target group per line. Press Pick groups (or right-click the node) to tick groups instead of typing. A line may carry its own mode - 'Upscale = Active' - and lines without one use mode_during_run. Newline is the only separator - titles often contain commas, so a comma split would tear them in half and match nothing.
      mode_during_runCOMBOBypassDefault mode for every chosen group without its own '= Mode' suffix. Held for the run you just started, then each node goes back to the mode it actually had.

      Outputs (0)

      No outputs