diff --git a/invokeai/app/invocations/ip_adapter.py b/invokeai/app/invocations/ip_adapter.py index 165a6bee24..94bb909433 100644 --- a/invokeai/app/invocations/ip_adapter.py +++ b/invokeai/app/invocations/ip_adapter.py @@ -91,7 +91,7 @@ class IPAdapterInvocation(BaseInvocation): image_encoder_model_id = ( ip_adapter_info.image_encoder_model_id if isinstance(ip_adapter_info, IPAdapterDiffusersConfig) - else "InvokeAI/ip_adapter_sd_image_encoder" + else "ip_adapter_sd_image_encoder" ) image_encoder_model_name = image_encoder_model_id.split("/")[-1].strip() image_encoder_model = self._get_image_encoder(context, image_encoder_model_name) diff --git a/invokeai/app/invocations/latent.py b/invokeai/app/invocations/latent.py index 8ad1684bcb..3c66b7014f 100644 --- a/invokeai/app/invocations/latent.py +++ b/invokeai/app/invocations/latent.py @@ -14,10 +14,12 @@ from diffusers import AutoencoderKL, AutoencoderTiny from diffusers.configuration_utils import ConfigMixin from diffusers.image_processor import VaeImageProcessor from diffusers.models.adapter import T2IAdapter -from diffusers.models.attention_processor import (AttnProcessor2_0, - LoRAAttnProcessor2_0, - LoRAXFormersAttnProcessor, - XFormersAttnProcessor) +from diffusers.models.attention_processor import ( + AttnProcessor2_0, + LoRAAttnProcessor2_0, + LoRAXFormersAttnProcessor, + XFormersAttnProcessor, +) from diffusers.models.unets.unet_2d_condition import UNet2DConditionModel from diffusers.schedulers import DPMSolverSDEScheduler from diffusers.schedulers import SchedulerMixin as Scheduler @@ -26,17 +28,22 @@ from pydantic import field_validator from torchvision.transforms.functional import resize as tv_resize from transformers import CLIPVisionModelWithProjection -from invokeai.app.invocations.constants import (LATENT_SCALE_FACTOR, - SCHEDULER_NAME_VALUES) -from invokeai.app.invocations.fields import (ConditioningField, - DenoiseMaskField, - FieldDescriptions, ImageField, - Input, InputField, LatentsField, - OutputField, UIType, WithBoard, - WithMetadata) +from invokeai.app.invocations.constants import LATENT_SCALE_FACTOR, SCHEDULER_NAME_VALUES +from invokeai.app.invocations.fields import ( + ConditioningField, + DenoiseMaskField, + FieldDescriptions, + ImageField, + Input, + InputField, + LatentsField, + OutputField, + UIType, + WithBoard, + WithMetadata, +) from invokeai.app.invocations.ip_adapter import IPAdapterField -from invokeai.app.invocations.primitives import (DenoiseMaskOutput, - ImageOutput, LatentsOutput) +from invokeai.app.invocations.primitives import DenoiseMaskOutput, ImageOutput, LatentsOutput from invokeai.app.invocations.t2i_adapter import T2IAdapterField from invokeai.app.services.shared.invocation_context import InvocationContext from invokeai.app.util.controlnet_utils import prepare_control_image @@ -44,19 +51,20 @@ from invokeai.backend.ip_adapter.ip_adapter import IPAdapter, IPAdapterPlus from invokeai.backend.lora import LoRAModelRaw from invokeai.backend.model_manager import BaseModelType, LoadedModel from invokeai.backend.model_patcher import ModelPatcher -from invokeai.backend.stable_diffusion import (PipelineIntermediateState, - set_seamless) -from invokeai.backend.stable_diffusion.diffusion.conditioning_data import ( - ConditioningData, IPAdapterConditioningInfo) +from invokeai.backend.stable_diffusion import PipelineIntermediateState, set_seamless +from invokeai.backend.stable_diffusion.diffusion.conditioning_data import ConditioningData, IPAdapterConditioningInfo from invokeai.backend.util.silence_warnings import SilenceWarnings from ...backend.stable_diffusion.diffusers_pipeline import ( - ControlNetData, IPAdapterData, StableDiffusionGeneratorPipeline, - T2IAdapterData, image_resized_to_grid_as_tensor) + ControlNetData, + IPAdapterData, + StableDiffusionGeneratorPipeline, + T2IAdapterData, + image_resized_to_grid_as_tensor, +) from ...backend.stable_diffusion.schedulers import SCHEDULER_MAP from ...backend.util.devices import choose_precision, choose_torch_device -from .baseinvocation import (BaseInvocation, BaseInvocationOutput, invocation, - invocation_output) +from .baseinvocation import BaseInvocation, BaseInvocationOutput, invocation, invocation_output from .controlnet_image_processors import ControlField from .model import ModelIdentifierField, UNetField, VAEField diff --git a/invokeai/backend/model_manager/probe.py b/invokeai/backend/model_manager/probe.py index bd47cc1a48..75f156ce21 100644 --- a/invokeai/backend/model_manager/probe.py +++ b/invokeai/backend/model_manager/probe.py @@ -9,23 +9,16 @@ from picklescan.scanner import scan_file_path import invokeai.backend.util.logging as logger from invokeai.app.util.misc import uuid_string -from invokeai.backend.model_hash.model_hash import HASHING_ALGORITHMS, ModelHash +from invokeai.backend.model_hash.model_hash import (HASHING_ALGORITHMS, + ModelHash) from invokeai.backend.util.util import SilenceWarnings -from .config import ( - AnyModelConfig, - BaseModelType, - ControlAdapterDefaultSettings, - InvalidModelConfigException, - MainModelDefaultSettings, - ModelConfigFactory, - ModelFormat, - ModelRepoVariant, - ModelSourceType, - ModelType, - ModelVariantType, - SchedulerPredictionType, -) +from .config import (AnyModelConfig, BaseModelType, + ControlAdapterDefaultSettings, + InvalidModelConfigException, MainModelDefaultSettings, + ModelConfigFactory, ModelFormat, ModelRepoVariant, + ModelSourceType, ModelType, ModelVariantType, + SchedulerPredictionType) from .util.model_util import lora_token_vector_length, read_checkpoint_meta CkptType = Dict[str | int, Any] @@ -536,7 +529,6 @@ class IPAdapterCheckpointProbe(CheckpointProbeBase): if not key.startswith(("image_proj.", "ip_adapter.")): continue cross_attention_dim = checkpoint["ip_adapter.1.to_k_ip.weight"].shape[-1] - print(cross_attention_dim) if cross_attention_dim == 768: return BaseModelType.StableDiffusion1 elif cross_attention_dim == 1024: diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index 1601169e03..d2402c61be 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -655,6 +655,7 @@ "install": "Install", "installAll": "Install All", "installRepo": "Install Repo", + "ipAdapters": "IP Adapters", "load": "Load", "localOnly": "local only", "manual": "Manual",