-
-
Save metacritical/c47f0bb0f385e68da62d2d520b1643bb to your computer and use it in GitHub Desktop.
Revisions
-
FurkanGozukara revised this gist
Apr 10, 2023 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,10 @@ # repo link : https://github.com/ai-forever/Kandinsky-2 # used repo commit hash : a4354c04d5fbd48851866ef7d84ec444d3d50102 # those who getting cuda error # pip uninstall torch # pip3 install torch==1.13.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117 import os import uuid from PIL import Image -
FurkanGozukara revised this gist
Apr 5, 2023 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ # tutorial video link : https://youtu.be/dYt9xJ7dnpU # colab link : https://colab.research.google.com/drive/1xSbu-b-EwYd6GdaFPRVgvXBX_mciZ41e?usp=sharing # repo link : https://github.com/ai-forever/Kandinsky-2 # used repo commit hash : a4354c04d5fbd48851866ef7d84ec444d3d50102 import os import uuid -
FurkanGozukara revised this gist
Apr 5, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # tutorial video link : https://youtu.be/dYt9xJ7dnpU # colab link : https://colab.research.google.com/drive/1xSbu-b-EwYd6GdaFPRVgvXBX_mciZ41e?usp=sharing import os import uuid -
FurkanGozukara revised this gist
Apr 5, 2023 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ # tutorial video link : https://youtu.be/dYt9xJ7dnpU import os import uuid from PIL import Image -
FurkanGozukara revised this gist
Apr 5, 2023 . 1 changed file with 35 additions and 26 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,33 +1,42 @@ import os import uuid from PIL import Image # Set the number of iterations num_iterations = 10 for iteration in range(num_iterations): print(f"Generating images for iteration {iteration + 1}/{num_iterations}...") images = model.generate_text2img( "lion, jungle, cartoon, ultra realistic", num_steps=40, batch_size=1, guidance_scale=4, h=768, w=768, sampler='p_sampler', prior_cf_scale=4, prior_steps="5" ) # path to the folder where the images will be saved folder_path = 'C:/Kandinsky-2/imgs' # generate a unique identifier guid = uuid.uuid4() # loop through all images in the list for i, image in enumerate(images): # create the file name using the GUID, index, and the image file extension file_name = f"{guid}_{i}.png" # display the image display(image) # save the image to the folder with the GUID and index name file_path = os.path.join(folder_path, file_name) image.save(file_path) remaining_iterations = num_iterations - (iteration + 1) print(f"Completed iteration {iteration + 1}/{num_iterations}. {remaining_iterations} iteration(s) remaining.") -
FurkanGozukara revised this gist
Apr 5, 2023 . 1 changed file with 24 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,33 @@ images = model.generate_text2img( "fantastic dreamlike forest", num_steps=30, batch_size=1, guidance_scale=4, h=768, w=768, sampler='p_sampler', prior_cf_scale=4, prior_steps="5" ) import os import uuid from PIL import Image # path to the folder where the images will be saved folder_path = 'C:/Kandinsky-2/imgs' # generate a unique identifier guid = uuid.uuid4() # loop through all images in the list for i, image in enumerate(images): # create the file name using the GUID, index, and the image file extension file_name = f"{guid}_{i}.png" # display the image display(image) # save the image to the folder with the GUID and index name file_path = os.path.join(folder_path, file_name) image.save(file_path) -
FurkanGozukara created this gist
Apr 5, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ 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))