Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taking up 16 GB of Ram on startup - automatically renders maybe? #654

Closed
hackthedev opened this issue Feb 8, 2024 · 5 comments
Closed
Labels
awaiting-response Waiting for the issuer to respond bug Something isn't working Stale

Comments

@hackthedev
Copy link

Has this issue been opened before?

Describe the bug

When i run docker desktop everything is fine but when i start stable diffusion with the following command after it displays the "Running on local url" text it starts to create a model or something and it gets stuck there taking up all my ram.

I used it for about a week without changing it and now all of the sudden i have this issue and because of this it keeps crashing making it useless.

How i start stable diffusion:
docker compose --profile auto up --build

Which UI
Auto

Hardware / Software

  • OS: Windows 10
  • OS version: 22H2
  • WSL version (if applicable): 2
  • Docker Version: 24.0.7
  • Docker compose version: v2.23.3-desktop.2
  • Repo version: ig from master
  • RAM: 32 GB Ram
  • GPU/VRAM: NVidia RTX 3080 GameRock Edition (10 or 12 GB)

Steps to Reproduce

  1. Start Docker Desktop
  2. Start Stable Diffusion with command above
  3. Look Ram usage go up to 16 GB without doing anything

Additional context

[+] Building 1.7s (25/25) FINISHED                                                                       docker:default
 => [auto internal] load build definition from Dockerfile                                                          0.0s
 => => transferring dockerfile: 2.93kB                                                                             0.0s
 => [auto internal] load .dockerignore                                                                             0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [auto internal] load metadata for docker.io/pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime                      1.6s
 => [auto internal] load metadata for docker.io/alpine/git:2.36.2                                                  1.6s
 => [auto download 1/8] FROM docker.io/alpine/git:2.36.2@sha256:ec491c893597b68c92b88023827faa771772cfd5e106b76c7  0.0s
 => [auto internal] load build context                                                                             0.0s
 => => transferring context: 122B                                                                                  0.0s
 => [auto stage-1  1/12] FROM docker.io/pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime@sha256:3387e598cb94fc248d82  0.0s
 => CACHED [auto stage-1  2/12] RUN --mount=type=cache,target=/var/cache/apt   apt-get update &&   apt-get instal  0.0s
 => CACHED [auto stage-1  3/12] RUN --mount=type=cache,target=/root/.cache/pip   git clone https://github.com/AUT  0.0s
 => CACHED [auto download 2/8] COPY clone.sh /clone.sh                                                             0.0s
 => CACHED [auto download 3/8] RUN . /clone.sh stable-diffusion-stability-ai https://github.com/Stability-AI/stab  0.0s
 => CACHED [auto download 4/8] RUN . /clone.sh CodeFormer https://github.com/sczhou/CodeFormer.git c5b4593074ba62  0.0s
 => CACHED [auto download 5/8] RUN . /clone.sh BLIP https://github.com/salesforce/BLIP.git 48211a1594f1321b00f14c  0.0s
 => CACHED [auto download 6/8] RUN . /clone.sh k-diffusion https://github.com/crowsonkb/k-diffusion.git ab527a9a6  0.0s
 => CACHED [auto download 7/8] RUN . /clone.sh clip-interrogator https://github.com/pharmapsychotic/clip-interrog  0.0s
 => CACHED [auto download 8/8] RUN . /clone.sh generative-models https://github.com/Stability-AI/generative-model  0.0s
 => CACHED [auto stage-1  4/12] COPY --from=download /repositories/ /stable-diffusion-webui/repositories/          0.0s
 => CACHED [auto stage-1  5/12] RUN mkdir /stable-diffusion-webui/interrogate && cp /stable-diffusion-webui/repos  0.0s
 => CACHED [auto stage-1  6/12] RUN --mount=type=cache,target=/root/.cache/pip   pip install -r /stable-diffusion  0.0s
 => CACHED [auto stage-1  7/12] RUN --mount=type=cache,target=/root/.cache/pip   pip install pyngrok xformers   g  0.0s
 => CACHED [auto stage-1  8/12] RUN apt-get -y install libgoogle-perftools-dev && apt-get clean                    0.0s
 => CACHED [auto stage-1  9/12] COPY . /docker                                                                     0.0s
 => CACHED [auto stage-1 10/12] RUN   sed -i 's/in_app_dir = .*/in_app_dir = True/g' /opt/conda/lib/python3.10/si  0.0s
 => CACHED [auto stage-1 11/12] WORKDIR /stable-diffusion-webui                                                    0.0s
 => [auto] exporting to image                                                                                      0.0s
 => => exporting layers                                                                                            0.0s
 => => writing image sha256:a2c468a04f247b600cd8663156e94d0f2fd7b268d426abdf856b840bfc835c1d                       0.0s
 => => naming to docker.io/library/sd-auto:71                                                                      0.0s
