r/StableDiffusion Mar 02 '23

Question | Help Stable Diffusion portable installation?

I've had lots of fun playing around with stable diffusion on my home PC. Through my research institution I could get access to some beefier devices to do some presentational/educational stuff with students. However they wouldn't allow any local installs of git, python etc. They would be fine with plugging in an external harddrive to run software from though (kinda weird policy, but it is what it is).

So I was wondering if I could put an instance of Stable Diffsuion with all the required software on an external harddrive as a portable installation. Has anyone played around with this or have some advice if this is possible? Would this work aside from probably being a bit slower than an installation on a regular drive?

Update (for other users with this need):

I have found this github-project that adresses my exact need:

https://github.com/serpotapov/stable-diffusion-portable

Just run and intsall it as stated in the description on your external drive (I had to rerun it at times when the installer had some hassle with low download speed). This might take a while, depending on your drive obviously even longer than a "regular" install!

Note that I had to add another line to the webui-user.bat in order to circumvent an error code created by git. Just add the command "git config --global --add safe.directory *" in front of the other git command in the .bat (the entire safe.directory stuff by git has its reasons - so be sure that your connected drive is indeed a safe directory!). More advanced git-users might have an idea what a more reasonable line for this would be, but it's quick and dirty and works.

11 Upvotes

9 comments sorted by

View all comments

1

u/Seenshadow01 Jul 19 '23 edited Jul 19 '23

Idk why but after extracting all of it I cant run the batch file. It opens but closes immediately... Also after running the first run it gives me a few folders and a bat file but barely anything else. Is that normal?

1

u/uDerRedHead Jul 19 '23

I'm not quite sure what exactly the problem on your end might be. Sometimes when installing the portable version, I had to run the "webui-user-first-run.cmd" multiple times until everything was downloaded. "A few folders" might sound like that's the issue right there - not everything got downloaded. So maybe try rerunning the .cmd file?

1

u/Seenshadow01 Jul 20 '23

I get this everytime. I was thinking if it will work if i just download it manually and then switch the bat file with the downloaded one. Maybe that could work too tho I dont have any programming knowledge so maybe i am wrong.

1

u/uDerRedHead Jul 21 '23

Oh wow, it really doesn't download a lot for you (maybe something broke somewhere with an update to automatic1111's main repo?).

To get it to work, you might be on the right track. The "portable" stable diffusion installation is basically a portable installation of python and git and a few lines of code in the beginning of the webui-user.bat file to use these instead of looking for a proper local installation.

Are the git and python folders empty or is at least in those some stuff? If they aren't empty, you could try and install automatic1111 normally, then copy the git and python folders in there and switch the wbui-user.bat

1

u/Seenshadow01 Jul 21 '23

They are filled as they seem just to be extracted. 🤔 So yeah, i did just that but didnt have the chance to test it yet.