Skip to main content
The Node Replacement API allows custom node developers to define migration paths from deprecated nodes to their newer equivalents. When you update or rename nodes, users can automatically upgrade their workflows.

When to use

  • Changing node class names: You changed a node’s class name (use DISPLAY_NAME for display name changes instead)
  • Merging nodes: Multiple nodes consolidated into one (e.g., Load3DAnimation merged into Load3D)
  • Refactoring inputs: Input names or types changed between versions
  • Fixing typos: Correcting node names without breaking existing workflows

Where to register replacements

Register replacements during your extension’s on_load lifecycle hook. Create a dedicated file (e.g., node_replacements.py) in your custom node package:

Complete example

Here’s a full example showing how to structure node replacements in a custom node package:

Core examples

ComfyUI core uses node replacements for built-in node migrations. Here are real examples from comfy_extras/nodes_replacements.py:

Simple node merge

When Load3DAnimation was merged into Load3D:

Typo fix

Correcting a typo in SDV_img2vid_ConditioningSVD_img2vid_Conditioning:

Input renaming with defaults

Replacing ImageScaleBy with ResizeImageMaskNode:

Autogrow input mapping

For nodes using Autogrow (dynamic inputs), use dot notation:

NodeReplace parameters

ParameterTypeDescription
new_node_idstrClass name of the replacement node
old_node_idstrClass name of the deprecated node
old_widget_idslist[str] | NoneOrdered list binding widget IDs to their relative indexes
input_mappinglist | NoneHow to map inputs from old to new node
output_mappinglist | NoneHow to map outputs from old to new node

Input mapping

Each input mapping entry defines how an input transfers from the old node to the new one. Map from old input:
Set a fixed value:
Map dynamic/autogrow inputs (use dot notation):

Output mapping

Output mappings use index-based references:

Widget ID binding

The old_widget_ids field maps widget IDs to their positional indexes. This is required because workflow JSON stores widget values by position, not ID.

REST API

Retrieve all registered replacements:
Response:

Frontend behavior

When a workflow contains a deprecated node, the frontend:
  1. Fetches replacements from GET /api/node_replacements
  2. Detects nodes matching old_node_id
  3. Prompts the user to upgrade
  4. Applies input/output mappings automatically
  5. Preserves connections and widget values
See the frontend implementation: