mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Remove redundant IPAdapterXL class.
This commit is contained in:
parent
91596d9527
commit
3f7d5b4e0f
@ -41,6 +41,8 @@ class ImageProjModel(torch.nn.Module):
|
|||||||
|
|
||||||
|
|
||||||
class IPAdapter:
|
class IPAdapter:
|
||||||
|
"""IP-Adapter: https://arxiv.org/pdf/2308.06721.pdf"""
|
||||||
|
|
||||||
def __init__(self, unet: UNet2DConditionModel, image_encoder_path, ip_ckpt, device, num_tokens=4):
|
def __init__(self, unet: UNet2DConditionModel, image_encoder_path, ip_ckpt, device, num_tokens=4):
|
||||||
self._unet = unet
|
self._unet = unet
|
||||||
self.device = device
|
self.device = device
|
||||||
@ -129,12 +131,6 @@ class IPAdapter:
|
|||||||
attn_processor.scale = scale
|
attn_processor.scale = scale
|
||||||
|
|
||||||
|
|
||||||
class IPAdapterXL(IPAdapter):
|
|
||||||
"""SDXL"""
|
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class IPAdapterPlus(IPAdapter):
|
class IPAdapterPlus(IPAdapter):
|
||||||
"""IP-Adapter with fine-grained features"""
|
"""IP-Adapter with fine-grained features"""
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ from pydantic import Field
|
|||||||
from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
|
from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
|
||||||
|
|
||||||
from invokeai.app.services.config import InvokeAIAppConfig
|
from invokeai.app.services.config import InvokeAIAppConfig
|
||||||
from invokeai.backend.ip_adapter.ip_adapter import IPAdapter, IPAdapterPlus, IPAdapterXL
|
from invokeai.backend.ip_adapter.ip_adapter import IPAdapter, IPAdapterPlus
|
||||||
from invokeai.backend.stable_diffusion.diffusion.conditioning_data import (
|
from invokeai.backend.stable_diffusion.diffusion.conditioning_data import (
|
||||||
ConditioningData,
|
ConditioningData,
|
||||||
IPAdapterConditioningInfo,
|
IPAdapterConditioningInfo,
|
||||||
@ -421,11 +421,7 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline):
|
|||||||
if ip_adapter_data is not None:
|
if ip_adapter_data is not None:
|
||||||
# Initialize IPAdapter
|
# Initialize IPAdapter
|
||||||
# TODO(ryand): Refactor to use model management for the IP-Adapter.
|
# TODO(ryand): Refactor to use model management for the IP-Adapter.
|
||||||
if "sdxl" in ip_adapter_data.ip_adapter_model:
|
if "plus" in ip_adapter_data.ip_adapter_model:
|
||||||
ip_adapter = IPAdapterXL(
|
|
||||||
self.unet, ip_adapter_data.image_encoder_model, ip_adapter_data.ip_adapter_model, self.unet.device
|
|
||||||
)
|
|
||||||
elif "plus" in ip_adapter_data.ip_adapter_model:
|
|
||||||
ip_adapter = IPAdapterPlus(
|
ip_adapter = IPAdapterPlus(
|
||||||
self.unet,
|
self.unet,
|
||||||
ip_adapter_data.image_encoder_model,
|
ip_adapter_data.image_encoder_model,
|
||||||
|
Loading…
Reference in New Issue
Block a user