Skip to content

Commit

Permalink
Minor tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
djbielejeski committed Mar 14, 2023
1 parent 43e007b commit 09bff3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions JupyterNotebookHelpers/setup_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def show_form(self, selected_model: SDModelOption):
def submit_form_click(self, b):
with self.output:
self.output.clear_output()
print('Generating config...')

# training images
uploaded_training_images = self.training_images_uploader.value
Expand Down Expand Up @@ -213,6 +214,7 @@ def submit_form_click(self, b):
learning_rate=self.learning_rate_select.value,
model_repo_id=self.selected_model.repo_id,
model_path=self.selected_model.filename,
run_seed_everything=False,
)

config.save_config_to_file(
Expand Down Expand Up @@ -249,6 +251,7 @@ def log_git_progress(self, op_code: int, cur_count, max_count, message: str = ''
self.regularization_images_progress_bar_widget.close()

def handle_training_images(self, uploaded_images):
print("Uploading training images...")
if os.path.exists(self.training_images_save_path):
# remove existing images
shutil.rmtree(self.training_images_save_path)
Expand Down
6 changes: 4 additions & 2 deletions dreambooth_helpers/joepenna_dreambooth_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def saturate(
gpu: int = 0,
model_repo_id: str = '',
token_only: bool = False,
run_seed_everything: bool = True,
):

# Map the values
Expand All @@ -81,7 +82,8 @@ def saturate(
self.seed = seed

# Global seed
seed_everything(self.seed)
if run_seed_everything:
seed_everything(self.seed)

self.debug = debug
self.gpu = gpu
Expand Down Expand Up @@ -111,7 +113,7 @@ def saturate(
self.training_images_count = len(_training_image_paths)
self.training_images = _training_image_paths

if token_only is False and regularization_images_folder_path is not None and regularization_images_folder_path is not '':
if token_only is False and regularization_images_folder_path is not None and regularization_images_folder_path != '':
self.regularization_images_folder_path = regularization_images_folder_path

if not os.path.exists(self.regularization_images_folder_path):
Expand Down

0 comments on commit 09bff3d

Please sign in to comment.