sdapi: add job_timestamp field to info result (#2110)

This commit is contained in:
Wagner Bruna 2026-04-10 22:28:53 -03:00 committed by GitHub
parent 5a3c92365a
commit f4fbd94129
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2480,6 +2480,8 @@ def lora_map_name_to_path(request_list):
def sd_generate(genparams):
global maxctx, args, currentusergenkey, totalgens, pendingabortkey, chatcompl_adapter
job_timestamp = datetime.now().strftime("%Y%m%d%H%M%S")
default_adapter = {} if chatcompl_adapter is None else chatcompl_adapter
adapter_obj = genparams.get('adapter', default_adapter)
forced_negprompt = adapter_obj.get("add_sd_negative_prompt", "")
@ -2594,6 +2596,7 @@ def sd_generate(genparams):
data_extra = ret.data_extra.decode("UTF-8","ignore")
info = json.loads(ret.info.decode("UTF-8","ignore"))
animated = True if ret.animated else False
info["job_timestamp"] = job_timestamp
return {"animated": animated, "data":data_main, "data_extra":data_extra, "info": info}