How to convert civitai models to ONNX! AMD GPU's on windows can use tons of SD models!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey there home labers and Engineers Fe engineer here so today we're going to take a look at converting different models over to the onnx format and specifically I've had multiple questions about how do I grab a model from say civi and convert it over to onnx that way I can use stable diffusion on my AMD GPU running onnx direct ML and be able to use different models besides ones that are just maybe available from hugging face or ones that were only in the onnx format so let's take a look for anybody who is looking at converting models you may start to think about doing things like running Optimum CLI for from hugging face themselves this is a mistake you might be thinking about oh I found this and it's specifically talking about converting models to onnx nope it's broken don't bother you might also see something called on nx- web from ssube nope I couldn't get that one to work either all of these are a huge mistake and a giant waste of time so let's just do it with what we already have shocker it's all you actually need so in order to go ahead and show people how to get models from civii as well as go ahead and optimize them with onnx I there's this model called elegant entropy I don't know I've never seen it before but it looks pretty good so we'll take a look and we'll we'll download this model and then I'll I'll show folks how to optimize it as soon as it's done downloading once you get your models downloaded open up a folder and go to your stable diffusion web UI direct ml go into the models folder and then go into stable diffuse fusion and from there whatever file you copied just put it right into there and you'll see there's my elegant entropy v14 dosaaf tensor file once your file is in the correct place we're going to go out of there and we're going to open up our stable diffusion inside of stable diffusion here you'll see that I literally just reloaded it we're going to go straight over over to the olive Tab and from Olive we're going to go to this optimize checkpoint and from there we are going to copy the exact name of the file and it is a safe tensors and then we are going to just copy the name in again we are not going to touch anything else and go ahead and hit optimize this process takes quite a while as well as folks should know that it takes a lot of hard drive space temporarily it could take anywhere from 20 to 30 gigabytes of hard drive space while it is optimizing it also takes a metric ton of ram so you may need to ensure that you don't have a ton of things going on so that you have Ram free those along with it will eat your CPU there are times where your CPU will be pegging out near 100 or at 100 so again it is to your benefit to make sure that you have as much ram clear as you possibly can make sure you have a lot of hard drive space free so that it has room to expand and and rewrite and optimize however at once as well as do not have a ton of stuff running on your CPU at the same time if you can help it because any of these problems could cause the optimization to fail the optimization takes about 10 minutes sometimes faster sometimes slower but for those 10 minutes just try to keep everything as free as you can just get up and walk away that's that's what I tend to do while it is optimizing I constantly end up hearing this in in comments there is no GPU for onnx runtime to do optimization even though this presents as an error it is okay the optimizer is actually using your CPU it's not using a GPU anyway so you'll see this error it's not a big deal just continue to sit in wait and be patient once you come back after a while you will hopefully see something that says optimization complete and you'll see down here in stable diffusion optimization complete it took 3 minutes and 28 seconds that seems like a lie seems like it took longer but now inside of here we have have Elegant entropy optimized let's go over to here and we'll type out a prompt and with your new checkpoint all optimized and ready you should now be able to use it from the dropdown I will say that if you take a look this person it's going to be difficult to tell from YouTube since it kind of thrashes all the video but this person looks reasonably clear reasonably clean the image looks non-distorted not overly grainy or anything like that if we generate with dream shaper we see a fairly similar thing the image looks reasonably fine there's some colors nothing is overly grainy you know Reds come out it doesn't look washed out but then if I go over to this one that I just literally optimize this elegant entropy v14 and hit generate you'll notice suddenly it looks grainy a little bit Dotty looks like there's a lot of dots and it looks washed out the the red hair color is much less clear it's much much more washed out and just kind of faded looking I don't know why but I did notice that this elegant entropy v14 seemingly no matter what I do it always gives washed out images uh change Samplers change steps change CFG scale doesn't really matter so I will say that while you should be able to get just about any model that you want doing this including many many many models from civii just be aware that if you start getting washed out look my assumption is is that there is something in the onnx optimization the just isn't always 100% I did grab this animerge v24 from civii and these images look entirely fine so your mileage may vary good luck though I hope this has helped some folks I have gotten quite a few questions about loading models specifically from civii on to onnx and this should get you guys there thanks so much for watching have a great day thank you so much for watching my videos home 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: 5,501
Rating: undefined out of 5
Keywords: AMD, DirectML, ONNX, Civitai, Stable Diffusion, how to, safetensor to ONNX, convert to ONNX
Id: cDrirEtmEqY
Channel Id: undefined
Length: 9min 49sec (589 seconds)
Published: Sat Nov 25 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.