ComfyUI Node

HT Widget Control

The node that pokes other nodes' widgets for you

By ArtHommage·Created 2 years ago·Updated about a year ago· 4
HT Widget Control
      modefixed
      target_widgetcontrol_after_generate
      target_typeglobal
      class_nameKSampler
      node_id

      Most ComfyUI control nodes pass data between nodes on wires. HT Widget Control doesn't. It reaches sideways into ComfyUI's own widget system and sets values on other nodes' UI controls - the same thing you'd do by clicking the little dice or typing into a field, but scripted from inside the graph. From HommageTools, it's for the person who wants a workflow to drive itself without a human touching the UI.

      Fair warning up front: this is one of the more experimental nodes in an already-experimental pack, and the README's "perpetually alpha, not for production" disclaimer applies harder here than most. The mechanism works, but it depends on ComfyUI's internal server.widget_values state, which isn't a public API and can change between ComfyUI versions.

      How it works

      The node targets one specific widget - currently the only choice is control_after_generate, which is the "fix seed after generation" mode ComfyUI seeds use. It stores a value into ComfyUI's server-side widget-values map under a key, with a mode that tells ComfyUI what to do with it:

      • fixed - set the widget to the given value, full stop.
      • increment / decrement - step the value up or down (useful for iteration-style workflows).
      • randomize - let ComfyUI roll the value fresh.

      Then you pick who gets affected via target_type:

      • global - applies to every node with that widget.
      • by_class - targets a node class; the class_name field defaults to KSampler, so you can hit all KSamplers without touching others.
      • by_id - targets a specific node; put its numeric ID in node_id.

      So the practical pattern is: set mode to randomize, target_widget to control_after_generate, target_type to by_class, and leave class_name as KSampler - now every KSampler in the graph rerolls its seed each run, automatically. That's genuinely useful in batch/latent workflows where you want fresh seeds without babysitting the UI.

      The catch

      The node has no outputs and is marked as an output node, so it always runs. But it mutates shared server state rather than returning data, which means behavior depends on execution order and what else is touching widget values. If two of these nodes fight over the same key, last one wins. And because it injects into PromptServer.instance, it needs the server-side environment - it won't do anything useful in a headless queue that isn't attached to the UI.

      Installing it

      It ships with the whole HommageTools pack. Install via ComfyUI Manager (search HommageTools) or manually:

      cd ComfyUI/custom_nodes
      git clone https://github.com/ArtHommage/HommageTools.git
      cd HommageTools && pip install -r requirements.txt
      

      Restart ComfyUI and it'll be under the HommageTools/System menu.

      Where it fits

      If you already control seeds with a proper seed-management node, you probably don't need this. But if you've ever caught yourself manually rerolling seeds across half a dozen KSamplers between runs, this is the automation you were doing by hand - just budget a little time to test it against your ComfyUI version, because this one's closer to the metal than the rest of the pack.

      CategoryHommageTools/System

      Inputs (5)

      NameTypeDefaultDescription
      modeCOMBOfixed4 options: fixed, increment, decrement, randomize
      target_widgetCOMBOcontrol_after_generate1 options: control_after_generate
      target_typeCOMBOglobal3 options: global, by_class, by_id
      class_nameoptSTRINGKSampler
      node_idoptSTRING

      Outputs (0)

      No outputs