Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
eb007e58
Commit
eb007e58
authored
Oct 23, 2022
by
w-e-w
Committed by
AUTOMATIC1111
Oct 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the same datetime object for [date] and [datetime]
parent
5a981310
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
images.py
modules/images.py
+3
-2
No files found.
modules/images.py
View file @
eb007e58
...
@@ -302,8 +302,9 @@ def apply_filename_pattern(x, p, seed, prompt):
...
@@ -302,8 +302,9 @@ def apply_filename_pattern(x, p, seed, prompt):
x
=
re
.
sub
(
r'\[sampler]'
,
sanitize_filename_part
(
sd_samplers
.
samplers
[
p
.
sampler_index
]
.
name
,
replace_spaces
=
False
),
x
,
flags
=
re
.
IGNORECASE
)
x
=
re
.
sub
(
r'\[sampler]'
,
sanitize_filename_part
(
sd_samplers
.
samplers
[
p
.
sampler_index
]
.
name
,
replace_spaces
=
False
),
x
,
flags
=
re
.
IGNORECASE
)
x
=
re
.
sub
(
r'\[model_hash]'
,
getattr
(
p
,
"sd_model_hash"
,
shared
.
sd_model
.
sd_model_hash
),
x
,
flags
=
re
.
IGNORECASE
)
x
=
re
.
sub
(
r'\[model_hash]'
,
getattr
(
p
,
"sd_model_hash"
,
shared
.
sd_model
.
sd_model_hash
),
x
,
flags
=
re
.
IGNORECASE
)
x
=
re
.
sub
(
r'\[date]'
,
datetime
.
date
.
today
()
.
isoformat
(),
x
,
flags
=
re
.
IGNORECASE
)
current_time
=
datetime
.
datetime
.
now
()
x
=
replace_datetime
(
x
,
datetime
.
datetime
.
now
())
x
=
re
.
sub
(
r'\[date]'
,
current_time
.
strftime
(
'
%
Y-
%
m-
%
d'
),
x
,
flags
=
re
.
IGNORECASE
)
x
=
replace_datetime
(
x
,
current_time
)
# replace [datetime], [datetime<Format>], [datetime<Format><Time Zone>]
x
=
re
.
sub
(
r'\[job_timestamp]'
,
getattr
(
p
,
"job_timestamp"
,
shared
.
state
.
job_timestamp
),
x
,
flags
=
re
.
IGNORECASE
)
x
=
re
.
sub
(
r'\[job_timestamp]'
,
getattr
(
p
,
"job_timestamp"
,
shared
.
state
.
job_timestamp
),
x
,
flags
=
re
.
IGNORECASE
)
# Apply [prompt] at last. Because it may contain any replacement word.^M
# Apply [prompt] at last. Because it may contain any replacement word.^M
if
prompt
is
not
None
:
if
prompt
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment