From a7a0a6b343b1803de2e83f483e8f5c77ea3a481d Mon Sep 17 00:00:00 2001 From: Christian Bastian <80225746+cdb-boop@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:56:30 -0400 Subject: [PATCH] Update model info slightly. - Hide Clip Skip "1" from Model Info. - Show Dimension/Rank and Alpha. (Nice to reference when evaluating a model's output.) --- __init__.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/__init__.py b/__init__.py index e93d1e9..64b29fc 100644 --- a/__init__.py +++ b/__init__.py @@ -629,13 +629,15 @@ async def get_model_info(request): info["Base Training Model"] = metadata.get("ss_sd_model_name", "") info["Base Model"] = metadata.get("ss_base_model_version", "") - info["Architecture"] = metadata.get("modelspec.architecture", "") # "stable-diffusion-xl-v1-base" + info["Architecture"] = metadata.get("modelspec.architecture", "") + info["Network Dimension"] = metadata.get("ss_network_dim", "") # features trained + info["Network Alpha"] = metadata.get("ss_network_alpha", "") # trained features applied clip_skip = metadata.get("ss_clip_skip", "") - if clip_skip == "None": + if clip_skip == "None" or clip_skip == "1": # assume 1 means no clip skip clip_skip = "" - info["Clip Skip"] = clip_skip # default 1 (disable clip skip) - info["Model Sampling Type"] = metadata.get("modelspec.prediction_type", "") # "epsilon" + info["Clip Skip"] = clip_skip + info["Model Sampling Type"] = metadata.get("modelspec.prediction_type", "") # it is unclear what these are #info["Hash SHA256"] = metadata.get("modelspec.hash_sha256", "") @@ -658,10 +660,10 @@ async def get_model_info(request): training_comment if training_comment != "None" else "" ).strip() - txt_file = abs_name + model_info_extension + info_text_file = abs_name + model_info_extension notes = "" - if os.path.isfile(txt_file): - with open(txt_file, 'r', encoding="utf-8") as f: + if os.path.isfile(info_text_file): + with open(info_text_file, 'r', encoding="utf-8") as f: notes = f.read() info["Notes"] = notes