SDXL ComfyUI img2img - A simple workflow for image 2 image (img2img) with the SDXL diffusion model

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
trying to kick off your weekend I thought I'd throw a quick video together here on how to do image to image with sdxl if you want to skip ahead a bit because you've seen me do this a thousand times that's fine but I think it's a good practice just kind of see it repeatedly so you understand it but I'm going to move a little bit quickly here so we're going to load in our checkpoint here and pick the base and we're not going to use a refiner on this one I mean you could but I think for just the clarity of of the process I'm not going to worry about it so I've got this here and I obviously need to encode this clip here so let's load those in so I'm just going to type in sdxl and load in louder orders here grab this and just like before we want to convert these to our positive prompts so we'll just convert these to text because I don't want to deal with them so this is going to be a primitive here unless we are positive prompt we're going to use that in both of the areas here and these are both going to be set to Green because I know it's my positive prompt colors and I want to do the exact same thing but I'm going to do it for the negative prompt so I'm just going to make sure I hold down the shift key when I paste and that will allow it to take everything in its connection so there we go we have our positive or negative prompt we're going to use a cyborg picture today so say I'm going to spell the word cyborg correctly and then down in the negative prompt I don't really have a compulsion to put anything so I'm just going to leave it blank okay so here's where we're going to kind of vary what we would do normally so we have our case sampler that we would low in and we would normally use the advanced K sampler but today we're going to use the simple one and we would bring our model in just like we would normally here's our positive our negative prompt and then we would normally have a latent a late noise so let's just let's just hook this up the way we would normally do it so actually you need to add noise latent empty latent here we would do again 1024 because that's what sdxl is good at that's the optimal size of the train size and here's latent so you're with me already we've probably done this graph a few times but we're almost done and then over here we want to be AED code it so we want to turn it back from a latent into a picture so we'll go here and then we can pull this out and do your image okay basic craft now how do we image the image with this really the secret is we're going to instead of pushing an empty latent in we're going to push in a latent that is from an image so there is a an add-on I would recommend you get so in the manager which by the way the manager if you don't have that it's over on civit as well and then if you're on civets and sure over there there's a group of nodes on there called the surfu notes Here so this durfu nodes and you can also just get these over on GitHub if you click on this it'll open it in GitHub and you can see where those are and those are the ones you want to go grab and you're going to install those now what those do is they give you some capabilities for image sizing and that's really kind of the biggest problem you're going to face here because the rest of this is kind of easy so first of all let's bring an image in and to do that we're just going to add a node go to an image and then we're going to load an image and I have one here that I like but I'm gonna grab another one here real quick I have all these women cyborgs that I've created over the months since I've been doing this and this this image is huge uh just you so if we pull this out for example you see it's going to be it's going to be gigantic and that's the the problem is is that these things have all been scaled up because I'd plan to retouch them and finish them and do something with them I just never got around to them so I want to do is I want to play with this image but it's gigantic and that's where those durfu nodes come in here so let's do add node your food nodes and go to modded node image and then this is the one we're looking for is image scale to side it's pretty simple concept it basically says the image you drag in here I'm going to scale the longest side to and 24. so we know that this will now fit into this model otherwise it's going to be several thousand pixels on the long Edge and that's not useful so this will do all the heavy lifting for us and I'm just going to leave the rest of these all set because I don't mind you know it's the longest Edge I really don't care about the upscale method and so on what I want to do is I want to feed this in and I want to put it into this latent well there's a way to do that if you drag this out for the suggested nodes there's a bae in code node so I said what's your Bae well it's this one so I see pretty much the exact opposite of this thing over here where we take the latent and we take a vae and we create an image in this case it's taking an image and a bae and turning it back into a latent well look at that just plug that right in there and then the denoise here is how much of it do you want to keep so it's backwards so 100 means 100 get rid of the image and then a zero percent would mean we want to see exactly the same image so in this case let's say we get rid of um we'll get rid of 35 of the image and the rest of the image will will stay the same so this is a pretty good amount for denoise I think in general so we're going to start there and then let's just see what we end up with and there we go so we could put these down next to each other eight obviously one is much larger than the other one so um pretty similar the detail in the hair the face is better now sdxl is just better at faces and I do like what it did to some of the circuitry here it looks a little bit more form-fitting so yeah I'm satisfactory but we could go ahead and play with this against this the number you're really working with here is this denoise here so if we go yeah this is what I do I kind of get my my interface and so it's kind of what I can see before and after wise and then I'll just play with this thing so let's say we go and we want say 45 right again and I like the speed of this because it doesn't have to reload all those nodes again but it's going to look a little bit different now because we're allowing it to change nearly half of the image go so kind of fun uh being able to take a concept you had and then image to image it and again using the prompt to guide this I'm not looking to perfect this into something that's more usable like I liked so much about this image but it just wasn't good enough and now I have the ability to kind of take that and run with it and again because we are dealing with images that are much larger than we used to have this is a pretty forgiving and we can even take this larger and I'll cover some other things about scaling this in another video but I wanted to give you this quick one for the weekend so you understand how image to image works and again that durfu node Suite is really handy otherwise we have to do some math and math is fine there's math nodes available but realistically that node is just so simple um and I love it why not and of course just like everything else here it's free and open source and it is over on civit as well so if you want to grab them from there or and get anyway and that's what I have for today Everybody Take Care stay safe and have a great weekend
Info
Channel: Scott Detweiler
Views: 46,018
Rating: undefined out of 5
Keywords: midjourney alternative, sdxl, stable difussion, ai art, comfyUI, automatic1111 alternative, stable diffusion, stable diffusion tutorial, comfyui tutorial, sdxl workflow, stable diffusion sdxl, img2img, image 2 image
Id: Zteta2_JvdA
Channel Id: undefined
Length: 7min 39sec (459 seconds)
Published: Sat Jul 29 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.