commit 7b75f43046a42ae68a72f4efd25598a521d94076 Author: tcsenpai Date: Sat Oct 26 18:24:16 2024 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d5b257 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +app/automatic_repo +app/automatic \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a4b51b6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM nvidia/cuda:12.6.2-base-ubuntu22.04 + +RUN apt-get update && apt-get install -y curl git + +# Install Python +RUN apt-get install -y python3 python3-pip python3-venv + +# Install Bash +RUN apt-get install -y bash + +# Install dos2unix +RUN apt-get install -y dos2unix + +# Install pip requirements +#COPY app/automatic/requirements.txt . +#RUN pip install -r requirements.txt + diff --git a/README.md b/README.md new file mode 100644 index 0000000..f080366 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# SD.Next (Automatic1111's Vladamantic fork) Docker Container + +This unofficial docker container is based on the work of [vladmandic](https://github.com/vladmandic) and aims to provide a simple and easy way to run the SD.Next web UI. It should be compatible with all the OSes that docker is supported on. + +## How it works + +The container will automatically clone the repository and install the dependencies on the first run. On subsequent runs, it will pull the latest changes and start the web UI.รน + +You can also: + +- Edit the exposed ports in the docker-compose file +- Edit what happens at runtime in the entrypoint.sh file (included flags, etc.) + +## Installing models and similar + +The container mounts the app/automatic_repo folder as a volume, so you can add models and other files to it. +After the first run, you will find the folder under app/automatic_repo. + +## Run + +``` +docker compose up --build -d +``` diff --git a/app/entrypoint.sh b/app/entrypoint.sh new file mode 100644 index 0000000..b781ac8 --- /dev/null +++ b/app/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# If no folder named automatic, clone the repository +if [ ! -d "automatic_repo" ]; then + git clone https://github.com/vladmandic/automatic automatic_repo + cd automatic_repo +else + cd automatic_repo + git pull +fi + +#pip install -r requirements.txt +bash webui.sh --debug --insecure --listen \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6c169e8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: "3.8" + +services: + automatic: + build: + context: . + dockerfile: Dockerfile + volumes: + - ./app:/mnt/app + ports: + - 7860:7860 + command: + [ + "/bin/bash", + "-c", + "cd /mnt/app && chmod +x ./entrypoint.sh && ./entrypoint.sh", + ] + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: [gpu] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8014753 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,68 @@ +setuptools==69.5.1 +patch-ng +anyio +addict +astunparse +filetype +future +GitPython +httpcore +inflection +jsonmerge +kornia +lark +omegaconf +optimum +piexif +psutil +pyyaml +resize-right +rich +toml +voluptuous +yapf +fasteners +orjson +ruff +pylint +invisible-watermark +pi-heif +safetensors==0.4.5 +tensordict==0.1.2 +peft==0.13.1 +httpx==0.24.1 +compel==2.0.3 +torchsde==0.2.6 +antlr4-python3-runtime==4.9.3 +requests==2.32.3 +tqdm==4.66.5 +accelerate==1.0.0 +opencv-contrib-python-headless==4.9.0.80 +einops==0.4.1 +gradio==3.43.2 +huggingface_hub==0.25.2 +numexpr==2.8.8 +numpy==1.26.4 +numba==0.59.1 +blendmodes +scipy +pandas +protobuf==4.25.3 +pytorch_lightning==1.9.4 +tokenizers==0.20.0 +transformers==4.45.2 +urllib3==1.26.19 +Pillow==10.4.0 +timm==0.9.16 +pydantic==1.10.15 +pyparsing==3.1.4 +typing-extensions==4.12.2 +torchdiffeq +dctorch +scikit-image +seam-carving +open-clip-torch + +# TODO temporary block for torch==2.5.0 +torchvision!=0.20.0 +torch!=2.5.0