mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-09 23:12:02 +00:00
fix exclusions for Downsample and Upsample
(also simplify list comprehension for exclusion list)
This commit is contained in:
parent
83c95fcf44
commit
deb5e930ae
|
@ -67,11 +67,8 @@ class SDLoraManager:
|
||||||
|
|
||||||
def add_loras_to_unet(self, loras: dict[str, Lora], /) -> None:
|
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}
|
unet_loras = {key: loras[key] for key in loras.keys() if "unet" in key}
|
||||||
exclude: list[str] = []
|
|
||||||
exclude = [
|
exclude = [
|
||||||
self.unet_exclusions[exclusion]
|
block for s, block in self.unet_exclusions.items() if all([s not in key for key in unet_loras.keys()])
|
||||||
for exclusion in self.unet_exclusions
|
|
||||||
if all([exclusion not in key for key in unet_loras.keys()])
|
|
||||||
]
|
]
|
||||||
SDLoraManager.auto_attach(unet_loras, self.unet, exclude=exclude)
|
SDLoraManager.auto_attach(unet_loras, self.unet, exclude=exclude)
|
||||||
|
|
||||||
|
@ -121,8 +118,8 @@ class SDLoraManager:
|
||||||
return {
|
return {
|
||||||
"time": "TimestepEncoder",
|
"time": "TimestepEncoder",
|
||||||
"res": "ResidualBlock",
|
"res": "ResidualBlock",
|
||||||
"downsample": "DownsampleBlock",
|
"downsample": "Downsample",
|
||||||
"upsample": "UpsampleBlock",
|
"upsample": "Upsample",
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in a new issue