AI Image In-Painting with OpenAI DALL-E - DALL-E Tips and Tricks #3 #dalle2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey friends welcome to one little coder in this open ai dahle tutorial i'm going to talk to you about a new image filling technique that you can do with open ai dali image filling is a process in which you can create a mask around the image and then fill that image fill that mask the masked space with something typically you would do it using an image editing tool like photoshop and then it might take a lot of hours for the graphic designer to do it but we are going to use the help of ai and then we have to do this thing so what i'm going to do now is i'm going to take this image that looks like this and then i'm going to create something that looks like this as you can see all these elements that you see around the puppy does not exist all these elements around the puppy all these elements around the puppy do not exist in the original image but you can see that this exists in the image that that that we have created with dali so how are we going to do image filling is what this video is going to teach you the potential is really good we are going to see a couple of examples but for now i'm going to show you exactly the same image and how to get this kind of output the first step is we need an image for that so as you can see i already have an image so first i'm going to copy the url of the image next i'm going to go to a service called photo pr.com put a p i think p photo p maybe photo p i don't know photo p dot com and go and then say open more file open more and then say open from url so i want to open the image from the url paste the image i'm going to say click paste it under new project okay so at this point you can see that the entire image is open so also a note if you already have a tool like photoshop you don't have to use photo p but because i want to keep everything browser based i'm using a photo browser based photo editing tool but the principles are same you can basically use any tool that you want whether it is on your machine or with this on the web now after you have this image now we have to create a mask area image mask which we want to ask the a to fill in so how do we create that so first thing is you need to select the image and then edit it and then click transform and then click scale at this point you would see the small squares at every corner that would help you transform this image in this case which is scaling it down so at this point you can keep the image wherever you want you can ask the a based on it i would like to keep this in the middle and then see what's going to happen so the next thing is you need to export the image this is an important part for you to note for your image masking to work fine with open a you have to you have to export this image as a png you can try with jpeg but sometimes the result that you get from open ai could be gibberish if you use jpeg so i would strongly encourage you to try png but also you know it doesn't cost you to try jpeg as well so at this point i've selected export this image as a png and then saving just just as you know that this is like this entire thing is the image but the content that we see is just here i'm going to click save it at this point and it is going to save the image i can give a name puppy small and the next thing is i'm going to go to open ai and i'm going to click the icon the main icon then it's going to take you to the landing page once you reach the landing page next you have to click upload image once you click upload image it's going to open this new window where you have to select the image in itself so select the puppy small which is a png based file png file and then select the area in our case we want the entire area to be filled so i'm not cropping it any further so the next thing is once you have the image you can click for variations you will see what variations do but for now we need to click edit images because that's exactly what we want to do at this point the ai might not know the places where you have to edit so it's always good to you know just mark some kind of information to say that the ai has to fill the space so now we have got a full-size image and then we have got a puppy in the middle and then we have just marked the space where the ai has to fill in now how do you make or how do you tell this ai to do as you all know if you have seen my previous videos that's what we call a prompt so now i can use a simple prompt and say fill so i am i'm basically asking open ai dali's prompt engine to fill in this spaces which i just marked let us see if it works out fine if it works out fine then we are going to try out new more options let me close zoom in a little bit and then wait for the result as you can see it takes a couple of seconds i'm not editing this seconds time is the time that goes on so you know what's actually happening so now as you know that this is our original image where the image is in the middle but the rest of the space is was empty so the image has been filled like this image has been filled like this imagine a spin fill like this like this like this like this so i think we have done a very good job just basically filling in the space but what if we have specific requirements on how the image has to be filled so i'm going to say fill in with cubes let's see and then click generate so now what i'm expecting is that i am expecting the dog to be in the middle the puppy to be in the middle i'm expecting some few lips around the rest of the area and let's see how it looks um if if the tulips look fine if all the images look fine or what is going to happen so this is indeed a powerful technique for you to edit any image using ai so as you can see we have got some image that is gibberish for example i don't consider this to be a really good image but this is definitely a good image you can actually feel some sort of depth of field like a dslr photo this is good as well this is definitely good as well and this is definitely good as well so at this point we have got the copy and the images quite well so maybe we can give certain more details like for example a single kitten running running along okay let's see if dali can understand what we mean so what i have in my mind is my prompt skills are so terrible but what i have in my mind is i want another kitten to run alongside with this puppy but let's see if it is going to happen like i said my prompting skills are so terrible and it's possible that the ai system could not understand what i mean um okay yes indeed it couldn't understand okay i can say fill it with a single kitten running along now let's see if it is going to change anything but you can actually see already that the images look different the images that you are seeing on the screen has already some sort of changes either the team itself has ran the image or you can see that um you you can see that you know there are certain variations in when dali even creates based on the prompt okay so now once again we have got terrible results so i would say this attempt is a little failure fill it with balloons are just flavors let's see just flavors and then see what happens if it works fine then we're going to move on to the next next part of this video where we're going to take a different image and then we're going to ask dali to complete it for us while this image is being generated we can go to image search and then we can say a cathedral and then get the picture of a cathedral where which one is this this this this this okay this looks good right this looks good what i'm going to do is i'm going to copy this image same thing like i'm going to click the image copy the picture go back here click open from url paste it click new project okay and then the image is being loaded it's quite a big image so now we need to transform select everything edit transform scale and then you can completely scale it this side so now instead of keeping the image in the middle i'm actually keeping the image in the side and then i'm going to expect dali to fill in this place okay so now i'm going to save export the image as a png file okay save cathedral png okay so we have got the input image let's go see what happened to the one that we already gave and it it has really turned out well so the flavors are there so you know like these things could be always ignored flavors are there it has really good depth of field as well i would say i would encourage it so we have got some pretty decent image so now what we are going to do now is we are going to select our new option the cathedral and then see can i use the cathedral and then select so at this point as you can see you cannot um you cannot just use the image as it is because there are some resolution issues so i'm going to keep it like this so that i have got some part from here somewhere at the top somewhere left now i'm going to click edit image once i click edit image i'm going to just again say fill and then see oh after erase after sorry i have to mark the area that i want to fill in which i forgot to mark so i'm going to click generate after i type and fill so ideally i'm expecting again it to feel um quite decent but let us see if it works fine because you know sometimes it's very easy for ml models to identify an object like a puppy and then create areas around it where it has to fill in the mask but but uh it's it's not the case with them okay so this is oh this is a little ridiculous right so it's not filling in properly so what we can say is fill in with lush green meadow and then see what's going to happen so the simple fill did not work out fine started adding text that is gibberish and as you all know dali has a history of not handling text well which was very well explained in the recent paper from google about party party i think party where they said like as you scale the size of the model the text becomes better and in the smaller one it didn't this is the image it it this this looks good like it it almost looks natural to me this this looks better i mean um you have to really notice to make sure that this part was not real so otherwise i think this is good this is good as well i would say this is this is like a dense forest this is good as well so we have got some decent options fill in with lush green meadow and fill in with lush green meadow where a red tesla is parked and generate let's see if it can actually place a car properly in this place where we have asked it to mask um but as you already know that only a certain part of the image has been asked to mask like fill in the mask so it's possible that the red tesla might not be placed properly but i still want to explore if it can places the tesla car and itself okay this is the original image you've got a tesla there um that's that's funny actually the tesla looks broken to me you've got a tesla um i'm not sure if it gets confused between tesla and spacex because maybe it's somehow related to elon musk that's that's my weird assumption but you you can see that there is there is a there is a tesla trying to be there so the next thing that we can try is we can say fill in with a three apple tree fill in with an apple tree where okay just apple tree and then see if it actually shows apple apple over there that's that's another thing that i wanted to try so the overall concept if you see it is taking an image and making that image a part of another bigger image more like in in what we speak like you're making an image a subset of another image and while you don't want to fill this the main area manually you're asking dali to do it so this has turned out to be a terrible prompt because it's literally drawing that will see over there so but the previous one was really good i think the the pillion the part was good natural and i could actually see um how this is happening once again what we have done is we have taken um like slightly a landscape image but i would really love to experiment the same thing with different kinds of image to understand the depth or the potential that this kind of feature it has got i assume that this would be extremely helpful in graphic designing where you take an image and then you have to superimpose that image on another image now as a graphic designer you might have to find a good image where you could superimpose the original smaller image but i find that with this with this feature in dali you don't have to literally find the second image but you're asking ai artificial intelligence system um i mean everybody calls it a otherwise i would probably call it image generation system to fill in the blank space for you and i think really it's a it has done a wonderful job if you have any questions let me know in the comment section otherwise happy coding stay safe
Info
Channel: 1littlecoder
Views: 11,336
Rating: undefined out of 5
Keywords:
Id: ifzNkc6BBi4
Channel Id: undefined
Length: 15min 8sec (908 seconds)
Published: Fri Jun 24 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.