CoolFace
Modelpublic

diffusers/tools

sourceHugging Facecreativeml-openrail-mupdated 3y agoView on Hugging Face
11likes28downloads
fuse_unfuse.py23 linesDownload Raw Back to root
1#!/usr/bin/env python32import torch3from diffusers import StableDiffusionXLPipeline4  5pipe = StableDiffusionXLPipeline.from_pretrained(6    "stabilityai/stable-diffusion-xl-base-1.0",7    torch_dtype=torch.float16,8).to("cuda")9 10#Fuse/unfuse first LoRA  11pipe.load_lora_weights("joachimsallstrom/aether-cloud-lora-for-sdxl")12pipe.fuse_lora()13pipe.unload_lora_weights()14pipe.unfuse_lora()15 16#Now it would be expected that the the LoRA has been unfused and `pipe` in the its original state, however...17 18#Fuse/unfuse second LoRA19pipe.load_lora_weights("jbilcke-hf/sdxl-zelda64")20pipe.fuse_lora()21pipe.unload_lora_weights()22pipe.unfuse_lora() #errors out23