File size: 1,019 Bytes
d8d872a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
#@title Fuse/unfuse LoRAs sequentially leading to trouble
import torch
from diffusers import StableDiffusionXLPipeline

pipe = StableDiffusionXLPipeline.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    torch_dtype=torch.float16,
    variant="fp16",
).to("cuda")

pipe.load_lora_weights("Pclanglais/TintinIA")
pipe.fuse_lora()
images = pipe("a mecha robot", num_inference_steps=2)
pipe.unfuse_lora()
pipe.unload_lora_weights()

pipe.load_lora_weights("ProomptEngineer/pe-balloon-diffusion-style")
pipe.fuse_lora()
images = pipe("a mecha robot", num_inference_steps=2)
pipe.unfuse_lora()
pipe.unload_lora_weights()

pipe.load_lora_weights("ostris/crayon_style_lora_sdxl")
pipe.fuse_lora()
images = pipe("a mecha robot", num_inference_steps=2)
pipe.unfuse_lora()
pipe.unload_lora_weights()


pipe.load_lora_weights("joachimsallstrom/aether-cloud-lora-for-sdxl")
pipe.fuse_lora()
images = pipe("a mecha robot", num_inference_steps=2)
pipe.unfuse_lora()
pipe.unload_lora_weights()