diff --git a/ressources/common.py b/ressources/common.py index 116c9ec..c1d8b09 100755 --- a/ressources/common.py +++ b/ressources/common.py @@ -1730,6 +1730,24 @@ def write_ini_img2shape( savefile.write(content) return + +def is_fast_lora(model): + if (\ +(model == "ByteDance/SDXL-Lightning") or \ +(model == "ByteDance/Hyper-SD") or \ +(model == "openskyml/lcm-lora-sdxl-turbo") or \ +("H1T/TCD-SD" in model.upper()) or \ +(model == "wangfuyun/PCM_Weights") or \ +(model == "tianweiy/DMD2") or \ +(model == "jasperai/flash-sdxl") or \ +(model == "jasperai/flash-sd") or \ +(model == "sd-community/sdxl-flash-lora") +): + is_fast_lora_value = True + else: + is_fast_lora_value = False + return is_fast_lora_value + def is_sdxl(model): if (\ ("XL" in model.upper()) or \ @@ -1760,6 +1778,8 @@ def lora_model_list(model): "tianweiy/DMD2":("dmd2_sdxl_4step_lora.safetensors", ""), "h1t/TCD-SDXL-LoRA":("pytorch_lora_weights.safetensors", ""), "wangfuyun/PCM_Weights":("sdxl/pcm_sdxl_lcmlike_lora_converted.safetensors", ""), + "jasperai/flash-sdxl":("pytorch_lora_weights.safetensors", ""), + "sd-community/sdxl-flash-lora":("sdxl-flash-lora.safetensors", "sdxl-flash-lora:0.55"), "ehristoforu/dalle-3-xl-v2":("dalle-3-xl-lora-v2.safetensors", ""), "DoctorDiffusion/doctor-diffusion-s-claymation-style-lora":("DD-made-of-clay-XL-v2.safetensors", "made-of-clay"), "DoctorDiffusion/doctor-diffusion-s-toy-xl-style-lora":("DD-toy-v2.safetensors", "toy"), @@ -1795,6 +1815,7 @@ def lora_model_list(model): "ByteDance/Hyper-SD":("Hyper-SD15-1step-lora.safetensors", ""), "h1t/TCD-SD15-LoRA":("pytorch_lora_weights.safetensors", ""), "wangfuyun/PCM_Weights":("sd15/pcm_sd15_lcmlike_lora_converted.safetensors", ""), + "jasperai/flash-sd":("pytorch_lora_weights.safetensors", ""), "Kvikontent/midjourney-v6":("mj6-10.safetensors", ""), "Norod78/SD15-IllusionDiffusionPattern-LoRA":("SD15-IllusionDiffusionPattern-LoRA.safetensors","IllusionDiffusionPattern"), diff --git a/webui.py b/webui.py index 3d77024..62205e4 100644 --- a/webui.py +++ b/webui.py @@ -361,7 +361,7 @@ def change_lora_model_txt2img_sd(model, lora_model, prompt, steps, cfg_scale, sa lora_prompt_txt2img_sd = lora_prompt_txt2img_sd.replace(lora_trigger, "") biniou_internal_previous_trigger_txt2img_sd = lora_keyword - if (lora_model == "ByteDance/SDXL-Lightning") or (lora_model == "ByteDance/Hyper-SD") or (lora_model == "openskyml/lcm-lora-sdxl-turbo") or ("H1T/TCD-SD" in lora_model.upper()) or (lora_model == "wangfuyun/PCM_Weights") or (lora_model == "tianweiy/DMD2"): + if is_fast_lora(lora_model): biniou_internal_previous_model_txt2img_sd = model biniou_internal_previous_steps_txt2img_sd = steps biniou_internal_previous_cfg_txt2img_sd = cfg_scale @@ -376,6 +376,12 @@ def change_lora_model_txt2img_sd(model, lora_model, prompt, steps, cfg_scale, sa return prompt_txt2img_sd.update(value=lora_prompt_txt2img_sd), num_inference_step_txt2img_sd.update(value=4), guidance_scale_txt2img_sd.update(value=0.0), sampler_txt2img_sd.update(value="LCM") elif (lora_model == "wangfuyun/PCM_Weights"): return prompt_txt2img_sd.update(value=lora_prompt_txt2img_sd), num_inference_step_txt2img_sd.update(value=2), guidance_scale_txt2img_sd.update(value=0.0), sampler_txt2img_sd.update(value="LCM") + elif (lora_model == "jasperai/flash-sdxl"): + return prompt_txt2img_sd.update(value=lora_prompt_txt2img_sd), num_inference_step_txt2img_sd.update(value=4), guidance_scale_txt2img_sd.update(value=0.0), sampler_txt2img_sd.update(value="LCM") + elif (lora_model == "jasperai/flash-sd"): + return prompt_txt2img_sd.update(value=lora_prompt_txt2img_sd), num_inference_step_txt2img_sd.update(value=2), guidance_scale_txt2img_sd.update(value=0.0), sampler_txt2img_sd.update(value="LCM") + elif (lora_model == "sd-community/sdxl-flash-lora"): + return prompt_txt2img_sd.update(value=lora_prompt_txt2img_sd), num_inference_step_txt2img_sd.update(value=6), guidance_scale_txt2img_sd.update(value=3.0), sampler_txt2img_sd.update(value="DPM++ SDE") else: if ((biniou_internal_previous_model_txt2img_sd == "") and (biniou_internal_previous_steps_txt2img_sd == "") and (biniou_internal_previous_cfg_txt2img_sd == "") and (biniou_internal_previous_sampler_txt2img_sd == "")): return prompt_txt2img_sd.update(value=lora_prompt_txt2img_sd), num_inference_step_txt2img_sd.update(), guidance_scale_txt2img_sd.update(), sampler_txt2img_sd.update()