March 2024 - Stable Diffusion with AMD on windows -- use zluda ;)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey there home labbers and Engineers Fe engineer here so uh today we're going to do something pretty interesting we're going to make an AMD card work like an Nvidia card and we're going to do it for stable diffusion all right let's go so okay this is going to be a bit complicated so make sure that you bear with me and pay attention number one since we are using windows but since rockim doesn't support all of the uh AI libraries we are going to need to install Rockham for Windows unlike Linux this does not end up being 20 gigs this ends up being like one gig so it doesn't take very long I would recommend that folks just simply download the installer and then launch it and follow along uh there aren't very many options um I think I just did a full install it really did not have a lot to it and it should be pretty straightforward but come over to the AMD page there will be a link at the bottom of the video and go through the hip SDK installer for Windows so okay step one done we got hip SDK and so we have sort of rock them on Windows great the next thing that you are going to do is come here and from igy Tire make sure you grab this zuda do zip and all you need to do is take it and unzip it into a folder you should probably name this folder zuda or something like that but effectively just unzip this ZIP file when you download it put it somewhere and then you should be good next make sure that you download get for Windows most people probably already have this but effectively this get for Windows just hit download follow through the prompts download that and the last of the things that you will need is Python and in case anybody is curious I am using python 3106 in order to find the specific version of python you can effectively just uh look up python downloads and I will have a link to this page and then you look for a specific release if you are doing 3106 go ahead just hit download when you do download and install it there will be a little box that says add to path you want to make sure that box is checked now that we have most of the requirements out of the way you are going to go to your search bar on Windows and you want to type in EnV there's going to be an option that comes up to that says edit the system environment variables and when you click on it it will bring up something like this and then you will click on environment variables and then down here under system variables you are going to find the variable called path and then you will hit edit in inside of there you are going to add two entries one is this hip path bin and it will look exactly like this and I will have effectively the text that you need in the video description and then you will also add the spot where you put your zuda files and all you need to do is hit new and then a effectively wherever you put your zuda files click up here in the bar copy that and just effectively paste it in there once you do that hit okay hit okay hit okay and it should now be added to path if you have any problems with this you can always restart your machine in the off chance that for some reason it is not being picked up as being added to path but that should be all you need to do with that for now and with that we are going to get clone and then the L shiggy tiger stable diffusion web UI direct ml go ahead hit enter from inside of here we are just going to run web ui. bat and this will will take a minute so I will skip forward for you okay now that it finished installing and did all of its things okay great so now it has done a few things that we needed it to do and you can just shut that down for the moment now we are going to go into our files and let's look inside of zuda test inside of this YouTube one and inside of stable diffusion web UI directml the easiest thing that's going to be to do is go ahead and get a second file explorer and what we're going to do here if this will behave is we're we going to come back to stable diffusion test zuda these are our zuda files and this is the stable diffusion webui direct ml what we need to do now is come over to now we're going to give automatic 1111 some of our specials the Luda FES we're going to open up ven lib site packages come all the way down to torch and if folks are curious right now the torch that gets installed is 2.2.0 c118 so in the future since this video will likely still be up if it downloads a different one and you have problems you may want to install this torch specifically but we'll open up torch we will go [Music] to lib and inside of here you will see a bunch of files specifically we want to take this kuas dll and copy it over and we want to take cusp par. dll and copy that over and then what we need to do is take the kuas 6411 go ahead and trash that and cus parse 6411 trash that and then take these ones that we just moved over and we are going to effectively rename them so now we have a kuas 64 111 and now we have a cus parse 64 11 great that's what we needed to do we can close these out now we should have all the things that we really need and with that we can just webui dobat D- - zuda so it started up without any problems and you'll see we have a safe tensors and we're just going to render an image of a girl on a bike fair warning the very first run with zuda can be horrendously slow so I am going to hit that you will see nothing happening at all nothing and that's okay this will probably take 10 15 or 20 minutes it may even take longer even though nothing is happening just let it go just walk away go do something else for a little while and that's literally what I'm going to do so okay so you see I got 10 12 14 iterations per second not too bad second run 13 12 13 iterations per second no big deal and this is using a safe tensors file remember this isn't using onnx or anything and those aren't too bad but let's do some interesting things I am going to actually open up my models and these are the models inside of that YouTube one that I just did and I happen to have some models over here that I can copy over so okay so I have a stable diffusion XEL model and a normal stable diffusion 1.5 model okay great let's reload our models okay this animerge this is just a random model that for some reason I have and I never got rid of it hit generate on that model same thing 10 11 14 iterations per second great and it generated a picture no big deal okay let's try an a stable diffusion XL model this was notoriously difficult to get running on windows with with automatic 1111 before okay so we have an Excel model now generate and of course Excel models are always more difficult wonderful it generated an image looks fine um let's generate a different image though so you'll see that it's working and it's running stable diffusion XEL so that's interesting a house in the woods aable and again this is still using stable diffusion XEL this is a good picture so if people remember before onnx and Olive were great for some performance optimizations but man it really kind of cut down on some things questions I always got how do I get DPM Plus+ 2m Caris well guess what you've got it along with all of the other Samplers of course all the normal things that you can do and then the other thing is people got very unhappy about not having in painting so great let's take a look at that we're just going to bump this scale way up so I'm going to cut out this tree all right okay you'll see I cut this tree out and I'm not going to change my prompt or anything like that just going to hit generate and while it still did end up putting a tree back in there you'll see it definitely changed the tree and unlike previous iterations with onnx and things like that where the whole image would end up changing this is now inpainting properly and it's because we aren't using anything crazy we're just using zuda which is basically mimicking a Cuda on our AMD how cool is that I think that's it folks this should uh this should wrap it up this is how you use automatic 1111 in windows with an AMD card and get all of the benefits effectively of running an Nvidia card and overall running stable diffusion XL on my 7900 XTX I'm still able to get five six iterations per second obviously my performance is slightly lower than it was with onnx but but for being able to do this on Windows this is fantastic and now a handful of honorable mentions for things that depending on how stuff works you might need to do you might need to go and update one of the files so let's take a look at doing that if you get an error talking about some sort of cudnn status internal error that is when you will want to turn this off depending on your graphics card you'll see I have the 7900 XTX you'll see I get two green check marks some folks may not get two green check marks and most of them are the radon 6000 series if you do not have two green check marks then you will actually need to move some more files around if your graphics card does not have two green check marks and instead the hip SDK column doesn't show up correctly and has the red X then you will need to follow these instructions and you will need to go to your where the hip SDK is installed go into the Rock blast directory you're going to find something inside of there called Library you're going to rename it you're going to download the files from this ZIP open up that zip and then drop the library from that zip into that rock blast where you took the library and renamed it and then you will need to reboot your PC and that's it folks this may not be Rock them on Windows which is honestly what I was really thinking was going to be the next things coming up but this allows you to use your AMD card as an Nvidia card which is pretty interesting so hope you guys have a good time thanks so much for watching have a great day thank you so much for watching my videos H labbers and Engineers I create and edit all these videos on my own so any likes and subscribes will massively help out the channel and allow me to continue creating content to help people if you got value out of this please consider liking and subscribing to the channel to be notified when new content drops if there's something I've not covered but you would like to see a video on it please leave a comment down below and again a massive thank you to everyone I hope you have a great day
Info
Channel: FE-Engineer
Views: 35,075
Rating: undefined out of 5
Keywords: AI, SD, Automatic1111, Stable Diffusion, Windows, AMD, Zluda
Id: n8RhNoAenvM
Channel Id: undefined
Length: 16min 37sec (997 seconds)
Published: Tue Mar 05 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.