Nodes/ComfyUI Web Viewer/BOOLEAN Key Control @ vrch.ai
ComfyUI Node

BOOLEAN Key Control @ vrch.ai

A hotkey that flips a boolean mid-workflow

By VrchStudio·Created 2 years ago·Updated 17 days ago· 356
BOOLEAN Key Control @ vrch.ai
    • BOOLEAN
    shortcut_keyF2
    current_valuefalse
    new_generation_after_pressingfalse

    The BOOLEAN Key Control @ vrch.ai is one of the smallest nodes in the ComfyUI Web Viewer pack and one of the handiest: press a key, and a BOOLEAN output flips. That's it. No sliders, no gestures, no faders - a hotkey that toggles a true/false value your workflow can branch on.

    It sounds trivial until you're live. In a realtime workflow you don't want to reach for the mouse and click a toggle every time the moment changes; you want a key. "Press F to switch to the cinematic prompt," "hit a key to pause generation," "toggle the upscaler on for this shot." That's what this node is for - a physical switch on your generation logic, no clicking required.

    How it works

    shortcut_key is an enum of function keys (F1 through F24 by default), so pick one that doesn't collide with ComfyUI's own shortcuts. Pressing it flips current_value (the boolean state, default false) between on and off, and that state comes out the BOOLEAN output. new_generation_after_pressing optionally kicks a new generation cycle the moment you hit the key - which is what turns a manual toggle into a live one.

    The single BOOLEAN output wires into any boolean input on your graph - a bypass, a switch, a conditioning gate. Since it holds state, it also works as a tiny memory: flip it once, and the value persists until you flip it again.

    Installing it

    Standard pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/VrchStudio/comfyui-web-viewer
    pip install -r comfyui-web-viewer/requirements.txt
    

    Or install "ComfyUI Web Viewer" from ComfyUI Manager and restart. No models, no dependencies beyond the pack.

    The gotcha that catches everyone

    The key only registers when the ComfyUI page has focus. The browser is what's listening for the keystroke, so if you're driving a second display or the page is in the background, your hotkeys silently do nothing - a real complaint in the community (the "how to activate hotkeys when window is not focused" thread is about exactly this). Keep the ComfyUI tab active, or the node is just decorative.

    Also, because shortcut keys are an enum, loading an old workflow that predates the field's strict list can throw a shortcut_key: 'None' not in [...] validation error. Re-pick the key in the dropdown and re-save. It's a two-second fix with a confusing error message.

    Pair it with new_generation_after_pressing and instant queue and you've got a no-mouse performance rig: key up for one look, key down for another, no reaching for the UI.

    Categoryvrch.ai/control/keyboard

    Inputs (3)

    NameTypeDefaultDescription
    shortcut_keyCOMBOF224 options: F1, F2, F3, F4, F5, F6, +18
    current_valueBOOLEANfalse
    new_generation_after_pressingBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN