ComfyUI/comfy/comfy_types
guill dcff27fe3f
Some checks are pending
Python Linting / Run Ruff (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
Add support for dev-only nodes. (#12106)
When a node is declared as dev-only, it doesn't show in the default UI
unless the dev mode is enabled in the settings. The intention is to
allow nodes related to unit testing to be included in ComfyUI
distributions without confusing the average user.
2026-01-27 13:03:29 -08:00
..
examples
__init__.py
node_typing.py
README.md

Comfy Typing

Type hinting for ComfyUI Node development

This module provides type hinting and concrete convenience types for node developers. If cloned to the custom_nodes directory of ComfyUI, types can be imported using:

from comfy.comfy_types import IO, ComfyNodeABC, CheckLazyMixin

class ExampleNode(ComfyNodeABC):
    @classmethod
    def INPUT_TYPES(s) -> InputTypeDict:
        return {"required": {}}

Full example is in examples/example_nodes.py.

Types

A few primary types are documented below. More complete information is available via the docstrings on each type.

IO

A string enum of built-in and a few custom data types. Includes the following special types and their requisite plumbing:

  • ANY: "*"
  • NUMBER: "FLOAT,INT"
  • PRIMITIVE: "STRING,FLOAT,INT,BOOLEAN"

ComfyNodeABC

An abstract base class for nodes, offering type-hinting / autocomplete, and somewhat-alright docstrings.

Type hinting for INPUT_TYPES

INPUT_TYPES auto-completion in Visual Studio Code

INPUT_TYPES return dict

INPUT_TYPES return value type hinting in Visual Studio Code

Options for individual inputs

INPUT_TYPES return value option auto-completion in Visual Studio Code