v0.0.4
Co-authored-by: Cursor <cursoragent@cursor.com>
comfyui-misc
ComfyUI custom nodes focused on small utility workflows.
Nodes
1) Any Switch (misc)
Selects one value from dynamic any_01, any_02, ... inputs.
- Input
select_index(INT):-1: automatically choose the first non-emptyany_*input0or higher: force selection ofany_{index+1}
any_01,any_02, ... (*): dynamic optional inputs
- Output
*: selected valueindex(INT): selected input index (0-based)
How to use
- Connect multiple candidates to
any_*inputs. - Keep
select_index=-1for auto mode, or set a number for fixed mode. - Use
indexwhen downstream nodes need to know which branch was chosen.
2) Any Output Switch (misc)
Routes one input to one of dynamic outputs any_01, any_02, ...
- Input
input(*): value to routeselect_index(INT):-1: route to the first connected output slot0or higher: force route toany_{index+1}
- Output
any_01,any_02, ... (*): dynamic outputs (only one is active)index(INT): selected output index (0-based)
How to use
- Connect
inputfrom an upstream node. - Connect each destination node to desired
any_*outputs. - Choose auto mode (
-1) or fixed mode (>=0) withselect_index.
3) Combine Primitives (misc)
Combines primitive values into a single combined package.
- Supported primitive types
INT,FLOAT,STRING,BOOLEAN,COMBO
- Input
primitive_01,primitive_02, ... (PRIMITIVE) dynamic optional inputs
- Output
combined(PRIMITIVES)length(INT): number of packed primitive values
How to use
- Connect primitive-producing nodes to
primitive_*inputs. - Send
combinedtoSplit Primitives (misc)or another compatible node. - Use
lengthfor loops/validation.
4) Split Primitives (misc)
Unpacks combined produced by Combine Primitives (misc).
- Input
combined(PRIMITIVES)
- Output
INT_01,FLOAT_02, ... (PRIMITIVE) dynamic outputs (typed names)length(INT)
How to use
- Connect
combinedfromCombine Primitives (misc)(creating Split from thecombinedoutput search also syncs correctly). - Connect downstream primitive consumers to typed outputs such as
INT_01. - Output slots auto-sync with upstream combine connections (even through relay nodes such as
Any Switch (misc)andReroute). - On workflow load / copy-paste restore, output links are preserved first and type-specific sync is applied after graph restoration settles.
Installation
- Place this folder under
ComfyUI/custom_nodes/comfyui-misc. - Restart ComfyUI.
- Node category:
misc.
Notes
- Dynamic slots are synchronized by JS extensions in
js/. - For workflow compatibility, keep ComfyUI and custom nodes up to date.
- See CHANGELOG.md for version history.
JavaScript unit tests (no ComfyUI required)
npm install
npm test
Tests live under test/js/ (one file per node, plus paste_restore.test.js for copy-paste link restore). Pure logic is in js/logic/.
Copy-paste and workflow load temporarily suppress dynamic slot removal so links can finish restoring before stabilize() trims unused sockets.
Languages
JavaScript
78.3%
Python
21.7%

