fix exclusions for Downsample and Upsample

(also simplify list comprehension for exclusion list)
This commit is contained in:
Pierre Chapuis 2024-01-29 10:49:39 +01:00
parent 83c95fcf44
commit deb5e930ae

View file

@ -67,11 +67,8 @@ class SDLoraManager:
def add_loras_to_unet(self, loras: dict[str, Lora], /) -> None:
unet_loras = {key: loras[key] for key in loras.keys() if "unet" in key}
exclude: list[str] = []
exclude = [
self.unet_exclusions[exclusion]
for exclusion in self.unet_exclusions
if all([exclusion not in key for key in unet_loras.keys()])
block for s, block in self.unet_exclusions.items() if all([s not in key for key in unet_loras.keys()])
]
SDLoraManager.auto_attach(unet_loras, self.unet, exclude=exclude)
@ -121,8 +118,8 @@ class SDLoraManager:
return {
"time": "TimestepEncoder",
"res": "ResidualBlock",
"downsample": "DownsampleBlock",
"upsample": "UpsampleBlock",
"downsample": "Downsample",
"upsample": "Upsample",
}
@property