mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 06:40:48 +08:00
Fix import order
This commit is contained in:
parent
292f43c127
commit
421c9b88ae
@ -1,5 +1,5 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from typing import Protocol, List, Dict, Optional, NamedTuple, Callable, Literal, Any
|
from typing import Protocol, List, Dict, Optional, NamedTuple, Callable, Literal, Any, TypeAlias, Union
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
PatchOffset = tuple[int, int, int]
|
PatchOffset = tuple[int, int, int]
|
||||||
@ -28,7 +28,7 @@ class PatchTuple(NamedTuple):
|
|||||||
function: PatchFunction
|
function: PatchFunction
|
||||||
|
|
||||||
|
|
||||||
ModelPatchesDictValue = list[PatchTuple | PatchWeightTuple]
|
ModelPatchesDictValue: TypeAlias = list[Union[PatchTuple, PatchWeightTuple]]
|
||||||
|
|
||||||
|
|
||||||
class PatchSupport(Protocol):
|
class PatchSupport(Protocol):
|
||||||
|
|||||||
@ -50,7 +50,6 @@ from .component_model.deprecation import _deprecate_method
|
|||||||
from .component_model.executor_types import ExecutorToClientProgress, ProgressMessage
|
from .component_model.executor_types import ExecutorToClientProgress, ProgressMessage
|
||||||
from .component_model.tqdm_watcher import TqdmWatcher
|
from .component_model.tqdm_watcher import TqdmWatcher
|
||||||
from .execution_context import current_execution_context
|
from .execution_context import current_execution_context
|
||||||
from .gguf import gguf_sd_loader
|
|
||||||
|
|
||||||
MMAP_TORCH_FILES = args.mmap_torch_files
|
MMAP_TORCH_FILES = args.mmap_torch_files
|
||||||
DISABLE_MMAP = args.disable_mmap
|
DISABLE_MMAP = args.disable_mmap
|
||||||
@ -136,6 +135,8 @@ def load_torch_file(ckpt: str, safe_load=False, device=None, return_metadata=Fal
|
|||||||
sd.update(safetensors.torch.load_file(str(checkpoint_file), device=device.type))
|
sd.update(safetensors.torch.load_file(str(checkpoint_file), device=device.type))
|
||||||
elif ckpt.lower().endswith(".gguf"):
|
elif ckpt.lower().endswith(".gguf"):
|
||||||
# from gguf
|
# from gguf
|
||||||
|
# avoiding circular imports here by importing it lazily
|
||||||
|
from .gguf import gguf_sd_loader
|
||||||
sd = gguf_sd_loader(ckpt)
|
sd = gguf_sd_loader(ckpt)
|
||||||
metadata = {"format": "gguf"}
|
metadata = {"format": "gguf"}
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user