Stable Diffusion Outpainting Colab Tutorial

By | September 14, 2022

In this short Stable Diffusion Tutorial, We’ll see a installation guide and walkthrough of newly released Stable Diffusion Colab Notebook.

Hey friends welcome to one little coder In this table diffusion tutorial we’re Going to see how to do out painting Image out painting using stable Diffusion In this tutorial is not going to have Any technical aspects of it unlike our Previous tutorial this is purely where You can just Run stable diffusion out painting and I’m going to show you how to run that Without any issue we’re not going to get In the technical details so to start With i want to just show you the demo of How it works Right now i’m running it on google Collab i don’t have my own gpu which Means it takes a little bit of time for It to generate image but as you can see There is an image canvas here so i can i Can put the box wherever i want like i Can move the box around I can keep the box somewhere here And after i keep the box somewhere here Now i can say um Birds flying is something that i tried An alien An alien space spaceship And then i can click output now what it Is going to do is it’s going to create An image within that box And it’s going to create in such a way That that image is quite relevant with The color combinations

And that you currently have like it’s It’s almost something that can fit in in The place that you have got and as you Can see um it is kind of um kind of done The same thing like what i can do is i Can again move it um go slightly top And then i can say the same thing um So i can say alien spaceship and it’s Probably going to deform the head of the Robot that i’ve got but the point is Like you can you can you can get the Idea of what is happening here what is Out painting i’ve already got a separate Tutorial explaining how painting using Dali um if you’re interested in or if You have dali access please check it out But otherwise this video is completely Free collab notebook that somebody has Very kindly put together so to quickly Show you Um i think it has been uh it has been Put together by linden i’m not sure if It is the original name but uh i think What they have done is they have Uh out painting using the canvas that is Available on jupyter notebook Um i mean From the jupiter notebook team the coin Start team And they have actually implemented that And then implemented out painting and uh This this is a great job um if you if You really like this work please give a Shout out to the developer um so let’s

Let’s get started with what what do we Have to do so the first thing is you can Go to this this um You can go to this google This project And you can click open and collab And once you click that you will be Taken to the collab notebook and you can You can actually see the demo if you Want and in the demo you can see how Fast it is like you can see what and the Kind of like you can change the prompt And then do this thing so that’s a good Thing so once you click it’s going to Open a google collab notebook and once You open a google collab notebook first Make sure that you connect with the Google collab notebook when you connect Just make sure that your runtime is gpu Runtime that’s the first thing that you Need to do After you do that install all the Required libraries like all these things Would be like folder like this just Install all the libraries then install Uh import required libraries then There is like the hugging face Authentication um this developer is not Giving you model directly so this has Been sourced from hunging base so when You run this then you have to go to The Then you have to go to the hugging face Profile page copy your token um with the

Right access come back here and paste it And that will be done next you need to Set up diffusers this is going to take a Bit of time because it’s going to Download the required models the Diffusers model from hugging this model Up The next setup is where you set up ui um The you the ui part And once you have the ui part uh ready The next thing is you need to set up the The infinite infinite canvas on google Collab you can specify here the canvas Width the canvas height uh what should Be the selection box size uh if you Select 512 what Then there is something if you select 256 Based on the computation that you’ve got Based on the gpu that you have got um You you can make a call about what Should be the size if you want to enable Uh if you want to upload an image then You can take this if you want to start With an image i think like in my case i Started with um with with the prompt in Itself After that right now um there is a Little bit of pillow version problem may It may not be there by the time you Check this project because i’ve already Raised the Github issue um but but for now you can Add this line um and then that would

Solve the problem so i’ll i’ll link the Cop the google column that i’m using in The youtube description um so you can Check it out so finally when you run the Final cell um you would get an empty Canvas so now uh let’s start from Scratch let’s say like um I’ve done something uh and i want to Clear it um so the way like at least Like the way i found out to clear it is I go here and then click run the ui Control Setup the canvas And finally i run the final thing so Then i get an empty canvas so the title Of this is have fun so when i click the Empty canvas now i can actually give um An image prompt that i want i can give Any prompt um i can go to lexica dot art Copy a prompt come back here paste it That is that is one possible option but Also i can also say um an alien Spaceship um And then i can say outpaint And when i say this thing it’s going to Create that image for this particular Box which is in this case is 256 and you Can see it’s resizing the sd output Stable division output to 512 into Whatever that we have selected And uh what is the step size what is the Guidance and all those things so now we Can move this a little bit and uh like Whatever we want to give next we can we

Can actually give so like for example Here i can say um Closet In the space And it’s going to like when i click out Paint um it’s going to try to match What we already have like the colors That are within within this square and Then it’s going to create an image for This prompt and then it’s going to fit In there And like that i can create a bigger Image like for example you can see it’s It’s a it’s quite um Quite similar uh but but I mean like i don’t know why why i have To give this but um Now i can say um An Alien um Sipping coffee I don’t i don’t know if it’s going to Give anything good but again uh the the Way you do out painting is you can Change this you can change the tile the The main tile and then you can start Giving the prompt in based on which You want this image to be filled in and You can see that all these will at the End like very coherent one single image That you would get and together with the Main image that you have given and this This this would also work when you have A theme when you have an idea right now

If you see like i’m completely doing it Randomly because i wanted to make this Video but on the other hand like you can Have a Proper idea how to do it and then that Will help you too so all in all uh this Is a very interesting project Like i said it leverages the infinite Canvas from jupiter and uh just Implements stable diffusion out printing I think this is the first work i’ve seen Um On collab out painting and uh this is This is definitely fun to do so just Just make sure that you give you give New credit to the developer and also Just make sure that you go start the Repository um Yeah so lenient thank you so much for Making this repository making it open Source and also making it google collab Compatible for people like me who do not Have gpu but otherwise this is a this is A very interesting project you can do Your own out painting any questions let Me know in the comment section otherwise Happy stable diffusion

Leave a Reply