Nodes/ComfyUI-nhknodes/πŸ”– Bookmark (nhk)
ComfyUI Node

πŸ”– Bookmark (nhk)

Jump Around a Giant Workflow Instantly β€” Bookmark (nhk)

By EnashkaΒ·Created 12 months agoΒ·Updated 29 days agoΒ· 23
πŸ”– Bookmark (nhk)
      β—„shortcut_key1β–Ί
      β—„zoom1.0β–Ί
      β—„anchorupper-leftβ–Ί

      The Bookmark (nhk) node does exactly one thing: it teleports your viewport to wherever you put it, on double-click or a keyboard shortcut. That's it. No inputs to wire, no data flowing through, nothing to execute. It's a navigation aid for the canvas, and on a big workflow it saves you more time than any fancy sampler ever will.

      If that sounds familiar, it's because rgthree has had a bookmark feature for ages - the author of this pack even cribbed the positioning math from it (the source comments admit as much, "original rgthree behavior"). This is the standalone version that ships inside nhknodes, so you get it without installing a second pack.

      How it works

      The Python side is a glorified stub: the bookmark function returns an empty tuple and marks the node as an output node so it sits quietly on the canvas. All the real work lives in the pack's frontend JavaScript. When you drop a Bookmark node down and set a shortcut_key, the node registers that key combo with a global keydown listener. Press it (while you're not typing in a text field - it deliberately ignores inputs and textareas) and the code recomputes the canvas offset so the bookmark node lands at your chosen anchor position in the viewport, then sets the zoom. Double-clicking the node does the same thing.

      The node keeps no persistent state between sessions - it's a canvas object, and the shortcut registration happens on node creation, so whatever you set stays until you change it.

      The inputs that matter

      Only three, and they're all self-explanatory:

      • shortcut_key - the key combo, like 1 or ctrl+2 or alt+shift+3. Defaults to 1.
      • zoom - how zoomed in you want to land, 0.5 to 2.0. Default 1.0.
      • anchor - upper-left or upper-right, i.e. where the bookmark node itself sits in the viewport when you jump to it.

      There are no outputs and nothing to connect. You just place it somewhere you want to return to and name it via the title.

      Installing it

      It's part of ComfyUI-nhknodes, so you get it with the whole pack:

      cd ComfyUI/custom_nodes && git clone https://github.com/Enashka/ComfyUI-nhknodes
      

      then restart ComfyUI, or just use ComfyUI Manager and search for "NHK Nodes". No extra dependencies, no model downloads - the requirements.txt has the usual torch/numpy/pillow plus a couple of API libs you don't need for this node.

      Where people get tripped up

      Because it's frontend-only, the shortcut won't fire while you're typing in a widget - that's intentional, not a bug. If you change shortcut_key on an existing node, the old combo is properly unregistered, so you won't get phantom jumps. And if you run ComfyUI headless or via the API, bookmarks obviously do nothing; they're a canvas convenience, not workflow logic. Put them on workflows you actually open and work in, and you'll wonder why you ever scrolled around a 200-node graph with the mouse wheel.

      Categorynhk/utility

      Inputs (3)

      NameTypeDefaultDescription
      shortcut_keySTRING1Keyboard shortcut to jump to this bookmark (e.g. '1', 'ctrl+2', 'alt+shift+3')
      zoomFLOAT1.00.5–2Zoom level when navigating to bookmark
      anchorCOMBOupper-leftWhere to position the bookmark node in viewport

      Outputs (0)

      No outputs