StableSwarmUI
StableSwarmUI copied to clipboard
Docker woes, and some workarounds in lieu of PR
hi, i really wanna believe in the swarm! and docker, because sheesh i don't want everyone's FOSS all over my main system. so, i'm on my only Windows box, which has WSL and Docker Desktop, and i hacked the container into life (but it took many frustrating hours - how was i to know that Git automatically adds carriage returns to shell scripts??? given i'm a Git noob, i'm not messing with how to use version control and PRs and all, sorry not sorry)
anyway, here are things that i did to get it to work, maybe these can help someone else, or be added to the main package:
-
BEFORE
git clone
this repo, i needed to rungit config --global core.autocrlf false
. this was because in my case, all the .sh files in the Docker image were altered by Git clone process, and the whole setup got messed up and the server wouldn't run - the
launch-docker.sh
of course assumes you're running in a Linux env, so i simply copied the contents and ran them in Powershell (maybe include a .bat file for Windows Docker users?) - adding ComfyUI Manager failed because it needed CV2, which gets installed by
src/BuiltinExtensions/ComfyUIBackend/ComfyUISelfStartBackend.cs
at line 190 which itself was missing some dependency. i tried a lot of things and learned a lot about Docker along the way, ultimately per some chitchat here, i learned about "installingopencv-python-headless
python dependency instead ofopencv-python
. That includes a precompiled binary wheel with no external dependencies (other than numpy), and is intended for headless environments like Docker. This saved almost 700mb in my docker image compared with using thepython3-opencv
Debian package (with all its dependencies)." - i did this the hard way (editing the file from inside the container), but perhaps this could be worked into a future release. it worked and now manager shows up in the UI change this:await install("opencv_python", "opencv-python");
to this:await install("opencv_python", "opencv-python-headless");
- i think i did something along the way while wrenching all this, don't know how to undo - there are 2 instances of comfy UI self start backends. every time i delete the 2nd one, when restarting the server it shows up again. i'm sure this is a waste of resources, and probably just a digit in a yaml somewhere, but i can't find it...
- WSL Fs up all the mounts, i don't know what to do. it's really hard to get to them, but i found this article which looks like a whole saturday so i'll get to it after a trip to Jamaica this week lawdamercy...
just for you-know-whats and giggles i saved my adjustments from the container back to the image so i don't need to repeat things later maybe - docker commit container_name stableswarmui
(i don't know if this saves my lost volumes and mounts into the image?)