roshikhan3021 commited on
Commit
0ce60a9
·
verified ·
1 Parent(s): 570b0db

Upload 19 files

Browse files
.dockerignore ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # C#
2
+ bin/
3
+ obj/
4
+ .vs/
5
+ .vscode/
6
+ *.user
7
+ *.suo
8
+ Properties/
9
+
10
+ # This project
11
+ Output/
12
+ Data/
13
+ Models/
14
+ tmp/
15
+ Extensions/
16
+ dlbackend/
17
+
18
+ # Python
19
+ __pycache__/
20
+ venv/
21
+ *.pth
.gitattributes CHANGED
@@ -1,35 +1,3 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ *.sh text eol=lf
2
+ Dockerfile text eol=lf
3
+ .dockerignore text eol=lf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.gitignore ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # C#
2
+ bin/
3
+ obj/
4
+ .vs/
5
+ .vscode/
6
+ *.user
7
+ *.suo
8
+ Properties/
9
+ .dotnet/
10
+
11
+ # This project
12
+ Output/
13
+ Data/
14
+ Models/
15
+ tmp/
16
+ Extensions/
17
+ dlbackend/
18
+ *.debug
19
+
20
+ # Python
21
+ __pycache__/
22
+ venv/
23
+ *.pth
CONTRIBUTING.md ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing to StableSwarmUI
2
+
3
+ Please open an Issue or Discussion, or ask on Discord before opening a pull request, to make sure your work doesn't overlap with others.
4
+
5
+ (TODO: More general contributing info)
6
+
7
+ ## Languages
8
+
9
+ Want to help translate Swarm into another language?
10
+
11
+ - First: you're going to have to speak English. The English text is the "one true root" language that all other languages are derived from, it would be problematic to translate a translation.
12
+ - Are you just helping improve an existing language?
13
+ - Great! Just edit the file in `languages/(language-code).json` and improve the translations included
14
+ - Do you want to add a new language?
15
+ - See example commit here: https://github.com/Stability-AI/StableSwarmUI/commit/20fd27a20127b6529a2837eb838a0cfae80c20b8
16
+ - In short: copy/paste `languages/en.json` to `languages/(your-code).json`, fill out the info at the top, and start translating keys.
17
+ - Also add `src/wwwroot/imgs/flags/(your-code).jpg` as a small icon image of a flag that represents the language.
18
+ - You can use https://github.com/mcmonkeyprojects/translate-tool to fill out any keys you can't be bothered filling in yourself with automatic AI-powered translation
19
+ - Are you adding new translatable keys?
20
+ - I use the hidden webconsole call `debugSubmitTranslatables()` to generate `languages/en.debug` which contains a raw key list, and then use `--add-json` to add it in with the translate tool.
21
+
22
+ # Legal
23
+
24
+ By submitting a contribution to this repo, you agree to grant a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license to the Stability.AI organization to use, copy, modify, and distribute your contribution under the terms of the MIT License, view [LICENSE.txt](/LICENSE.txt) for details, and under any future license we may change to.
Dockerfile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim
2
+
3
+ # Install python
4
+ RUN apt update
5
+ RUN apt install -y git wget build-essential python3.11 python3.11-venv python3.11-dev
6
+
7
+ # Install dependencies for controlnet preprocessors
8
+ RUN apt install -y libglib2.0-0 libgl1
9
+
10
+ # Copy swarm's files into the docker container
11
+ COPY . .
12
+
13
+ # Send the port forward
14
+ EXPOSE 7801
15
+
16
+ # Set the run file to the launch script
17
+ ENTRYPOINT ["bash", "launchtools/docker.sh"]
LICENSE.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Stability AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -1,13 +1,174 @@
1
- ---
2
- title: Stability
3
- emoji: 🖼
4
- colorFrom: purple
5
- colorTo: red
6
- sdk: gradio
7
- sdk_version: 4.26.0
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # StableSwarmUI
2
+
3
+ **StableSwarmUI 0.6.4.1 Beta**.
4
+
5
+ A Modular Stable Diffusion Web-User-Interface, with an emphasis on making powertools easily accessible, high performance, and extensibility.
6
+
7
+ ![ui-screenshot](.github/images/stableswarmui.jpg)
8
+
9
+ Join the [Discord](https://discord.gg/q2y38cqjNw) to discuss the project, get support, see announcements, etc.
10
+
11
+ Follow the [Feature Announcements Thread](https://github.com/Stability-AI/StableSwarmUI/discussions/11) for updates on new features.
12
+
13
+ # Status
14
+
15
+ This project is in **Beta** status. This means for most tasks, Swarm has excellent tooling available to you, but there is much more planned. Swarm is recommended as an ideal UI for most users, beginners and pros alike. There are still some things to be worked out.
16
+
17
+ Beginner users will love Swarm's primary Generate tab interface, making it easy to generate anything with a variety of powerful features. Advanced users may favor the Comfy Workflow tab to get the unrestricted raw graph, but will still have reason to come back to the Generate tab for convenience features (image editor, auto-workflow-generation, etc) and powertools (eg Grid Generator).
18
+
19
+ Those interested in helping push Swarm from Beta to a Full ready-for-anything perfected Release status are welcome to submit PRs (read the [Contributing](/CONTRIBUTING.md) document first), and you can contact us here on GitHub or on [Discord](https://discord.gg/q2y38cqjNw). I highly recommend reaching out to ask about plans for a feature before PRing it. There may already be specific plans or even a work in progress.
20
+
21
+ Key feature targets not yet implemented:
22
+ - Better mobile browser support
23
+ - full detail "Current Model" display in UI, separate from the model selector (probably as a tab within the batch sidebar?)
24
+ - And a way to dynamically shift tabs around between spots for convenience / layout customization
25
+ - LLM-assisted prompting
26
+ - convenient direct-distribution of Swarm as a program (Electron app?)
27
+
28
+ # Try It On Google Colab or Runpod
29
+
30
+ ### Google Colab
31
+
32
+ **WARNING**: Google Colab does not necessarily allow remote WebUIs, particularly for free accounts, use at your own risk.
33
+
34
+ Colab link if you want to try Swarm: https://colab.research.google.com/github/Stability-AI/StableSwarmUI/blob/master/colab/colab-notebook.ipynb
35
+
36
+ ### Runpod
37
+
38
+ Runpod template (note: maintained by third party contributor [nerdylive123](https://github.com/nerdylive123)): https://runpod.io/console/deploy?template=u7mlkrmxq3&ref=c6jd6jj0
39
+
40
+ Note it may take several minutes to start up the first time. Check the container logs to see setup progress. Check the template `?` info for hints on how to use.
41
+
42
+ # Installing on Windows
43
+
44
+ Note: if you're on Windows 10, you may need to manually install [git](https://git-scm.com/download/win) and [DotNET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) first. (Windows 11 this is automated).
45
+
46
+ - Download [The Install-Windows.bat file](https://github.com/Stability-AI/StableSwarmUI/releases/download/0.6.1-Beta/install-windows.bat), store it somewhere you want to install at (not `Program Files`), and run it.
47
+ - It should open a command prompt and install itself.
48
+ - If it closes without going further, try running it again, it sometimes needs to run twice. (TODO: Fix that)
49
+ - It will place an icon on your desktop that you can use to re-launch the server at any time.
50
+ - When the installer completes, it will automatically launch the StableSwarmUI server, and open a browser window to the install page.
51
+ - Follow the install instructions on the page.
52
+ - After you submit, be patient, some of the install processing take a few minutes (downloading models and etc).
53
+
54
+ (TODO): Even easier self-contained pre-installer, a `.msi` or `.exe` that provides a general install screen and lets you pick folder and all.
55
+
56
+ # Alternate Manual Windows Install
57
+
58
+ - Install git from https://git-scm.com/download/win
59
+ - Install DotNET 8 SDK from https://dotnet.microsoft.com/en-us/download/dotnet/8.0 (Make sure to get the SDK x64 for Windows)
60
+ - open a terminal to the folder you want swarm in and run `git clone https://github.com/Stability-AI/StableSwarmUI`
61
+ - open the folder and run `launch-windows.bat`
62
+
63
+ # Installing on Linux
64
+
65
+ - Install `git`, `python3` via your OS package manager if they are not already installed (make sure to include `pip` and `venv` on distros that do not include them in python directly)
66
+ - For example, on recent Ubuntu versions, `sudo apt install git python3-pip python3-venv`
67
+ - Download [the install-linux.sh file](https://github.com/Stability-AI/StableSwarmUI/releases/download/0.6.1-Beta/install-linux.sh), store it somewhere you want to install at, and run it
68
+ - If you like terminals, you can open a terminal to the folder and run the following commands:
69
+ - `wget https://github.com/Stability-AI/StableSwarmUI/releases/download/0.6.1-Beta/install-linux.sh -O install-linux.sh`
70
+ - `chmod +x install-linux.sh`
71
+ - Run the `./install-linux.sh` script, it will install everything for you and eventually open the webpage in your browser.
72
+ - Follow the install instructions on-page.
73
+
74
+ - You can at any time in the future run the `launch-linux.sh` script to re-launch Swarm.
75
+ - If the page doesn't open itself, you can manually open `http://localhost:7801`
76
+
77
+ # Alternate Manual Linux Install
78
+
79
+ - Install `git`, `python3` via your OS package manager if they are not already installed (make sure to include `pip` and `venv` on distros that do not include them in python directly)
80
+ - For example, on recent Ubuntu versions, `sudo apt install git python3-pip python3-venv`
81
+ - Install DotNET 8 using the instructions at https://dotnet.microsoft.com/en-us/download/dotnet/8.0 (you need `dotnet-sdk-8.0`, as that includes all relevant sub-packages)
82
+ - Some users [have said](https://github.com/Stability-AI/StableSwarmUI/pull/6) that certain Linux distros expect `aspnet-runtime` to be installed separately
83
+ - Open a shell terminal and `cd` to a directory you want to install into
84
+ - Run shell commands:
85
+ - `git clone https://github.com/Stability-AI/StableSwarmUI`
86
+ - cd `StableSwarmUI`
87
+ - `./launch-linux.sh`
88
+ - open `http://localhost:7801/Install` (if it doesn't launch itself)
89
+ - Follow the install instructions on-page.
90
+
91
+ (TODO): Maybe outlink a dedicated document with per-distro details and whatever. Maybe also make a one-click installer for Linux?
92
+
93
+ # Installing on Mac
94
+
95
+ > **Note**: You can only run StableSwarmUI on Mac computers with M1 or M2 (Mx) Apple silicon processors.
96
+
97
+ - Open Terminal.
98
+ - Ensure your `brew` packages are updated with `brew update`.
99
+ - Verify your `brew` installation with `brew doctor`. You should not see any error in the command output.
100
+ - Install .NET for macOS: `brew install dotnet`.
101
+ - If you don't have Python, install it: `brew install python@3.10` and `brew install virtualenv`
102
+ - Change the directory (`cd`) to the folder where you want to install StableSwarmUI.
103
+ - Clone the StableSwarmUI GitHub repository: `git clone https://github.com/Stability-AI/StableSwarmUI`.
104
+ - `cd StableSwarmUI` and run the installation script: `./launch-macos.sh`.
105
+
106
+ The installation starts now and downloads the Stable Diffusion models from the internet. Depending on your internet connection, this may take several minutes. Wait for your web browser to open the StableSwarmUI window.
107
+
108
+ > During the StableSwarmUI installation, you are prompted for the type of backend you want to use. For Mac computers with M1 or M2, you can safely choose the ComfyUI backend and choose the Stable Diffusion XL Base and Refiner models in the Download Models screen.
109
+
110
+ # Running with Docker
111
+
112
+ - To forward an Nvidia GPU, you must have the Nvidia Container Toolkit installed: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
113
+ - Open a shell terminal and `cd` to a directory you want to install into
114
+ - Run shell commands:
115
+ - `git clone https://github.com/Stability-AI/StableSwarmUI`
116
+ - cd `StableSwarmUI`
117
+ - `./launch-docker.sh`
118
+ - Open your browser to `localhost:7801`
119
+ - Note that it will forward the `Models` and `Output` directory, and will mount `Data` and `dlbackend` as independent persistent volumes.
120
+
121
+ # Documentation
122
+
123
+ See [the documentation folder](/docs/README.md).
124
+
125
+ # Motivations
126
+
127
+ The "Swarm" name is in reference to the original key function of the UI: enabling a 'swarm' of GPUs to all generate images for the same user at once (especially for large grid generations). This is just the feature that inspired the name and not the end all of what Swarm is.
128
+
129
+ The overall goal of StableSwarmUI is to a be full-featured one-stop-shop for all things Stable Diffusion.
130
+
131
+ See [the motivations document](/docs/Motivations.md) for motivations on technical choices.
132
+
133
+ # Legal
134
+
135
+ This project:
136
+ - embeds a copy of [7-zip](https://7-zip.org/download.html) (LGPL).
137
+ - has the ability to auto-install [ComfyUI](https://github.com/comfyanonymous/ComfyUI) (GPL).
138
+ - has the option to use as a backend [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) (AGPL).
139
+ - can automatically install [christophschuhmann/improved-aesthetic-predictor](https://github.com/christophschuhmann/improved-aesthetic-predictor) (Apache2).
140
+ - can automatically install [yuvalkirstain/PickScore](https://github.com/yuvalkirstain/PickScore) (MIT).
141
+ - can automatically install [git-for-windows](https://git-scm.com/download/win) (GPLv2).
142
+ - can automatically install MIT/BSD/Apache2/PythonSoftwareFoundation pip packages: [spandrel](https://pypi.org/project/spandrel/), [dill](https://pypi.org/project/dill/), [imageio-ffmpeg](https://pypi.org/project/imageio-ffmpeg/), [opencv-python-headless](https://pypi.org/project/opencv-python-headless/), [matplotlib](https://pypi.org/project/matplotlib/), [rembg](https://pypi.org/project/rembg/), [kornia](https://pypi.org/project/kornia/), [Cython](https://pypi.org/project/Cython/)
143
+ - can automatically install [ultralytics](https://github.com/ultralytics/ultralytics) (AGPL) for `YOLOv8` face detection (ie `SwarmYoloDetection` node or `<segment:yolo-...>` syntax usage may become subject to AGPL terms),
144
+ - can automatically install [insightface](https://github.com/deepinsight/insightface) (MIT) for `IP Adapter - Face` support
145
+ - uses [JSON.NET](https://github.com/JamesNK/Newtonsoft.Json) (MIT), [FreneticUtilities](https://github.com/FreneticLLC/FreneticUtilities) (MIT), [LiteDB](https://github.com/mbdavid/LiteDB) (MIT), [ImageSharp](https://github.com/SixLabors/ImageSharp/) (Apache2 under open-source Split License)
146
+ - embeds copies of web assets from [BootStrap](https://getbootstrap.com/) (MIT), [Select2](https://select2.org/) (MIT), [JQuery](https://jquery.com/) (MIT), [exifr](https://github.com/MikeKovarik/exifr) (MIT).
147
+ - has the option to connect to remote servers to use [the Stability AI API](https://platform.stability.ai/) as a backend.
148
+ - supports user-built extensions which may have their own licenses or legal conditions.
149
+
150
+ StableSwarmUI itself is under the MIT license, however some usages may be affected by the GPL variant licenses of connected projects list above, and note that any models used have their own licenses.
151
+
152
+ ### License
153
+
154
+ The MIT License (MIT)
155
+
156
+ Copyright (c) 2024 Stability AI
157
+
158
+ Permission is hereby granted, free of charge, to any person obtaining a copy
159
+ of this software and associated documentation files (the "Software"), to deal
160
+ in the Software without restriction, including without limitation the rights
161
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
162
+ copies of the Software, and to permit persons to whom the Software is
163
+ furnished to do so, subject to the following conditions:
164
+
165
+ The above copyright notice and this permission notice shall be included in all
166
+ copies or substantial portions of the Software.
167
+
168
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
169
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
170
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
171
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
172
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
173
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
174
+ SOFTWARE.
StableSwarmUI.sln ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 
2
+ Microsoft Visual Studio Solution File, Format Version 12.00
3
+ # Visual Studio Version 17
4
+ VisualStudioVersion = 17.5.33530.505
5
+ MinimumVisualStudioVersion = 10.0.40219.1
6
+ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StableSwarmUI", "src\StableSwarmUI.csproj", "{2A621042-196A-4F9C-88EA-10369EAEE774}"
7
+ EndProject
8
+ Global
9
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
10
+ Debug|Any CPU = Debug|Any CPU
11
+ Release|Any CPU = Release|Any CPU
12
+ EndGlobalSection
13
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
14
+ {2A621042-196A-4F9C-88EA-10369EAEE774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15
+ {2A621042-196A-4F9C-88EA-10369EAEE774}.Debug|Any CPU.Build.0 = Debug|Any CPU
16
+ {2A621042-196A-4F9C-88EA-10369EAEE774}.Release|Any CPU.ActiveCfg = Release|Any CPU
17
+ {2A621042-196A-4F9C-88EA-10369EAEE774}.Release|Any CPU.Build.0 = Release|Any CPU
18
+ EndGlobalSection
19
+ GlobalSection(SolutionProperties) = preSolution
20
+ HideSolutionNode = FALSE
21
+ EndGlobalSection
22
+ GlobalSection(ExtensibilityGlobals) = postSolution
23
+ SolutionGuid = {FD662A7C-77C1-49E7-B0AC-EF986731A226}
24
+ EndGlobalSection
25
+ EndGlobal
docker-compose.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ stableswarmui:
3
+ image: stableswarmui
4
+ build: .
5
+ container_name: stableswarmui
6
+ # uncomment `networks: host` if you want to access other services on the host network (eg a separated comfy instance)
7
+ # networks: host
8
+ volumes:
9
+ - swarmdata:/Data
10
+ - swarmbackend:/dlbackend
11
+ - ./Models:/Models
12
+ - ./Output:/Output
13
+ ports:
14
+ - "7801:7801"
15
+ deploy:
16
+ resources:
17
+ reservations:
18
+ devices:
19
+ - driver: nvidia
20
+ # change the count to the number of GPUs you want to use.
21
+ count: 1
22
+ capabilities: [gpu]
23
+ volumes:
24
+ swarmdata:
25
+ swarmbackend:
install-linux.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ # Ensure correct local path.
4
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5
+ cd $SCRIPT_DIR
6
+
7
+ # Accidental run prevention
8
+ if [ -d "StableSwarmUI" ]; then
9
+ echo "StableSwarmUI already exists in this directory. Please remove it before installing."
10
+ exit 1
11
+ fi
12
+ if [ -f "StableSwarmUI.sln" ]; then
13
+ echo "StableSwarmUI already exists in this directory. Please remove it before installing."
14
+ exit 1
15
+ fi
16
+
17
+ # Download swarm
18
+ git clone https://github.com/Stability-AI/StableSwarmUI
19
+ cd StableSwarmUI
20
+
21
+ # install dotnet
22
+ cd launchtools
23
+ rm dotnet-install.sh
24
+ # https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
25
+ wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
26
+ chmod +x dotnet-install.sh
27
+
28
+ # Note: manual installers that want to avoid home dir, add to both of the below lines: --install-dir $SCRIPT_DIR/.dotnet
29
+ ./dotnet-install.sh --channel 8.0 --runtime aspnetcore
30
+ ./dotnet-install.sh --channel 8.0
31
+ cd ..
32
+
33
+ # Launch
34
+ ./launch-linux.sh $@
install-windows.bat ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+
3
+ cd /d "%~dp0"
4
+
5
+ if exist StableSwarmUI (
6
+ echo StableSwarmUI is already installed in this folder. If this is incorrect, delete the 'StableSwarmUI' folder and try again.
7
+ pause
8
+ exit
9
+ )
10
+
11
+ if exist StableSwarmUI.sln (
12
+ echo StableSwarmUI is already installed in this folder. If this is incorrect, delete 'StableSwarmUI.sln' and try again.
13
+ pause
14
+ exit
15
+ )
16
+
17
+ winget install Microsoft.DotNet.SDK.8 --accept-source-agreements --accept-package-agreements
18
+ winget install --id Git.Git -e --source winget --accept-source-agreements --accept-package-agreements
19
+
20
+ git clone https://github.com/Stability-AI/StableSwarmUI
21
+ cd StableSwarmUI
22
+
23
+ call .\make-shortcut.bat
24
+
25
+ call .\launch-windows.bat --launch_mode webinstall
26
+
27
+ IF %ERRORLEVEL% NEQ 0 ( pause )
launch-docker.sh ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ docker build -t stableswarmui .
4
+
5
+ # add "--network=host" if you want to access other services on the host network (eg a separated comfy instance)
6
+ docker run -it \
7
+ --name stableswarmui \
8
+ --mount source=swarmdata,target=/Data \
9
+ --mount source=swarmbackend,target=/dlbackend \
10
+ -v ./Models:/Models \
11
+ -v ./Output:/Output \
12
+ --gpus=all -p 7801:7801 stableswarmui
launch-linux.sh ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ # Ensure correct local path.
4
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5
+ cd $SCRIPT_DIR
6
+
7
+ # Add dotnet non-admin-install to path
8
+ export PATH="$SCRIPT_DIR/.dotnet:~/.dotnet:$PATH"
9
+
10
+ # Server settings option
11
+ if [ -f ./src/bin/always_pull ]; then
12
+ echo "Pulling latest changes..."
13
+ git pull
14
+ fi
15
+
16
+ if [ -f ./src/bin/must_rebuild ]; then
17
+ echo "Rebuilding..."
18
+ rm -rf ./src/bin/live_release_backup
19
+ mv ./src/bin/live_release ./src/bin/live_release_backup
20
+ rm ./src/bin/must_rebuild
21
+ elif [ -d .git ]; then
22
+ cur_head=`git rev-parse HEAD`
23
+ built_head=`cat src/bin/last_build`
24
+ if [ "$cur_head" != "$built_head" ]; then
25
+ printf "\n\nWARNING: You did a git pull without building. Will now build for you...\n\n"
26
+ rm -rf ./src/bin/live_release_backup
27
+ mv ./src/bin/live_release ./src/bin/live_release_backup
28
+ fi
29
+ else
30
+ printf "\n\nWARNING: YOU DID NOT CLONE FROM GIT. THIS WILL BREAK SOME SYSTEMS. PLEASE INSTALL PER THE README.\n\n"
31
+ fi
32
+
33
+ # Build the program if it isn't already built
34
+ if [ ! -f src/bin/live_release/StableSwarmUI.dll ]; then
35
+ dotnet build src/StableSwarmUI.csproj --configuration Release -o ./src/bin/live_release
36
+ cur_head=`git rev-parse HEAD`
37
+ echo $cur_head > src/bin/last_build
38
+ fi
39
+
40
+ # Default env configuration, gets overwritten by the C# code's settings handler
41
+ export ASPNETCORE_ENVIRONMENT="Production"
42
+ export ASPNETCORE_URLS="http://*:7801"
43
+ # Actual runner.
44
+ dotnet src/bin/live_release/StableSwarmUI.dll $@
45
+
46
+ # Exit code 42 means restart, anything else = don't.
47
+ if [ $? == 42 ]; then
48
+ . ./launch-linux.sh $@
49
+ fi
launch-macos.sh ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ # Ensure correct local path.
4
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5
+ cd $SCRIPT_DIR
6
+
7
+ # Building first is more reliable than running directly from src
8
+ dotnet build src/StableSwarmUI.csproj --configuration Release -o ./src/bin/live_release
9
+ # Default env configuration, gets overwritten by the C# code's settings handler
10
+ ASPNETCORE_ENVIRONMENT="Production"
11
+ ASPNETCORE_URLS="http://*:7801"
12
+
13
+ # PyTorch MPS fallback to CPU, so incompatible comfy nodes can still work.
14
+ export PYTORCH_ENABLE_MPS_FALLBACK=1
15
+
16
+ # Actual runner.
17
+ dotnet src/bin/live_release/StableSwarmUI.dll $@
launch-windows-dev.ps1 ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ensure correct local path.
2
+ $thisPath = Split-Path $MyInvocation.MyCommand.Path -Parent
3
+ cd $thisPath
4
+
5
+ # Visual Studio likes to generate invalid files here for some reason, so autonuke it
6
+ if (Test-Path "src/Properties/launchSettings.json") {
7
+ rm src/Properties/launchSettings.json
8
+ }
9
+
10
+ # Nuke build files to ensure our build is fresh and won't skip past errors
11
+ Remove-Item 'src/bin/' -Recurse
12
+ Remove-Item 'src/obj/' -Recurse
13
+
14
+ # Building first is more reliable than running directly from src
15
+ dotnet build src/StableSwarmUI.csproj --configuration Debug -o src/bin/live_release
16
+
17
+ # Default env configuration, gets overwritten by the C# code's settings handler
18
+ $Env:ASPNETCORE_ENVIRONMENT = "Production"
19
+ $Env:ASPNETCORE_URLS = "http://*:7801"
20
+
21
+ # Actual runner.
22
+ dotnet src\bin\live_release\StableSwarmUI.dll --environment dev @args
launch-windows.bat ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal ENABLEDELAYEDEXPANSION
3
+
4
+ rem Ensure correct local path.
5
+ cd /D "%~dp0"
6
+
7
+ rem Microsoft borked the dotnet installer/path handler, so force x64 to be read first
8
+ set PATH=C:\Program Files\dotnet;%PATH%
9
+
10
+ rem Server settings option
11
+ if exist .\src\bin\always_pull (
12
+ echo "Pulling latest changes..."
13
+ git pull
14
+ )
15
+
16
+ if exist .\src\bin\must_rebuild (
17
+ echo "Rebuilding..."
18
+ rmdir /s /q .\src\bin\live_release_backup
19
+ move .\src\bin\live_release .\src\bin\live_release_backup
20
+ del .\src\bin\must_rebuild
21
+ ) else if not exist .git (
22
+ echo "" & echo ""
23
+ echo "WARNING: YOU DID NOT CLONE FROM GIT. THIS WILL BREAK SOME SYSTEMS. PLEASE INSTALL PER THE README."
24
+ echo "" & echo ""
25
+ ) else (
26
+ for /f "delims=" %%i in ('git rev-parse HEAD') do set CUR_HEAD=%%i
27
+ set /p BUILT_HEAD=<src/bin/last_build
28
+ if not "!CUR_HEAD!"=="!BUILT_HEAD!" (
29
+ echo "" & echo ""
30
+ echo "WARNING: You did a git pull without building. Will now build for you..."
31
+ echo "" & echo ""
32
+ rmdir /s /q .\src\bin\live_release_backup
33
+ move .\src\bin\live_release .\src\bin\live_release_backup
34
+ )
35
+ )
36
+
37
+ rem Build the program if it isn't already built
38
+ if not exist src\bin\live_release\StableSwarmUI.dll (
39
+ rem For some reason Microsoft's nonsense is missing the official nuget source? So forcibly add that to be safe.
40
+ dotnet nuget add source https://api.nuget.org/v3/index.json --name "NuGet official package source"
41
+
42
+ dotnet build src/StableSwarmUI.csproj --configuration Release -o src/bin/live_release
43
+ for /f "delims=" %%i in ('git rev-parse HEAD') do set CUR_HEAD2=%%i
44
+ echo !CUR_HEAD2!> src/bin/last_build
45
+ )
46
+
47
+ rem Default env configuration, gets overwritten by the C# code's settings handler
48
+ set ASPNETCORE_ENVIRONMENT="Production"
49
+ set ASPNETCORE_URLS="http://*:7801"
50
+
51
+ dotnet src\bin\live_release\StableSwarmUI.dll %*
52
+
53
+ rem Exit code 42 means restart, anything else = don't.
54
+ if %ERRORLEVEL% EQU 42 (
55
+ echo "Restarting..."
56
+ call launch-windows.bat %*
57
+ )
58
+
59
+ IF %ERRORLEVEL% NEQ 0 ( pause )
make-shortcut.bat ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ @echo off
2
+
3
+ set SHORTCUTPATH="%userprofile%\Desktop\StableSwarmUI.url"
4
+ echo [InternetShortcut] >> "%SHORTCUTPATH%"
5
+ echo URL="%CD%\launch-windows.bat" >> "%SHORTCUTPATH%"
6
+ echo IconFile="%CD%\src\wwwroot\favicon.ico" >> "%SHORTCUTPATH%"
7
+ echo IconIndex=0 >> "%SHORTCUTPATH%"
update-linuxmac.sh ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ # Ensure correct local path.
4
+ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5
+ cd $SCRIPT_DIR
6
+
7
+ # Add dotnet non-admin-install to path
8
+ export PATH="$SCRIPT_DIR/.dotnet:~/.dotnet:$PATH"
9
+
10
+ # The actual update
11
+ git pull
12
+
13
+ # Make a backup of the current live_release to be safe
14
+ if [ -d ./src/bin/live_release ]; then
15
+ rm -rf ./src/bin/live_release_backup
16
+ mv ./src/bin/live_release ./src/bin/live_release_backup
17
+ fi
18
+
19
+ # Now build the new copy
20
+ dotnet build src/StableSwarmUI.csproj --configuration Release -o ./src/bin/live_release
update-windows.bat ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+
3
+ rem Ensure correct local path.
4
+ cd /D "%~dp0"
5
+
6
+ rem Microsoft borked the dotnet installer/path handler, so force x64 to be read first
7
+ set PATH=C:\Program Files\dotnet;%PATH%
8
+
9
+ rem For some reason Microsoft's nonsense is missing the official nuget source? So forcibly add that to be safe.
10
+ dotnet nuget add source https://api.nuget.org/v3/index.json --name "NuGet official package source"
11
+
12
+ rem The actual update
13
+ git pull
14
+
15
+ rem Make a backup of the current live_release to be safe
16
+ if exist src\bin\live_release\ (
17
+ rmdir /s /q src\bin\live_release_backup
18
+ move src\bin\live_release src\bin\live_release_backup
19
+ )
20
+
21
+ rem Now build the new copy
22
+ dotnet build src/StableSwarmUI.csproj --configuration Release -o src/bin/live_release
23
+
24
+ timeout 3