ComfyUI/comfy/comfy_types
Christian Byrne 98ff01e148
Display progress and result URL directly on API nodes (#8102)
* [Luma] Print download URL of successful task result directly on nodes (#177)

[Veo] Print download URL of successful task result directly on nodes (#184)

[Recraft] Print download URL of successful task result directly on nodes (#183)

[Pixverse] Print download URL of successful task result directly on nodes (#182)

[Kling] Print download URL of successful task result directly on nodes (#181)

[MiniMax] Print progress text and download URL of successful task result directly on nodes (#179)

[Docs] Link to docs in `API_NODE` class property type annotation comment (#178)

[Ideogram] Print download URL of successful task result directly on nodes (#176)

[Kling] Print download URL of successful task result directly on nodes (#181)

[Veo] Print download URL of successful task result directly on nodes (#184)

[Recraft] Print download URL of successful task result directly on nodes (#183)

[Pixverse] Print download URL of successful task result directly on nodes (#182)

[MiniMax] Print progress text and download URL of successful task result directly on nodes (#179)

[Docs] Link to docs in `API_NODE` class property type annotation comment (#178)

[Luma] Print download URL of successful task result directly on nodes (#177)

[Ideogram] Print download URL of successful task result directly on nodes (#176)

Show output URL and progress text on Pika nodes (#168)

[BFL] Print download URL of successful task result directly on nodes (#175)

[OpenAI ] Print download URL of successful task result directly on nodes (#174)

* fix ruff errors

* fix 3.10 syntax error
2025-05-14 00:33:18 -04:00
..

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