Skip to content

Commit

Permalink
autodetect-modeltype: also do the v2 checkbox in extract_lora
Browse files Browse the repository at this point in the history
  • Loading branch information
b-fission committed Aug 6, 2024
1 parent ed22556 commit c0966bc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions kohya_gui/extract_lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,17 @@ def change_sdxl(sdxl):
outputs=[load_tuned_model_to, load_original_model_to],
)

#secondary event on model_tuned for auto-detection of SDXL
#secondary event on model_tuned for auto-detection of v2/SDXL
def change_modeltype_model_tuned(path):
detect = SDModelType(path)
v2 = gr.Checkbox(value=detect.Is_SD2())
sdxl = gr.Checkbox(value=detect.Is_SDXL())
return v2, sdxl

model_tuned.change(
lambda path: gr.Checkbox(value=SDModelType(path).Is_SDXL()),
change_modeltype_model_tuned,
inputs=model_tuned,
outputs=sdxl
outputs=[v2, sdxl]
)

extract_button = gr.Button("Extract LoRA model")
Expand Down

0 comments on commit c0966bc

Please sign in to comment.