Auto Installer Script (.bat) Files For Stable Diffusion XL (SDXL) On Your PC
Added 2023-07-06 14:12:22 +0000 UTCUpdated 19 September 2023 : Fixed gradio and other bugs working perfect
July 8: Now we are using official repo weights. Not anymore leaked weights. You need to accept terms of new repo links (Repo 1 , Repo 2).
Please upvote this reddit thread if possible.
Join discord and tell me your discord username to get a special rank : SECourses Discord
Video tutorial for this post step by step (and 8 GB VRAM settings) : https://youtu.be/__7VNmnn5iU
First accept terms and conditions on both of the below Hugging Face repositories.
You need a free Hugging Face account so get one if you didn't get previously : click here to join
Then get a Hugging Face token for yourself from here
Then download install.bat and run.bat files
If you have 12 GB or lower VRAM having GPU please use run_low_vram.bat
Run install.bat file with double click
After it is finished installation enter inside stable-diffusion-xl-demo folder and edit app2.py file. You can even use notepad but i prefer to use notepad++ for editing. Right click file and click edit
Find access_token and change it to your token
e.g. access_token = "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" //this is a real token you can use
Save the changes then double click and start run.bat. It will start the Gradio interface
Watch the tutorial video for more information. When you first time run it, it will download the necessary weights and model files
Comments
this is too old i dont suggest you to use anymore. use swarmui or forge web ui or automatic1111 web ui. swarmui is amazing here full tutorial : https://youtu.be/HKX8_F1Er_w
Furkan Gözükara
2024-09-05 14:13:30 +0000 UTCafter running run.bat RuntimeError: Failed to import diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl because of the following error (look up to see its traceback): numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
olga shulga
2024-09-05 12:26:43 +0000 UTCHello again you were right. It took me a lot of time to fix but I fixed. please redownload install.bat and install again
Furkan Gözükara
2023-09-19 00:48:44 +0000 UTCyes i can help. what is your python version? also i am installing on my computer to verify it is working or not
Furkan Gözükara
2023-09-18 22:12:40 +0000 UTCHi Sec, I double click to start run.bat then I get this message: Traceback (most recent call last): File "C:\Automatic1111install\auto sdxl\stable-diffusion-xl-demo\app2.py", line 1, in import gradio as gr ModuleNotFoundError: No module named 'gradio' Press any key to continue . . . Can you help with this?
John S
2023-09-18 22:03:59 +0000 UTCand here comfyui tutorial if you prefer that : https://youtu.be/FnMHbhvWUhE
Furkan Gözükara
2023-07-26 22:29:04 +0000 UTCso sorry that i missed your message. now i suggest automatic1111 : https://www.patreon.com/posts/automatic-for-ui-86307255
Furkan Gözükara
2023-07-26 22:28:21 +0000 UTCYes if you have high ram very possible. I think it can be done with diffusers as well I should look for it. But I am pretty sure auto 1111 will get sdxl support very soon
Furkan Gözükara
2023-07-10 11:53:46 +0000 UTCNice! I went with https://github.com/vladmandic/automatic/wiki/Diffusers for now, and swapping models from VRAM to RAM (I have 64gb) makes it a breeze to use SDXL on 12GB VRAM locally. Probably 8 as well.
Mikael Svenson
2023-07-10 10:46:09 +0000 UTCI just posted runpod script. It clones with git large and uses downloaded folder :)
Furkan Gözükara
2023-07-09 23:24:24 +0000 UTCRunpod script posted :)
Furkan Gözükara
2023-07-09 23:23:51 +0000 UTCYep it is next. I will also make hopefully auto installer
Furkan Gözükara
2023-07-08 20:27:45 +0000 UTCLooking forward to runpod script 😍
indievish
2023-07-08 18:32:16 +0000 UTCSure it is totally possible 👍
Furkan Gözükara
2023-07-08 09:33:45 +0000 UTCThank you.. I'll change them a bit as I don't want it on my C drive
Mikael Svenson
2023-07-08 09:31:47 +0000 UTCthey are downloaded into user cache folder. if you remember i deleted it in the video to show you. so they are permanent. it will use them when you run again. you will find inside here : C:\Users\ur_username\.cache\huggingface\hub yes alternatively you can clone and give cloned directory path in the app2.py file
Furkan Gözükara
2023-07-08 09:30:25 +0000 UTCWhen using the bat files, where are the safetensor files downloaded to? Or are they runtime only? Or I create a directory, set the SDXL_MODEL_DIR folder in enviroments, and that optimizes it? I'll clone huggingface repos and change the scripts - should fix it.
Mikael Svenson
2023-07-08 09:17:21 +0000 UTCthanks for letting us know. i think it will get much faster when sdxl 1.0 is released with other optimizations. it is slow due to vram usage i think. so the vram becomes full so it becomes too slow
Furkan Gözükara
2023-07-08 09:15:39 +0000 UTCRefiner step works for me on 12gb, but very slow. Using 11.7/12
Mikael Svenson
2023-07-08 09:13:42 +0000 UTCHello. Sorry for late reply. I just uploaded run_low_vram.bat file. Can you try it please?
Furkan Gözükara
2023-07-08 08:01:39 +0000 UTChello welcome. please use run_low_vram file. just uploaded it. it is for 12gb and below cards.
Furkan Gözükara
2023-07-08 08:00:28 +0000 UTCami gives me this error with 16gb and an rtx 3060
esfera
2023-07-08 05:52:45 +0000 UTCCan you check that if xformers installed? I wonder if that paticular version is removed from wheels or not. I can check tomorrow and update scripts
Furkan Gözükara
2023-07-08 01:17:32 +0000 UTCyep out of memory error. you are running low vram settings right? i just did a test and it used only 8.8 gb vram. it should work with your card.
Furkan Gözükara
2023-07-08 01:12:55 +0000 UTCStill having this error: File "D:\AI\stable-diffusion-xl-demo\app2.py", line 52, in pipe_refiner.to("cuda") File "D:\AI\stable-diffusion-xl-demo\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 681, in to module.to(torch_device, torch_dtype) File "D:\AI\stable-diffusion-xl-demo\venv\lib\site-packages\transformers\modeling_utils.py", line 1902, in to return super().to(*args, **kwargs) File "D:\AI\stable-diffusion-xl-demo\venv\lib\site-packages\torch\nn\modules\module.py", line 1145, in to return self._apply(convert) File "D:\AI\stable-diffusion-xl-demo\venv\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) File "D:\AI\stable-diffusion-xl-demo\venv\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) File "D:\AI\stable-diffusion-xl-demo\venv\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) File "D:\AI\stable-diffusion-xl-demo\venv\lib\site-packages\torch\nn\modules\module.py", line 820, in _apply param_applied = fn(param) File "D:\AI\stable-diffusion-xl-demo\venv\lib\site-packages\torch\nn\modules\module.py", line 1143, in convert return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 122.00 MiB (GPU 0; 12.00 GiB total capacity; 10.99 GiB already allocated; 0 bytes free; 11.18 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF Press any key to continue . . . Looks like an out of memory error? Running an RTX 3080 12Gb Sorry for the long paste
Ralph Guevara
2023-07-08 00:40:52 +0000 UTCGood question. In code we don't have it anywhere. But I don't know if enabled in pipeline. But you can try easily. Don't install it and see if you will get error or not :) and you are welcome
Furkan Gözükara
2023-07-07 23:42:21 +0000 UTCIs the invisible watermark enabled? I see it in the requirements but don't know if it's disabled in code. Thanks for this, BTW.
Daniel Jennings
2023-07-07 23:36:32 +0000 UTCSorry for ther late response, but now im out of work and trying the auto installer. Im getting this Memory Error, not to sure if there is a way to fix it. Here is the error via Github https://gist.github.com/zeuszl1/ea80ac6f35bca0eb0008b559908d7c94
Ralph Guevara
2023-07-07 21:30:47 +0000 UTCAwesome
Furkan Gözükara
2023-07-07 17:37:24 +0000 UTCYep. Triton works only in Linux. It is optimization so a little bit slower but works great
Furkan Gözükara
2023-07-07 17:37:18 +0000 UTCGreat job its working now, thx
Jack Steel
2023-07-07 17:08:44 +0000 UTCJust downloaded the install files, hit run and getting this popup - A matching Triton is not available, some optimizations will not be enabled. Error caught was: No module named 'triton' Is that fine?
Ralph Guevara
2023-07-07 17:04:36 +0000 UTCthanks for bringing into my attention. just updated run.bat file and also repo links. should work perfect now. dont forget to accept terms and set your access token
Furkan Gözükara
2023-07-07 12:47:06 +0000 UTCseems like run.bat is missing. unable to download it now, can you post another link for it?
Ali Rahmoun
2023-07-07 12:34:01 +0000 UTCjust made update. please redownload scripts and make a new install. it should work now
Furkan Gözükara
2023-07-07 09:02:36 +0000 UTCjust made update. please redownload scripts and make a new install. it should work now
Furkan Gözükara
2023-07-07 09:02:31 +0000 UTCcorrect. i am about to fix the error. they deleted the repo we used. i am updating links for a new repo. hopefully in 30 min
Furkan Gözükara
2023-07-07 08:50:48 +0000 UTCmine is hanging on loading model with this instruction: ``` A matching Triton is not available, some optimizations will not be enabled. Error caught was: No module named 'triton' Loading model E:\SDXL 0.9\stable-diffusion-xl-base-0.9 ```
Chad Gauthier
2023-07-07 08:42:21 +0000 UTCI am fixing the urls. It will be up soon.
Furkan Gözükara
2023-07-07 08:13:01 +0000 UTCI have gotten a little farther, I downloaded the non pruned models, and now am getting this, https://imgur.com/a/lz2ygWD
Jack Steel
2023-07-07 05:32:13 +0000 UTChere example screenshot : https://i.imgur.com/M2FlUV7.png
Furkan Gözükara
2023-07-07 00:00:13 +0000 UTCfor example: model_key_base = r"C:\Users\King\Downloads\SDXL 0.9\stable-diffusion-xl-base-0.9" model_key_refiner = r"C:\Users\King\Downloads\SDXL 0.9\stable-diffusion-xl-refiner-0.9"
Furkan Gözükara
2023-07-06 23:59:12 +0000 UTCif you have downloaded all models from torrent yes you can edit app2.py file and make it use that folder.
Furkan Gözükara
2023-07-06 23:58:18 +0000 UTCI was able to grab the models, (using another link|dead now) is there a way to bypass Huggingface checking the site for them?
Jack Steel
2023-07-06 23:36:29 +0000 UTCHello. Hugging face deleted the repo :/ I am working on a solution.
Furkan Gözükara
2023-07-06 23:33:00 +0000 UTCHello. Hugging face deleted the repo :/ I am working on a solution.
Furkan Gözükara
2023-07-06 23:32:57 +0000 UTCA matching Triton is not available, some optimizations will not be enabled. Error caught was: No module named 'triton' Loading model nichijoufan777/stable-diffusion-xl-base-0.9 Couldn't connect to the Hub: 404 Client Error. (Request ID: 90e2dcf0-e285-48bf-a5bf-341de7bbffca)
Jack Steel
2023-07-06 23:31:01 +0000 UTCHello, I am getting the following error when doing run.bat
Jack Steel
2023-07-06 23:31:00 +0000 UTC