Merge pull request #1952 from AI-Casanova/kohya

Enable side loading of multiple Kohya-style LoRA for SDXL
This commit is contained in:
Vladimir Mandic
2023-08-07 14:42:30 +02:00
committed by GitHub
3 changed files with 515 additions and 17 deletions
+4 -2
View File
@@ -93,8 +93,8 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
args['callback_steps'] = 1
if 'callback' in possible:
args['callback'] = diffusers_callback
if 'cross_attention_kwargs' in possible and lora_state['active']:
args['cross_attention_kwargs'] = { 'scale': lora_state['multiplier']}
if 'cross_attention_kwargs' in possible and lora_state['active'] and shared.opts.diffusers_lora_loader == "Diffusers":
args['cross_attention_kwargs'] = { 'scale': lora_state['multiplier'][0]}
for arg in kwargs:
if arg in possible:
args[arg] = kwargs[arg]
@@ -143,6 +143,7 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
# parsed_prompt = [parse_prompt_attention(prompt) for prompt in prompts]
if shared.state.interrupted or shared.state.skipped:
unload_diffusers_lora()
return results
if shared.opts.diffusers_move_base and not shared.sd_model.has_accelerate:
@@ -167,6 +168,7 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
output = shared.sd_model(**pipe_args) # pylint: disable=not-callable
if shared.state.interrupted or shared.state.skipped:
unload_diffusers_lora()
return results
if shared.sd_refiner is None or not p.enable_hr: