Subworkflow
Stop copy-pasting your sampler chain — turn it into a node
The name is the pitch. Subworkflow (class SWF_Subworkflow, from the eniewold/ComfyUI-Subworkflow pack) turns a saved ComfyUI workflow into something you can call like a function from another workflow. You pick a .json file from a dropdown, and the node grows the input and output slots that the inner workflow declares. Wire them up, hit Queue, and the whole inner graph runs inside your outer one - no copy-pasting a sampler chain into every project you own.
It's from the same family of ideas as subgraphs, but it's not a subgraph. A subgraph is a group of nodes reused within one workflow file. This loads a completely separate workflow file and splices it into your prompt at execution time. Change the inner file once, and every workflow that calls it picks up the change on the next run. That's the whole appeal: one source of truth for the pipeline you reuse, plus an actual reload toggle if you'd rather have the old behavior.
How it works
Under the hood the node uses ComfyUI's newer V3 node API. When you queue a job, it reads the workflow JSON from ComfyUI/user/default/workflows, scans it for Subworkflow Input and Subworkflow Output boundary nodes, builds an execution subgraph, and expands it into the running prompt. That's why the node looks nearly empty when you drop it in - the slots only appear after you choose a file.
The two inputs that matter:
workflow- a dropdown listing every workflow file inComfyUI/user/default/workflows. Note that folder specifically: that's where the inner workflows have to live, not the template folder you'd normally save to.at execution- the booleanreload_each_execution, defaultreload.reloadre-reads the file every run, so you can edit the inner workflow and see it live.keep loadedcaches the parsed graph, which is faster and required if the inner workflow randomizes a seed via a control-after-generate node linked to aSubworkflow Input.
Outputs are dynamic and inferred from the inner workflow's Subworkflow Output nodes - there's nothing to configure on your side.
Installing it
Either use ComfyUI Manager (search the Custom Nodes Manager for "Subworkflow (reuseable workflows)" - remove the filters if it doesn't show) or:
cd ComfyUI/custom_nodes
git clone https://github.com/eniewold/ComfyUI-Subworkflow.git
Then restart ComfyUI and hard-refresh the browser (Ctrl+F5). There's no requirements.txt - nothing extra to pip install. The one real requirement is a recent ComfyUI: the pack is built on the V3 node API and was tested against 0.18.2. If the nodes don't appear after install, that's your first suspect; update ComfyUI before you debug anything else.
Where people get burned
It's beta (v1.2.3), by a solo author, and the README is upfront that a lot of the code was AI-assisted - so expect rough edges. Known issues: the progress bar can overshoot past 100%, the input/output order on the node is "undetermined", and when a linked node's type doesn't match what the inner boundary expects, the link gets severed silently. If a slot suddenly goes grey, that's what happened - reconnect it with the right type. Also remember the workflow file is read-only to this node: it never saves changes back to the inner file.
One structural thing to plan for: since the inner workflow stays a separate file, sharing a workflow that uses Subworkflow means sharing every inner file too. The author has floated embedding as a fallback, but for now treat inner workflows like source files - version them, and keep them out of reach of people who don't have them.
For debugging, set COMFYUI_SUBWORKFLOW_DEBUG=true in your environment for backend trace logs, or localStorage.setItem("swf_debug", "1") in the browser console for frontend ones.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| workflow | COMBO | 1 options: | |
| reload_each_execution | BOOLEAN | true | — |
Outputs (0)
No outputs