This commit is contained in:
Haoming 2026-02-09 11:21:58 +08:00
parent 690e3a7855
commit 5c23cf6e81
2 changed files with 8 additions and 6 deletions

View File

@ -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("")

View File

@ -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")