How to move the image generation AI 'Stable Diffusion' with Google Colaboratory and save the image to Google Drive
The image generation AI ``
Stable Diffusion with ???? Diffusers
https://huggingface.co/blog/stable_diffusion
The procedure for running Stable Diffusion on Google Colaboratory is summarized in detail in the following article.
Summary of how to use image generation AI ``Stable Diffusion'' even on low-spec PCs for free and without waiting time - GIGAZINE
First, look at the above article and enter ' pipe.to('cuda') ' to proceed to the point where Stable Diffusion is ready.
Next, mount Google Drive. Click the folder icon on the left, then click the Google Drive icon.
The command to mount Google Drive is automatically entered, so click the play icon to execute it.
You will be asked if you want to allow this notebook to access Google Drive files, so click 'Connect to Google Drive'.
Since the login screen pops up, select an account.
Access to your Google Drive account will be requested, so click 'Allow'.
Then, in the notebook of Google Colaboratory, 'drive/MyDrive' is displayed in the file column in the left column.
This time, I created a folder called 'AI Image' in Google Drive as a folder for saving images generated by Stable Diffusion.
This time, specify the created 'AI Image' as the output destination. The commands are as follows.
[code] import os
os.chdir('/content/drive/MyDrive/AI Image')[/code]
Enter the command in your notebook and click the play icon. Now you are ready.
After that, enter the character string and generate the image. The character string this time is 'cat eat ramen midnight at stall, in Renoir style, perfect lighting' and will be output as 'cat.png'.
When I looked at 'AI Image' in Google Drive after the output was finished, the output 'cat.png' was saved.
The output image is below. I had a Renoir -style drawing of a cat eating ramen. The cat is drawn in a relatively good way, but the cat is supposed to be the side that eats ramen, but for some reason it is the side that can be eaten as a ramen ingredient, resulting in a somewhat bizarre result.
Related Posts:
in Review, Web Service, Art, Posted by log1i_yk