[SUPPORT] - stable-diffusion Advanced


Recommended Posts

There is a small description on docker hub at the bottom of the page (https://hub.docker.com/r/holaflenain/stable-diffusion)


Version 2.0.0 :
Utilize Conda to manage dependencies efficiently.
Prepared for Reactor in Auto1111, SD-Next, and ComfyUI.
More common folders merged in the models folder.
Split install scripts for easier maintenance.
Implemented various fixes.

 

 

 

 

For github I don't know how it works 😅
I'll take a look

  • Like 1
Link to comment

Using TCMalloc: libtcmalloc_minimal.so.4
Python 3.11.6 | packaged by conda-forge | (main, Oct  3 2023, 10:40:35) [GCC 12.3.0]
Version: v1.6.0-2-g4afaaf8a
Commit hash: 4afaaf8a020c1df457bcf7250cb1c7f609699fa7
Installing open_clip

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists...
Building dependency tree...
Reading state information...
11 packages can be upgraded. Run 'apt list --upgradable' to see them.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

 

 

Link to comment

EDIT: Pinning to the 1.5.1 tag made it stop happening so it is definitely an issue in the latest update.

 

Mine stopped working. invokeai just seems to do some reinstall loop then the container stops. Any idea? (I've made no other changes.

 

 

My config is here: siz0lN1.png

 

And here is the last log before the container stops:

XK84ACV.png

Edited by anethema
Link to comment

FaceFusion seems to have stopped working after the latest update.

Deleted the old container and created a new one. Folders are created, but git and python seems to be missing or not in path.

 

Log output:

 

/entry.sh: line 102: git: command not found
/entry.sh: line 104: cd: /opt/stable-diffusion/51-facefusion/facefusion: No such file or directory
/entry.sh: line 105: git: command not found
/entry.sh: line 106: git: command not found
-bash: line 1: python3: command not found
-bash: line 1: venv/bin/activate: No such file or directory
-bash: line 1: eval: --: invalid option
eval: usage: eval [arg ...]
Link to comment
On 11/15/2023 at 7:29 PM, FoxxMD said:

 

This didn't work for me but the comments in that issue were the clue I needed. For anyone else running into memory leaks when using SD.Next:

 

1. Exec into the container and install updated malloc library

 

apt update
apt -y install libgoogle-perftools-dev

 

2. Create the file /mnt/user/appdata/stable-diffusion/04-SD-Next/webui/webui-user.sh and add this contents:

 

export LD_PRELOAD=libtcmalloc.so
echo "libtcmalloc loaded"

 

3. Make the file executable

Open unraid web terminal and run

chmod +x /mnt/user/appdata/stable-diffusion/04-SD-Next/webui/webui-user.sh

 

EDIT: @Holaf can you please add libgoogle-perftools-dev as a dependency in the image?

 

OR add a hook into entry.sh so end-users can run a script as root on container start/creation so these kinds of modifications can be made without needing to modify the docker image.

 

Thanks, this also worked perfectly in Automatic1111.

 

For anyone else having memory leak with --medvram in A1111, follow step 1 and add the export from step 2 in the file: /mnt/user/appdata/stable-diffusion/02-sd-webui/webui/webui-user.sh

 

Step 3 is not required for A1111.

Link to comment
On 11/19/2023 at 11:47 AM, anethema said:

EDIT: Pinning to the 1.5.1 tag made it stop happening so it is definitely an issue in the latest update.

 

Mine stopped working. invokeai just seems to do some reinstall loop then the container stops. Any idea? (I've made no other changes.

 

 

My config is here: siz0lN1.png

 

And here is the last log before the container stops:

XK84ACV.png

This docker fills up the entire default UNRAID space reserved for docker... so you have to either make the default larger than 20Gb, or find a way to make it download the files and access them from local storage (without breaking their app).  Mine is 17% full normally and goes to 100% when trying to install this.  I suspect you have the same issue.

 

 

Link to comment
4 hours ago, Holaf said:

They changed the command name 😵
I will update that before tomorrow.

I also changed the default cache path to a path that's mapped on unraid to prevent filling docker.img
(it will no longer be necessary to add a path like I told you to do)

Thanks buddy!  I tried it with a different option (02) and that worked, thus confirming it was just not pulling the file or running it. 
Downside to scripting... it only does exactly what it is told and doens't know when a dev changes something. 
Thanks again for even taking the time to make, publish, and support everyone with getting it working.

AI is already paying off dividends.  See below. 

00017-1351271622.png

Edited by leptoid
Link to comment
7 hours ago, FoxxMD said:

@Holaf please let me know if I can help with getting the code onto github, or really anywhere. There are many changes for SD.Next that could improve everyone's experience if we could make pull requests. It may also be useful for helping SD.Next get an official docker image working.

I'm working on it, slowly, but it's coming.
I'm learning as I go so it's a bit longer than expected 😵💫

  • Like 1
Link to comment

Appreciate the learning experience but these pain points are pretty painful..if you have time -- everytime i restart the container (not update the image, just restart) using SD.Next is reinstalls everything. image.thumb.png.8432f5c64a37d3b76e9c0725d2cb66b7.png

 

My server is low-power, 10-year 1.7ghz xenon...it takes 15+ minutes to get to a ready state every time I need to restart it due to a server error or just tinkering. It makes iteration extremely slowly and painful. If this is something I can prevent by adjusting SD.Next settings let me know but I have a hunch its due to the way the docker image is setup but I can't verify this since I can't see the Dockerfile!

 

I'd prefer to get my hands dirty and help improve the experience/dockerfile myself since I've got tons of experience here but it feels like my hands are tied right now.

Edited by FoxxMD
Link to comment

Hey,

 

Thanks so much for putting this project together. I'm using it on a Windows box, not even on unraid -- because this is so handy to have so many UIs available in one docker image.

 

I'm also running into the same issue that @FoxxMD is experiencing. Whenever I restart a container, there is a long sequence of installing that needs to occur.

 

Also, specifically with the lama-cleaner UI, I'm noticing that whenever I switch the model from the `lama` model, it downloads the model fine but fails to select it because xformers package is missing:

 

ModuleNotFoundError: Refer to https://github.com/facebookresearch/xformers for more information on how to install xformers

 

Looking at lama-cleaner's Dockerfile https://github.com/Sanster/lama-cleaner/blob/main/docker/GPUDockerfile

I wonder if something like this is missing:

 

RUN pip3 install xformers==0.0.22.post4 --index-url https://download.pytorch.org/whl/cu118

 

Link to comment

I initially installed with Invoke.Ai and things were running pretty smooth. I decided to explore some of the other UIs (5 - ComfyUI in this case).  I edited the config to 05 and applied, but the webui is still coming up invoke.ai.  I also removed the stable diffusion directory and reinstalled, but still not seeing the ComfyUI

Link to comment

Ok, nvm, i cant install anything. Somewhere it hangs every time and i cant figure out why

 

Edit: I got it working again, had to delete everything in appdata except models and output folders and recreated the docker container

Edited by Joly0
Link to comment

Btw, i have found a bug with StableSwarmUI. Using the built-in comfyui the saved images are not in the outputs folder. I have looked through the folder structure of the container, but cant find the image anywhere. So either i am missing something, or there is a bug

 

EDIT: Found the folder, its here "/opt/stable-diffusion/07-StableSwarm/StableSwarmUI/dlbackend/ComfyUI/output" inside the container. I guess there needs to be an additional "ln -s" for that one

Edited by Joly0
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.