IrisRainbowNeko / DreamArtist-sd-webui-extension

DreamArtist for Stable-Diffusion-webui extension
Apache License 2.0
690 stars 52 forks source link

VRAM usage? #14

Open dogarrowtype opened 1 year ago

dogarrowtype commented 1 year ago

Hello, I was just wondering how much VRAM this takes to train? I got it working, but I quickly ran out of VRAM on my RTX 2070S (only 8gb).

78Alpha commented 1 year ago

Been training with 6.4 GB VRAM for 2 days, RTX 3070 8 GB, no issues

PapaBones commented 1 year ago

Been training with 6.4 GB VRAM for 2 days, RTX 3070 8 GB, no issues

What kind of settings did you use to make it run? 3070 TI here and it's telling me it has got not enough vram.

sw882882 commented 1 year ago

i have been able to run it with 7~ gigs of usage with 384x384 without reconstruction. 448 sort of works but it runs out of memory every hour or so. (I am running with xformers and medvram, so that may help, though might be slightly worse results)

78Alpha commented 1 year ago

Aside from the train with Dream checkmark, I have it set to use xformers. 512x512, the rest is on default since there is no info on it.

Sazoji commented 1 year ago

Aside from the train with Dream checkmark

300px-Two-handed_facepalm

without reconstruction and 448p can start training, but I'm not getting any spectacular results, will try that --medvram and see if I can get reconstruction enabled

PapaBones commented 1 year ago

I can make it run with 384 but that gives poor results, anything higher and even with xformers and medvram I can't make it run. What's the general steps people use to get any good results?

IrisRainbowNeko commented 1 year ago

I can make it run with 384 but that gives poor results, anything higher and even with xformers and medvram I can't make it run. What's the general steps people use to get any good results?

https://github.com/7eu7d7/DreamArtist-sd-webui-extension#pre-trained-embeddings, here are the recommended parameters.

If you not check Read parameters (prompt, etc...) from txt2img tab when making previews and give text in text2img tab, the preview is useless, due to the absence of negative embedding. But the final trained embedding is usable.

henryvii99 commented 1 year ago

Strangely enough if I uncheck "train with Dream Artist" then I can get the code working, otherwise I will get out of memory error. (I am using an 2060)

If I am not training with Dream Artist then what am I doing?

Also, I will get out of memory error if I am using train with Dream Artist, no matter how small the img size I use (even 128 x 128 will get an error, edit: ok with 64x64, is there a way to fix it?

If I run the addon by disabling train by Dream Artist I will get the error instead. UnboundLocalError: local variable 'embedding_neg' referenced before assignment

============================================================== Edit on 23:09 Looks like if I reduce every parameter (64x64, 1500steps, all other parameters default), I can train an embedding And it can make an impact when I use the prompt for txt2img, so it works, but not functional right now

mekrod commented 1 year ago

Strangely enough if I uncheck "train with Dream Artist" then I can get the code working, otherwise I will get out of memory error. (I am using an 2060)

If I am not training with Dream Artist then what am I doing?

Also, I will get out of memory error if I am using train with Dream Artist, no matter how small the img size I use (even 128 x 128 will get an error, edit: ok with 64x64, is there a way to fix it?

If I run the addon by disabling train by Dream Artist I will get the error instead. UnboundLocalError: local variable 'embedding_neg' referenced before assignment

============================================================== Edit on 23:09 Looks like if I reduce every parameter (64x64, 1500steps, all other parameters default), I can train an embedding And it can make an impact when I use the prompt for txt2img, so it works, but not functional right now

you need more vram 6gb is not enough, this needs cards with 8gb +, 12gb or more for training 512x512. 78Alpha claims seems fake (or idk what he is doing), i mean this is using like 10.8 gb (11.1 total use with windows) of vram without reconstruction on 512x512 default settings using xformers.

henryvii99 commented 1 year ago

Strangely enough if I uncheck "train with Dream Artist" then I can get the code working, otherwise I will get out of memory error. (I am using an 2060) If I am not training with Dream Artist then what am I doing? Also, I will get out of memory error if I am using train with Dream Artist, no matter how small the img size I use (even 128 x 128 will get an error, edit: ok with 64x64, is there a way to fix it? If I run the addon by disabling train by Dream Artist I will get the error instead. UnboundLocalError: local variable 'embedding_neg' referenced before assignment ============================================================== Edit on 23:09 Looks like if I reduce every parameter (64x64, 1500steps, all other parameters default), I can train an embedding And it can make an impact when I use the prompt for txt2img, so it works, but not functional right now

you need more vram 6gb is not enough, this needs cards with 8gb +, 12gb or more for training 512x512. 78Alpha claims seems fake (or idk what he is doing), i mean this is using like 10.8 gb (11.1 total use with windows) of vram without reconstruction on 512x512 default settings using xformers.

Thanks for your reply...I am now messing with the controls, seems I can get it running on 256x256 on my crappy card. So it should be function as intended, now I need to know how to use the embedding produced properly with a bit of trial and error.

BTW the embeddings generated from 1 image is just 10+19KB, is that supposed to be that small file size?

Sazoji commented 1 year ago

(this is after the rectangular support update) On my 3070 I don't get OOM (without reconstruction, but DA enabled) with 448x512 for single-image training, indefinitely as long as I'm not running anything else on the GPU (video, browsing), but 384x512(or some res similar, precropped from my TI training sets) can run multiple images in DreamArtist. I'm not getting anything near the reconstruction-based results in the repo, but if you adjust the prompt sizes and trainings to be similar to normal textual inversion training, you can see improvement upon normal TI, even with the cropped image datasets.

sw882882 commented 1 year ago

Yea I seem to get around what sazoji is getting with his 3070 on my 3050 (though prob slower), i can do 448x512 with a few images. I am running it with ssh so I can squeeze every byte of ram out of the card. I can't get reconstruction working with 384x384, and below that Its probably not worth it and I have yet to try. The results do seem to be better than normal TI, definitely faster at least and does it with less data (mostly usable at around 3000, only a couple of images), though not as impressive as the results in the readme. (I am running with xformers and medvram)

78Alpha commented 1 year ago

part1 Part2 part3

This is everything I have for the settings on DreamArtist. The standard Unload VAE, and new Xformers for training applied. It seems to just work like normal Textual Inversion, results are about the same.

Everyone seems to claim different things though. Some 3090 users are training 8000 steps in 2.5 hours, but mine is at 1 hour for the same, however, my system randomly locks up anytime I do training. It is like the DeepSpeed situation on Dreambooth. Some people can run it below the minimum requirements, but others with the exact same setup can't. For all I know I have an older version of the extension that isn't as hungry or just may not have a leak.

NaughtDZ commented 1 year ago

I can use the RTX3070 8G graphics card to train 512 * 512 ordinary embedding normally, but I can't train on this extension.