Update lollms_sd.py

This commit is contained in:
Saifeddine ALOUI 2024-11-27 16:23:25 +01:00 committed by GitHub
parent 372a474cf6
commit 95646652b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -524,8 +524,12 @@ class LollmsSD(LollmsTTI):
def saveImage(self, image:Image, save_folder=None): def saveImage(self, image:Image, save_folder=None):
if save_folder is None: if save_folder is None:
save_folder = self.output_dir save_folder = self.output_dir
save_folder = Path(save_folder)
if not save_folder.is_dir():
image_name = self.get_available_image_name(save_folder, self.wm) image_name = self.get_available_image_name(save_folder, self.wm)
image_path = os.path.join(save_folder, image_name) image_path = os.path.join(save_folder, image_name)
else:
image_path = save_folder
image.save(image_path) image.save(image_path)
return image_path return image_path