Git Product home page Git Product logo

stable-diffusion-webui-docker's Introduction

๐Ÿฃ Please follow me for new updates https://twitter.com/camenduru
๐Ÿ”ฅ Please join our discord server https://discord.gg/k5BwmmvJJU
๐Ÿฅณ Please join my patreon community https://patreon.com/camenduru

lite has a stable WebUI and stable installed extensions.
stable has ControlNet, a stable WebUI, and stable installed extensions.
nightly has ControlNet, the latest WebUI, and daily installed extension updates.

Stable Diffusion Web UI

https://github.com/AUTOMATIC1111/stable-diffusion-webui

Stable Diffusion Web UI Colab

https://github.com/camenduru/stable-diffusion-webui-colab

Documentation

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki.

Installed Extensions

https://github.com/deforum-art/deforum-for-automatic1111-webui
https://github.com/yfszzx/stable-diffusion-webui-images-browser
https://github.com/camenduru/stable-diffusion-webui-huggingface
https://github.com/Vetchems/sd-civitai-browser
https://github.com/kohya-ss/sd-webui-additional-networks

Installed Scripts

https://github.com/camenduru/stable-diffusion-webui-scripts/blob/main/run_n_times.py

Models License

https://huggingface.co/spaces/CompVis/stable-diffusion-license

๐Ÿณ Base Docker

https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.7.1/ubuntu2204/devel/cudnn8/Dockerfile
https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.7.1/ubuntu2204/base/Dockerfile

Xformers

For the correct xformers wheel, please check https://github.com/camenduru/stable-diffusion-webui-colab/releases
or build with the same VM pip wheel git+https://github.com/facebookresearch/xformers#egg=xformers

stable-diffusion-webui-docker's People

Contributors

camenduru avatar henrizuber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

stable-diffusion-webui-docker's Issues

cannot build on mac m1 with docker desktop

Hi, I am trying to build the image using docker build . on mac m1 and run into many issues.

Hope you can help and thank you so much!

first ModuleNotFoundError: No module named 'torch'

=> ERROR [ 7/21] RUN pip install --pre xformers                                                                                           3.4s
------                                                                                                                                          
 > [ 7/21] RUN pip install --pre xformers:                                                                                                      
#10 0.397 Defaulting to user installation because normal site-packages is not writeable                                                         
#10 0.763 Collecting xformers                                                                                                                   
#10 1.054   Downloading xformers-0.0.17.dev466.tar.gz (7.4 MB)                                                                                  
#10 2.312      โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 7.4/7.4 MB 5.9 MB/s eta 0:00:00                                                         
#10 2.879   Preparing metadata (setup.py): started
#10 2.988   Preparing metadata (setup.py): finished with status 'error'
#10 2.990   error: subprocess-exited-with-error
#10 2.990   
#10 2.990   ร— python setup.py egg_info did not run successfully.
#10 2.990   โ”‚ exit code: 1
#10 2.990   โ•ฐโ”€> [6 lines of output]
#10 2.990       Traceback (most recent call last):
#10 2.990         File "<string>", line 2, in <module>
#10 2.990         File "<pip-setuptools-caller>", line 34, in <module>
#10 2.990         File "/tmp/pip-install-fxjxehjn/xformers_e15ca0b2eef3427fad5cc55bdcca5e7f/setup.py", line 23, in <module>
#10 2.990           import torch
#10 2.990       ModuleNotFoundError: No module named 'torch'
#10 2.990       [end of output]
#10 2.990   
#10 2.990   note: This error originates from a subprocess, and is likely not a problem with pip.
#10 2.991 error: metadata-generation-failed
#10 2.991 
#10 2.991 ร— Encountered error while generating package metadata.
#10 2.991 โ•ฐโ”€> See above for output.
#10 2.991 
#10 2.991 note: This is an issue with the package mentioned above, not pip.
#10 2.991 hint: See above for details.
------

fixed by adding:

RUN pip3 install --upgrade pip
RUN pip install torch
RUN pip install --pre xformers

