aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortateisu <tateisu@gmail.com>2022-09-26 15:44:52 +0900
committerAUTOMATIC1111 <16777216c@gmail.com>2022-09-26 16:24:21 +0300
commit78d6aef30249530d8cc0b5023b2f8bf8c86f8446 (patch)
tree215efeaaded21d2aa79ccb0b0022137e13643132
parentb39f06cea7082183c0091119635239f10b3fe180 (diff)
use strftime. update hints.js
-rw-r--r--javascript/hints.js4
-rw-r--r--modules/images.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/javascript/hints.js b/javascript/hints.js
index ed79796f..59dd770c 100644
--- a/javascript/hints.js
+++ b/javascript/hints.js
@@ -57,8 +57,8 @@ titles = {
"Interrogate": "Reconstruct prompt from existing image and put it into the prompt field.",
- "Images filename pattern": "Use following tags to define how filenames for images are chosen: [steps], [cfg], [prompt], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [job_timestamp]; leave empty for default.",
- "Directory name pattern": "Use following tags to define how subdirectories for images and grids are chosen: [steps], [cfg], [prompt], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [job_timestamp]; leave empty for default.",
+ "Images filename pattern": "Use following tags to define how filenames for images are chosen: [steps], [cfg], [prompt], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [datetime], [job_timestamp]; leave empty for default.",
+ "Directory name pattern": "Use following tags to define how subdirectories for images and grids are chosen: [steps], [cfg], [prompt], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [datetime], [job_timestamp]; leave empty for default.",
"Max prompt words": "Set the maximum number of words to be used in the [prompt_words] option; ATTENTION: If the words are too long, they may exceed the maximum length of the file path that the system can handle",
"Loopback": "Process an image, use it as an input, repeat.",
diff --git a/modules/images.py b/modules/images.py
index 76278339..9458bf8d 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -295,7 +295,7 @@ def apply_filename_pattern(x, p, seed, prompt):
x = x.replace("[model_hash]", shared.sd_model.sd_model_hash)
x = x.replace("[date]", datetime.date.today().isoformat())
- x = x.replace("[datetime]", re.sub(r'(\.\d+|\D+)', "", datetime.datetime.now().isoformat()))
+ x = x.replace("[datetime]", datetime.datetime.now().strftime("%Y%m%d%H%M%S"))
x = x.replace("[job_timestamp]", shared.state.job_timestamp)
if cmd_opts.hide_ui_dir_config: