fix diffusers

This commit is contained in:
whitepapercg
2024-05-09 14:20:25 +07:00
parent c0178303d8
commit 05dfdf05a9
3 changed files with 14 additions and 14 deletions
+8 -8
View File
@@ -2,12 +2,12 @@
torch
torchvision
torchaudio
accelerate==0.25.0
torchmetrics==1.2.1
tqdm==4.66.1
transformers==4.36.2
diffusers==0.25.0
einops==0.7.0
bitsandbytes==0.39.0
scipy==1.11.1
accelerate==0.30.0
torchmetrics==1.4.0
tqdm==4.66.4
transformers==4.40.2
diffusers==0.27.2
einops==0.8.0
bitsandbytes==0.43.1
scipy==1.13.0
opencv-python
+2 -2
View File
@@ -37,7 +37,7 @@ from diffusers.models.embeddings import (
ImageHintTimeEmbedding,
ImageProjection,
ImageTimeEmbedding,
PositionNet,
GLIGENTextBoundingboxProjection,
TextImageProjection,
TextImageTimeEmbedding,
TextTimeEmbedding,
@@ -695,7 +695,7 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin)
positive_len = cross_attention_dim[0]
feature_type = "text-only" if attention_type == "gated" else "text-image"
self.position_net = PositionNet(
self.position_net = GLIGENTextBoundingboxProjection(
positive_len=positive_len, out_dim=cross_attention_dim, feature_type=feature_type
)
+4 -4
View File
@@ -37,7 +37,7 @@ from diffusers.models.embeddings import (
ImageHintTimeEmbedding,
ImageProjection,
ImageTimeEmbedding,
PositionNet,
GLIGENTextBoundingboxProjection,
TextImageProjection,
TextImageTimeEmbedding,
TextTimeEmbedding,
@@ -764,7 +764,7 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin)
positive_len = cross_attention_dim[0]
feature_type = "text-only" if attention_type == "gated" else "text-image"
self.position_net = PositionNet(
self.position_net = GLIGENTextBoundingboxProjection(
positive_len=positive_len, out_dim=cross_attention_dim, feature_type=feature_type
)
@@ -841,9 +841,9 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin)
def fn_recursive_attn_processor(name: str, module: torch.nn.Module, processor):
if hasattr(module, "set_processor"):
if not isinstance(processor, dict):
module.set_processor(processor, _remove_lora=_remove_lora)
module.set_processor(processor)
else:
module.set_processor(processor.pop(f"{name}.processor"), _remove_lora=_remove_lora)
module.set_processor(processor.pop(f"{name}.processor"))
for sub_name, child in module.named_children():
fn_recursive_attn_processor(f"{name}.{sub_name}", child, processor)