then ERROR: No matching distribution found for triton I don't know what to do.

docker build .
[+] Building 2.3s (15/28)                                                                                                                       
 => [internal] load build definition from Dockerfile                                                                                       0.0s
 => => transferring dockerfile: 2.65kB                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                          0.0s
 => => transferring context: 2B                                                                                                            0.0s
 => [internal] load metadata for docker.io/nvidia/cuda:11.7.1-base-ubuntu22.04                                                             1.3s
 => [auth] nvidia/cuda:pull token for registry-1.docker.io                                                                                 0.0s
 => CANCELED https://huggingface.co/ckpt/anything-v4.5-vae-swapped/resolve/main/anything-v4.5-vae-swapped.safetensors                      0.9s
 => [ 1/22] FROM docker.io/nvidia/cuda:11.7.1-base-ubuntu22.04@sha256:ab51a8d50a8c7d5f0c61b4a3eaeaa72b99aa60c2235c8c1a8c87410d9172aba5     0.0s
 => CACHED https://raw.githubusercontent.com/camenduru/stable-diffusion-webui-scripts/main/run_n_times.py                                  0.0s
 => CACHED [ 2/22] RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgl1 libglib2.0-0 wget git git-lfs python3-pip pyt  0.0s
 => CACHED [ 3/22] RUN adduser --disabled-password --gecos '' user                                                                         0.0s
 => CACHED [ 4/22] RUN mkdir /content && chown -R user:user /content                                                                       0.0s
 => CACHED [ 5/22] WORKDIR /content                                                                                                        0.0s
 => CACHED [ 6/22] RUN pip3 install --upgrade pip                                                                                          0.0s
 => CACHED [ 7/22] RUN pip install torch                                                                                                   0.0s
 => CACHED [ 8/22] RUN pip install --pre xformers                                                                                          0.0s
 => ERROR [ 9/22] RUN pip install --pre triton                                                                                             0.9s
------                                                                                                                                          
 > [ 9/22] RUN pip install --pre triton:
#13 0.406 Defaulting to user installation because normal site-packages is not writeable
#13 0.844 ERROR: Could not find a version that satisfies the requirement triton (from versions: none)
#13 0.844 ERROR: No matching distribution found for triton

enhancement: Reduce the image size with a simple change

- RUN pip3 install --upgrade pip
- RUN pip install xformers==0.0.16
- RUN pip install triton==2.0.0
- RUN pip install numexpr
...
- RUN cd stable-diffusion-webui && python launch.py --skip-torch-cuda-test
+ RUN cd stable-diffusion-webui && pip install xformers==0.0.16 triton==2.0.0 numexpr && python launch.py --skip-torch-cuda-test

xformers will install a torch-1.13.1, and python launch.py will install torch-1.13.1-cuxxx. Docker does not really delete the torch-1.13.1 if they are in two different layers.

This will reduce 2-3GB in Dockerfile.Lite (From about 14GB to 12GB)

Cannot add middleware after an application has started

To create a public link, set share=True in launch().
Traceback (most recent call last):
File "/content/stable-diffusion-webui/webui.py", line 195, in
webui()
File "/content/stable-diffusion-webui/webui.py", line 163, in webui
app.add_middleware(GZipMiddleware, minimum_size=1000)
File "/home/user/.local/lib/python3.10/site-packages/starlette/applications.py", line 135, in add_middleware
raise RuntimeError("Cannot add middleware after an application has started")
RuntimeError: Cannot add middleware after an application has started

pkg-config not found

I got this error when I ran the Docker.Stable file on the Hugging Face platform.

Collecting pycairo>=1.20.0 (from rlPyCairo<1,>=0.2.0->reportlab->svglib)
  Downloading pycairo-1.23.0.tar.gz (344 kB)
     โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 344.6/344.6 kB 171.1 MB/s eta 0:00:00
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: svglib, pycairo
  Building wheel for svglib (setup.py): started
  Building wheel for svglib (setup.py): finished with status 'done'
  Created wheel for svglib: filename=svglib-1.5.1-py3-none-any.whl size=30920 sha256=1002e19b3ebf3991b3bdfb4a6a73b00312c7266e8e969d5597ea533b539faad8
  Stored in directory: /home/user/.cache/pip/wheels/56/9f/90/f37f4b9dbf82987a24ae14f15586e96715cb669a4710b3b85d
  Building wheel for pycairo (pyproject.toml): started
  Building wheel for pycairo (pyproject.toml): finished with status 'error'
Successfully built svglib
Failed to build pycairo

stderr:   error: subprocess-exited-with-error
  
  ร— Building wheel for pycairo (pyproject.toml) did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [12 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/cairo
      copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-310/cairo
      copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-310/cairo
      copying cairo/py.typed -> build/lib.linux-x86_64-cpython-310/cairo
      running build_ext
      'pkg-config' not found.
      Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycairo
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects

Build stable-diffusion image fail.

DockerFile: Dockerfile.Lite
Docker Version: Docker Desktop v23.0.5
CUDA version : 12.9.
This is error stack:

#0 156.2 Installing collected packages: urllib3, torch, pillow, idna, charset-normalizer, certifi, requests, torchvision
#0 156.3   Attempting uninstall: torch
#0 156.3     Found existing installation: torch 1.13.1
#0 156.4     Uninstalling torch-1.13.1:
#0 159.4       Successfully uninstalled torch-1.13.1
#0 181.2   WARNING: The scripts convert-caffe2-to-onnx, convert-onnx-to-caffe2 and torchrun are installed in '/home/user/.local/bin' which is not on PATH.
#0 181.2   Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
#0 181.7   WARNING: The script normalizer is installed in '/home/user/.local/bin' which is not on PATH.
#0 181.7   Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
#0 182.1 Successfully installed certifi-2023.5.7 charset-normalizer-3.1.0 idna-3.4 pillow-9.5.0 requests-2.30.0 torch-1.13.1+cu117 torchvision-0.14.1+cu117 urllib3-2.0.2
#0 192.6 Traceback (most recent call last):
#0 192.6   File "/content/stable-diffusion-webui/launch.py", line 360, in <module>
#0 192.6 Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0]
#0 192.6 Commit hash: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8
#0 192.6 Installing torch and torchvision
#0 192.6 Installing gfpgan
#0 192.6     prepare_environment()
#0 192.6   File "/content/stable-diffusion-webui/launch.py", line 275, in prepare_environment
#0 192.6     run_pip(f"install {gfpgan_package}", "gfpgan")
#0 192.6   File "/content/stable-diffusion-webui/launch.py", line 137, in run_pip
#0 192.6     return run(f'"{python}" -m pip {args} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}")
#0 192.6   File "/content/stable-diffusion-webui/launch.py", line 105, in run
#0 192.6     raise RuntimeError(message)
#0 192.6 RuntimeError: Couldn't install gfpgan.
#0 192.6 Command: "/usr/bin/python" -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary
#0 192.6 Error code: 1
#0 192.6 stdout: Defaulting to user installation because normal site-packages is not writeable
#0 192.6 Collecting git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379
#0 192.6   Cloning https://github.com/TencentARC/GFPGAN.git (to revision 8d2447a2d918f8eba5a4a01463fd48e45126a379) to /tmp/pip-req-build-5t3vhjb0
#0 192.6
#0 192.6 stderr:   Running command git clone --filter=blob:none --quiet https://github.com/TencentARC/GFPGAN.git /tmp/pip-req-build-5t3vhjb0
#0 192.6   fatal: unable to access 'https://github.com/TencentARC/GFPGAN.git/': Could not resolve host: github.com
#0 192.6   error: subprocess-exited-with-error
#0 192.6
#0 192.6   ร— git clone --filter=blob:none --quiet https://github.com/TencentARC/GFPGAN.git /tmp/pip-req-build-5t3vhjb0 did not run successfully.
#0 192.6   โ”‚ exit code: 128
#0 192.6   โ•ฐโ”€> See above for output.
#0 192.6
#0 192.6   note: This error originates from a subprocess, and is likely not a problem with pip.
#0 192.6 error: subprocess-exited-with-error
#0 192.6
#0 192.6 ร— git clone --filter=blob:none --quiet https://github.com/TencentARC/GFPGAN.git /tmp/pip-req-build-5t3vhjb0 did not run successfully.
#0 192.6 โ”‚ exit code: 128
#0 192.6 โ•ฐโ”€> See above for output.
#0 192.6
#0 192.6 note: This error originates from a subprocess, and is likely not a problem with pip.
#0 192.6
#0 192.6
------
Dockerfile.Lite:35
--------------------
  33 |     RUN sed -i -e 's/fastapi==0.90.1/fastapi==0.89.1/g' /content/stable-diffusion-webui/requirements_versions.txt
  34 |     RUN sed -i -e 's/    start()/    #start()/g' /content/stable-diffusion-webui/launch.py
  35 | >>> RUN cd stable-diffusion-webui && python launch.py --skip-torch-cuda-test
  36 |
  37 |     ADD --chown=user https://huggingface.co/ckpt/sd15/resolve/main/v1-5-pruned-emaonly.ckpt /content/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt
--------------------
ERROR: failed to solve: process "/bin/sh -c cd stable-diffusion-webui && python launch.py --skip-torch-cuda-test" did not complete successfully: exit code: 1

I am terribly sorry to bother you. Could you please help me with my question? I really need your help and would greatly appreciate it. Sorry for the inconvenience.

ImportError: cannot import name 'FormColumn' from 'modules.ui_components'

Thank you for your work.
Here is the error message I got when running python webui.py --xformers --listen --enable-insecure-extension-access --gradio-queue inside the docker container build with Dockerfile.Stable.

Error loading script: deforum.py                                                             [73/483]
Traceback (most recent call last):                                                                   
  File "/content/stable-diffusion-webui/modules/scripts.py", line 229, in load_scripts               
    script_module = script_loading.load_module(scriptfile.path)                                      
  File "/content/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module          
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/content/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts/deforum.py
", line 22, in <module>
    init_deforum()
  File "/content/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts/deforum.py
", line 14, in init_deforum                                                                          
    from deforum_helpers.ui_right import on_ui_tabs
  File "/content/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts/deforum_he
lpers/ui_right.py", line 8, in <module>
    from .ui_left import setup_deforum_left_side_ui
  File "/content/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts/deforum_he
lpers/ui_left.py", line 7, in <module>
    from .ui_elements import get_tab_run, get_tab_keyframes, get_tab_prompts, get_tab_init, get_tab_h
ybrid, get_tab_output
  File "/content/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts/deforum_he
lpers/ui_elements.py", line 2, in <module>
    from modules.ui_components import FormRow, FormColumn
ImportError: cannot import name 'FormColumn' from 'modules.ui_components' (/content/stable-diffusion-
webui/modules/ui_components.py)
Error calling: /content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additi
onal_networks.py/ui
Traceback (most recent call last):
  File "/content/stable-diffusion-webui/modules/scripts.py", line 243, in wrap_call
    res = func(*args, **kwargs)
  File "/content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_ne
tworks.py", line 104, in ui
    weight.release(lambda w: (w, w), inputs=[weight], outputs=[weight_unet, weight_tenc])
AttributeError: 'Slider' object has no attribute 'release'
Error executing callback ui_tabs_callback for /content/stable-diffusion-webui/extensions/sd-we[8/483]
itional-networks/scripts/additional_networks.py                                                      
Traceback (most recent call last):                                                                   
  File "/content/stable-diffusion-webui/modules/script_callbacks.py", line 119, in ui_tabs_callback
    res += c.callback() or []
  File "/content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_ne
tworks.py", line 290, in on_ui_tabs
    metadata_editor.setup_ui(addnet_paste_params)
  File "/content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/metadata_edit
or.py", line 462, in setup_ui
    outputs=[addnet_paste_params[tabname][i]["module"], addnet_paste_params[tabname][i]["model"]],
IndexError: list index out of range

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.