A source node that lives next to your booleans (typically inside a
subgraph) and relays them to Group/Node Controllers elsewhere. It reads
booleans in its own graph (always reliable) and delivers the result the
safe way, sidestepping the flaky cross-boundary boolean reads.
Fully automatic: each tick it walks its patch output to discover the
Controllers it feeds - up out of its subgraph, across at the root, and
down into sibling/nested subgraphs - pulls their target labels, and
auto-creates one boolean input per target (no manual signal naming). It
resolves those booleans locally and pushes the result onto every
Controller on the lane, so one Wired Controller fans out to many
(Group and Node, mixed). A patched signal governs its target and
overrides ALL, just like a direct boolean; a target's own direct boolean
wins for that one target.
Two bindings (wire tried first, channel is the fallback):
- wire: WiredController `patch` output -> Controller `patch` input,
followed across boundaries by a robust output walk (link map +
floating links + reverse output-proxy lookup; host matched by id and
identity; descends into sibling subgraphs).
- channel: name-keyed global registry, no traversal, any nesting depth.
Controllers gain a `patch` input and a `channel` field (both inert until
connected). The bus socket is named "patch" (SWITCHBOARD_PATCH) to fit
the Switchboard theme; older saved nodes are normalised on load. Boolean
resolution refactored into shared module functions. Adds a Wired
Controller diagnostics menu. README + example_workflows notes updated.
1 line
8.9 KiB
JSON
1 line
8.9 KiB
JSON
{"id":"151410b3-7845-4561-aac4-8968574e9ba2","revision":0,"last_node_id":943,"last_link_id":2432,"nodes":[{"id":942,"type":"MarkdownNote","pos":[-340,-270],"size":[870,500],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[],"properties":{},"widgets_values":["# Wired Controller\n\n**Keep your booleans in one tidy subgraph and drive Controllers anywhere -\nacross subgraph boundaries, reliably.**\n\nA **Wired Controller** is a *source*. It sits next to your booleans (usually\n**inside a subgraph**), reads them in its own graph (always reliable), and\nrelays the result to the Group/Node Controllers that hold the real targets.\n\n## Set it up\n\n1. Inside a subgraph, drop your booleans (e.g. **Value on Boolean**, promoted\n subgraph-input booleans) and a **Wired Controller**.\n2. Connect the Wired Controller to the Controllers it should drive, by **either**:\n - **Wire** - run its **`signals`** output across a subgraph output (IO) into\n each Controller's **`↦ signals`** input. One output can fan out to many\n Controllers (Group *and* Node, mixed).\n - **Channel** - type a name in the Wired Controller's **`channel`** field and\n the same name in each Controller's **`channel`** field. No wire needed -\n works at any subgraph nesting depth.\n3. **That's it - it fills itself in.** The Wired Controller reads the targets\n already on the Controllers it feeds and **auto-creates one `BOOLEAN` input\n per target**, labelled to match. Add/remove a target on a Controller and its\n inputs follow. Just wire your booleans into the inputs it grows.\n\n## How it behaves\n\n- A signal **governs** its target exactly like a directly-wired boolean:\n `true` = enabled, `false` = disabled (using that target's `↳ disable as` mode),\n and it **overrides** the master `ALL` toggle.\n- A target's own direct `BOOLEAN` input, if also wired, wins for that one target.\n- An input you leave unwired is ignored - that target stays on manual / `ALL`.\n\n## Why use it instead of wiring a boolean straight in\n\nReading a boolean *across* a subgraph boundary is best-effort and can get\nconfused when several subgraphs are in play. The Wired Controller flips this to\nthe reliable side: it reads booleans in their own graph and delivers the result\nin the safe direction (out of its subgraph, across, and down into the target's\nsubgraph). Result: a subgraph holds just *booleans + one Wired Controller*,\nwhile the real targets stay on Controllers in the parent graph - one tidy box of\nswitches drives the whole pipeline.\n\n> Tip: running two Wired Controllers? Give them distinct channel names so their\n> signals don't merge."],"color":"#c09430","bgcolor":"rgba(24,24,27,.9)"},{"id":84,"type":"ee221fde-6df4-47b9-a09b-2426d59dd757","pos":[-680,-40],"size":[310,90],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"patch","type":"SWITCHBOARD_PATCH","links":[2432]}],"properties":{"proxyWidgets":[["92","boolean"],["88","boolean"]],"cnr_id":"comfy-core","ver":"0.22.0"},"widgets_values":[]},{"id":87,"type":"ecb7b7df-6ae8-410f-91af-ade331eb256a","pos":[560,-80],"size":[300,100],"flags":{},"order":2,"mode":0,"inputs":[{"name":"↦ patch","type":"SWITCHBOARD_PATCH","link":2432}],"outputs":[],"properties":{"proxyWidgets":[["81","98: Preview as Text"],["94","Preview as Text"]],"cnr_id":"comfy-core","ver":"0.22.0"},"widgets_values":[]}],"links":[[2432,84,0,87,0,"SWITCHBOARD_PATCH"]],"groups":[],"definitions":{"subgraphs":[{"id":"ee221fde-6df4-47b9-a09b-2426d59dd757","version":1,"state":{"lastGroupId":34,"lastNodeId":943,"lastLinkId":2432,"lastRerouteId":290},"revision":0,"config":{},"name":"Boolean + WiredController","inputNode":{"id":-10,"bounding":[-900,-120,128,48]},"outputNode":{"id":-20,"bounding":[290,-150,128,68]},"inputs":[],"outputs":[{"id":"74bd93c3-27c3-407a-80a3-243a07b234b6","name":"patch","type":"SWITCHBOARD_PATCH","linkIds":[2431],"pos":[314,-126]}],"widgets":[],"nodes":[{"id":88,"type":"SwitchboardValueOnBoolean","pos":[-680,-190],"size":[270,170],"flags":{},"order":0,"mode":0,"inputs":[{"label":"NodeID: 89 Preview as Text","localized_name":"boolean","name":"boolean","type":"BOOLEAN","widget":{"name":"boolean"},"link":null},{"localized_name":"value_if_true","name":"value_if_true","type":"FLOAT","widget":{"name":"value_if_true"},"link":null},{"localized_name":"value_if_false","name":"value_if_false","type":"FLOAT","widget":{"name":"value_if_false"},"link":null}],"outputs":[{"localized_name":"float","name":"float","type":"FLOAT","links":null},{"localized_name":"int","name":"int","type":"INT","links":null},{"localized_name":"string","name":"string","type":"STRING","links":null},{"localized_name":"boolean","name":"boolean","type":"BOOLEAN","links":[185]}],"title":"Control NodeID 89","properties":{"cnr_id":"comfyui-switchboard","ver":"1.1.2","Node name for S&R":"SwitchboardValueOnBoolean"},"widgets_values":[false,1,0]},{"id":92,"type":"SwitchboardValueOnBoolean","pos":[-850,90],"size":[260,170],"flags":{},"order":1,"mode":0,"inputs":[{"label":"Group `Preview as Text`","localized_name":"boolean","name":"boolean","type":"BOOLEAN","widget":{"name":"boolean"},"link":null},{"localized_name":"value_if_true","name":"value_if_true","type":"FLOAT","widget":{"name":"value_if_true"},"link":null},{"localized_name":"value_if_false","name":"value_if_false","type":"FLOAT","widget":{"name":"value_if_false"},"link":null}],"outputs":[{"localized_name":"float","name":"float","type":"FLOAT","links":null},{"localized_name":"int","name":"int","type":"INT","links":null},{"localized_name":"string","name":"string","type":"STRING","links":null},{"localized_name":"boolean","name":"boolean","type":"BOOLEAN","links":[2427]}],"title":"Control Group `Group`","properties":{"cnr_id":"comfyui-switchboard","ver":"1.1.2","Node name for S&R":"SwitchboardValueOnBoolean"},"widgets_values":[false,1,0]},{"id":93,"type":"Wired Controller","pos":[-330,-20],"size":[240,170],"flags":{},"order":2,"mode":0,"inputs":[{"name":"98: Preview as Text","type":"BOOLEAN","link":185},{"name":"Preview as Text","type":"BOOLEAN","link":2427}],"outputs":[{"name":"patch","type":"SWITCHBOARD_PATCH","links":[2431]}],"properties":{"channel":"","signals":[{"label":"98: Preview as Text"},{"label":"Preview as Text"}]}}],"groups":[],"links":[{"id":185,"origin_id":88,"origin_slot":3,"target_id":93,"target_slot":0,"type":"BOOLEAN"},{"id":2427,"origin_id":92,"origin_slot":3,"target_id":93,"target_slot":1,"type":"BOOLEAN"},{"id":2431,"origin_id":93,"origin_slot":0,"target_id":-20,"target_slot":0,"type":"SWITCHBOARD_PATCH"}],"extra":{}},{"id":"ecb7b7df-6ae8-410f-91af-ade331eb256a","version":1,"state":{"lastGroupId":34,"lastNodeId":943,"lastLinkId":2432,"lastRerouteId":290},"revision":0,"config":{},"name":"Group & NodeControllers","inputNode":{"id":-10,"bounding":[160,140,128,68]},"outputNode":{"id":-20,"bounding":[1062.2166656494142,156,128,48]},"inputs":[{"id":"7bd24429-9e88-452b-84ab-a63ab6117d51","name":"↦ patch","type":"SWITCHBOARD_PATCH","linkIds":[2429,2430],"pos":[264,164]}],"outputs":[],"widgets":[],"nodes":[{"id":99,"type":"PreviewAny","pos":[1430,180],"size":[210,170],"flags":{},"order":0,"mode":4,"inputs":[{"localized_name":"source","name":"source","type":"*","link":null}],"outputs":[{"localized_name":"STRING","name":"STRING","type":"STRING","links":null}],"properties":{"cnr_id":"comfy-core","ver":"0.22.0","Node name for S&R":"PreviewAny"},"widgets_values":[null,null,null]},{"id":98,"type":"PreviewAny","pos":[860,320],"size":[210,170],"flags":{},"order":1,"mode":4,"inputs":[{"localized_name":"source","name":"source","type":"*","link":null}],"outputs":[{"localized_name":"STRING","name":"STRING","type":"STRING","links":null}],"properties":{"cnr_id":"comfy-core","ver":"0.22.0","Node name for S&R":"PreviewAny"},"widgets_values":[null,null,null]},{"id":94,"type":"Group Controller","pos":[1090,-130],"size":[260,200],"flags":{},"order":3,"mode":0,"inputs":[{"name":"Preview as Text","type":"BOOLEAN","link":null},{"name":"↦ patch","type":"SWITCHBOARD_PATCH","link":2429}],"outputs":[],"properties":{"controls":[{"key":"Preview as Text","label":"Preview as Text","enabled":false,"disableMode":"bypass"}]}},{"id":81,"type":"Node Controller","pos":[530,-90],"size":[350,340],"flags":{},"order":2,"mode":0,"inputs":[{"name":"98: Preview as Text","type":"BOOLEAN","link":null},{"name":"↦ patch","type":"SWITCHBOARD_PATCH","link":2430}],"outputs":[],"properties":{"controls":[{"key":"98","label":"98: Preview as Text","enabled":false,"disableMode":"bypass"}],"busChannel":""}}],"groups":[{"id":2,"title":"Preview as Text","bounding":[1380,100,300,260],"color":"#3f789e","flags":{}}],"links":[{"id":2429,"origin_id":-10,"origin_slot":0,"target_id":94,"target_slot":1,"type":"SWITCHBOARD_PATCH"},{"id":2430,"origin_id":-10,"origin_slot":0,"target_id":81,"target_slot":1,"type":"SWITCHBOARD_PATCH"}],"extra":{}}]},"config":{},"extra":{"frontendVersion":"1.16.8","VHS_latentpreview":false,"VHS_latentpreviewrate":0,"VHS_MetadataImage":true,"VHS_KeepIntermediate":true,"ds":{"scale":1.2307692307692308,"offset":[953.25,401.03125]}},"version":0.4} |