slice_workflow
Extract a single active pipeline from a toggle-template workflow with multiple pipelines, returning a standalone graph with only the needed subgraph definitions.
Instructions
Slice ONE pipeline out of a toggle-template workflow — the kind built with rgthree 'Fast Groups Bypasser/Muter' where one graph holds many pipelines and only one is active at a time. Seeds from the output/SaveImage nodes in the named groups, takes their backward dependency closure (through real links AND virtual Set/Get buses), un-bypasses the kept nodes (and the internals of any subgraph defs they use), and returns a STANDALONE, activated UI graph carrying only the subgraph defs it uses. Reads from any server-side path, userdata filename, or inline graph. Pair with strip_workflow afterward to flatten the Set/Get buses into real connections.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Absolute server-side path to the workflow .json on disk. | |
| graph | No | Inline UI-format workflow JSON. | |
| groups | Yes | Group-title substrings (case-insensitive) whose output nodes seed the slice — CSV string or array, e.g. 'TEXT TO IMAGE,TXT' or ['extend','sampler']. Shared post-proc is pulled in via the closure. | |
| filename | No | Workflow filename in the ComfyUI userdata library. |