Workflow customization
Each plugin ships a default ComfyUI workflow JSON under
resources/workflow/<plugin>.json. You can replace it with a custom workflow
to swap models, add pre/post-processing, or chain effects, as long as the
workflow respects the contract the plugin expects.
This page documents that contract.
What the plugin sends
When the plugin submits a job, it loads the workflow JSON from disk and substitutes a fixed set of template variables before POSTing to ComfyUI. The plugin does not otherwise modify the JSON — every node and edge in your custom workflow is preserved.
Template variables
| Variable | Replaced with | When |
|---|---|---|
${INPUT_PATH} |
The full path to the input EXR file on the server side. | Every render. |
${OUTPUT_PREFIX} |
The full path prefix the output EXR(s) should be written to on the server side. | Every render. |
${FRAME} |
The numeric frame index for per-frame plugins. | Per-frame plugins only. |
${IMAGE_LOAD_CAP} |
The number of frames to load in this sequence pass. | Sequence plugins only. |
${PROJECT_NAME} |
The user-facing project name (set in the plugin parameters). | Every render. |
${WORKFLOW_NAME} |
The workflow identifier (defaults to the plugin name). | Every render. |
Strings are substituted literally. For server paths on Windows ComfyUI hosts (UNC paths), the plugin handles backslash escaping for valid JSON automatically.
Variables that are not present in the workflow are silently ignored. Variables referenced in the workflow but unknown to the plugin remain in the JSON literally, which will likely cause ComfyUI to error.
Required nodes
A workflow must contain at least:
- A
LoadEXRnode (or equivalent) reading from${INPUT_PATH}. For sequence plugins this node also receives${IMAGE_LOAD_CAP}as theimage_load_capfield. - A
SaveEXRnode (or equivalent) writing to${OUTPUT_PREFIX}. The prefix already includes the project / workflow / frame hierarchy; do not prepend or modify it.
Anything in between is your business: you can insert color management nodes, pre-processing, additional models, or post-processing.
Replacing the default workflow
- In ComfyUI, build and test your custom workflow until it runs end to end with manually-supplied input and output paths.
- Export the workflow (
Workflow → Export → API Format JSON). - In the exported JSON, replace your test input path with
${INPUT_PATH}, your test output prefix with${OUTPUT_PREFIX}, and any other applicable template variables. - Save the result to
resources/workflow/<plugin>.jsonin the plugin bundle, replacing the default. - Restart your host application (so the bundle is reloaded).
Alternatively, some plugins expose a Workflow Path parameter that lets you point at an external workflow JSON without modifying the bundle.
Worked example: replacing the upscaler model
Suppose you want to use a different upscaler than upscale_seedvr2 ships with,
e.g. an ESRGAN variant for fast comp work where temporal consistency does not
matter.
- Open ComfyUI and create a workflow with:
LoadEXR→ESRGAN Upscale→SaveEXR. - Test it manually. Confirm the EXR output looks right.
- Export to API format. Open the JSON in a text editor.
- Find the
LoadEXRnode’sfilepathvalue. Replace it with${INPUT_PATH}. - Find the
LoadEXRnode’simage_load_capvalue. Replace it with${IMAGE_LOAD_CAP}if you want sequence behavior, or set it to1if you want per-frame. - Find the
SaveEXRnode’sfilename_prefixvalue. Replace it with${OUTPUT_PREFIX}. - Save as
~/my-custom-upscaler.json. - In the plugin’s
Workflow Pathparameter (if exposed), point at this file. - Render.
Limitations
- The plugin does not validate the workflow before submission. A broken workflow surfaces as a ComfyUI error in the plugin’s status panel.
- The plugin does not introspect node parameters; you cannot expose a custom node’s parameter as a host-side OFX parameter without modifying the plugin source. The recommended pattern for that is to add a new plugin instead.
- Some custom nodes have side effects (downloading weights, writing logs, etc.) the plugin does not see. That is by design — the plugin treats ComfyUI as a black box.
For deeper integrations, see Architecture and consider authoring a new plugin.