mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
feat: add button to enable LoRAs (#2210)
* Initial commit
* Update README.md
* sync with original main Fooocus repo
* update with my gitignore setup
* add max lora config feature
* Revert "add max lora config feature"
This reverts commit cfe7463fe2.
* add lora enabler feature
* Update README.md
* Update .gitignore
* update
* merge
* revert changes
* revert
* feat: change width of LoRA columns
* refactor: rename lora_enable to lora_enabled, optimize code
---------
Co-authored-by: Manuel Schmid <manuel.schmid@odt.net>
This commit is contained in:
co-authored by
Manuel Schmid
parent
eebd7752ab
commit
468d704b29
@@ -322,11 +322,14 @@ with shared.gradio_root:
|
||||
|
||||
for i, (n, v) in enumerate(modules.config.default_loras):
|
||||
with gr.Row():
|
||||
lora_enabled = gr.Checkbox(label='Enable', value=True,
|
||||
elem_classes=['lora_enable', 'min_check'])
|
||||
lora_model = gr.Dropdown(label=f'LoRA {i + 1}',
|
||||
choices=['None'] + modules.config.lora_filenames, value=n)
|
||||
choices=['None'] + modules.config.lora_filenames, value=n,
|
||||
elem_classes='lora_model')
|
||||
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]
|
||||
lora_ctrls += [lora_enabled, lora_model, lora_weight]
|
||||
|
||||
with gr.Row():
|
||||
model_refresh = gr.Button(label='Refresh', value='\U0001f504 Refresh All Files', variant='secondary', elem_classes='refresh_button')
|
||||
@@ -471,7 +474,7 @@ with shared.gradio_root:
|
||||
results = []
|
||||
results += [gr.update(choices=modules.config.model_filenames), gr.update(choices=['None'] + modules.config.model_filenames)]
|
||||
for i in range(5):
|
||||
results += [gr.update(choices=['None'] + modules.config.lora_filenames), gr.update()]
|
||||
results += [gr.update(choices=['None'] + modules.config.lora_filenames), gr.update(), gr.update(interactive=True)]
|
||||
return results
|
||||
|
||||
model_refresh.click(model_refresh_clicked, [], [base_model, refiner_model] + lora_ctrls,
|
||||
|
||||
Reference in New Issue
Block a user