Update lollms_comfyui.py

This commit is contained in:
Saifeddine ALOUI 2024-06-16 01:53:22 +02:00 committed by GitHub
parent 81c77715d9
commit 4ff4cc0ea8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -388,13 +388,13 @@ class LollmsComfyUI(LollmsTTI):
}
}
"""
def save_images(images, folder_path):
def save_images(images:dict, folder_path:str|Path):
# Create the folder if it doesn't exist
folder = Path(folder_path)
folder.mkdir(parents=True, exist_ok=True)
# Save each image to the folder
for i, img_data in enumerate(images):
for i, img_data in images.items():
img_path = folder / f'image_{i+1}.png'
with open(img_path, 'wb') as img_file:
img_file.write(base64.b64decode(img_data))