Skip to content

Commit

Permalink
also remove legacy sapi v1 while i'm at it
Browse files Browse the repository at this point in the history
this is the old one that wasn't support anymore already anyway
  • Loading branch information
mcmonkey4eva committed Jun 21, 2024
1 parent 89b2ed9 commit a343f5a
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 263 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ This project:
- can automatically install [insightface](https://github.com/deepinsight/insightface) (MIT) for `IP Adapter - Face` support
- 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)
- 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).
- has the option to connect to remote servers to use [the Stability AI API](https://platform.stability.ai/) as a backend.
- supports user-built extensions which may have their own licenses or legal conditions.

SwarmUI 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.
Expand Down
5 changes: 3 additions & 2 deletions docs/Motivations.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ It is also hoped that building Stable Diffusion tools in C# will enable a wider

## Modularity

The project was designed to be heavily modular, such that backends are fully separated from the middle-layer which is fully separated from the frontend UI, and all components are interswappable. This is to enable extensibility and customization. For example, an extension can easily provide alternative backend generators (this project comes with several built-in, such as ComfyUI, Auto WebUI, StabilityAPI, ...) without having to edit anything else to work.
The project was designed to be heavily modular, such that backends are fully separated from the middle-layer which is fully separated from the frontend UI, and all components are interswappable. This is to enable extensibility and customization. For example, an extension can easily provide alternative backend generators (this project comes with several built-in, such as ComfyUI, Auto WebUI, ...) without having to edit anything else to work.

The limitation of this approach is some tools may not easily be intercompatible, eg the StabilityAPI backend has only a select few limited inputs, vs the local backends that have a wider range, and many parameters don't work with StabilityAPI.
The limitation of this approach is some tools may not easily be intercompatible, limiting power users to only the most well supported tools.

## Comfy

Expand All @@ -24,6 +24,7 @@ For the goal of maximizing capabilities, a 'main' backend needed to be chosen to
- The code inside is extremely clean and well written.
- It provides bonus features that other UIs can't match (ie: the workflow node editor).
- The lead developer of Comfy was hired to Stability, and was able to directly help in ensuring the SwarmUI-ComfyUI integration works as best it can.
- (June 2024 note: we now continue to work together in the independent [Comfy Org](https://www.comfy.org/))

## Web Frontend

Expand Down
7 changes: 0 additions & 7 deletions src/BuiltinExtensions/StabilityAPI/README.md

This file was deleted.

198 changes: 0 additions & 198 deletions src/BuiltinExtensions/StabilityAPI/StabilityAPIBackend.cs

This file was deleted.

32 changes: 0 additions & 32 deletions src/BuiltinExtensions/StabilityAPI/StabilityAPIExtension.cs

This file was deleted.

12 changes: 2 additions & 10 deletions src/Pages/Install.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,6 @@
<a href="#" onclick="javascript:$('#gpu_check_modal').modal('show')">Do I?</a> You can learn more about <a href="https://github.com/comfyanonymous/ComfyUI">ComfyUI here</a>.
</div>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="backend_radio" id="backend_radio_stabilityapi" value="stabilityapi">
<label class="form-check-label" for="backend_radio_stabilityapi">Stability API (Remote)</label>
<div class="install_hint">The Stability API powers DreamStudio and services like it. If you don't have a powerful local PC, you can use the Stability API to power your generations.
You must have a valid API key to use this. <a href="https://platform.stability.ai/docs/getting-started/authentication" target="_blank" rel="noopener noreferrer">Click Here for info about the Stability API and how to get an API key.</a>
</div>
<input type="password" id="stability_api_key" name="Stability API Key" placeholder="Stability API Key">
</div>
<hr>
<h3>For Experienced Users: Skip Backend Install</h3>
<div class="install_hint">You can configure custom backends post-install.</div>
Expand All @@ -217,7 +209,7 @@

<div id="installer_section_models" style="display: none;">
<div class="install_q_head">Download Models</div>
<div class="install_hint">You can select models to automatically download for local running here. If you selected 'Stability API' on the previous page, you can skip this page.</div>
<div class="install_hint">You can select models to automatically download for local running here.</div>
Note: by downloading Stable Diffusion models, you agree to the terms of <a href="https://github.com/Stability-AI/stablediffusion/blob/main/LICENSE-MODEL" target="_blank" rel="noopener noreferrer">The CreativeML Open RAIL++-M License</a>.
<br>
<fieldset class="form-group" id="models_fieldset">
Expand All @@ -243,7 +235,7 @@
</div>
</fieldset>
<label>Or community models!</label>
<div class="install_hint">You can download an endless variety of community-made models from online sites such as <a href="https://huggingface.co/spaces/huggingface-projects/diffusers-gallery" target="_blank" rel="noopener noreferrer">HuggingFace</a> or <a href="https://civitai.com/" target="_blank" rel="noopener noreferrer">Civitai</a>. (NOTICE: These are examples of third-party websites featuring user-submitted models, Stability.AI offers no guarantees about what content may exist there, browse with caution.) Remember to only download '.safetensors' files, never '.ckpt' ones.</div>
<div class="install_hint">You can download an endless variety of community-made models from online sites such as <a href="https://huggingface.co/spaces/huggingface-projects/diffusers-gallery" target="_blank" rel="noopener noreferrer">HuggingFace</a> or <a href="https://civitai.com/" target="_blank" rel="noopener noreferrer">Civitai</a>. (NOTICE: These are examples of third-party websites featuring user-submitted models, We offer no guarantees about what content may exist there, browse with caution.) Remember to only download '.safetensors' files, never '.ckpt' ones.</div>
</div>

<div id="installer_section_end" style="display: none;">
Expand Down
10 changes: 0 additions & 10 deletions src/WebAPI/BasicAPIFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,6 @@ void moveFolder()
Program.Backends.AddNewOfType(Program.Backends.BackendTypes["comfyui_selfstart"], new ComfyUISelfStartBackend.ComfyUISelfStartSettings() { StartScript = path, GPU_ID = gpu, ExtraArgs = extraArgs.Trim() });
break;
}
case "stabilityapi":
if (string.IsNullOrWhiteSpace(stability_api_key))
{
await output($"Invalid stability API key!");
await socket.SendJson(new JObject() { ["error"] = $"Invalid stability API key!" }, API.WebsocketTimeout);
return null;
}
File.WriteAllText("Data/sapi_key.dat", stability_api_key);
Program.Backends.AddNewOfType(Program.Backends.BackendTypes["stability_api"]);
break;
case "none":
await output("Not installing any backend.");
break;
Expand Down
3 changes: 0 additions & 3 deletions src/wwwroot/js/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ class InstallerClass {
if (backend == null) {
return false;
}
if (backend == 'stabilityapi') {
return getRequiredElementById('stability_api_key').value != '';
}
return true;
case 'models':
return true;
Expand Down

0 comments on commit a343f5a

Please sign in to comment.