mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-09 13:50:49 +08:00
Fix import order
This commit is contained in:
parent
292f43c127
commit
421c9b88ae
@ -1,5 +1,5 @@
|
||||
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
|
||||
|
||||
PatchOffset = tuple[int, int, int]
|
||||
@ -28,7 +28,7 @@ class PatchTuple(NamedTuple):
|
||||
function: PatchFunction
|
||||
|
||||
|
||||
ModelPatchesDictValue = list[PatchTuple | PatchWeightTuple]
|
||||
ModelPatchesDictValue: TypeAlias = list[Union[PatchTuple, PatchWeightTuple]]
|
||||
|
||||
|
||||
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.tqdm_watcher import TqdmWatcher
|
||||
from .execution_context import current_execution_context
|
||||
from .gguf import gguf_sd_loader
|
||||
|
||||
MMAP_TORCH_FILES = args.mmap_torch_files
|
||||
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))
|
||||
elif ckpt.lower().endswith(".gguf"):
|
||||
# from gguf
|
||||
# avoiding circular imports here by importing it lazily
|
||||
from .gguf import gguf_sd_loader
|
||||
sd = gguf_sd_loader(ckpt)
|
||||
metadata = {"format": "gguf"}
|
||||
else:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user