Skip to content

Commit

Permalink
Add use_masks checkbox to SDXL finetune UI (after merge).
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanJDick committed May 22, 2024
1 parent 717a247 commit 2b17c95
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ def __init__(self):
"learning rate schedule, if applicable to the selected scheduler.",
interactive=True,
)
with gr.Row():
self.use_masks = gr.Checkbox(
label="Use Masks", info="This can only be enabled if the dataset contains masks.", interactive=True
)

with gr.Tab("Advanced"):
with gr.Row():
self.min_snr_gamma = gr.Number(
label="Minimum SNR Gamma",
Expand Down Expand Up @@ -180,6 +186,7 @@ def update_ui_components_with_config_data(
self.max_checkpoints: config.max_checkpoints,
self.lr_scheduler: config.lr_scheduler,
self.lr_warmup_steps: config.lr_warmup_steps,
self.use_masks: config.use_masks,
self.min_snr_gamma: config.min_snr_gamma,
self.max_grad_norm: config.max_grad_norm,
self.train_batch_size: config.train_batch_size,
Expand Down Expand Up @@ -218,6 +225,7 @@ def update_config_with_ui_component_data(
new_config.max_checkpoints = ui_data.pop(self.max_checkpoints)
new_config.lr_scheduler = ui_data.pop(self.lr_scheduler)
new_config.lr_warmup_steps = ui_data.pop(self.lr_warmup_steps)
new_config.use_masks = ui_data.pop(self.use_masks)
new_config.min_snr_gamma = ui_data.pop(self.min_snr_gamma)
new_config.max_grad_norm = ui_data.pop(self.max_grad_norm)
new_config.train_batch_size = ui_data.pop(self.train_batch_size)
Expand Down

0 comments on commit 2b17c95

Please sign in to comment.