diff --git a/invokeai/backend/model_manager/load/model_loaders/stable_diffusion.py b/invokeai/backend/model_manager/load/model_loaders/stable_diffusion.py index 572859dbaee..4113588b36f 100644 --- a/invokeai/backend/model_manager/load/model_loaders/stable_diffusion.py +++ b/invokeai/backend/model_manager/load/model_loaders/stable_diffusion.py @@ -117,8 +117,6 @@ def _load_from_singlefile( load_class = load_classes[config.base][config.variant] except KeyError as e: raise Exception(f"No diffusers pipeline known for base={config.base}, variant={config.variant}") from e - prediction_type = config.prediction_type.value - upcast_attention = config.upcast_attention # Without SilenceWarnings we get log messages like this: # site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`. @@ -129,13 +127,7 @@ def _load_from_singlefile( # ['text_model.embeddings.position_ids'] with SilenceWarnings(): - pipeline = load_class.from_single_file( - config.path, - torch_dtype=self._torch_dtype, - prediction_type=prediction_type, - upcast_attention=upcast_attention, - load_safety_checker=False, - ) + pipeline = load_class.from_single_file(config.path, torch_dtype=self._torch_dtype) if not submodel_type: return pipeline diff --git a/invokeai/backend/model_manager/metadata/fetch/huggingface.py b/invokeai/backend/model_manager/metadata/fetch/huggingface.py index 8787ceeb36a..8c1d6e74aea 100644 --- a/invokeai/backend/model_manager/metadata/fetch/huggingface.py +++ b/invokeai/backend/model_manager/metadata/fetch/huggingface.py @@ -20,7 +20,7 @@ import requests from huggingface_hub import HfApi, configure_http_backend, hf_hub_url -from huggingface_hub.utils._errors import RepositoryNotFoundError, RevisionNotFoundError +from huggingface_hub.errors import RepositoryNotFoundError, RevisionNotFoundError from pydantic.networks import AnyHttpUrl from requests.sessions import Session diff --git a/invokeai/backend/util/hotfixes.py b/invokeai/backend/util/hotfixes.py index 7e362fe9589..95f2c904ad8 100644 --- a/invokeai/backend/util/hotfixes.py +++ b/invokeai/backend/util/hotfixes.py @@ -3,7 +3,7 @@ import diffusers import torch from diffusers.configuration_utils import ConfigMixin, register_to_config -from diffusers.loaders import FromOriginalControlNetMixin +from diffusers.loaders.single_file_model import FromOriginalModelMixin from diffusers.models.attention_processor import AttentionProcessor, AttnProcessor from diffusers.models.controlnet import ControlNetConditioningEmbedding, ControlNetOutput, zero_module from diffusers.models.embeddings import ( @@ -32,7 +32,9 @@ logger = InvokeAILogger.get_logger(__name__) -class ControlNetModel(ModelMixin, ConfigMixin, FromOriginalControlNetMixin): +# NOTE(ryand): I'm not the origina author of this code, but for future reference, it appears that this class was copied +# from diffusers in order to add support for the encoder_attention_mask argument. +class ControlNetModel(ModelMixin, ConfigMixin, FromOriginalModelMixin): """ A ControlNet model. diff --git a/pyproject.toml b/pyproject.toml index 3065ad4c587..493c68ad7d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,12 +33,12 @@ classifiers = [ ] dependencies = [ # Core generation dependencies, pinned for reproducible builds. - "accelerate==0.30.1", + "accelerate==1.0.1", "bitsandbytes==0.43.3; sys_platform!='darwin'", "clip_anytorch==2.6.0", # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip", "compel==2.0.2", "controlnet-aux==0.0.7", - "diffusers[torch]==0.27.2", + "diffusers[torch]==0.31.0", "gguf==0.10.0", "invisible-watermark==0.2.0", # needed to install SDXL base and refiner using their repo_ids "mediapipe>=0.10.7", # needed for "mediapipeface" controlnet model @@ -61,7 +61,7 @@ dependencies = [ # Core application dependencies, pinned for reproducible builds. "fastapi-events==0.11.1", "fastapi==0.111.0", - "huggingface-hub==0.23.1", + "huggingface-hub==0.26.1", "pydantic-settings==2.2.1", "pydantic==2.7.2", "python-socketio==5.11.1",