[+] Running 1/0
 ✔ Container webui-docker-auto-1  Created                                                                          0.0s
Attaching to auto-1
auto-1  | /stable-diffusion-webui
auto-1  | total 792K
auto-1  | drwxr-xr-x 1 root root 4.0K Feb  7 18:10 .
auto-1  | drwxr-xr-x 1 root root 4.0K Jan 27 23:49 ..
auto-1  | -rw-r--r-- 1 root root   48 Jan 27 23:47 .eslintignore
auto-1  | -rw-r--r-- 1 root root 3.4K Jan 27 23:47 .eslintrc.js
auto-1  | drwxr-xr-x 8 root root 4.0K Jan 27 23:47 .git
auto-1  | -rw-r--r-- 1 root root   55 Jan 27 23:47 .git-blame-ignore-revs
auto-1  | drwxr-xr-x 4 root root 4.0K Jan 27 23:47 .github
auto-1  | -rw-r--r-- 1 root root  495 Jan 27 23:47 .gitignore
auto-1  | -rw-r--r-- 1 root root  119 Jan 27 23:47 .pylintrc
auto-1  | -rw-r--r-- 1 root root  51K Jan 27 23:47 CHANGELOG.md
auto-1  | -rw-r--r-- 1 root root  243 Jan 27 23:47 CITATION.cff
auto-1  | -rw-r--r-- 1 root root  657 Jan 27 23:47 CODEOWNERS
auto-1  | -rw-r--r-- 1 root root  35K Jan 27 23:47 LICENSE.txt
auto-1  | -rw-r--r-- 1 root root  12K Jan 27 23:47 README.md
auto-1  | drwxr-xr-x 2 root root 4.0K Jan 27 23:49 __pycache__
auto-1  | -rw-r--r-- 1 root root  69K Feb  2 23:26 cache.json
auto-1  | lrwxrwxrwx 1 root root   29 Feb  7 18:10 config.json -> /data/config/auto/config.json
auto-1  | lrwxrwxrwx 1 root root   31 Feb  7 18:10 config_states -> /data/config/auto/config_states
auto-1  | drwxr-xr-x 2 root root 4.0K Jan 27 23:47 configs
auto-1  | lrwxrwxrwx 1 root root   16 Feb  7 18:10 embeddings -> /data/embeddings
auto-1  | -rw-r--r-- 1 root root  167 Jan 27 23:47 environment-wsl2.yaml
auto-1  | lrwxrwxrwx 1 root root   28 Feb  7 18:10 extensions -> /data/config/auto/extensions
auto-1  | drwxr-xr-x 1 root root 4.0K Jan 27 23:47 extensions-builtin
auto-1  | drwxr-xr-x 2 root root 4.0K Jan 27 23:47 html
auto-1  | drwxr-xr-x 2 root root 4.0K Jan 27 23:48 interrogate
auto-1  | drwxr-xr-x 2 root root 4.0K Jan 27 23:47 javascript
auto-1  | -rw-r--r-- 1 root root 1.3K Jan 27 23:47 launch.py
auto-1  | drwxr-xr-x 2 root root 4.0K Jan 27 23:47 localizations
auto-1  | lrwxrwxrwx 1 root root   12 Feb  7 18:10 models -> /data/models
auto-1  | drwxr-xr-x 1 root root 4.0K Jan 27 23:49 modules
auto-1  | -rw-r--r-- 1 root root  185 Jan 27 23:47 package.json
auto-1  | -rw-r--r-- 1 root root  149 Feb  7 18:11 params.txt
auto-1  | -rw-r--r-- 1 root root  813 Jan 27 23:47 pyproject.toml
auto-1  | drwxr-xr-x 1 root root 4.0K Jan 27 23:39 repositories
auto-1  | -rw-r--r-- 1 root root   49 Jan 27 23:47 requirements-test.txt
auto-1  | -rw-r--r-- 1 root root  360 Jan 27 23:47 requirements.txt
auto-1  | -rw-r--r-- 1 root root  556 Jan 27 23:47 requirements_versions.txt
auto-1  | -rw-r--r-- 1 root root 411K Jan 27 23:47 screenshot.png
auto-1  | -rw-r--r-- 1 root root 5.3K Jan 27 23:47 script.js
auto-1  | drwxr-xr-x 1 root root 4.0K Jan 30 16:19 scripts
auto-1  | -rw-r--r-- 1 root root  23K Jan 27 23:47 style.css
auto-1  | lrwxrwxrwx 1 root root   28 Feb  7 18:10 styles.csv -> /data/config/auto/styles.csv
auto-1  | drwxr-xr-x 3 root root 4.0K Jan 27 23:47 test
auto-1  | drwxr-xr-x 2 root root 4.0K Jan 27 23:47 textual_inversion_templates
auto-1  | drwxr-xr-x 2 root root 4.0K Feb  2 23:26 tmp
auto-1  | lrwxrwxrwx 1 root root   32 Feb  7 18:10 ui-config.json -> /data/config/auto/ui-config.json
auto-1  | -rw-r--r-- 1 root root  670 Jan 27 23:47 webui-macos-env.sh
auto-1  | -rw-r--r-- 1 root root   84 Jan 27 23:47 webui-user.bat
auto-1  | -rw-r--r-- 1 root root 1.4K Jan 27 23:47 webui-user.sh
auto-1  | -rw-r--r-- 1 root root 2.3K Jan 27 23:47 webui.bat
auto-1  | -rw-r--r-- 1 root root 5.3K Jan 27 23:47 webui.py
auto-1  | -rwxr-xr-x 1 root root 7.9K Jan 27 23:47 webui.sh
auto-1  | Mounted embeddings
auto-1  | Mounted .cache
auto-1  | Mounted styles.csv
auto-1  | Mounted ui-config.json
auto-1  | Mounted models
auto-1  | Mounted .cache
auto-1  | Mounted config_states
auto-1  | Mounted config.json
auto-1  | Mounted extensions
auto-1  | Installing extension dependencies (if any)
auto-1  | Loading weights [1449e5b0b9] from /stable-diffusion-webui/models/Stable-diffusion/animagineXLV3_v30.safetensors
auto-1  | /stable-diffusion-webui/extensions/stable-diffusion-webui-two-shot/scripts/two_shot.py:397: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
auto-1  |   canvas_image = gr.Image(source='upload', mirror_webcam=False, type='numpy', tool='color-sketch',
auto-1  | /stable-diffusion-webui/extensions/stable-diffusion-webui-two-shot/scripts/two_shot.py:471: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
auto-1  |   visual_regions = gr.Gallery(label="Regions").style(grid=(4, 4, 4, 8), height="auto")
auto-1  | /stable-diffusion-webui/extensions/stable-diffusion-webui-two-shot/scripts/two_shot.py:471: GradioDeprecationWarning: The 'grid' parameter will be deprecated. Please use 'columns' in the constructor instead.
auto-1  |   visual_regions = gr.Gallery(label="Regions").style(grid=(4, 4, 4, 8), height="auto")
auto-1  | Running on local URL:  http://0.0.0.0:7860
auto-1  |
auto-1  | To create a public link, set `share=True` in `launch()`.
auto-1  | Startup time: 10.1s (import torch: 3.2s, import gradio: 0.7s, setup paths: 1.4s, initialize shared: 0.4s, other imports: 0.8s, setup codeformer: 0.1s, list SD models: 1.5s, load scripts: 0.4s, create ui: 0.8s, gradio launch: 0.4s).
auto-1  | Creating model from config: /stable-diffusion-webui/repositories/generative-models/configs/inference/sd_xl_base.yaml
auto-1  | Applying attention optimization: xformers... done.
auto-1  | Model loaded in 63.8s (load weights from disk: 5.6s, create model: 0.4s, apply weights to model: 57.0s, calculate empty prompt: 0.6s).
@hackthedev hackthedev added the bug Something isn't working label Feb 8, 2024
@AbdBarho
Copy link
Owner

Can you open the URL of the webui and see if it is working?

Loading the model on start was changed in auto (a while ago), it is expected to take 16 GB, especially on windows since it is running in a VM.

Maybe try to increase WSL memory size, you have 32 so 24 should be ok?

@AbdBarho AbdBarho added the awaiting-response Waiting for the issuer to respond label Feb 18, 2024
@hackthedev
Copy link
Author

hi omg i forgot to reply.
yes i can open the website just fine etc. i think the issue was because i downloaded the current version and not from releases. i reinstalled with the latest release and so far its workingfine and not trying to make some weird model out of nowhere

@hackthedev
Copy link
Author

@AbdBarho i realised something else tho.
I successfully set the limit to 24-26 gb, smth like that. When i use txt2img etc the ram usage goes up and back down, tho when i use the upscaler it goes up to 24 GB ram usage, and even after upscaling or scaling by a factor of 1 so there is a smaller image the ram usage wont decrease again and stays at 23-24gb.

I dont know if its reserved memory now but just a thing i noticed

Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Mar 13, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-response Waiting for the issuer to respond bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

2 participants