Nodes/ComfyUI_RunpodNodes/RunPod ComfyUI Workflow Runner
ComfyUI Node

RunPod ComfyUI Workflow Runner

Run a whole ComfyUI workflow on a RunPod worker

By tcarwash·Created 8 months ago·Updated 8 months ago· 0
RunPod ComfyUI Workflow Runner
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • IMAGE
api_key
endpoint
workflow_json
vars{}

Of all 27 nodes in this pack, this is the one that's actually ComfyUI running ComfyUI. RunPodImageNodeComfy is the "ComfyUI Workflow Runner": you paste an exported workflow JSON into it, and it ships that whole workflow to a worker-comfyui serverless endpoint on RunPod, where a full ComfyUI instance runs it and sends the result image back. It's the pack's answer to "I want my exact graph, but on someone else's GPU."

The workflow is a real thing people do - running exported ComfyUI workflows on RunPod serverless GPUs is a pattern with enough users that community tooling has grown up around it (people have built whole CLIs to deploy such endpoints and fire workflows from the terminal). This node brings that into the graph itself, so you can chain a local node, a remote workflow run, and more local post-processing in one canvas.

How it works

You export your workflow first - Workflow > Export (API) in ComfyUI, which gives you the API-format JSON. Paste it into workflow_json, point endpoint at your worker-comfyui deployment, and the node POSTs the workflow (plus any images you wired) to RunPod. It polls until the remote ComfyUI finishes and returns the image - the node reads it from output.message and decodes it to an IMAGE tensor.

Two extras make it usable as a building block:

  • Eight image slots (image_1 through image_8) - wire local images in; they're sent as image_1.png, image_2.png, etc., which you reference inside the workflow.
  • vars - a JSON string of variables. The node recursively replaces $name placeholders in the workflow with the corresponding values from the JSON. This is how you make one workflow template into many runs.

The inputs that matter

  • api_key - RunPod key.
  • endpoint - your worker-comfyui endpoint ID.
  • workflow_json - the exported API-format workflow, pasted as text. The heart of the node.
  • vars - a JSON object, default {}, for $placeholder substitution. Build it by hand or with the sibling RunPodVariablesBuilderNode.
  • image_1 … image_8 - optional IMAGE wires sent as files to the remote run.

What comes out

One image output (IMAGE) - the final output of the remote workflow. Note: only a single result image comes back; if your remote workflow produces multiple outputs, wire the runner around that expectation.

Installing it

One of 27 nodes in tcarwash/ComfyUI_RunpodNodes. ComfyUI Manager: search ComfyUI_RunpodNodes, or

cd ComfyUI/custom_nodes
git clone https://github.com/tcarwash/ComfyUI_RunpodNodes

then restart. No extra dependencies - the pack runs on what ComfyUI already ships. You need a RunPod key and a deployed worker-comfyui endpoint (see the worker-comfyui template).

Gotchas

  • The remote worker must have the workflow's custom nodes and models - the API JSON references node types by class name, so a workflow full of local custom nodes will fail on a bare worker. This is the #1 gotcha and it's not obvious at first.
  • JSON pasting is unforgiving - malformed workflow JSON throws immediately with a parse error; make sure the export is intact.
  • Image wiring requires the workflow to expect the files - image_1.png only matters if your remote graph has a Load Image node pointed at it. The node sends the files; your workflow has to use them.
  • Serverless metering - per-second GPU, cold starts, and now the whole remote graph's runtime. A heavy workflow is a heavy bill.
  • vars must be valid JSON - an invalid vars string errors out (Invalid vars JSON:), and malformed $ substitutions silently pass through unchanged.

This is the power node of the pack, and the fiddliest - it assumes you can export a workflow and keep a worker-comfyui deployment alive. If that describes you, it's genuinely impressive: a whole local graph's logic, executed remotely, dropping an image back into the same canvas.

CategoryRunPod/Custom Serverless

Inputs (12)

NameTypeDefaultDescription
api_keySTRING
endpointSTRING
workflow_jsonSTRING
varsoptSTRING{}
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE