mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-08-02 23:14:49 +08:00
Adding TYPE_CHECKING ifs into _io.py to try to clean up failing CI
This commit is contained in:
@@ -6,22 +6,23 @@ from abc import ABC, abstractmethod
|
|||||||
from collections import Counter
|
from collections import Counter
|
||||||
from dataclasses import asdict, dataclass
|
from dataclasses import asdict, dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Callable, Literal, TypedDict, TypeVar
|
from typing import Any, Callable, Literal, TypedDict, TypeVar, TYPE_CHECKING
|
||||||
|
from typing_extensions import NotRequired, final
|
||||||
|
|
||||||
# used for type hinting
|
# used for type hinting
|
||||||
import torch
|
import torch
|
||||||
from spandrel import ImageModelDescriptor
|
|
||||||
from typing_extensions import NotRequired, final
|
|
||||||
|
|
||||||
from comfy.clip_vision import ClipVisionModel
|
if TYPE_CHECKING:
|
||||||
from comfy.clip_vision import Output as ClipVisionOutput_
|
from spandrel import ImageModelDescriptor
|
||||||
from comfy.controlnet import ControlNet
|
from comfy.clip_vision import ClipVisionModel
|
||||||
from comfy.hooks import HookGroup, HookKeyframeGroup
|
from comfy.clip_vision import Output as ClipVisionOutput_
|
||||||
from comfy.model_patcher import ModelPatcher
|
from comfy.controlnet import ControlNet
|
||||||
from comfy.samplers import CFGGuider, Sampler
|
from comfy.hooks import HookGroup, HookKeyframeGroup
|
||||||
from comfy.sd import CLIP, VAE
|
from comfy.model_patcher import ModelPatcher
|
||||||
from comfy.sd import StyleModel as StyleModel_
|
from comfy.samplers import CFGGuider, Sampler
|
||||||
from comfy_api.input import VideoInput
|
from comfy.sd import CLIP, VAE
|
||||||
|
from comfy.sd import StyleModel as StyleModel_
|
||||||
|
from comfy_api.input import VideoInput
|
||||||
from comfy_api.internal import (_ComfyNodeInternal, _NodeOutputInternal, classproperty, copy_class, first_real_override, is_class,
|
from comfy_api.internal import (_ComfyNodeInternal, _NodeOutputInternal, classproperty, copy_class, first_real_override, is_class,
|
||||||
prune_dict, shallow_clone_class)
|
prune_dict, shallow_clone_class)
|
||||||
from comfy_api.latest._resources import Resources, ResourcesLocal
|
from comfy_api.latest._resources import Resources, ResourcesLocal
|
||||||
@@ -543,7 +544,8 @@ class Conditioning(ComfyTypeIO):
|
|||||||
|
|
||||||
@comfytype(io_type="SAMPLER")
|
@comfytype(io_type="SAMPLER")
|
||||||
class Sampler(ComfyTypeIO):
|
class Sampler(ComfyTypeIO):
|
||||||
Type = Sampler
|
if TYPE_CHECKING:
|
||||||
|
Type = Sampler
|
||||||
|
|
||||||
@comfytype(io_type="SIGMAS")
|
@comfytype(io_type="SIGMAS")
|
||||||
class Sigmas(ComfyTypeIO):
|
class Sigmas(ComfyTypeIO):
|
||||||
@@ -555,44 +557,54 @@ class Noise(ComfyTypeIO):
|
|||||||
|
|
||||||
@comfytype(io_type="GUIDER")
|
@comfytype(io_type="GUIDER")
|
||||||
class Guider(ComfyTypeIO):
|
class Guider(ComfyTypeIO):
|
||||||
Type = CFGGuider
|
if TYPE_CHECKING:
|
||||||
|
Type = CFGGuider
|
||||||
|
|
||||||
@comfytype(io_type="CLIP")
|
@comfytype(io_type="CLIP")
|
||||||
class Clip(ComfyTypeIO):
|
class Clip(ComfyTypeIO):
|
||||||
Type = CLIP
|
if TYPE_CHECKING:
|
||||||
|
Type = CLIP
|
||||||
|
|
||||||
@comfytype(io_type="CONTROL_NET")
|
@comfytype(io_type="CONTROL_NET")
|
||||||
class ControlNet(ComfyTypeIO):
|
class ControlNet(ComfyTypeIO):
|
||||||
Type = ControlNet
|
if TYPE_CHECKING:
|
||||||
|
Type = ControlNet
|
||||||
|
|
||||||
@comfytype(io_type="VAE")
|
@comfytype(io_type="VAE")
|
||||||
class Vae(ComfyTypeIO):
|
class Vae(ComfyTypeIO):
|
||||||
Type = VAE
|
if TYPE_CHECKING:
|
||||||
|
Type = VAE
|
||||||
|
|
||||||
@comfytype(io_type="MODEL")
|
@comfytype(io_type="MODEL")
|
||||||
class Model(ComfyTypeIO):
|
class Model(ComfyTypeIO):
|
||||||
Type = ModelPatcher
|
if TYPE_CHECKING:
|
||||||
|
Type = ModelPatcher
|
||||||
|
|
||||||
@comfytype(io_type="CLIP_VISION")
|
@comfytype(io_type="CLIP_VISION")
|
||||||
class ClipVision(ComfyTypeIO):
|
class ClipVision(ComfyTypeIO):
|
||||||
Type = ClipVisionModel
|
if TYPE_CHECKING:
|
||||||
|
Type = ClipVisionModel
|
||||||
|
|
||||||
@comfytype(io_type="CLIP_VISION_OUTPUT")
|
@comfytype(io_type="CLIP_VISION_OUTPUT")
|
||||||
class ClipVisionOutput(ComfyTypeIO):
|
class ClipVisionOutput(ComfyTypeIO):
|
||||||
Type = ClipVisionOutput_
|
if TYPE_CHECKING:
|
||||||
|
Type = ClipVisionOutput_
|
||||||
|
|
||||||
@comfytype(io_type="STYLE_MODEL")
|
@comfytype(io_type="STYLE_MODEL")
|
||||||
class StyleModel(ComfyTypeIO):
|
class StyleModel(ComfyTypeIO):
|
||||||
Type = StyleModel_
|
if TYPE_CHECKING:
|
||||||
|
Type = StyleModel_
|
||||||
|
|
||||||
@comfytype(io_type="GLIGEN")
|
@comfytype(io_type="GLIGEN")
|
||||||
class Gligen(ComfyTypeIO):
|
class Gligen(ComfyTypeIO):
|
||||||
'''ModelPatcher that wraps around a 'Gligen' model.'''
|
'''ModelPatcher that wraps around a 'Gligen' model.'''
|
||||||
Type = ModelPatcher
|
if TYPE_CHECKING:
|
||||||
|
Type = ModelPatcher
|
||||||
|
|
||||||
@comfytype(io_type="UPSCALE_MODEL")
|
@comfytype(io_type="UPSCALE_MODEL")
|
||||||
class UpscaleModel(ComfyTypeIO):
|
class UpscaleModel(ComfyTypeIO):
|
||||||
Type = ImageModelDescriptor
|
if TYPE_CHECKING:
|
||||||
|
Type = ImageModelDescriptor
|
||||||
|
|
||||||
@comfytype(io_type="AUDIO")
|
@comfytype(io_type="AUDIO")
|
||||||
class Audio(ComfyTypeIO):
|
class Audio(ComfyTypeIO):
|
||||||
@@ -603,7 +615,8 @@ class Audio(ComfyTypeIO):
|
|||||||
|
|
||||||
@comfytype(io_type="VIDEO")
|
@comfytype(io_type="VIDEO")
|
||||||
class Video(ComfyTypeIO):
|
class Video(ComfyTypeIO):
|
||||||
Type = VideoInput
|
if TYPE_CHECKING:
|
||||||
|
Type = VideoInput
|
||||||
|
|
||||||
@comfytype(io_type="SVG")
|
@comfytype(io_type="SVG")
|
||||||
class SVG(ComfyTypeIO):
|
class SVG(ComfyTypeIO):
|
||||||
@@ -629,11 +642,13 @@ class Mesh(ComfyTypeIO):
|
|||||||
|
|
||||||
@comfytype(io_type="HOOKS")
|
@comfytype(io_type="HOOKS")
|
||||||
class Hooks(ComfyTypeIO):
|
class Hooks(ComfyTypeIO):
|
||||||
Type = HookGroup
|
if TYPE_CHECKING:
|
||||||
|
Type = HookGroup
|
||||||
|
|
||||||
@comfytype(io_type="HOOK_KEYFRAMES")
|
@comfytype(io_type="HOOK_KEYFRAMES")
|
||||||
class HookKeyframes(ComfyTypeIO):
|
class HookKeyframes(ComfyTypeIO):
|
||||||
Type = HookKeyframeGroup
|
if TYPE_CHECKING:
|
||||||
|
Type = HookKeyframeGroup
|
||||||
|
|
||||||
@comfytype(io_type="TIMESTEPS_RANGE")
|
@comfytype(io_type="TIMESTEPS_RANGE")
|
||||||
class TimestepsRange(ComfyTypeIO):
|
class TimestepsRange(ComfyTypeIO):
|
||||||
|
Reference in New Issue
Block a user