Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Remove useless annotations imports. (#14105)

comfyanonymousda49b7d0b6a1
diff --git a/app/assets/services/metadata_extract.py b/app/assets/services/metadata_extract.py
index a004929bc..bdfe60218 100644
--- a/app/assets/services/metadata_extract.py
+++ b/app/assets/services/metadata_extract.py
@@ -4,7 +4,6 @@ Tier 1: Filesystem metadata (zero parsing)
Tier 2: Safetensors header metadata (fast JSON read only)
"""
-from __future__ import annotations
import json
import logging
diff --git a/app/custom_node_manager.py b/app/custom_node_manager.py
index 281febca9..738af2abd 100644
--- a/app/custom_node_manager.py
+++ b/app/custom_node_manager.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import os
import folder_paths
import glob
diff --git a/app/frontend_management.py b/app/frontend_management.py
index 483da2d29..8e84e8dd9 100644
--- a/app/frontend_management.py
+++ b/app/frontend_management.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
import argparse
import logging
import os
diff --git a/app/model_manager.py b/app/model_manager.py
index f124d1117..8f6e34b33 100644
--- a/app/model_manager.py
+++ b/app/model_manager.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import os
import base64
import json
diff --git a/app/user_manager.py b/app/user_manager.py
index 0517b3344..7b11e381c 100644
--- a/app/user_manager.py
+++ b/app/user_manager.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
import json
import os
import re
diff --git a/comfy/comfy_types/node_typing.py b/comfy/comfy_types/node_typing.py
index 57126fa4a..bb21eb1d1 100644
--- a/comfy/comfy_types/node_typing.py
+++ b/comfy/comfy_types/node_typing.py
@@ -1,6 +1,5 @@
"""Comfy-specific type hinting"""
-from __future__ import annotations
from typing import Literal, TypedDict, Optional
from typing_extensions import NotRequired
from abc import ABC, abstractmethod
diff --git a/comfy/ldm/lightricks/vae/causal_audio_autoencoder.py b/comfy/ldm/lightricks/vae/causal_audio_autoencoder.py
index b556b128f..58b67d45a 100644
--- a/comfy/ldm/lightricks/vae/causal_audio_autoencoder.py
+++ b/comfy/ldm/lightricks/vae/causal_audio_autoencoder.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
import torch
from torch import nn
from torch.nn import functional as F
diff --git a/comfy/ldm/lightricks/vae/causal_video_autoencoder.py b/comfy/ldm/lightricks/vae/causal_video_autoencoder.py
index 998122c85..5975015e2 100644
--- a/comfy/ldm/lightricks/vae/causal_video_autoencoder.py
+++ b/comfy/ldm/lightricks/vae/causal_video_autoencoder.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
import threading
import torch
from torch import nn
diff --git a/comfy/ldm/lumina/model.py b/comfy/ldm/lumina/model.py
index 9e432d5c0..d0ee97d33 100644
--- a/comfy/ldm/lumina/model.py
+++ b/comfy/ldm/lumina/model.py
@@ -1,5 +1,4 @@
# Code from: https://github.com/Alpha-VLLM/Lumina-Image-2.0/blob/main/models/model.py
-from __future__ import annotations
from typing import List, Optional, Tuple
diff --git a/comfy/ldm/moge/geometry.py b/comfy/ldm/moge/geometry.py
index 7fdc97871..d1a1e445f 100644
--- a/comfy/ldm/moge/geometry.py
+++ b/comfy/ldm/moge/geometry.py
@@ -1,6 +1,5 @@
"""Pure-torch + scipy geometry helpers for MoGe inference and mesh export."""
-from __future__ import annotations
from typing import Optional, Tuple
diff --git a/comfy/ldm/moge/model.py b/comfy/ldm/moge/model.py
index 6876c4af2..1695626bc 100644
--- a/comfy/ldm/moge/model.py
+++ b/comfy/ldm/moge/model.py
@@ -4,7 +4,6 @@ V1: DINOv2 backbone + multi-output head (points, mask).
V2: DINOv2 encoder + neck + per-output heads (points, mask, normal, optional metric-scale MLP).
"""
-from __future__ import annotations
from numbers import Number
from typing import Any, Dict, List, Optional, Tuple, Union
diff --git a/comfy/ldm/moge/modules.py b/comfy/ldm/moge/modules.py
index 235a59212..f6443d65a 100644
--- a/comfy/ldm/moge/modules.py
+++ b/comfy/ldm/moge/modules.py
@@ -1,6 +1,5 @@
"""Building blocks for MoGe: residual conv stack, resamplers, MLP, DINOv2 encoder, v1 head."""
-from __future__ import annotations
from typing import List, Optional, Sequence, Tuple, Union
diff --git a/comfy/ldm/moge/panorama.py b/comfy/ldm/moge/panorama.py
index de53ebe68..18d0cb665 100644
--- a/comfy/ldm/moge/panorama.py
+++ b/comfy/ldm/moge/panorama.py
@@ -6,7 +6,6 @@ equirect distance map via a multi-scale Poisson + gradient sparse solve.
Image sampling uses F.grid_sample (GPU); the sparse solve uses lsmr (CPU).
"""
-from __future__ import annotations
from typing import Callable, List, Optional, Tuple
diff --git a/comfy/lora.py b/comfy/lora.py
index c0e8b865c..4e0ea29e0 100644
--- a/comfy/lora.py
+++ b/comfy/lora.py
@@ -16,7 +16,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
-from __future__ import annotations
import comfy.memory_management
import comfy.utils
import comfy.model_management
diff --git a/comfy/patcher_extension.py b/comfy/patcher_extension.py
index 4b276b175..189ee84ca 100644
--- a/comfy/patcher_extension.py
+++ b/comfy/patcher_extension.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
from typing import Callable
class CallbacksMP:
diff --git a/comfy/sd.py b/comfy/sd.py
index 084170c62..a4e49763a 100644
--- a/comfy/sd.py
+++ b/comfy/sd.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
import json
import torch
from enum import Enum
diff --git a/comfy_api/latest/__init__.py b/comfy_api/latest/__init__.py
index 04973fea0..e0a585b10 100644
--- a/comfy_api/latest/__init__.py
+++ b/comfy_api/latest/__init__.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING
from comfy_api.internal import ComfyAPIBase
diff --git a/comfy_api/latest/_input_impl/video_types.py b/comfy_api/latest/_input_impl/video_types.py
index 942278d88..99e67d363 100644
--- a/comfy_api/latest/_input_impl/video_types.py
+++ b/comfy_api/latest/_input_impl/video_types.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
from av.container import InputContainer
from av.subtitles.stream import SubtitleStream
from fractions import Fraction
diff --git a/comfy_api/latest/_util/video_types.py b/comfy_api/latest/_util/video_types.py
index c92477f08..6c9d6a526 100644
--- a/comfy_api/latest/_util/video_types.py
+++ b/comfy_api/latest/_util/video_types.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from fractions import Fraction
diff --git a/comfy_api_nodes/apis/__init__.py b/comfy_api_nodes/apis/__init__.py
index 46a583b5e..9c4cfb9b6 100644
--- a/comfy_api_nodes/apis/__init__.py
+++ b/comfy_api_nodes/apis/__init__.py
@@ -3,7 +3,6 @@
# timestamp: 2025-07-30T08:54:00+00:00
# pylint: disable
-from __future__ import annotations
from datetime import date, datetime
from enum import Enum
diff --git a/comfy_api_nodes/apis/bfl.py b/comfy_api_nodes/apis/bfl.py
index d8d3557b3..f0665fa09 100644
--- a/comfy_api_nodes/apis/bfl.py
+++ b/comfy_api_nodes/apis/bfl.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
from enum import Enum
from typing import Any, Dict, Optional
diff --git a/comfy_api_nodes/apis/stability.py b/comfy_api_nodes/apis/stability.py
index 718360187..5b9b5ac7d 100644
--- a/comfy_api_nodes/apis/stability.py
+++ b/comfy_api_nodes/apis/stability.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
from enum import Enum
from typing import Optional
diff --git a/comfy_execution/graph.py b/comfy_execution/graph.py
index c47f3c79b..479ee8a53 100644
--- a/comfy_execution/graph.py
+++ b/comfy_execution/graph.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
from typing import Type, Literal
import nodes
diff --git a/comfy_execution/progress.py b/comfy_execution/progress.py
index f951a3350..731b8dc66 100644
--- a/comfy_execution/progress.py
+++ b/comfy_execution/progress.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
from typing import TypedDict, Dict, Optional, Tuple
from typing_extensions import override
from PIL import Image
diff --git a/comfy_execution/validation.py b/comfy_execution/validation.py
index e73624bd1..ae9a2376c 100644
--- a/comfy_execution/validation.py
+++ b/comfy_execution/validation.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
from comfy_api.latest import IO
diff --git a/comfy_extras/mediapipe/face_geometry.py b/comfy_extras/mediapipe/face_geometry.py
index 04b2b0557..4f3813430 100644
--- a/comfy_extras/mediapipe/face_geometry.py
+++ b/comfy_extras/mediapipe/face_geometry.py
@@ -2,7 +2,6 @@
+ weighted Procrustes solver. Computes the 4x4 facial transformation matrix.
"""
-from __future__ import annotations
import math
import numpy as np
diff --git a/comfy_extras/mediapipe/face_landmarker.py b/comfy_extras/mediapipe/face_landmarker.py
index a792b6046..e6b463c4c 100644
--- a/comfy_extras/mediapipe/face_landmarker.py
+++ b/comfy_extras/mediapipe/face_landmarker.py
@@ -1,7 +1,6 @@
"""Pure-PyTorch port of MediaPipe's face_landmarker_v2_with_blendshapes.task:
BlazeFace detector → FaceMesh v2 → ARKit-52 blendshapes."""
-from __future__ import annotations
import math
from functools import lru_cache
diff --git a/comfy_extras/nodes_audio.py b/comfy_extras/nodes_audio.py
index d5084497e..f09a8a874 100644
--- a/comfy_extras/nodes_audio.py
+++ b/comfy_extras/nodes_audio.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import av
import torchaudio
import torch
diff --git a/comfy_extras/nodes_context_windows.py b/comfy_extras/nodes_context_windows.py
index f7ca833dc..24729c3a7 100644
--- a/comfy_extras/nodes_context_windows.py
+++ b/comfy_extras/nodes_context_windows.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
from comfy_api.latest import ComfyExtension, io
import comfy.context_windows
import nodes
diff --git a/comfy_extras/nodes_curve.py b/comfy_extras/nodes_curve.py
index 9803e8034..099453131 100644
--- a/comfy_extras/nodes_curve.py
+++ b/comfy_extras/nodes_curve.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import numpy as np
from comfy_api.latest import ComfyExtension, io
diff --git a/comfy_extras/nodes_images.py b/comfy_extras/nodes_images.py
index 33933229d..fe6008aa3 100644
--- a/comfy_extras/nodes_images.py
+++ b/comfy_extras/nodes_images.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import nodes
import folder_paths
diff --git a/comfy_extras/nodes_logic.py b/comfy_extras/nodes_logic.py
index 342cadb69..92507f1fc 100644
--- a/comfy_extras/nodes_logic.py
+++ b/comfy_extras/nodes_logic.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
from typing import TypedDict
from typing_extensions import override
from comfy_api.latest import ComfyExtension, io
diff --git a/comfy_extras/nodes_math.py b/comfy_extras/nodes_math.py
index 06aefa475..0040d1a92 100644
--- a/comfy_extras/nodes_math.py
+++ b/comfy_extras/nodes_math.py
@@ -4,7 +4,6 @@ Provides a ComfyMathExpression node that evaluates math expressions
against dynamically-grown numeric inputs.
"""
-from __future__ import annotations
import math
import string
diff --git a/comfy_extras/nodes_mediapipe.py b/comfy_extras/nodes_mediapipe.py
index 6b7916aee..32dc22de3 100644
--- a/comfy_extras/nodes_mediapipe.py
+++ b/comfy_extras/nodes_mediapipe.py
@@ -10,7 +10,6 @@ Custom IO types:
MediaPipeFaceLandmarker also emits the core BOUNDING_BOX type — pair with DrawBBoxes.
"""
-from __future__ import annotations
import numpy as np
import torch
diff --git a/comfy_extras/nodes_moge.py b/comfy_extras/nodes_moge.py
index 3508781a0..79aec5d7f 100644
--- a/comfy_extras/nodes_moge.py
+++ b/comfy_extras/nodes_moge.py
@@ -1,6 +1,5 @@
"""ComfyUI nodes for the native MoGe (Monocular Geometry Estimation) integration."""
-from __future__ import annotations
import torch
diff --git a/comfy_extras/nodes_number_convert.py b/comfy_extras/nodes_number_convert.py
index e38a33c15..01593b6e6 100644
--- a/comfy_extras/nodes_number_convert.py
+++ b/comfy_extras/nodes_number_convert.py
@@ -4,7 +4,6 @@ Provides a single node that converts INT, FLOAT, STRING, and BOOL
inputs into FLOAT and INT outputs.
"""
-from __future__ import annotations
import math
diff --git a/comfy_extras/nodes_painter.py b/comfy_extras/nodes_painter.py
index e104c8480..df7a0b76a 100644
--- a/comfy_extras/nodes_painter.py
+++ b/comfy_extras/nodes_painter.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import hashlib
import os
diff --git a/comfy_extras/nodes_resolution.py b/comfy_extras/nodes_resolution.py
index 520b4067e..1628038cc 100644
--- a/comfy_extras/nodes_resolution.py
+++ b/comfy_extras/nodes_resolution.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
import math
from enum import Enum
from typing_extensions import override
diff --git a/comfy_extras/nodes_toolkit.py b/comfy_extras/nodes_toolkit.py
index ae802896b..0548a0cf8 100644
--- a/comfy_extras/nodes_toolkit.py
+++ b/comfy_extras/nodes_toolkit.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
from typing_extensions import override
from comfy_api.latest import ComfyExtension, io
diff --git a/comfy_extras/nodes_video.py b/comfy_extras/nodes_video.py
index 78a2a28f8..ae1d826d5 100644
--- a/comfy_extras/nodes_video.py
+++ b/comfy_extras/nodes_video.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import os
import av
import torch
diff --git a/folder_paths.py b/folder_paths.py
index 36d61fcd0..7304e1b73 100644
--- a/folder_paths.py
+++ b/folder_paths.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import os
import time
import mimetypes
diff --git a/nodes.py b/nodes.py
index fd4365c90..669a7057b 100644
--- a/nodes.py
+++ b/nodes.py
@@ -1,4 +1,3 @@
-from __future__ import annotations
import torch