Hi there I have cloned this space:
Stable Diffusion Web UI - a Hugging Face Space by darkstorm2150
I have changed Dockerfile using ChatGPT to run OpenVINO:
Base image
FROM ubuntu:22.04
Update and install dependencies
RUN apt-get update -y &&
apt-get upgrade -y &&
apt-get install -y libgl1 libglib2.0-0 wget git git-lfs python3-pip python3.10-venv &&
rm -rf /var/lib/apt/lists/*
Clone the OpenVINO repository
RUN git clone GitHub - openvinotoolkit/stable-diffusion-webui: Stable Diffusion web UI /content/stable-diffusion-webui
Change working directory
WORKDIR /content/stable-diffusion-webui
Create and activate virtual environment with proper permissions
RUN python3.10 -m venv /venv &&
/venv/bin/pip install --upgrade pip &&
chown -R 1000:1000 /venv
Set permissions for other directories
RUN chown -R 1000:1000 /content/stable-diffusion-webui
Switch to the new user
USER 1000:1000
Install requirements
COPY requirements.txt /content/stable-diffusion-webui/requirements.txt
RUN /venv/bin/pip install -r requirements.txt
Copy environment patches
ADD ((Link1))
ADD ((Link2))
Apply environment patches
RUN sed -i -e β/import image_from_url_text/r /content/env_patch.pyβ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e β/demo:/r /content/header_patch.pyβ /content/stable-diffusion-webui/modules/ui.py
Add necessary import of os module in launch.py
RUN sed -i β1i import osβ /content/stable-diffusion-webui/launch.py
Remove unnecessary GPU-related code
RUN sed -i -e β/prepare_environment()/a\ os.system(f"ββsed -i -e βββs/dict()))/dict())).cpu()/gββ /content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.pyβββ)β /content/stable-diffusion-webui/launch.py
RUN sed -i -e βs/ start()/ #start()/gβ /content/stable-diffusion-webui/launch.py
Adjust WebUI settings
RUN sed -i -e β/(modelmerger_interface, "Checkpoint Merger", "modelmerger"),/dβ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e β/(train_interface, "Train", "ti"),/dβ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e β/extensions_interface, "Extensions", "extensions"/dβ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e β/settings_interface, "Settings", "settings"/dβ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e βs/document.getElementsByTagName(βgradio-appβ)[0].shadowRoot/!!document.getElementsByTagName(βgradio-appβ)[0].shadowRoot ? document.getElementsByTagName(βgradio-appβ)[0].shadowRoot : document/gβ /content/stable-diffusion-webui/script.js
RUN sed -i -e βs/ show_progress=False,/ show_progress=True,/gβ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e βs/default_enabled=False/default_enabled=True/gβ /content/stable-diffusion-webui/webui.py
RUN sed -i -e βs/ outputs=[/queue=False, &/gβ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e βs/ queue=False, / /gβ /content/stable-diffusion-webui/modules/ui.py
Copy configuration files
ADD ((Link3))
ADD ((Link4))
ADD ((Link5))
Expose port
EXPOSE 7860
Launch the WebUI
CMD [β/bin/bashβ, β./webui.shβ, ββskip-torch-cuda-testβ, ββprecisionβ, βfullβ, ββno-halfβ]
And the runtime error I am encountering is:
===== Application Startup at 2024-05-01 15:58:51 =====
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################
################################################################
whoami: cannot find name for user ID 1000
Running on user
################################################################
################################################################
Repo already cloned, using it as install directory
################################################################
################################################################
Create and activate python venv
################################################################
################################################################
Launching launch.py...
################################################################
Cannot locate TCMalloc (improves CPU memory usage)
fatal: No names found, cannot describe anything.
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
Version: 1.6.0
Commit hash: 44006297e03a07f28505d54d6ba5fd55e0c1292d
Installing torch and torchvision
WARNING: The directory '/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu118
Collecting torch==2.0.1
Downloading https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp310-cp310-linux_x86_64.whl (2267.3 MB)
ββββββββββββββββββββββββββββββββββββββββ 2.3/2.3 GB 370.2 MB/s eta 0:00:00
Collecting torchvision==0.15.2
Downloading https://download.pytorch.org/whl/cu118/torchvision-0.15.2%2Bcu118-cp310-cp310-linux_x86_64.whl (6.1 MB)
ββββββββββββββββββββββββββββββββββββββββ 6.1/6.1 MB 202.4 MB/s eta 0:00:00
Collecting typing-extensions
Downloading typing_extensions-4.11.0-py3-none-any.whl (34 kB)
Collecting sympy
Downloading https://download.pytorch.org/whl/sympy-1.12-py3-none-any.whl (5.7 MB)
ββββββββββββββββββββββββββββββββββββββββ 5.7/5.7 MB 340.9 MB/s eta 0:00:00
Collecting networkx
Downloading networkx-3.3-py3-none-any.whl (1.7 MB)
ββββββββββββββββββββββββββββββββββββββββ 1.7/1.7 MB 98.1 MB/s eta 0:00:00
Collecting triton==2.0.0
Downloading https://download.pytorch.org/whl/triton-2.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (63.3 MB)
βββββββββββββββββββββββββββββββββββββββ 63.3/63.3 MB 365.0 MB/s eta 0:00:00
Collecting jinja2
Downloading https://download.pytorch.org/whl/Jinja2-3.1.3-py3-none-any.whl (133 kB)
βββββββββββββββββββββββββββββββββββββ 133.2/133.2 KB 373.7 MB/s eta 0:00:00
Collecting filelock
Downloading filelock-3.14.0-py3-none-any.whl (12 kB)
Collecting numpy
Downloading numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
βββββββββββββββββββββββββββββββββββββββ 18.2/18.2 MB 356.0 MB/s eta 0:00:00
Collecting pillow!=8.3.*,>=5.3.0
Downloading pillow-10.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (4.5 MB)
ββββββββββββββββββββββββββββββββββββββββ 4.5/4.5 MB 282.4 MB/s eta 0:00:00
Collecting requests
Downloading requests-2.31.0-py3-none-any.whl (62 kB)
βββββββββββββββββββββββββββββββββββββββ 62.6/62.6 KB 306.1 MB/s eta 0:00:00
Collecting lit
Downloading lit-18.1.4-py3-none-any.whl (96 kB)
βββββββββββββββββββββββββββββββββββββββ 96.4/96.4 KB 278.0 MB/s eta 0:00:00
Collecting cmake
Downloading cmake-3.29.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (26.7 MB)
βββββββββββββββββββββββββββββββββββββββ 26.7/26.7 MB 217.9 MB/s eta 0:00:00
Collecting MarkupSafe>=2.0
Downloading https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting charset-normalizer<4,>=2
Downloading charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
βββββββββββββββββββββββββββββββββββββ 142.1/142.1 KB 341.5 MB/s eta 0:00:00
Collecting urllib3<3,>=1.21.1
Downloading urllib3-2.2.1-py3-none-any.whl (121 kB)
βββββββββββββββββββββββββββββββββββββ 121.1/121.1 KB 319.4 MB/s eta 0:00:00
Collecting idna<4,>=2.5
Downloading idna-3.7-py3-none-any.whl (66 kB)
βββββββββββββββββββββββββββββββββββββββ 66.8/66.8 KB 240.7 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
Downloading certifi-2024.2.2-py3-none-any.whl (163 kB)
βββββββββββββββββββββββββββββββββββββ 163.8/163.8 KB 388.4 MB/s eta 0:00:00
Collecting mpmath>=0.19
Downloading https://download.pytorch.org/whl/mpmath-1.3.0-py3-none-any.whl (536 kB)
βββββββββββββββββββββββββββββββββββββ 536.2/536.2 KB 404.1 MB/s eta 0:00:00
Installing collected packages: mpmath, lit, urllib3, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, idna, filelock, cmake, charset-normalizer, certifi, requests, jinja2, triton, torch, torchvision
Successfully installed MarkupSafe-2.1.5 certifi-2024.2.2 charset-normalizer-3.3.2 cmake-3.29.2 filelock-3.14.0 idna-3.7 jinja2-3.1.3 lit-18.1.4 mpmath-1.3.0 networkx-3.3 numpy-1.26.4 pillow-10.3.0 requests-2.31.0 sympy-1.12 torch-2.0.1+cu118 torchvision-0.15.2+cu118 triton-2.0.0 typing-extensions-4.11.0 urllib3-2.2.1
Installing clip
Installing open_clip
Cloning Stable Diffusion into /content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai...
Cloning into '/content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai'...
Cloning Stable Diffusion XL into /content/stable-diffusion-webui/repositories/generative-models...
Cloning into '/content/stable-diffusion-webui/repositories/generative-models'...
Cloning K-diffusion into /content/stable-diffusion-webui/repositories/k-diffusion...
Cloning into '/content/stable-diffusion-webui/repositories/k-diffusion'...
Cloning CodeFormer into /content/stable-diffusion-webui/repositories/CodeFormer...
Cloning into '/content/stable-diffusion-webui/repositories/CodeFormer'...
Cloning BLIP into /content/stable-diffusion-webui/repositories/BLIP...
Cloning into '/content/stable-diffusion-webui/repositories/BLIP'...
Installing requirements for CodeFormer
Installing requirements
sh: 1: Syntax error: Unterminated quoted string
Kindly help me to resolve this error and I am a beginner. Thanks