Skip to content

Commit 95a7e0f

Browse files
committed
fox-copies
1 parent 5fbc59c commit 95a7e0f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/diffusers/loaders/lora_pipeline.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4243,10 +4243,10 @@ def save_lora_weights(
42434243
safe_serialization=safe_serialization,
42444244
)
42454245

4246-
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.fuse_lora
4246+
# Copied from diffusers.loaders.lora_pipeline.Mochi1LoraLoaderMixin.fuse_lora
42474247
def fuse_lora(
42484248
self,
4249-
components: List[str] = ["transformer"],
4249+
components: List[str] = ["transformer", "text_encoder"],
42504250
lora_scale: float = 1.0,
42514251
safe_fusing: bool = False,
42524252
adapter_names: Optional[List[str]] = None,
@@ -4273,23 +4273,21 @@ def fuse_lora(
42734273
Example:
42744274
42754275
```py
4276-
>>> import torch
4277-
>>> from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
4278-
4279-
>>> model_id = "hunyuanvideo-community/HunyuanVideo"
4280-
>>> transformer = HunyuanVideoTransformer3DModel.from_pretrained(
4281-
... model_id, subfolder="transformer", torch_dtype=torch.bfloat16
4282-
... )
4283-
>>> pipe = HunyuanVideoPipeline.from_pretrained(model_id, transformer=transformer, torch_dtype=torch.float16)
4284-
>>> pipe.load_lora_weights("a-r-r-o-w/HunyuanVideo-tuxemons", adapter_name="tuxemons")
4285-
>>> pipe.set_adapter("tuxemons", 1.2)
4276+
from diffusers import DiffusionPipeline
4277+
import torch
4278+
4279+
pipeline = DiffusionPipeline.from_pretrained(
4280+
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16
4281+
).to("cuda")
4282+
pipeline.load_lora_weights("nerijs/pixel-art-xl", weight_name="pixel-art-xl.safetensors", adapter_name="pixel")
4283+
pipeline.fuse_lora(lora_scale=0.7)
42864284
```
42874285
"""
42884286
super().fuse_lora(
42894287
components=components, lora_scale=lora_scale, safe_fusing=safe_fusing, adapter_names=adapter_names
42904288
)
42914289

4292-
# Copied from diffusers.loaders.lora_pipeline.CogVideoXLoraLoaderMixin.unfuse_lora
4290+
# Copied from diffusers.loaders.lora_pipeline.Mochi1LoraLoaderMixin.unfuse_lora
42934291
def unfuse_lora(self, components: List[str] = ["transformer", "text_encoder"], **kwargs):
42944292
r"""
42954293
Reverses the effect of

0 commit comments

Comments
 (0)