a2569875 / stable-diffusion-webui-composable-lora

This extension replaces the built-in LoRA forward procedure.
GNU Affero General Public License v3.0
155 stars 14 forks source link

Syntax incompatibility with other prompt editing extension causes error #20

Open siteth opened 11 months ago

siteth commented 11 months ago

I regularly use the prompt fusion extension ( syntax: [a:b:c:step_a, step_b, step_c] ) for step-dependent prompt interpolation and a prompt blending script (syntax: {a:weight_a|b:weight_b}) for constant prompt interpolation.

If I use both in a prompt, this can result in prompt structures like these: [bird:{dog|cat}:2,10]

Even if with no loras loaded and the composable-lora extension not enabled this results in the following error

Traceback (most recent call last): File ".../stable-diffusion/webui/stable-diffusion-webui/modules/scripts.py", line 519, in process script.process(p, *script_args) File ".../stable-diffusion/webui/stable-diffusion-webui/extensions/stable-diffusion-webui-composable-lora/scripts/composable_lora_script.py", line 133, in process composable_lora.load_prompt_loras(prompt) File ".../stable-diffusion/webui/stable-diffusion-webui/extensions/stable-diffusion-webui-composable-lora/composable_lora.py", line 121, in load_prompt_loras tmp_lora_controllers = composable_lora_step.parse_step_rendering_syntax(prompt) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".../stable-diffusion/webui/stable-diffusion-webui/extensions/stable-diffusion-webui-composable-lora/composable_lora_step.py", line 269, in parse_step_rendering_syntax tmp_lora_controllers += get_LoRA_Controllers(item) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".../stable-diffusion/webui/stable-diffusion-webui/extensions/stable-diffusion-webui-composable-lora/composable_lora_step.py", line 579, in get_LoRA_Controllers result_list.append(LoRA_Switcher_Controller(tmp_lora_list, float(split_by_colon[2]), -1.0)) ^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: could not convert string to float: '2,10'