Core Extensions

June 18, 2026 ยท View on GitHub

This directory contains the core extensions that provide essential functionality to the ComfyUI frontend.

Table of Contents

Overview

Extensions in ComfyUI are modular JavaScript modules that extend and enhance the functionality of the frontend. The extensions in this directory are considered "core" as they provide fundamental features that are built into ComfyUI by default.

Extension Architecture

ComfyUI's extension system follows these key principles:

  1. Registration-based: Extensions must register themselves with the application using app.registerExtension()
  2. Hook-driven: Extensions interact with the system through predefined hooks
  3. Non-intrusive: Extensions should avoid directly modifying core objects where possible

Core Extensions List

The following table lists ALL core extensions in the system as of 2025-01-30:

Main Extensions

ExtensionDescriptionCategory
clipspace.tsImplements the Clipspace feature for temporary image storageImage
contextMenuFilter.tsProvides context menu filtering capabilitiesUI
dynamicPrompts.tsProvides dynamic prompt generation capabilitiesPrompts
editAttention.tsImplements attention editing functionalityText
electronAdapter.tsAdapts functionality for Electron environmentPlatform
groupNode.tsMigrates deprecated group nodes to subgraphs on loadGraph
groupOptions.tsHandles group node configuration optionsGraph
index.tsMain extension registration and coordinationCore
load3d.tsSupports 3D model loading and visualization3D
maskeditor.tsImplements the mask editor for image masking operationsImage
nodeTemplates.tsProvides node template functionalityTemplates
noteNode.tsAdds note nodes for documentation within workflowsGraph
previewAny.tsUniversal preview functionality for various data typesPreview
rerouteNode.tsImplements reroute nodes for cleaner workflow connectionsGraph
saveImageExtraOutput.tsHandles additional image output savingImage
saveMesh.tsImplements 3D mesh saving functionality3D
simpleTouchSupport.tsProvides basic touch interaction supportInput
slotDefaults.tsManages default values for node slotsNodes
uploadAudio.tsHandles audio file upload functionalityAudio
uploadImage.tsHandles image upload functionalityImage
webcamCapture.tsProvides webcam capture capabilitiesMedia
widgetInputs.tsImplements various widget input typesWidgets

Conditional Lines Subdirectory

Located in extensions/core/load3d/conditional-lines/:

FileDescription
ColoredShadowMaterial.jsMaterial for colored shadow rendering
ConditionalEdgesGeometry.jsGeometry for conditional edge rendering
ConditionalEdgesShader.jsShader for conditional edges
OutsideEdgesGeometry.jsGeometry for outside edge detection

Lines2 Subdirectory

Located in extensions/core/load3d/conditional-lines/Lines2/:

FileDescription
ConditionalLineMaterial.jsMaterial for conditional line rendering
ConditionalLineSegmentsGeometry.jsGeometry for conditional line segments

ThreeJS Override Subdirectory

Located in extensions/core/load3d/threejsOverride/:

FileDescription
OverrideMTLLoader.jsCustom MTL loader with enhanced functionality

Extension Development

When developing or modifying extensions, follow these best practices:

  1. Use provided hooks rather than directly modifying core application objects
  2. Maintain compatibility with other extensions
  3. Follow naming conventions for both extension names and settings
  4. Properly document extension hooks and functionality
  5. Test with other extensions to ensure no conflicts

Extension Registration

Extensions are registered using the app.registerExtension() method:

app.registerExtension({
  name: 'MyExtension',

  // Hook implementations
  async init() {
    // Implementation
  },

  async beforeRegisterNodeDef(nodeType, nodeData, app) {
    // Implementation
  }

  // Other hooks as needed
})

Extension Hooks

ComfyUI extensions can implement various hooks that are called at specific points in the application lifecycle:

Hook Execution Sequence

Web Page Load

init
addCustomNodeDefs
getCustomWidgets
beforeRegisterNodeDef    [repeated multiple times]
registerCustomNodes
beforeConfigureGraph
nodeCreated
loadedGraphNode
afterConfigureGraph
setup

Loading Workflow

beforeConfigureGraph
beforeRegisterNodeDef   [zero, one, or multiple times]
nodeCreated             [repeated multiple times]
loadedGraphNode         [repeated multiple times]
afterConfigureGraph

Adding New Node

nodeCreated

Key Hooks

HookDescription
initCalled after canvas creation but before nodes are added
setupCalled after the application is fully set up and running
addCustomNodeDefsCalled before nodes are registered with the graph
getCustomWidgetsAllows extensions to add custom widgets
beforeRegisterNodeDefAllows extensions to modify nodes before registration
registerCustomNodesAllows extensions to register additional nodes
loadedGraphNodeCalled when a node is reloaded onto the graph
nodeCreatedCalled after a node's constructor
beforeConfigureGraphCalled before a graph is configured
afterConfigureGraphCalled after a graph is configured
getSelectionToolboxCommandsAllows extensions to add commands to the selection toolbox

For the complete list of available hooks and detailed descriptions, see the ComfyExtension interface in comfy.ts.

Further Reading

For more detailed information about ComfyUI's extension system, refer to the official documentation:

Also, check the main README.md section on Developer APIs for the latest information on extension APIs and features.