Skip to content

Commit 056fb8a

Browse files
committed
unfuse_lora
1 parent ca913f0 commit 056fb8a

File tree

1 file changed

+14
-171
lines changed

1 file changed

+14
-171
lines changed

src/diffusers/loaders/lora_pipeline.py

Lines changed: 14 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -994,21 +994,7 @@ def fuse_lora(
994994

995995
def unfuse_lora(self, components: List[str] = ["unet", "text_encoder", "text_encoder_2"], **kwargs):
996996
r"""
997-
Reverses the effect of
998-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
999-
1000-
<Tip warning={true}>
1001-
1002-
This is an experimental API.
1003-
1004-
</Tip>
1005-
1006-
Args:
1007-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
1008-
unfuse_unet (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
1009-
unfuse_text_encoder (`bool`, defaults to `True`):
1010-
Whether to unfuse the text encoder LoRA parameters. If the text encoder wasn't monkey-patched with the
1011-
LoRA parameters then it won't have any effect.
997+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
1012998
"""
1013999
super().unfuse_lora(components=components, **kwargs)
10141000

@@ -1326,18 +1312,7 @@ def fuse_lora(
13261312
# Copied from diffusers.loaders.lora_pipeline.StableDiffusionXLLoraLoaderMixin.unfuse_lora with unet->transformer
13271313
def unfuse_lora(self, components: List[str] = ["transformer", "text_encoder", "text_encoder_2"], **kwargs):
13281314
r"""
1329-
Reverses the effect of
1330-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
1331-
1332-
<Tip warning={true}>
1333-
1334-
This is an experimental API.
1335-
1336-
</Tip>
1337-
1338-
Args:
1339-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
1340-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
1315+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
13411316
unfuse_text_encoder (`bool`, defaults to `True`):
13421317
Whether to unfuse the text encoder LoRA parameters. If the text encoder wasn't monkey-patched with the
13431318
LoRA parameters then it won't have any effect.
@@ -1559,18 +1534,7 @@ def fuse_lora(
15591534
# Copied from diffusers.loaders.lora_pipeline.SanaLoraLoaderMixin.unfuse_lora
15601535
def unfuse_lora(self, components: List[str] = ["transformer", "text_encoder"], **kwargs):
15611536
r"""
1562-
Reverses the effect of
1563-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
1564-
1565-
<Tip warning={true}>
1566-
1567-
This is an experimental API.
1568-
1569-
</Tip>
1570-
1571-
Args:
1572-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
1573-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
1537+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
15741538
"""
15751539
super().unfuse_lora(components=components, **kwargs)
15761540

@@ -2788,18 +2752,7 @@ def fuse_lora(
27882752

27892753
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
27902754
r"""
2791-
Reverses the effect of
2792-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
2793-
2794-
<Tip warning={true}>
2795-
2796-
This is an experimental API.
2797-
2798-
</Tip>
2799-
2800-
Args:
2801-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
2802-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
2755+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
28032756
"""
28042757
super().unfuse_lora(components=components, **kwargs)
28052758

@@ -3018,18 +2971,7 @@ def fuse_lora(
30182971
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.unfuse_lora
30192972
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
30202973
r"""
3021-
Reverses the effect of
3022-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
3023-
3024-
<Tip warning={true}>
3025-
3026-
This is an experimental API.
3027-
3028-
</Tip>
3029-
3030-
Args:
3031-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
3032-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
2974+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
30332975
"""
30342976
super().unfuse_lora(components=components, **kwargs)
30352977

@@ -3251,18 +3193,7 @@ def fuse_lora(
32513193
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.unfuse_lora
32523194
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
32533195
r"""
3254-
Reverses the effect of
3255-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
3256-
3257-
<Tip warning={true}>
3258-
3259-
This is an experimental API.
3260-
3261-
</Tip>
3262-
3263-
Args:
3264-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
3265-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
3196+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
32663197
"""
32673198
super().unfuse_lora(components=components, **kwargs)
32683199

@@ -3481,18 +3412,7 @@ def fuse_lora(
34813412
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.unfuse_lora
34823413
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
34833414
r"""
3484-
Reverses the effect of
3485-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
3486-
3487-
<Tip warning={true}>
3488-
3489-
This is an experimental API.
3490-
3491-
</Tip>
3492-
3493-
Args:
3494-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
3495-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
3415+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
34963416
"""
34973417
super().unfuse_lora(components=components, **kwargs)
34983418

@@ -3714,18 +3634,7 @@ def fuse_lora(
37143634
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.unfuse_lora
37153635
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
37163636
r"""
3717-
Reverses the effect of
3718-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
3719-
3720-
<Tip warning={true}>
3721-
3722-
This is an experimental API.
3723-
3724-
</Tip>
3725-
3726-
Args:
3727-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
3728-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
3637+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
37293638
"""
37303639
super().unfuse_lora(components=components, **kwargs)
37313640

@@ -3948,18 +3857,7 @@ def fuse_lora(
39483857
# Copied from diffusers.loaders.lora_pipeline.SanaLoraLoaderMixin.unfuse_lora
39493858
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
39503859
r"""
3951-
Reverses the effect of
3952-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
3953-
3954-
<Tip warning={true}>
3955-
3956-
This is an experimental API.
3957-
3958-
</Tip>
3959-
3960-
Args:
3961-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
3962-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
3860+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
39633861
"""
39643862
super().unfuse_lora(components=components, **kwargs)
39653863

@@ -4252,18 +4150,7 @@ def fuse_lora(
42524150
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.unfuse_lora
42534151
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
42544152
r"""
4255-
Reverses the effect of
4256-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
4257-
4258-
<Tip warning={true}>
4259-
4260-
This is an experimental API.
4261-
4262-
</Tip>
4263-
4264-
Args:
4265-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
4266-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
4153+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
42674154
"""
42684155
super().unfuse_lora(components=components, **kwargs)
42694156

@@ -4559,18 +4446,7 @@ def fuse_lora(
45594446
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.unfuse_lora
45604447
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
45614448
r"""
4562-
Reverses the effect of
4563-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
4564-
4565-
<Tip warning={true}>
4566-
4567-
This is an experimental API.
4568-
4569-
</Tip>
4570-
4571-
Args:
4572-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
4573-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
4449+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
45744450
"""
45754451
super().unfuse_lora(components=components, **kwargs)
45764452

@@ -4789,18 +4665,7 @@ def fuse_lora(
47894665
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.unfuse_lora
47904666
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
47914667
r"""
4792-
Reverses the effect of
4793-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
4794-
4795-
<Tip warning={true}>
4796-
4797-
This is an experimental API.
4798-
4799-
</Tip>
4800-
4801-
Args:
4802-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
4803-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
4668+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
48044669
"""
48054670
super().unfuse_lora(components=components, **kwargs)
48064671

@@ -5022,18 +4887,7 @@ def fuse_lora(
50224887
# Copied from diffusers.loaders.lora_pipeline.SanaLoraLoaderMixin.unfuse_lora
50234888
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
50244889
r"""
5025-
Reverses the effect of
5026-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
5027-
5028-
<Tip warning={true}>
5029-
5030-
This is an experimental API.
5031-
5032-
</Tip>
5033-
5034-
Args:
5035-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
5036-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
4890+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
50374891
"""
50384892
super().unfuse_lora(components=components, **kwargs)
50394893

@@ -5257,18 +5111,7 @@ def fuse_lora(
52575111
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.unfuse_lora
52585112
def unfuse_lora(self, components: List[str] = ["transformer"], **kwargs):
52595113
r"""
5260-
Reverses the effect of
5261-
[`pipe.fuse_lora()`](https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraBaseMixin.fuse_lora).
5262-
5263-
<Tip warning={true}>
5264-
5265-
This is an experimental API.
5266-
5267-
</Tip>
5268-
5269-
Args:
5270-
components (`List[str]`): List of LoRA-injectable components to unfuse LoRA from.
5271-
unfuse_transformer (`bool`, defaults to `True`): Whether to unfuse the UNet LoRA parameters.
5114+
See [`~loaders.StableDiffusionLoraLoaderMixin.unfuse_lora`] for more details.
52725115
"""
52735116
super().unfuse_lora(components=components, **kwargs)
52745117

0 commit comments

Comments
 (0)