This commit adds support for integrating Krita AI Diffusion models and nodes into the Comfy image editing application. It includes the following changes:
- Downloads recommended models for Krita AI Diffusion if enabled
- Symlinks the downloaded upscale models into the models directory
- Adds environment variables to enable/disable dependancy node packs
- Clones and sets up the required Git repositories for those node packs if enabled
- Installs additional dependencies like aiohttp and tqdm if Krita AI Diffusion is used
These changes allow Comfy to leverage the powerful image generation and editing capabilities provided by the Krita AI Diffusion project. Users can now access advanced features like outpainting, inpainting, upscaling, etc. within the Comfy UI.
The commit also improves the build process by using a cache for pip installs and specifying types for mounted volumes in Docker for better performance and reproducibility.
- Update base image to pytorch 2.3.1
- Fix missing comment line escape
- Support [krita-ai-diffusion](https://github.com/Acly/krita-ai-diffusion/wiki/ComfyUI-Setup) (`USE_KRITA=true`)
This enables the following custom nodes (including comfyui_controlnet_aux):
* **ComfyUI_IPAdapter_plus** (`USE_IPAPLUS=true`)
* **comfyui-inpaint-nodes** (`USE_INPAINT=true`)
* **comfyui-tooling-nodes** (`USE_TOOLING=true`)
The invoke team already maintains a docker setup for their service, this
copy here was maybe relevant 2 years ago when all of this started, but I
don't think it makes sense anymore.
Refer to invoke's docs to install using docker
https://invoke-ai.github.io/InvokeAI/installation/040_INSTALL_DOCKER/
Fix the problem that some extensions need to be installed from src
Now, because the step of installing extensions is moved forward in
`entrypoint.sh` instead of `startup.sh`, we cannot install some required
packages before executing `install.py`
When installing the extension `sd-webui-roop`, it relies on
`insightface==0.7.3`, and when installing this pypi package, it is found
that when building the wheel package, an error will be reported because
`gcc` cannot be found
ddc02ee1a9/requirements.txt (L1)
Therefore, considering that not all pypi packages are distributed in
wheel, those pypi packages distributed in src need `build-essential` to
build
Perform a full extension installation process instead of just installing
dependencies
Some extensions do not include `requirements.txt` but install
dependencies in `install.py`, and all extensions include `install.py`,
so it is safe to use it for extended dependency installation
This is because the extension development of AUTOMATIC1111's webui does
not require the existence of `requirements.txt` but uses `install.py` to
initialize the extension
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions#installpy
I updated the paths to make all paths work
Now paths in ComfyUI are working
Added:
- `input`
- `models/configs`
- `models/gligen`
- `models/diffusers`
- `models/hypernetworks`
Was broken:
- `custom_nodes`
- `models/clip_vision`
- `models/clip`
---------
Co-authored-by: LEv145 <you@example.com>
Co-authored-by: AbdBarho <ka70911@gmail.com>
`jq` merge direction in this case is right to left so if the user had
set up custom paths it would replace them with the default ones.
This PR switches the direction to use the defaults as fallback instead
of overwriting user settings.
----
Didn't want to create an issue for the tiny change.
Thanks for your work on the repo, it saved me a lot of time, 👍
---------
Co-authored-by: AbdBarho <ka70911@gmail.com>
As discussed in Discussion
[#367](https://github.com/AbdBarho/stable-diffusion-webui-docker/discussions/367),
this adds support for the newer ComfyUI. I forked the fork that would
already add this but the maintainer of that fork hasn't implemented the
changes needed to properly get the output function working, which I did.
I believe everything is functional though I have not tested every single
node.
I changed the table format for the README and a few other minor things
for aesthetic reasons but if you want me to revert those, I will.
---------
Co-authored-by: Jonathan Kovacs <jkovacs-dev@users.noreply.github.com>
Co-authored-by: AbdBarho <ka70911@gmail.com>
## Justification
Closes issue #352
This update makes the Dockerfiles OCI compliant, making it easier to use
Buildah or other image building techniques that require it
## Implementation
This changes a few things, listed below:
* auto: Download container is switched to alpine. The `git` container
specified the `/git` directory as a volume. As such, all the files under
`/git` would be lost after each script invoke. Alpine is used later in
the build process anyway, so it shouldn't be any extra cost to switch to
it
* auto: "New" clone.sh script is copied into the container, which is
basically just the previous clone script that was embedded in the
Dockerfile.
* all: `<<EOF` heredoc styles have been switched to `&& \`
* all: I added NVIDIA_DRIVER_CAPABILITIES and NVIDIA_VISIBLE_DEVICES to
expose my Nvidia card. This is most likely a selinux/podman problem, but
shouldn't change anything with docker to add it.
* docker-compose: I added selinux labeling. I tested this with real
docker (not just podman!) and it seems to work fine. Though I suggest
you try it too.
## Testing
Locally builds with buildah.
Note: for caching to work properly, you still need to replace
`/root/.cache/pip` with `/root/.cache/pip,Z` on selinux systems.
Note: I was having some trouble running invoke. Thought it was this PR,
but it's a known issue. See
https://github.com/invoke-ai/InvokeAI/issues/3182
---------
Co-authored-by: AbdBarho <ka70911@gmail.com>
Upon enabling the ControlNet addon from
https://github.com/AbdBarho/stable-diffusion-webui-docker/pull/385 one
might want to use the `openpose` preprocessors. Those are downloaded by
the addon the first time they are used. Without proper mounts those
networks will be downloaded on usage after each container start.
This PR enables those mounts to reduce data traffic.
The ControlNet addon
[sd-webui-controlnet](https://github.com/Mikubill/sd-webui-controlnet)
requires the `data/ControlNet` folder to be mounted into
`models/ControlNet`.
This PR enables said mount and adds the ControlNet folder to
`.gitignore` file.
---------
Co-authored-by: AbdBarho <ka70911@gmail.com>
Rename the UIs in docker compose to their new names
Changes folder names
Changes output folder structure
Closes issue #263
Adds `sygil-sl` instead of docker compose flag.
- auto:
36a0ba357a
- History tab should be working, closes#138
- hlky:
bd57d22f2e
- experimental support for the streamlit UI, use the env var
`USE_STREAMLIT`, see the `docker-compose.yml` file, closes#105
- Don't create issues if it fails, it is still very early in dev.
### Update versions
- auto:
03d62538ae
- History Tab IS NOT WORKING YET! #138
- hlky:
fd51bab1ec
- lstein:
fe2a2cfc8bCloses#102 the config file has been moved to `data/config/auto`
1. Update `docker-compose.yml`: use `PRELOAD=true` for lstein. See the
[note](94bad8555a/docs/installation/INSTALL_LINUX.md (L60))
in the installation guide of InvokeAI.
3. Fix `services/lstein/mount.sh`: change `CodeFormer` to `Codeformer`.
4. Update `services/lstein/mount.sh`: avoid having to re-download the
`${PWD}/gfpgan/weights/...` every time the container is started.
- auto:
050a6a798c
- Now uses python 3.10
- requires a complete re-install
- Image is now smaller (5.7GB vs 9.8GB)
- hlky:
fe6e72fde7
- lstein:
31869885d9
- img2img now works
- auto:
2995107fa2
- More samplers
- Textual inversion training
- hlky:
1a9c053cb7
- Build times are SLOW
- lstein:
4f247a3672
- Prepare for 2.0 release
- very cool new UI!
### Update versions
- auto:
3f417566b0
### Breaking changes:
* renamed `automatic-1111` service to `auto`
* the `cache` folder is now deprecated, replaced with `data` (see
migration guide below)
* `embeddings` folder has been moved to `data/embeddings`
* use GFPGAN 1.4
### Migration Guide
Note: in theory, running the command
```
docker compose --profile download up --build
```
is all you need to use the new version, however, this means you will
also have to download everything again. A new script is available under
`scripts/migratev1tov2.sh` that will copy models to the new structure
and should get you most of the way, run
```bash
./scripts/migratev1tov2.sh
```
or you can manually inspect the script and copy the files
After that, run
```
docker compose --profile download up --build
```
to validate everything.
Docker compose allows override some settings in `docker-compose.yml` by
using additional file: `docker-compose.override.yml`.
This allows to hold own settings in override file which does not
conflict with updates made by pulling newer version with "git pull"
command.
This feature requires three things:
1. Creating `docker-compose.override.yml-dist` file which is a
distributed file inside repo. This file can be copied as
`docker-compose.override.yml` and modified for own needs.
2. Change in `.gitignore` file so `docker-compose.override.yml` file is
ignored, so git pull / commit will not complain about this file.
3. Modify wiki entry about setup to mention possibility to use this
method.
Closes#101
**Has this issue been opened before? Check the [FAQ](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Main), the [issues](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues?q=is%3Aissue) and in [the issues in the WebUI repo](https://github.com/hlky/stable-diffusion-webui)**
<!-- PLEASE FILL THIS OUT, IT WILL MAKE BOTH OF OUR LIVES EASIER -->
**Has this issue been opened before?**
- [ ] It is not in the [FAQ](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/FAQ), I checked.
- [ ] It is not in the [issues](https://github.com/AbdBarho/stable-diffusion-webui-docker/issues?q=), I searched.
**Describe the bug**
<!-- tried to run the app, my cat exploded -->
**Which UI**
auto or auto-cpu or invoke or comfy?
**Hardware / Software**
- OS: [e.g. Windows 10 / Ubuntu 22.04]
- OS version: <!-- on windows, use the command `winver` to find out, on ubuntu `lsb_release -d` -->
- WSL version (if applicable): <!-- get using `wsl -l -v` -->
- Docker Version: <!-- get using `docker version` -->
- Docker compose version: <!-- get using `docker compose version` -->
stale-issue-message: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.
stale-pr-message:This PR 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.
close-issue-message:This issue was closed because it has been stalled for 7 days with no activity.
close-pr-message:This PR was closed because it has been stalled for 7 days with no activity.
Run Stable Diffusion on your machine with a nice UI without any hassle!
This repository provides the [WebUI](https://github.com/hlky/stable-diffusion-webui) as a docker image for easy setup and deployment. Please note that the WebUI is experimental and evolving quickly, so expect some bugs.
## Features
- Interactive UI with many features, and more on the way!
- Support for 6GB GPU cards.
- GFPGAN for face reconstruction, RealESRGAN for super-sampling.
- (Optional) [RealESRGAN_x4plus.pth (64MB)](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth) and [RealESRGAN_x4plus_anime_6B.pth (18MB)](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth).
- (Optional) [LDSR (2GB)](https://heibox.uni-heidelberg.de/f/578df07c8fc04ffbadf3/?dl=1) and [its configuration](https://heibox.uni-heidelberg.de/f/31a76b13ea27482981b4/?dl=1), rename to `LDSR.ckpt` and `LDSR.yaml` respectively.
-TODO: (I still need to find the RealESRGAN_x2plus_6b.pth) -->
Put all of the downloaded files in the `models` folder, it should look something like this:
```
models/
├── model.ckpt
├── GFPGANv1.3.pth
├── RealESRGAN_x4plus.pth
├── RealESRGAN_x4plus_anime_6B.pth
├── LDSR.ckpt
└── LDSR.yaml
```
## Run
After the build is done, you can run the app with:
```
docker compose up --build
```
Will start the app on http://localhost:7860/
Note: the first start will take sometime as some other models will be downloaded, these will be cached in the `cache` folder, so next runs are faster.
## Config
in the `docker-compose.yml` you can change the `CLI_ARGS` variable, which contains the arguments that will be passed to the WebUI. By default: `--extra-models-cpu --optimized-turbo` are given, which allow you to use this model on a 6GB GPU. However, some features might not be available in the mode.
[You can find the full list of arguments here.](https://github.com/hlky/stable-diffusion/blob/d667ff52a36b4e79526f01555bfbf85428f334ce/scripts/webui.py)
### FAQ
You can find fixes to common issues [in the wiki page.](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Main)
# Disclaimer
The authors of this project are not responsible for any content generated using this interface.
This license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, spread misinformation and target vulnerable groups. For the full list of restrictions please read [the license](./LICENSE).
# Thanks
Special thanks to everyone behind these awesome projects, without them, none of this would have been possible:
Run Stable Diffusion on your machine with a nice UI without any hassle!
## Setup & Usage
Visit the wiki for [Setup](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup) and [Usage](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Usage) instructions, checkout the [FAQ](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/FAQ) page if you face any problems, or create a new issue!
## Features
This repository provides multiple UIs for you to play around with stable diffusion:
Contributions are welcome! **Create a discussion first of what the problem is and what you want to contribute (before you implement anything)**
## Disclaimer
The authors of this project are not responsible for any content generated using this interface.
This license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, spread misinformation and target vulnerable groups. For the full list of restrictions please read [the license](./LICENSE).
## Thanks
Special thanks to everyone behind these awesome projects, without them, none of this would have been possible:
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.