Added job_timestamp to Processed
So `[job_timestamp]` pattern can use in saving image UI.
This commit is contained in:
parent
070b7d60cf
commit
1cc36d170a
@ -298,7 +298,7 @@ def apply_filename_pattern(x, p, seed, prompt):
|
|||||||
x = x.replace("[model_hash]", shared.sd_model.sd_model_hash)
|
x = x.replace("[model_hash]", shared.sd_model.sd_model_hash)
|
||||||
x = x.replace("[date]", datetime.date.today().isoformat())
|
x = x.replace("[date]", datetime.date.today().isoformat())
|
||||||
x = x.replace("[datetime]", datetime.datetime.now().strftime("%Y%m%d%H%M%S"))
|
x = x.replace("[datetime]", datetime.datetime.now().strftime("%Y%m%d%H%M%S"))
|
||||||
x = x.replace("[job_timestamp]", shared.state.job_timestamp)
|
x = x.replace("[job_timestamp]", getattr(p, "job_timestamp", shared.state.job_timestamp))
|
||||||
|
|
||||||
# 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:
|
||||||
|
@ -122,6 +122,7 @@ class Processed:
|
|||||||
self.extra_generation_params = p.extra_generation_params
|
self.extra_generation_params = p.extra_generation_params
|
||||||
self.index_of_first_image = index_of_first_image
|
self.index_of_first_image = index_of_first_image
|
||||||
self.styles = p.styles
|
self.styles = p.styles
|
||||||
|
self.job_timestamp = state.job_timestamp
|
||||||
|
|
||||||
self.eta = p.eta
|
self.eta = p.eta
|
||||||
self.ddim_discretize = p.ddim_discretize
|
self.ddim_discretize = p.ddim_discretize
|
||||||
@ -167,6 +168,7 @@ class Processed:
|
|||||||
"index_of_first_image": self.index_of_first_image,
|
"index_of_first_image": self.index_of_first_image,
|
||||||
"infotexts": self.infotexts,
|
"infotexts": self.infotexts,
|
||||||
"styles": self.styles,
|
"styles": self.styles,
|
||||||
|
"job_timestamp": self.job_timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.dumps(obj)
|
return json.dumps(obj)
|
||||||
|
Loading…
Reference in New Issue
Block a user