diff --git a/modules/launch_utils.py b/modules/launch_utils.py index fc057feb..f16aa79f 100644 --- a/modules/launch_utils.py +++ b/modules/launch_utils.py @@ -533,20 +533,24 @@ def dump_sysinfo(): return filename -VERSION_UID: Final[str] = "POSTMEM" +VERSION_UID: Final[str] = "PY313" def verify_version(): """prompt user to do a clean reinstall""" settings_file: os.PathLike = args.ui_settings_file + if not os.path.isfile(settings_file): - return # config.json does not exist on a fresh git clone + # config.json does not exist on a fresh git clone + with open(settings_file, "w", encoding="utf8") as file: + json.dump({"VERSION_UID": VERSION_UID}, file) + return with open(settings_file, "r", encoding="utf8") as file: settings: dict[str, Any] = json.load(file) if settings.get("VERSION_UID", None) == VERSION_UID: - return # key matches + return # already up-to-date os.system("") diff --git a/modules_forge/main_entry.py b/modules_forge/main_entry.py index 23da1e0b..9b821951 100644 --- a/modules_forge/main_entry.py +++ b/modules_forge/main_entry.py @@ -9,7 +9,7 @@ from rich import print_json from backend import memory_management from backend.args import dynamic_args from backend.logging import setup_logger -from modules import infotext_utils, launch_utils, paths, processing, sd_models, shared, shared_items, ui_common +from modules import infotext_utils, paths, processing, sd_models, shared, shared_items, ui_common from modules_forge.presets import PresetArch, use_distill, use_shift logger = logging.getLogger("ui_models") @@ -200,8 +200,6 @@ def get_a1111_ui_component(tab: str, label: str) -> gr.components.Component: def forge_main_entry(): - shared.opts.set("VERSION_UID", launch_utils.VERSION_UID) - ui_txt2img_steps = get_a1111_ui_component("txt2img", "Steps") ui_txt2img_hr_steps = get_a1111_ui_component("txt2img", "Hires steps") ui_img2img_steps = get_a1111_ui_component("img2img", "Steps")