some js for lora UI

This commit is contained in:
lllyasviel 2023-11-15 07:30:16 -08:00
parent e59fd50787
commit 608fe3962c
3 changed files with 9 additions and 2 deletions

View File

@ -1 +1 @@
version = '2.1.815'
version = '2.1.816'

View File

@ -79,4 +79,10 @@ onUiLoaded(async () => {
}
}, 200);
});
let inputs = document.querySelectorAll('.lora_weight input[type="range"]');
inputs.forEach(function (input) {
input.style.marginTop = '12px';
});
});

View File

@ -279,7 +279,8 @@ with shared.gradio_root:
for i, (n, v) in enumerate(modules.config.default_loras):
with gr.Row():
lora_model = gr.Dropdown(label=f'LoRA {i+1}', choices=['None'] + modules.config.lora_filenames, value=n)
lora_weight = gr.Slider(label='Weight', minimum=-2, maximum=2, step=0.01, value=v)
lora_weight = gr.Slider(label='Weight', minimum=-2, maximum=2, step=0.01, value=v,
elem_classes='lora_weight')
lora_ctrls += [lora_model, lora_weight]
with gr.Row():
model_refresh = gr.Button(label='Refresh', value='\U0001f504 Refresh All Files', variant='secondary', elem_classes='refresh_button')