Skip to content

Instantly share code, notes, and snippets.

@metacritical
Forked from FurkanGozukara/kandinsky.txt
Created July 14, 2023 23:18
Show Gist options
  • Save metacritical/c47f0bb0f385e68da62d2d520b1643bb to your computer and use it in GitHub Desktop.
Save metacritical/c47f0bb0f385e68da62d2d520b1643bb to your computer and use it in GitHub Desktop.
Save kandinsky generated images
display(images[0])
import os
import uuid
from PIL import Image
# path to the folder where the image will be saved
folder_path = 'C:/Kandinsky-2/imgs'
# generate a unique identifier
guid = uuid.uuid4()
# create the file name using the GUID and the image file extension
file_name = str(guid) + '.png'
# save the image to the folder with the GUID name
images[0].save(os.path.join(folder_path, file_name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment