Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files
convert_url_to_diffusers_sd.py
CHANGED
@@ -212,6 +212,7 @@ def fuse_loras(pipe, civitai_key="", lora_dict={}, temp_dir="."):
|
|
212 |
pipe.set_adapters(a_list, adapter_weights=w_list)
|
213 |
pipe.fuse_lora(adapter_names=a_list, lora_scale=1.0)
|
214 |
pipe.unload_lora_weights()
|
|
|
215 |
|
216 |
|
217 |
def convert_url_to_diffusers_sd(url, civitai_key="", half=True, vae=None, scheduler="Euler", lora_dict={},
|
@@ -259,7 +260,7 @@ def convert_url_to_diffusers_sd(url, civitai_key="", half=True, vae=None, schedu
|
|
259 |
elif new_vae_file:
|
260 |
pipe.vae = AutoencoderKL.from_single_file(new_vae_file)
|
261 |
|
262 |
-
fuse_loras(pipe, lora_dict, temp_dir, civitai_key)
|
263 |
|
264 |
sconf = get_scheduler_config(scheduler)
|
265 |
pipe.scheduler = sconf[0].from_config(pipe.scheduler.config, **sconf[1])
|
|
|
212 |
pipe.set_adapters(a_list, adapter_weights=w_list)
|
213 |
pipe.fuse_lora(adapter_names=a_list, lora_scale=1.0)
|
214 |
pipe.unload_lora_weights()
|
215 |
+
return pipe
|
216 |
|
217 |
|
218 |
def convert_url_to_diffusers_sd(url, civitai_key="", half=True, vae=None, scheduler="Euler", lora_dict={},
|
|
|
260 |
elif new_vae_file:
|
261 |
pipe.vae = AutoencoderKL.from_single_file(new_vae_file)
|
262 |
|
263 |
+
pipe = fuse_loras(pipe, lora_dict, temp_dir, civitai_key)
|
264 |
|
265 |
sconf = get_scheduler_config(scheduler)
|
266 |
pipe.scheduler = sconf[0].from_config(pipe.scheduler.config, **sconf[1])
|
convert_url_to_diffusers_sd_gr.py
CHANGED
@@ -241,6 +241,7 @@ def fuse_loras(pipe, lora_dict={}, temp_dir=".", civitai_key="", hf_token=""):
|
|
241 |
pipe.set_adapters(a_list, adapter_weights=w_list)
|
242 |
pipe.fuse_lora(adapter_names=a_list, lora_scale=1.0)
|
243 |
pipe.unload_lora_weights()
|
|
|
244 |
|
245 |
|
246 |
def convert_url_to_diffusers_sd(url, civitai_key="", hf_token="", is_upload_sf=False, half=True, vae=None, scheduler="Euler", lora_dict={},
|
@@ -289,7 +290,7 @@ def convert_url_to_diffusers_sd(url, civitai_key="", hf_token="", is_upload_sf=F
|
|
289 |
elif new_vae_file:
|
290 |
pipe.vae = AutoencoderKL.from_single_file(new_vae_file)
|
291 |
|
292 |
-
fuse_loras(pipe, lora_dict, temp_dir, civitai_key, hf_token)
|
293 |
|
294 |
sconf = get_scheduler_config(scheduler)
|
295 |
pipe.scheduler = sconf[0].from_config(pipe.scheduler.config, **sconf[1])
|
|
|
241 |
pipe.set_adapters(a_list, adapter_weights=w_list)
|
242 |
pipe.fuse_lora(adapter_names=a_list, lora_scale=1.0)
|
243 |
pipe.unload_lora_weights()
|
244 |
+
return pipe
|
245 |
|
246 |
|
247 |
def convert_url_to_diffusers_sd(url, civitai_key="", hf_token="", is_upload_sf=False, half=True, vae=None, scheduler="Euler", lora_dict={},
|
|
|
290 |
elif new_vae_file:
|
291 |
pipe.vae = AutoencoderKL.from_single_file(new_vae_file)
|
292 |
|
293 |
+
pipe = fuse_loras(pipe, lora_dict, temp_dir, civitai_key, hf_token)
|
294 |
|
295 |
sconf = get_scheduler_config(scheduler)
|
296 |
pipe.scheduler = sconf[0].from_config(pipe.scheduler.config, **sconf[1])
|
local/convert_url_to_diffusers_sd.py
CHANGED
@@ -212,6 +212,7 @@ def fuse_loras(pipe, civitai_key="", lora_dict={}, temp_dir="."):
|
|
212 |
pipe.set_adapters(a_list, adapter_weights=w_list)
|
213 |
pipe.fuse_lora(adapter_names=a_list, lora_scale=1.0)
|
214 |
pipe.unload_lora_weights()
|
|
|
215 |
|
216 |
|
217 |
def convert_url_to_diffusers_sd(url, civitai_key="", half=True, vae=None, scheduler="Euler", lora_dict={},
|
@@ -259,7 +260,7 @@ def convert_url_to_diffusers_sd(url, civitai_key="", half=True, vae=None, schedu
|
|
259 |
elif new_vae_file:
|
260 |
pipe.vae = AutoencoderKL.from_single_file(new_vae_file)
|
261 |
|
262 |
-
fuse_loras(pipe, lora_dict, temp_dir, civitai_key)
|
263 |
|
264 |
sconf = get_scheduler_config(scheduler)
|
265 |
pipe.scheduler = sconf[0].from_config(pipe.scheduler.config, **sconf[1])
|
|
|
212 |
pipe.set_adapters(a_list, adapter_weights=w_list)
|
213 |
pipe.fuse_lora(adapter_names=a_list, lora_scale=1.0)
|
214 |
pipe.unload_lora_weights()
|
215 |
+
return pipe
|
216 |
|
217 |
|
218 |
def convert_url_to_diffusers_sd(url, civitai_key="", half=True, vae=None, scheduler="Euler", lora_dict={},
|
|
|
260 |
elif new_vae_file:
|
261 |
pipe.vae = AutoencoderKL.from_single_file(new_vae_file)
|
262 |
|
263 |
+
pipe = fuse_loras(pipe, lora_dict, temp_dir, civitai_key)
|
264 |
|
265 |
sconf = get_scheduler_config(scheduler)
|
266 |
pipe.scheduler = sconf[0].from_config(pipe.scheduler.config, **sconf[1])
|