fix p.outpath_grids sometimes not available

pull/181/head
Tung Nguyen 2023-11-09 22:27:12 +07:00
parent dcb085cf81
commit c791bf91f5
1 changed files with 5 additions and 1 deletions

View File

@ -521,7 +521,11 @@ class TaskRunner:
self.__run_callbacks("task_cleared")
def __on_image_saved(self, data: script_callbacks.ImageSaveParams):
if data.filename.startswith(data.p.outpath_grids):
if self.current_task_id is None:
return
outpath_grids = shared.opts.outdir_grids or shared.opts.outdir_txt2img_grids
if data.filename.startswith(outpath_grids):
self.__saved_images_path.insert(0, data.filename)
else:
self.__saved_images_path.append(data.filename)