小珠光选择器
Big clickable buttons instead of typing numbers into a switch
- value
Some nodes you use because they're clever. This one you use because it's visible. XiaozhuguangSelector (小珠光选择器) is a button-based label selector: you set up a row of named buttons, click one, and it outputs the corresponding integer. Where a plain switch or select widget hides your choices behind a dropdown, this puts them on the canvas as labeled buttons you can hit at a glance - which turns out to matter a lot when a workflow is a control panel you (or someone else) operates by hand.
The mechanism is frontend-first. The node's real work - turning a label into a number - is trivial: the backend takes the current label string, parses it as an integer, and returns it as the value output (defaulting to 0 if the label isn't numeric). All the behavior lives in the JavaScript: the buttons you see, the labels on them, the font, the layout. You configure the buttons through the node's settings (the _xz_settings input holds the serialized config, which is how your setup survives saving and reloading the workflow). Resize it and the buttons scale to fill - it's designed to sit on a canvas as a readable control, not as a data node you bury.
Inputs and outputs, which are minimal by design:
- label - the currently selected label (parsed to the output integer).
- _xz_settings - the node's own serialized settings; you won't normally touch this directly, but it's what persists your button config.
- value - the output integer for the selected button.
So the workflow pattern is: set up buttons like "Low / Med / High" or "Portrait / Landscape / Square", click one, and wire the integer out to a switch, a resolution picker, or anything that consumes a number. The pack also ships a sibling boolean selector for the on/off case, so between the two you can build a whole control strip of clickable options. The selector's changelog history is all UI polish - resizable height, buttons that scale, font that resizes - which tells you exactly what this node is optimizing for: a panel you don't have to squint at.
The honest caveat: it outputs only integers, and it's a convenience node, not a functional upgrade. If you never operate a workflow by clicking through options, a dropdown does the same job with less canvas space. But the moment you're running a workflow interactively - tweaking a style, picking a model variant, switching camera angle presets - labeled buttons beat dropdowns every time. It's the plumbing-KB philosophy in miniature: a node whose job is to make the graph readable for the human driving it.
Install is the pack standard - ComfyUI Manager → ComfyUI-xiaozhuguang → restart, or git clone https://github.com/xiaozhuguang/ComfyUI-xiaozhuguang into custom_nodes. No models, no dependencies. If you're already running the pack for its other nodes, this is the polish piece that makes a workflow feel like a tool instead of a tangle.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| label | STRING | 0 | — |
| _xz_settings | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | INT | — |