KohyaSS/dreambooth_gui/common_gui.py

23 lines
454 B
Python
Raw Normal View History

2022-12-16 18:16:23 +00:00
from easygui import diropenbox, fileopenbox
2022-12-17 01:26:26 +00:00
2022-12-16 18:16:23 +00:00
def get_folder_path():
2022-12-17 01:26:26 +00:00
folder_path = diropenbox('Select the directory to use')
2022-12-16 18:16:23 +00:00
return folder_path
2022-12-17 01:26:26 +00:00
2022-12-16 18:16:23 +00:00
def remove_doublequote(file_path):
if file_path != None:
2022-12-17 01:26:26 +00:00
file_path = file_path.replace('"', '')
2022-12-16 18:16:23 +00:00
return file_path
2022-12-17 01:26:26 +00:00
2022-12-16 18:16:23 +00:00
def get_file_path(file_path):
2022-12-17 01:26:26 +00:00
file_path = fileopenbox(
'Select the config file to load', default=file_path, filetypes='*.json'
)
2022-12-16 18:16:23 +00:00
2022-12-17 01:26:26 +00:00
return file_path