aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/processing.py11
-rw-r--r--modules/shared.py1
-rw-r--r--modules/ui.py6
3 files changed, 15 insertions, 3 deletions
diff --git a/modules/processing.py b/modules/processing.py
index e8808beb..e786791a 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -458,6 +458,16 @@ def fix_seed(p):
p.subseed = get_fixed_seed(p.subseed)
+def program_version():
+ import launch
+
+ res = launch.git_tag()
+ if res == "<none>":
+ res = None
+
+ return res
+
+
def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iteration=0, position_in_batch=0):
index = position_in_batch + iteration * p.batch_size
@@ -483,6 +493,7 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
"Init image hash": getattr(p, 'init_img_hash', None),
"RNG": opts.randn_source if opts.randn_source != "GPU" else None,
"NGMS": None if p.s_min_uncond == 0 else p.s_min_uncond,
+ "Version": program_version() if opts.add_version_to_infotext else None,
}
generation_params.update(p.extra_generation_params)
diff --git a/modules/shared.py b/modules/shared.py
index dd374713..f40faa79 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -394,6 +394,7 @@ options_templates.update(options_section(('ui', "User interface"), {
"do_not_show_images": OptionInfo(False, "Do not show any images in results for web"),
"add_model_hash_to_info": OptionInfo(True, "Add model hash to generation information"),
"add_model_name_to_info": OptionInfo(True, "Add model name to generation information"),
+ "add_version_to_infotext": OptionInfo(True, "Add program version to generation information"),
"disable_weights_auto_swap": OptionInfo(True, "When reading generation parameters from text into UI (from PNG info or pasted text), do not change the selected model/checkpoint."),
"send_seed": OptionInfo(True, "Send seed when sending prompt or image to other interface"),
"send_size": OptionInfo(True, "Send size when sending prompt or image to another interface"),
diff --git a/modules/ui.py b/modules/ui.py
index 16c46515..b2916e9c 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -1923,7 +1923,7 @@ def versions_html():
python_version = ".".join([str(x) for x in sys.version_info[0:3]])
commit = launch.commit_hash()
- short_commit = commit[0:8]
+ tag = launch.git_tag()
if shared.xformers_available:
import xformers
@@ -1932,6 +1932,8 @@ def versions_html():
xformers_version = "N/A"
return f"""
+version: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/{commit}">{tag}</a>
+ • 
python: <span title="{sys.version}">{python_version}</span>
 • 
torch: {getattr(torch, '__long_version__',torch.__version__)}
@@ -1940,7 +1942,5 @@ xformers: {xformers_version}
 • 
gradio: {gr.__version__}
 • 
-commit: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/{commit}">{short_commit}</a>
- • 
checkpoint: <a id="sd_checkpoint_hash">N/A</a>
"""