Meismaxandmaxisme commited on
Commit
7248238
·
verified ·
1 Parent(s): a970b13

Upload 19 files

Browse files
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Rupesh Sreeraman
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 ADDED
@@ -0,0 +1,731 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FastSD CPU :sparkles:[![Mentioned in Awesome OpenVINO](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/openvinotoolkit/awesome-openvino)
2
+
3
+ <div align="center">
4
+ <a href="https://trendshift.io/repositories/3957" target="_blank"><img src="https://trendshift.io/api/badge/repositories/3957" alt="rupeshs%2Ffastsdcpu | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
5
+ </div>
6
+
7
+ FastSD CPU is a faster version of Stable Diffusion on CPU. Based on [Latent Consistency Models](https://github.com/luosiallen/latent-consistency-model) and
8
+ [Adversarial Diffusion Distillation](https://nolowiz.com/fast-stable-diffusion-on-cpu-using-fastsd-cpu-and-openvino/).
9
+
10
+ ![FastSD CPU screenshot](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/fastsdcpu-webui.png)
11
+ The following interfaces are available :
12
+
13
+ - Desktop GUI, basic text to image generation (Qt,faster)
14
+ - WebUI (Advanced features,Lora,controlnet etc)
15
+ - CLI (CommandLine Interface)
16
+
17
+ 🚀 Using **OpenVINO(SDXS-512-0.9)**, it took **0.82 seconds** (**820 milliseconds**) to create a single 512x512 image on a **Core i7-12700**.
18
+
19
+ ## 📰 News
20
+
21
+ - **2025-05-17** - Added SANA Sprint(OpenVINO) support,Tiny AutoEncoder 1.3(Mocha Croissant) support
22
+ - **2025-04-20** - Added MCP server support,faster uv based installation,Cluade desktop, Open WebUI support
23
+ - **2024-11-03** - Added Intel Core Ultra Series 2 (Lunar Lake) NPU support
24
+ - **2024-10-02** - Added GGUF diffusion model(Flux) support
25
+ - **2024-09-03** – Added Intel AI PC GPU, NPU support 🚀
26
+
27
+ ## Table of Contents 👇
28
+
29
+ - [Supported&nbsp;Platforms](#Supported&nbsp;platforms)
30
+ - [Dependencies](#dependencies)
31
+ - [Memory requirements](#memory-requirements)
32
+ - [Features](#features)
33
+ - [Benchmarks](#fast-inference-benchmarks)
34
+ - [OpenVINO Support](#openvino)
35
+ - [Installation](#installation)
36
+ - [Real-time text to image (EXPERIMENTAL)](#real-time-text-to-image)
37
+ - [Models](#models)
38
+ - [How to use Lora models](#useloramodels)
39
+ - [How to use controlnet](#usecontrolnet)
40
+ - [Android + Termux](#android)
41
+ - [Raspberry Pi 4](#raspberry)
42
+ - [API&nbsp;Support](#apisupport)
43
+ - [GGUF support (Flux)](#gguf-support)
44
+ - [AI PC Support - OpenVINO](#ai-pc-support)
45
+ - [MCP Server Support](#mcpsupport)
46
+ - [Open WebUI Support](#openwebuisupport)
47
+ - [ComfyUI support](#comfyuisupport)
48
+ - [License](#license)
49
+ - [Contributors](#contributors)
50
+
51
+ ## Supported platforms⚡️
52
+
53
+ FastSD CPU works on the following platforms:
54
+
55
+ - Windows
56
+ - Linux
57
+ - Mac
58
+ - Android + Termux
59
+ - Raspberry PI 4
60
+
61
+ ## Dependencies 📦
62
+
63
+ - Python 3.10 or higher
64
+ - [uv - fast Python package and project manager](https://docs.astral.sh/uv/)
65
+
66
+ ## Memory requirements
67
+
68
+ Minimum system RAM requirement for FastSD CPU.
69
+
70
+ Model (LCM,OpenVINO): SD Turbo, 1 step, 512 x 512
71
+
72
+ Model (LCM-LoRA): Dreamshaper v8, 3 step, 512 x 512
73
+
74
+ | Mode | Min RAM |
75
+ | --------------------- | ------------- |
76
+ | LCM | 2 GB |
77
+ | LCM-LoRA | 4 GB |
78
+ | OpenVINO | 11 GB |
79
+
80
+ If we enable Tiny decoder(TAESD) we can save some memory(2GB approx) for example in OpenVINO mode memory usage will become 9GB.
81
+
82
+ :exclamation: Please note that guidance scale >1 increases RAM usage and slow inference speed.
83
+
84
+ ## Features ✨
85
+
86
+ - Desktop GUI, web UI and CLI
87
+ - Supports 256,512,768,1024 image sizes
88
+ - Supports Windows,Linux,Mac
89
+ - Saves images and diffusion setting used to generate the image
90
+ - Settings to control,steps,guidance and seed
91
+ - Added safety checker setting
92
+ - Maximum inference steps increased to 25
93
+ - Added [OpenVINO](https://github.com/openvinotoolkit/openvino) support
94
+ - Fixed OpenVINO image reproducibility issue
95
+ - Fixed OpenVINO high RAM usage,thanks [deinferno](https://github.com/deinferno)
96
+ - Added multiple image generation support
97
+ - Application settings
98
+ - Added Tiny Auto Encoder for SD (TAESD) support, 1.4x speed boost (Fast,moderate quality)
99
+ - Safety checker disabled by default
100
+ - Added SDXL,SSD1B - 1B LCM models
101
+ - Added LCM-LoRA support, works well for fine-tuned Stable Diffusion model 1.5 or SDXL models
102
+ - Added negative prompt support in LCM-LoRA mode
103
+ - LCM-LoRA models can be configured using text configuration file
104
+ - Added support for custom models for OpenVINO (LCM-LoRA baked)
105
+ - OpenVINO models now supports negative prompt (Set guidance >1.0)
106
+ - Real-time inference support,generates images while you type (experimental)
107
+ - Fast 2,3 steps inference
108
+ - Lcm-Lora fused models for faster inference
109
+ - Supports integrated GPU(iGPU) using OpenVINO (export DEVICE=GPU)
110
+ - 5.7x speed using OpenVINO(steps: 2,tiny autoencoder)
111
+ - Image to Image support (Use Web UI)
112
+ - OpenVINO image to image support
113
+ - Fast 1 step inference (SDXL Turbo)
114
+ - Added SD Turbo support
115
+ - Added image to image support for Turbo models (Pytorch and OpenVINO)
116
+ - Added image variations support
117
+ - Added 2x upscaler (EDSR and Tiled SD upscale (experimental)),thanks [monstruosoft](https://github.com/monstruosoft) for SD upscale
118
+ - Works on Android + Termux + PRoot
119
+ - Added interactive CLI,thanks [monstruosoft](https://github.com/monstruosoft)
120
+ - Added basic lora support to CLI and WebUI
121
+ - ONNX EDSR 2x upscale
122
+ - Add SDXL-Lightning support
123
+ - Add SDXL-Lightning OpenVINO support (int8)
124
+ - Add multilora support,thanks [monstruosoft](https://github.com/monstruosoft)
125
+ - Add basic ControlNet v1.1 support(LCM-LoRA mode),thanks [monstruosoft](https://github.com/monstruosoft)
126
+ - Add ControlNet annotators(Canny,Depth,LineArt,MLSD,NormalBAE,Pose,SoftEdge,Shuffle)
127
+ - Add SDXS-512 0.9 support
128
+ - Add SDXS-512 0.9 OpenVINO,fast 1 step inference (0.8 seconds to generate 512x512 image)
129
+ - Default model changed to SDXS-512-0.9
130
+ - Faster realtime image generation
131
+ - Add NPU device check
132
+ - Revert default model to SDTurbo
133
+ - Update realtime UI
134
+ - Add hypersd support
135
+ - 1 step fast inference support for SDXL and SD1.5
136
+ - Experimental support for single file Safetensors SD 1.5 models(Civitai models), simply add local model path to configs/stable-diffusion-models.txt file.
137
+ - Add REST API support
138
+ - Add Aura SR (4x)/GigaGAN based upscaler support
139
+ - Add Aura SR v2 upscaler support
140
+ - Add FLUX.1 schnell OpenVINO int 4 support
141
+ - Add CLIP skip support
142
+ - Add token merging support
143
+ - Add Intel AI PC support
144
+ - AI PC NPU(Power efficient inference using OpenVINO) supports, text to image ,image to image and image variations support
145
+ - Add [TAEF1 (Tiny autoencoder for FLUX.1) openvino](https://huggingface.co/rupeshs/taef1-openvino) support
146
+ - Add Image to Image and Image Variations Qt GUI support,thanks [monstruosoft](https://github.com/monstruosoft)
147
+
148
+ <a id="fast-inference-benchmarks"></a>
149
+
150
+ ## Fast Inference Benchmarks
151
+
152
+ ### 🚀 Fast 1 step inference with Hyper-SD
153
+
154
+ #### Stable diffuion 1.5
155
+
156
+ Works with LCM-LoRA mode.
157
+ Fast 1 step inference supported on `runwayml/stable-diffusion-v1-5` model,select `rupeshs/hypersd-sd1-5-1-step-lora` lcm_lora model from the settings.
158
+
159
+ #### Stable diffuion XL
160
+
161
+ Works with LCM and LCM-OpenVINO mode.
162
+
163
+ - *Hyper-SD SDXL 1 step* - [rupeshs/hyper-sd-sdxl-1-step](https://huggingface.co/rupeshs/hyper-sd-sdxl-1-step)
164
+
165
+ - *Hyper-SD SDXL 1 step OpenVINO* - [rupeshs/hyper-sd-sdxl-1-step-openvino-int8](https://huggingface.co/rupeshs/hyper-sd-sdxl-1-step-openvino-int8)
166
+
167
+ #### Inference Speed
168
+
169
+ Tested on Core i7-12700 to generate **768x768** image(1 step).
170
+
171
+ | Diffusion Pipeline | Latency |
172
+ | --------------------- | ------------- |
173
+ | Pytorch | 19s |
174
+ | OpenVINO | 13s |
175
+ | OpenVINO + TAESDXL | 6.3s |
176
+
177
+ ### Fastest 1 step inference (SDXS-512-0.9)
178
+
179
+ :exclamation:This is an experimental model, only text to image workflow is supported.
180
+
181
+ #### Inference Speed
182
+
183
+ Tested on Core i7-12700 to generate **512x512** image(1 step).
184
+
185
+ **SDXS-512-0.9**
186
+
187
+ | Diffusion Pipeline | Latency |
188
+ | --------------------- | ------------- |
189
+ | Pytorch | 4.8s |
190
+ | OpenVINO | 3.8s |
191
+ | OpenVINO + TAESD | **0.82s** |
192
+
193
+ ### 🚀 Fast 1 step inference (SD/SDXL Turbo - Adversarial Diffusion Distillation,ADD)
194
+
195
+ Added support for ultra fast 1 step inference using [sdxl-turbo](https://huggingface.co/stabilityai/sdxl-turbo) model
196
+
197
+ :exclamation: These SD turbo models are intended for research purpose only.
198
+
199
+ #### Inference Speed
200
+
201
+ Tested on Core i7-12700 to generate **512x512** image(1 step).
202
+
203
+ **SD Turbo**
204
+
205
+ | Diffusion Pipeline | Latency |
206
+ | --------------------- | ------------- |
207
+ | Pytorch | 7.8s |
208
+ | OpenVINO | 5s |
209
+ | OpenVINO + TAESD | 1.7s |
210
+
211
+ **SDXL Turbo**
212
+
213
+ | Diffusion Pipeline | Latency |
214
+ | --------------------- | ------------- |
215
+ | Pytorch | 10s |
216
+ | OpenVINO | 5.6s |
217
+ | OpenVINO + TAESDXL | 2.5s |
218
+
219
+ ### 🚀 Fast 2 step inference (SDXL-Lightning - Adversarial Diffusion Distillation)
220
+
221
+ SDXL-Lightning works with LCM and LCM-OpenVINO mode.You can select these models from app settings.
222
+
223
+ Tested on Core i7-12700 to generate **768x768** image(2 steps).
224
+
225
+ | Diffusion Pipeline | Latency |
226
+ | --------------------- | ------------- |
227
+ | Pytorch | 18s |
228
+ | OpenVINO | 12s |
229
+ | OpenVINO + TAESDXL | 10s |
230
+
231
+ - *SDXL-Lightning* - [rupeshs/SDXL-Lightning-2steps](https://huggingface.co/rupeshs/SDXL-Lightning-2steps)
232
+
233
+ - *SDXL-Lightning OpenVINO* - [rupeshs/SDXL-Lightning-2steps-openvino-int8](https://huggingface.co/rupeshs/SDXL-Lightning-2steps-openvino-int8)
234
+
235
+ ### 2 Steps fast inference (LCM)
236
+
237
+ FastSD CPU supports 2 to 3 steps fast inference using LCM-LoRA workflow. It works well with SD 1.5 models.
238
+
239
+ ![2 Steps inference](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/2steps-inference.jpg)
240
+
241
+ ### FLUX.1-schnell OpenVINO support
242
+
243
+ ![FLUX Schenell OpenVINO](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/fastsdcpu_flux_on_cpu.png)
244
+
245
+ :exclamation: Important - Please note the following points with FLUX workflow
246
+
247
+ - As of now only text to image generation mode is supported
248
+ - Use OpenVINO mode
249
+ - Use int4 model - *rupeshs/FLUX.1-schnell-openvino-int4*
250
+ - 512x512 image generation needs around **30GB** system RAM
251
+
252
+ Tested on Intel Core i7-12700 to generate **512x512** image(3 steps).
253
+
254
+ | Diffusion Pipeline | Latency |
255
+ | --------------------- | ------------- |
256
+ | OpenVINO | 4 min 30sec |
257
+
258
+ ### Benchmark scripts
259
+
260
+ To benchmark run the following batch file on Windows:
261
+
262
+ - `benchmark.bat` - To benchmark Pytorch
263
+ - `benchmark-openvino.bat` - To benchmark OpenVINO
264
+
265
+ Alternatively you can run benchmarks by passing `-b` command line argument in CLI mode.
266
+ <a id="openvino"></a>
267
+
268
+ ## OpenVINO support
269
+
270
+ Fast SD CPU utilizes [OpenVINO](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/overview.html) to speed up the inference speed.
271
+ Thanks [deinferno](https://github.com/deinferno) for the OpenVINO model contribution.
272
+ We can get 2x speed improvement when using OpenVINO.
273
+ Thanks [Disty0](https://github.com/Disty0) for the conversion script.
274
+
275
+ ### OpenVINO SDXL models
276
+
277
+ These are models converted to use directly use it with FastSD CPU. These models are compressed to int8 to reduce the file size (10GB to 4.4 GB) using [NNCF](https://github.com/openvinotoolkit/nncf)
278
+
279
+ - Hyper-SD SDXL 1 step - [rupeshs/hyper-sd-sdxl-1-step-openvino-int8](https://huggingface.co/rupeshs/hyper-sd-sdxl-1-step-openvino-int8)
280
+ - SDXL Lightning 2 steps - [rupeshs/SDXL-Lightning-2steps-openvino-int8](https://huggingface.co/rupeshs/SDXL-Lightning-2steps-openvino-int8)
281
+
282
+ ### OpenVINO SD Turbo models
283
+
284
+ We have converted SD/SDXL Turbo models to OpenVINO for fast inference on CPU. These models are intended for research purpose only. Also we converted TAESDXL MODEL to OpenVINO and
285
+
286
+ - *SD Turbo OpenVINO* - [rupeshs/sd-turbo-openvino](https://huggingface.co/rupeshs/sd-turbo-openvino)
287
+ - *SDXL Turbo OpenVINO int8* - [rupeshs/sdxl-turbo-openvino-int8](https://huggingface.co/rupeshs/sdxl-turbo-openvino-int8)
288
+ - *TAESDXL OpenVINO* - [rupeshs/taesdxl-openvino](https://huggingface.co/rupeshs/taesdxl-openvino)
289
+
290
+ You can directly use these models in FastSD CPU.
291
+
292
+ ### Convert SD 1.5 models to OpenVINO LCM-LoRA fused models
293
+
294
+ We first creates LCM-LoRA baked in model,replaces the scheduler with LCM and then converts it into OpenVINO model. For more details check [LCM OpenVINO Converter](https://github.com/rupeshs/lcm-openvino-converter), you can use this tools to convert any StableDiffusion 1.5 fine tuned models to OpenVINO.
295
+
296
+ <a id="real-time-text-to-image"></a>
297
+
298
+ ## Real-time text to image (EXPERIMENTAL)
299
+
300
+ We can generate real-time text to images using FastSD CPU.
301
+
302
+ **CPU (OpenVINO)**
303
+
304
+ Near real-time inference on CPU using OpenVINO, run the `start-realtime.bat` batch file and open the link in browser (Resolution : 512x512,Latency : 0.82s on Intel Core i7)
305
+
306
+ Watch YouTube video :
307
+
308
+ [![IMAGE_ALT](https://img.youtube.com/vi/0XMiLc_vsyI/0.jpg)](https://www.youtube.com/watch?v=0XMiLc_vsyI)
309
+
310
+ ## Models
311
+
312
+ To use single file [Safetensors](https://huggingface.co/docs/safetensors/en/index) SD 1.5 models(Civit AI) follow this [YouTube tutorial](https://www.youtube.com/watch?v=zZTfUZnXJVk). Use LCM-LoRA Mode for single file safetensors.
313
+
314
+ Fast SD supports LCM models and LCM-LoRA models.
315
+
316
+ ### LCM Models
317
+
318
+ These models can be configured in `configs/lcm-models.txt` file.
319
+
320
+ ### OpenVINO models
321
+
322
+ These are LCM-LoRA baked in models. These models can be configured in `configs/openvino-lcm-models.txt` file
323
+
324
+ ### LCM-LoRA models
325
+
326
+ These models can be configured in `configs/lcm-lora-models.txt` file.
327
+
328
+ - *lcm-lora-sdv1-5* - distilled consistency adapter for [runwayml/stable-diffusion-v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5)
329
+ - *lcm-lora-sdxl* - Distilled consistency adapter for [stable-diffusion-xl-base-1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0)
330
+ - *lcm-lora-ssd-1b* - Distilled consistency adapter for [segmind/SSD-1B](https://huggingface.co/segmind/SSD-1B)
331
+
332
+ These models are used with Stablediffusion base models `configs/stable-diffusion-models.txt`.
333
+
334
+ :exclamation: Currently no support for OpenVINO LCM-LoRA models.
335
+
336
+ ### How to add new LCM-LoRA models
337
+
338
+ To add new model follow the steps:
339
+ For example we will add `wavymulder/collage-diffusion`, you can give Stable diffusion 1.5 Or SDXL,SSD-1B fine tuned models.
340
+
341
+ 1. Open `configs/stable-diffusion-models.txt` file in text editor.
342
+ 2. Add the model ID `wavymulder/collage-diffusion` or locally cloned path.
343
+
344
+ Updated file as shown below :
345
+
346
+ ```Lykon/dreamshaper-8
347
+ Fictiverse/Stable_Diffusion_PaperCut_Model
348
+ stabilityai/stable-diffusion-xl-base-1.0
349
+ runwayml/stable-diffusion-v1-5
350
+ segmind/SSD-1B
351
+ stablediffusionapi/anything-v5
352
+ wavymulder/collage-diffusion
353
+ ```
354
+
355
+ Similarly we can update `configs/lcm-lora-models.txt` file with lcm-lora ID.
356
+
357
+ ### How to use LCM-LoRA models offline
358
+
359
+ Please follow the steps to run LCM-LoRA models offline :
360
+
361
+ - In the settings ensure that "Use locally cached model" setting is ticked.
362
+ - Download the model for example `latent-consistency/lcm-lora-sdv1-5`
363
+ Run the following commands:
364
+
365
+ ```
366
+ git lfs install
367
+ git clone https://huggingface.co/latent-consistency/lcm-lora-sdv1-5
368
+ ```
369
+
370
+ Copy the cloned model folder path for example "D:\demo\lcm-lora-sdv1-5" and update the `configs/lcm-lora-models.txt` file as shown below :
371
+
372
+ ```
373
+ D:\demo\lcm-lora-sdv1-5
374
+ latent-consistency/lcm-lora-sdxl
375
+ latent-consistency/lcm-lora-ssd-1b
376
+ ```
377
+
378
+ - Open the app and select the newly added local folder in the combo box menu.
379
+ - That's all!
380
+ <a id="useloramodels"></a>
381
+
382
+ ## How to use Lora models
383
+
384
+ Place your lora models in "lora_models" folder. Use LCM or LCM-Lora mode.
385
+ You can download lora model (.safetensors/Safetensor) from [Civitai](https://civitai.com/) or [Hugging Face](https://huggingface.co/)
386
+ E.g: [cutecartoonredmond](https://civitai.com/models/207984/cutecartoonredmond-15v-cute-cartoon-lora-for-liberteredmond-sd-15?modelVersionId=234192)
387
+ <a id="usecontrolnet"></a>
388
+
389
+ ## ControlNet support
390
+
391
+ We can use ControlNet in LCM-LoRA mode.
392
+
393
+ Download ControlNet models from [ControlNet-v1-1](https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/tree/main).Download and place controlnet models in "controlnet_models" folder.
394
+
395
+ Use the medium size models (723 MB)(For example : <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/blob/main/control_v11p_sd15_canny_fp16.safetensors>)
396
+
397
+ ## Installation
398
+
399
+ ### FastSD CPU on Windows
400
+
401
+ ![FastSD CPU Desktop GUI Screenshot](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/fastsdcpu-gui.jpg)
402
+
403
+ :exclamation:**You must have a working Python and uv installation.(Recommended : Python 3.10 or higher )**
404
+
405
+ To install FastSD CPU on Windows run the following steps :
406
+
407
+ - Clone/download this repo or download [release](https://github.com/rupeshs/fastsdcpu/releases).
408
+ - Double click `install.bat` (It will take some time to install,depending on your internet speed.)
409
+ - You can run in desktop GUI mode or web UI mode.
410
+
411
+ #### Desktop GUI
412
+
413
+ - To start desktop GUI double click `start.bat`
414
+
415
+ #### Web UI
416
+
417
+ - To start web UI double click `start-webui.bat`
418
+
419
+ ### FastSD CPU on Linux
420
+
421
+ :exclamation:**Ensure that you have Python 3.10 and uv installed.**
422
+
423
+ - Clone/download this repo or download [release](https://github.com/rupeshs/fastsdcpu/releases).
424
+ - In the terminal, enter into fastsdcpu directory
425
+ - Run the following command
426
+
427
+ `chmod +x install.sh`
428
+
429
+ `./install.sh`
430
+
431
+ #### To start Desktop GUI
432
+
433
+ `./start.sh`
434
+
435
+ #### To start Web UI
436
+
437
+ `./start-webui.sh`
438
+
439
+ ### FastSD CPU on Mac
440
+
441
+ ![FastSD CPU running on Mac](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/fastsdcpu-mac-gui.jpg)
442
+
443
+ :exclamation:**Ensure that you have Python 3.9 or 3.10 or 3.11 version installed.**
444
+
445
+ Run the following commands to install FastSD CPU on Mac :
446
+
447
+ - Clone/download this repo or download [release](https://github.com/rupeshs/fastsdcpu/releases).
448
+ - In the terminal, enter into fastsdcpu directory
449
+ - Run the following command
450
+
451
+ `chmod +x install-mac.sh`
452
+
453
+ `./install-mac.sh`
454
+
455
+ #### To start Desktop GUI
456
+
457
+ `./start.sh`
458
+
459
+ #### To start Web UI
460
+
461
+ `./start-webui.sh`
462
+
463
+ Thanks [Autantpourmoi](https://github.com/Autantpourmoi) for Mac testing.
464
+
465
+ :exclamation:We don't support OpenVINO on Mac (M1/M2/M3 chips, but *does* work on Intel chips).
466
+
467
+ If you want to increase image generation speed on Mac(M1/M2 chip) try this:
468
+
469
+ `export DEVICE=mps` and start app `start.sh`
470
+
471
+ #### Web UI screenshot
472
+
473
+ ![FastSD CPU WebUI Screenshot](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/fastcpu-webui.png)
474
+
475
+ ### Google Colab
476
+
477
+ Due to the limitation of using CPU/OpenVINO inside colab, we are using GPU with colab.
478
+ [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1SuAqskB-_gjWLYNRFENAkIXZ1aoyINqL?usp=sharing)
479
+
480
+ ### CLI mode (Advanced users)
481
+
482
+ ![FastSD CPU CLI Screenshot](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/fastcpu-cli.png)
483
+
484
+ Open the terminal and enter into fastsdcpu folder.
485
+ Activate virtual environment using the command:
486
+
487
+ ##### Windows users
488
+
489
+ (Suppose FastSD CPU available in the directory "D:\fastsdcpu")
490
+ `D:\fastsdcpu\env\Scripts\activate.bat`
491
+
492
+ ##### Linux users
493
+
494
+ `source env/bin/activate`
495
+
496
+ Start CLI `src/app.py -h`
497
+
498
+ <a id="android"></a>
499
+
500
+ ## Android (Termux + PRoot)
501
+
502
+ FastSD CPU running on Google Pixel 7 Pro.
503
+
504
+ ![FastSD CPU Android Termux Screenshot](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/fastsdcpu-android-termux-pixel7.png)
505
+
506
+ ### Install FastSD CPU on Android
507
+
508
+ Follow this guide to install FastSD CPU on Android + Termux [How To Install and Run FastSD CPU on Android + Temux – Step By Step Guide [Updated]](https://nolowiz.com/how-to-install-and-run-fastsd-cpu-on-android-temux-step-by-step-guide/)
509
+
510
+ <a id="raspberry"></a>
511
+
512
+ ## Raspberry PI 4 support
513
+
514
+ Thanks [WGNW_MGM] for Raspberry PI 4 testing.FastSD CPU worked without problems.
515
+ System configuration - Raspberry Pi 4 with 4GB RAM, 8GB of SWAP memory.
516
+
517
+ <a id="apisupport"></a>
518
+
519
+ ## API support
520
+
521
+ ![FastSD CPU API documentation](https://raw.githubusercontent.com/rupeshs/fastsdcpu/add-basic-api-support/docs/images/fastsdcpu-api.png)
522
+
523
+ FastSD CPU supports basic API endpoints. Following API endpoints are available :
524
+
525
+ - /api/info - To get system information
526
+ - /api/config - Get configuration
527
+ - /api/models - List all available models
528
+ - /api/generate - Generate images (Text to image,image to image)
529
+
530
+ To start FastAPI in webserver mode run:
531
+ ``python src/app.py --api``
532
+
533
+ or use `start-webserver.sh` for Linux and `start-webserver.bat` for Windows.
534
+
535
+ Access API documentation locally at <http://localhost:8000/api/docs> .
536
+
537
+ Generated image is JPEG image encoded as base64 string.
538
+ In the image-to-image mode input image should be encoded as base64 string.
539
+
540
+ To generate an image a minimal request `POST /api/generate` with body :
541
+
542
+ ```
543
+ {
544
+ "prompt": "a cute cat",
545
+ "use_openvino": true
546
+ }
547
+ ```
548
+
549
+ <a id="gguf-support"></a>
550
+
551
+ ## GGUF support - Flux
552
+
553
+ [GGUF](https://github.com/ggerganov/ggml/blob/master/docs/gguf.md) Flux model supported via [stablediffusion.cpp](https://github.com/leejet/stable-diffusion.cpp) shared library. Currently Flux Schenell model supported.
554
+
555
+ To use GGUF model use web UI and select GGUF mode.
556
+
557
+ Tested on Windows and Linux.
558
+
559
+ :exclamation: Main advantage here we reduced minimum system RAM required for Flux workflow to around **12 GB**.
560
+
561
+ Supported mode - Text to image
562
+
563
+ ### How to run Flux GGUF model
564
+
565
+ - Download stablediffusion.cpp prebuilt shared library and place it inside fastsdcpu folder
566
+ For Windows users, download [stable-diffusion.dll](https://huggingface.co/rupeshs/FastSD-Flux-GGUF/blob/main/stable-diffusion.dll)
567
+
568
+ For Linux users download [libstable-diffusion.so](https://huggingface.co/rupeshs/FastSD-Flux-GGUF/blob/main/libstable-diffusion.so)
569
+
570
+ You can also build the library manully by following the guide *"Build stablediffusion.cpp shared library for GGUF flux model support"*
571
+
572
+ - Download **diffusion model** from [flux1-schnell-q4_0.gguf](https://huggingface.co/rupeshs/FastSD-Flux-GGUF/blob/main/flux1-schnell-q4_0.gguf) and place it inside `models/gguf/diffusion` directory
573
+ - Download **clip model** from [clip_l_q4_0.gguf](https://huggingface.co/rupeshs/FastSD-Flux-GGUF/blob/main/clip_l_q4_0.gguf) and place it inside `models/gguf/clip` directory
574
+ - Download **T5-XXL model** from [t5xxl_q4_0.gguf](https://huggingface.co/rupeshs/FastSD-Flux-GGUF/blob/main/t5xxl_q4_0.gguf) and place it inside `models/gguf/t5xxl` directory
575
+ - Download **VAE model** from [ae.safetensors](https://huggingface.co/black-forest-labs/FLUX.1-schnell/blob/main/ae.safetensors) and place it inside `models/gguf/vae` directory
576
+ - Start web UI and select GGUF mode
577
+ - Select the models settings tab and select GGUF diffusion,clip_l,t5xxl and VAE models.
578
+ - Enter your prompt and generate image
579
+
580
+ ### Build stablediffusion.cpp shared library for GGUF flux model support(Optional)
581
+
582
+ To build the stablediffusion.cpp library follow these steps
583
+
584
+ - `git clone https://github.com/leejet/stable-diffusion.cpp`
585
+ - `cd stable-diffusion.cpp`
586
+ - `git pull origin master`
587
+ - `git submodule init`
588
+ - `git submodule update`
589
+ - `git checkout 14206fd48832ab600d9db75f15acb5062ae2c296`
590
+ - `cmake . -DSD_BUILD_SHARED_LIBS=ON`
591
+ - `cmake --build . --config Release`
592
+ - Copy the stablediffusion dll/so file to fastsdcpu folder
593
+
594
+ <a id="ai-pc-support"></a>
595
+
596
+ ## Intel AI PC support - OpenVINO (CPU, GPU, NPU)
597
+
598
+ Fast SD now supports AI PC with Intel® Core™ Ultra Processors. [To learn more about AI PC and OpenVINO](https://nolowiz.com/ai-pc-and-openvino-quick-and-simple-guide/).
599
+
600
+ ### GPU
601
+
602
+ For GPU mode `set device=GPU` and run webui. FastSD GPU benchmark on AI PC as shown below.
603
+
604
+ ![FastSD AI PC Arc GPU benchmark](https://raw.githubusercontent.com/rupeshs/fastsdcpu/main/docs/images/ARCGPU.png)
605
+
606
+ ### NPU
607
+
608
+ FastSD CPU now supports power efficient NPU (Neural Processing Unit) that comes with Intel Core Ultra processors.
609
+
610
+ FastSD tested with following Intel processor's NPUs:
611
+
612
+ - Intel Core Ultra Series 1 (Meteor Lake)
613
+ - Intel Core Ultra Series 2 (Lunar Lake)
614
+
615
+ Currently FastSD support this model for NPU [rupeshs/sd15-lcm-square-openvino-int8](https://huggingface.co/rupeshs/sd15-lcm-square-openvino-int8).
616
+
617
+ Supports following modes on NPU :
618
+
619
+ - Text to image
620
+ - Image to image
621
+ - Image variations
622
+
623
+ To run model in NPU follow these steps (Please make sure that your AI PC's NPU driver is the latest):
624
+
625
+ - Start webui
626
+ - Select LCM-OpenVINO mode
627
+ - Select the models settings tab and select OpenVINO model `rupeshs/sd15-lcm-square-openvino-int8`
628
+ - Set device envionment variable `set DEVICE=NPU`
629
+ - Now it will run on the NPU
630
+
631
+ This is heterogeneous computing since text encoder and Unet will use NPU and VAE will use GPU for processing. Thanks to OpenVINO.
632
+
633
+ Please note that tiny auto encoder will not work in NPU mode.
634
+
635
+ *Thanks to Intel for providing AI PC dev kit and Tiber cloud access to test FastSD, special thanks to [Pooja Baraskar](https://github.com/Pooja-B),[Dmitriy Pastushenkov](https://github.com/DimaPastushenkov).*
636
+
637
+ <a id="mcpsupport"></a>
638
+
639
+ ## MCP Server Support
640
+
641
+ FastSDCPU now supports [MCP(Model Context Protocol)](https://modelcontextprotocol.io/introduction) server.
642
+
643
+ - Start FastSDCPU MCP server:
644
+ ``python src/app.py --mcp``
645
+ or
646
+ Run `start-mcpserver.sh` for Linux and `start-mcpserver.bat` for Windows.
647
+
648
+ FastSDCPU MCP server will be running at <http://127.0.0.1:8000/mcp>
649
+
650
+ It can be used with AI apps that support MCP protocol for example [Claude desktop](https://claude.ai/download)
651
+
652
+ Note: OpenWebUI not directly using MCP protocol it is based on OpenAPI protocol.
653
+
654
+ ### Claude desktop
655
+
656
+ To connect with FastSD MCP server first configure Claude desktop :
657
+
658
+ - First configure Claude desktop,open File - >Settings -> Developer - Edit config
659
+ - Add below config(Also ensure that node.js installed on your machine)
660
+
661
+ ```json
662
+ {
663
+ "mcpServers": {
664
+ "fastsdcpu": {
665
+ "command": "npx",
666
+ "args": [
667
+ "mcp-remote",
668
+ "http://127.0.0.1:8000/mcp"
669
+ ]
670
+ }
671
+ }
672
+ }
673
+ ```
674
+
675
+ - Restart Claude desktop
676
+ - Give a sample prompt to generate image "create image of a cat"
677
+
678
+ Screenshot of Claude desktop accessing **Intel AI PC NPU** to generate an image using the FastSD MCP server
679
+
680
+ ![Claude desktop FastSD CPU AIPC NPU](https://raw.githubusercontent.com/rupeshs/fastsdcpu/refs/heads/add-mcp-server-support/docs/images/fastsdcpu_claude.jpg)
681
+
682
+ <a id="openwebuisupport"></a>
683
+
684
+ ## Open WebUI Support
685
+
686
+ The FastSDCPU can be used with [OpenWebUI](https://github.com/open-webui/open-webui) for local image generation using LLM and tool calling.
687
+
688
+ Follow the below steps to FastSD to use with Open WebUI.
689
+
690
+ - Start FastSDCPU MCP server:
691
+ ``python src/app.py --mcp``
692
+ or
693
+ Run `start-mcpserver.sh` for Linux and `start-mcpserver.bat` for Windows.
694
+
695
+ - Update server URL in the settings page as shown below
696
+
697
+ ![OpenWebUI Settings](https://raw.githubusercontent.com/rupeshs/fastsdcpu/refs/heads/add-mcp-server-support/docs/images/openwebui-settings.png)
698
+
699
+ - Change chat controls setting "Function Calling" to "Native"
700
+
701
+ - Generate image using text prompt (Qwen 2.5 7B model used for the demo)
702
+
703
+ ![OpenWebUI FastSD MCP Server](https://raw.githubusercontent.com/rupeshs/fastsdcpu/refs/heads/add-mcp-server-support/docs/images/openwebui-fastsd.jpg)
704
+
705
+ <a id="comfyuisupport"></a>
706
+
707
+ ## ComfyUI support
708
+
709
+ FastSD can be used with ComfyUI with [ComfyUI-FastSDCPU node](https://github.com/BetaDoggo/ComfyUI-FastSDCPU). To use it follow this [step by step guide](https://nolowiz.com/how-to-use-comfyui-with-fastsdcpu-and-openvino/). To use NPU set environment variable "DEVICE=NPU" and choose "rupeshs/sd15-lcm-square-openvino-int8" as your OpenVINO Model.
710
+
711
+ ![Comfyui OpenVINO text to image workflow](https://raw.githubusercontent.com/rupeshs/fastsdcpu/refs/heads/add-sana-sprint-support/docs/images/comfyui-workflow.png)
712
+
713
+ ## License
714
+
715
+ The fastsdcpu project is available as open source under the terms of the [MIT license](https://github.com/rupeshs/fastsdcpu/blob/main/LICENSE)
716
+
717
+ ## Disclaimer
718
+
719
+ Users are granted the freedom to create images using this tool, but they are obligated to comply with local laws and utilize it responsibly. The developers will not assume any responsibility for potential misuse by users.
720
+
721
+ <a id="contributors"></a>
722
+
723
+ ## Thanks to all our contributors
724
+
725
+ Original Author & Maintainer - [Rupesh Sreeraman](https://github.com/rupeshs)
726
+
727
+ We thank all contributors for their time and hard work!
728
+
729
+ <a href="https://github.com/rupeshs/fastsdcpu/graphs/contributors">
730
+ <img src="https://contrib.rocks/image?repo=rupeshs/fastsdcpu" />
731
+ </a>
THIRD-PARTY-LICENSES ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ stablediffusion.cpp - MIT
2
+
3
+ OpenVINO stablediffusion engine - Apache 2
4
+
5
+ SD Turbo - STABILITY AI NON-COMMERCIAL RESEARCH COMMUNITY LICENSE AGREEMENT
6
+
7
+ MIT License
8
+
9
+ Copyright (c) 2023 leejet
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ ERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
30
+
31
+ Definitions.
32
+
33
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
34
+
35
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
36
+
37
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
38
+
39
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
40
+
41
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
42
+
43
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
44
+
45
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
46
+
47
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
50
+
51
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
52
+
53
+ Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
54
+
55
+ Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
56
+
57
+ Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
58
+
59
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
60
+
61
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
62
+
63
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
64
+
65
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
66
+
67
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
68
+
69
+ Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
70
+
71
+ Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
72
+
73
+ Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
74
+
75
+ Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
76
+
77
+ Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
78
+
79
+ END OF TERMS AND CONDITIONS
80
+
81
+ APPENDIX: How to apply the Apache License to your work.
82
+
83
+ To apply the Apache License to your work, attach the following
84
+ boilerplate notice, with the fields enclosed by brackets "[]"
85
+ replaced with your own identifying information. (Don't include
86
+ the brackets!) The text should be enclosed in the appropriate
87
+ comment syntax for the file format. We also recommend that a
88
+ file or class name and description of purpose be included on the
89
+ same "printed page" as the copyright notice for easier
90
+ identification within third-party archives.
91
+ Copyright [yyyy] [name of copyright owner]
92
+
93
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
94
+
95
+ <http://www.apache.org/licenses/LICENSE-2.0>
96
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
97
+
98
+ STABILITY AI NON-COMMERCIAL RESEARCH COMMUNITY LICENSE AGREEMENT
99
+ Dated: November 28, 2023
100
+
101
+ By using or distributing any portion or element of the Models, Software, Software Products or Derivative Works, you agree to be bound by this Agreement.
102
+
103
+ "Agreement" means this Stable Non-Commercial Research Community License Agreement.
104
+
105
+ “AUP” means the Stability AI Acceptable Use Policy available at <https://stability.ai/use-policy>, as may be updated from time to time.
106
+
107
+ "Derivative Work(s)” means (a) any derivative work of the Software Products as recognized by U.S. copyright laws and (b) any modifications to a Model, and any other model created which is based on or derived from the Model or the Model’s output. For clarity, Derivative Works do not include the output of any Model.
108
+
109
+ “Documentation” means any specifications, manuals, documentation, and other written information provided by Stability AI related to the Software.
110
+
111
+ "Licensee" or "you" means you, or your employer or any other person or entity (if you are entering into this Agreement on such person or entity's behalf), of the age required under applicable laws, rules or regulations to provide legal consent and that has legal authority to bind your employer or such other person or entity if you are entering in this Agreement on their behalf.
112
+
113
+ “Model(s)" means, collectively, Stability AI’s proprietary models and algorithms, including machine-learning models, trained model weights and other elements of the foregoing, made available under this Agreement.
114
+
115
+ “Non-Commercial Uses” means exercising any of the rights granted herein for the purpose of research or non-commercial purposes. Non-Commercial Uses does not include any production use of the Software Products or any Derivative Works.
116
+
117
+ "Stability AI" or "we" means Stability AI Ltd. and its affiliates.
118
+
119
+ "Software" means Stability AI’s proprietary software made available under this Agreement.
120
+
121
+ “Software Products” means the Models, Software and Documentation, individually or in any combination.
122
+
123
+ 1. License Rights and Redistribution.
124
+
125
+ a. Subject to your compliance with this Agreement, the AUP (which is hereby incorporated herein by reference), and the Documentation, Stability AI grants you a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable, royalty free and limited license under Stability AI’s intellectual property or other rights owned or controlled by Stability AI embodied in the Software Products to use, reproduce, distribute, and create Derivative Works of, the Software Products, in each case for Non-Commercial Uses only.
126
+
127
+ b. You may not use the Software Products or Derivative Works to enable third parties to use the Software Products or Derivative Works as part of your hosted service or via your APIs, whether you are adding substantial additional functionality thereto or not. Merely distributing the Software Products or Derivative Works for download online without offering any related service (ex. by distributing the Models on HuggingFace) is not a violation of this subsection. If you wish to use the Software Products or any Derivative Works for commercial or production use or you wish to make the Software Products or any Derivative Works available to third parties via your hosted service or your APIs, contact Stability AI at <https://stability.ai/contact>.
128
+
129
+ c. If you distribute or make the Software Products, or any Derivative Works thereof, available to a third party, the Software Products, Derivative Works, or any portion thereof, respectively, will remain subject to this Agreement and you must (i) provide a copy of this Agreement to such third party, and (ii) retain the following attribution notice within a "Notice" text file distributed as a part of such copies: "This Stability AI Model is licensed under the Stability AI Non-Commercial Research Community License, Copyright (c) Stability AI Ltd. All Rights Reserved.” If you create a Derivative Work of a Software Product, you may add your own attribution notices to the Notice file included with the Software Product, provided that you clearly indicate which attributions apply to the Software Product and you must state in the NOTICE file that you changed the Software Product and how it was modified.
130
+
131
+ 2. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE SOFTWARE PRODUCTS AND ANY OUTPUT AND RESULTS THERE FROM ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE SOFTWARE PRODUCTS, DERIVATIVE WORKS OR ANY OUTPUT OR RESULTS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE SOFTWARE PRODUCTS, DERIVATIVE WORKS AND ANY OUTPUT AND RESULTS.
132
+
133
+ 3. Limitation of Liability. IN NO EVENT WILL STABILITY AI OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF STABILITY AI OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
134
+
135
+ 4. Intellectual Property.
136
+
137
+ a. No trademark licenses are granted under this Agreement, and in connection with the Software Products or Derivative Works, neither Stability AI nor Licensee may use any name or mark owned by or associated with the other or any of its affiliates, except as required for reasonable and customary use in describing and redistributing the Software Products or Derivative Works.
138
+
139
+ b. Subject to Stability AI’s ownership of the Software Products and Derivative Works made by or for Stability AI, with respect to any Derivative Works that are made by you, as between you and Stability AI, you are and will be the owner of such Derivative Works
140
+
141
+ c. If you institute litigation or other proceedings against Stability AI (including a cross-claim or counterclaim in a lawsuit) alleging that the Software Products, Derivative Works or associated outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Stability AI from and against any claim by any third party arising out of or related to your use or distribution of the Software Products or Derivative Works in violation of this Agreement.
142
+
143
+ 5. Term and Termination. The term of this Agreement will commence upon your acceptance of this Agreement or access to the Software Products and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Stability AI may terminate this Agreement if you are in breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete and cease use of any Software Products or Derivative Works. Sections 2-4 shall survive the termination of this Agreement.
benchmark-openvino.bat ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal
3
+
4
+ set "PYTHON_COMMAND=python"
5
+
6
+ call python --version > nul 2>&1
7
+ if %errorlevel% equ 0 (
8
+ echo Python command check :OK
9
+ ) else (
10
+ echo "Error: Python command not found, please install Python (Recommended : Python 3.10 or Python 3.11) and try again"
11
+ pause
12
+ exit /b 1
13
+
14
+ )
15
+
16
+ :check_python_version
17
+ for /f "tokens=2" %%I in ('%PYTHON_COMMAND% --version 2^>^&1') do (
18
+ set "python_version=%%I"
19
+ )
20
+
21
+ echo Python version: %python_version%
22
+
23
+ call "%~dp0env\Scripts\activate.bat" && %PYTHON_COMMAND% src/app.py -b --use_openvino --openvino_lcm_model_id "rupeshs/sd-turbo-openvino"
benchmark.bat ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal
3
+
4
+ set "PYTHON_COMMAND=python"
5
+
6
+ call python --version > nul 2>&1
7
+ if %errorlevel% equ 0 (
8
+ echo Python command check :OK
9
+ ) else (
10
+ echo "Error: Python command not found, please install Python (Recommended : Python 3.10 or Python 3.11) and try again"
11
+ pause
12
+ exit /b 1
13
+
14
+ )
15
+
16
+ :check_python_version
17
+ for /f "tokens=2" %%I in ('%PYTHON_COMMAND% --version 2^>^&1') do (
18
+ set "python_version=%%I"
19
+ )
20
+
21
+ echo Python version: %python_version%
22
+
23
+ call "%~dp0env\Scripts\activate.bat" && %PYTHON_COMMAND% src/app.py -b
install-mac.sh ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ echo Starting FastSD CPU env installation...
3
+ set -e
4
+ PYTHON_COMMAND="python3"
5
+
6
+ if ! command -v python3 &>/dev/null; then
7
+ if ! command -v python &>/dev/null; then
8
+ echo "Error: Python not found, please install python 3.8 or higher and try again"
9
+ exit 1
10
+ fi
11
+ fi
12
+
13
+ if command -v python &>/dev/null; then
14
+ PYTHON_COMMAND="python"
15
+ fi
16
+
17
+ echo "Found $PYTHON_COMMAND command"
18
+
19
+ python_version=$($PYTHON_COMMAND --version 2>&1 | awk '{print $2}')
20
+ echo "Python version : $python_version"
21
+
22
+ if ! command -v uv &>/dev/null; then
23
+ echo "Error: uv command not found,please install https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_1 and try again."
24
+ exit 1
25
+ fi
26
+
27
+ BASEDIR=$(pwd)
28
+
29
+ uv venv --python 3.11.6 "$BASEDIR/env"
30
+ # shellcheck disable=SC1091
31
+ source "$BASEDIR/env/bin/activate"
32
+ uv pip install torch
33
+ uv pip install -r "$BASEDIR/requirements.txt"
34
+ chmod +x "start.sh"
35
+ chmod +x "start-webui.sh"
36
+ read -n1 -r -p "FastSD CPU installation completed,press any key to continue..." key
install.bat ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ @echo off
3
+ setlocal
4
+ echo Starting FastSD CPU env installation...
5
+
6
+ set "PYTHON_COMMAND=python"
7
+
8
+ call python --version > nul 2>&1
9
+ if %errorlevel% equ 0 (
10
+ echo Python command check :OK
11
+ ) else (
12
+ echo "Error: Python command not found,please install Python(Recommended : Python 3.10 or Python 3.11) and try again."
13
+ pause
14
+ exit /b 1
15
+
16
+ )
17
+
18
+ call uv --version > nul 2>&1
19
+ if %errorlevel% equ 0 (
20
+ echo uv command check :OK
21
+ ) else (
22
+ echo "Error: uv command not found,please install https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2 and try again."
23
+ pause
24
+ exit /b 1
25
+
26
+ )
27
+ :check_python_version
28
+ for /f "tokens=2" %%I in ('%PYTHON_COMMAND% --version 2^>^&1') do (
29
+ set "python_version=%%I"
30
+ )
31
+
32
+ echo Python version: %python_version%
33
+
34
+ uv venv --python 3.11.6 "%~dp0env"
35
+ call "%~dp0env\Scripts\activate.bat" && uv pip install torch --index-url https://download.pytorch.org/whl/cpu
36
+ call "%~dp0env\Scripts\activate.bat" && uv pip install -r "%~dp0requirements.txt"
37
+ echo FastSD CPU env installation completed.
38
+ pause
install.sh ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ echo Starting FastSD CPU env installation...
3
+ set -e
4
+ PYTHON_COMMAND="python3"
5
+
6
+ if ! command -v python3 &>/dev/null; then
7
+ if ! command -v python &>/dev/null; then
8
+ echo "Error: Python not found, please install python 3.8 or higher and try again"
9
+ exit 1
10
+ fi
11
+ fi
12
+
13
+ if command -v python &>/dev/null; then
14
+ PYTHON_COMMAND="python"
15
+ fi
16
+
17
+ echo "Found $PYTHON_COMMAND command"
18
+
19
+ python_version=$($PYTHON_COMMAND --version 2>&1 | awk '{print $2}')
20
+ echo "Python version : $python_version"
21
+
22
+ if ! command -v uv &>/dev/null; then
23
+ echo "Error: uv command not found,please install https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_1 and try again."
24
+ exit 1
25
+ fi
26
+
27
+ BASEDIR=$(pwd)
28
+
29
+ uv venv --python 3.11.6 "$BASEDIR/env"
30
+ # shellcheck disable=SC1091
31
+ source "$BASEDIR/env/bin/activate"
32
+ uv pip install torch --index-url https://download.pytorch.org/whl/cpu
33
+ if [[ "$1" == "--disable-gui" ]]; then
34
+ #! For termux , we don't need Qt based GUI
35
+ packages="$(grep -v "^ *#\|^PyQt5" requirements.txt | grep .)"
36
+ # shellcheck disable=SC2086
37
+ uv pip install $packages
38
+ else
39
+ uv pip install -r "$BASEDIR/requirements.txt"
40
+ fi
41
+
42
+ chmod +x "start.sh"
43
+ chmod +x "start-webui.sh"
44
+ read -n1 -r -p "FastSD CPU installation completed,press any key to continue..." key
requirements.txt ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ accelerate==1.6.0
2
+ diffusers==0.33.0
3
+ transformers==4.48.0
4
+ PyQt5
5
+ Pillow==9.4.0
6
+ openvino==2025.1.0
7
+ optimum-intel==1.23.0
8
+ onnx==1.16.0
9
+ numpy==1.26.4
10
+ onnxruntime==1.17.3
11
+ pydantic
12
+ typing-extensions==4.8.0
13
+ pyyaml==6.0.1
14
+ gradio==5.6.0
15
+ peft==0.6.1
16
+ opencv-python==4.8.1.78
17
+ omegaconf==2.3.0
18
+ controlnet-aux==0.0.7
19
+ mediapipe>=0.10.9
20
+ tomesd==0.1.3
21
+ mcp==1.6.0
22
+ fastapi-mcp==0.3.0
start-mcpserver.bat ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal
3
+ echo Starting fastsdcpu...
4
+
5
+ set "PYTHON_COMMAND=python"
6
+
7
+ call python --version > nul 2>&1
8
+ if %errorlevel% equ 0 (
9
+ echo Python command check :OK
10
+ ) else (
11
+ echo "Error: Python command not found, please install Python (Recommended : Python 3.10 or Python 3.11) and try again"
12
+ pause
13
+ exit /b 1
14
+
15
+ )
16
+
17
+ :check_python_version
18
+ for /f "tokens=2" %%I in ('%PYTHON_COMMAND% --version 2^>^&1') do (
19
+ set "python_version=%%I"
20
+ )
21
+
22
+ echo Python version: %python_version%
23
+
24
+ set PATH=%PATH%;%~dp0env\Lib\site-packages\openvino\libs
25
+ call "%~dp0env\Scripts\activate.bat" && %PYTHON_COMMAND% "%~dp0\src\app.py" --mcp
start-mcpserver.sh ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ echo Starting FastSD CPU please wait...
3
+ set -e
4
+ PYTHON_COMMAND="python3"
5
+
6
+ if ! command -v python3 &>/dev/null; then
7
+ if ! command -v python &>/dev/null; then
8
+ echo "Error: Python not found, please install python 3.8 or higher and try again"
9
+ exit 1
10
+ fi
11
+ fi
12
+
13
+ if command -v python &>/dev/null; then
14
+ PYTHON_COMMAND="python"
15
+ fi
16
+
17
+ echo "Found $PYTHON_COMMAND command"
18
+
19
+ python_version=$($PYTHON_COMMAND --version 2>&1 | awk '{print $2}')
20
+ echo "Python version : $python_version"
21
+
22
+ BASEDIR=$(pwd)
23
+ # shellcheck disable=SC1091
24
+ source "$BASEDIR/env/bin/activate"
25
+ $PYTHON_COMMAND src/app.py --mcp
start-realtime.bat ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal
3
+ echo Starting fastsdcpu...
4
+
5
+ set "PYTHON_COMMAND=python"
6
+
7
+ call python --version > nul 2>&1
8
+ if %errorlevel% equ 0 (
9
+ echo Python command check :OK
10
+ ) else (
11
+ echo "Error: Python command not found, please install Python (Recommended : Python 3.10 or Python 3.11) and try again"
12
+ pause
13
+ exit /b 1
14
+
15
+ )
16
+
17
+ :check_python_version
18
+ for /f "tokens=2" %%I in ('%PYTHON_COMMAND% --version 2^>^&1') do (
19
+ set "python_version=%%I"
20
+ )
21
+
22
+ echo Python version: %python_version%
23
+
24
+ set PATH=%PATH%;%~dp0env\Lib\site-packages\openvino\libs
25
+ call "%~dp0env\Scripts\activate.bat" && %PYTHON_COMMAND% "%~dp0\src\app.py" --r
start-realtime.sh ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ set -e # Exit immediately if a command exits with a non-zero status
4
+
5
+ echo "Starting fastsdcpu..."
6
+
7
+ PYTHON_COMMAND="python3"
8
+
9
+ # Check if Python is installed
10
+ if command -v $PYTHON_COMMAND >/dev/null 2>&1; then
11
+ echo "Python command check: OK"
12
+ else
13
+ echo "Error: Python command not found, please install Python (Recommended: Python 3.10 or Python 3.11) and try again"
14
+ exit 1
15
+ fi
16
+
17
+ # Get Python version
18
+ python_version=$($PYTHON_COMMAND --version 2>&1 | awk '{print $2}')
19
+ echo "Python version: $python_version"
20
+
21
+ echo $PATH
22
+ # Activate virtual environment and run the application
23
+ source "$(dirname "$0")/env/bin/activate" && $PYTHON_COMMAND "$(dirname "$0")/src/app.py" --r
start-webserver.bat ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal
3
+ echo Starting fastsdcpu...
4
+
5
+ set "PYTHON_COMMAND=python"
6
+
7
+ call python --version > nul 2>&1
8
+ if %errorlevel% equ 0 (
9
+ echo Python command check :OK
10
+ ) else (
11
+ echo "Error: Python command not found, please install Python (Recommended : Python 3.10 or Python 3.11) and try again"
12
+ pause
13
+ exit /b 1
14
+
15
+ )
16
+
17
+ :check_python_version
18
+ for /f "tokens=2" %%I in ('%PYTHON_COMMAND% --version 2^>^&1') do (
19
+ set "python_version=%%I"
20
+ )
21
+
22
+ echo Python version: %python_version%
23
+
24
+ set PATH=%PATH%;%~dp0env\Lib\site-packages\openvino\libs
25
+ call "%~dp0env\Scripts\activate.bat" && %PYTHON_COMMAND% "%~dp0\src\app.py" --api
start-webserver.sh ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ echo Starting FastSD CPU please wait...
3
+ set -e
4
+ PYTHON_COMMAND="python3"
5
+
6
+ if ! command -v python3 &>/dev/null; then
7
+ if ! command -v python &>/dev/null; then
8
+ echo "Error: Python not found, please install python 3.8 or higher and try again"
9
+ exit 1
10
+ fi
11
+ fi
12
+
13
+ if command -v python &>/dev/null; then
14
+ PYTHON_COMMAND="python"
15
+ fi
16
+
17
+ echo "Found $PYTHON_COMMAND command"
18
+
19
+ python_version=$($PYTHON_COMMAND --version 2>&1 | awk '{print $2}')
20
+ echo "Python version : $python_version"
21
+
22
+ BASEDIR=$(pwd)
23
+ # shellcheck disable=SC1091
24
+ source "$BASEDIR/env/bin/activate"
25
+ $PYTHON_COMMAND src/app.py --api
start-webui.bat ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal
3
+ echo Starting fastsdcpu...
4
+
5
+ set "PYTHON_COMMAND=python"
6
+
7
+ call python --version > nul 2>&1
8
+ if %errorlevel% equ 0 (
9
+ echo Python command check :OK
10
+ ) else (
11
+ echo "Error: Python command not found, please install Python (Recommended : Python 3.10 or Python 3.11) and try again"
12
+ pause
13
+ exit /b 1
14
+
15
+ )
16
+
17
+ :check_python_version
18
+ for /f "tokens=2" %%I in ('%PYTHON_COMMAND% --version 2^>^&1') do (
19
+ set "python_version=%%I"
20
+ )
21
+
22
+ echo Python version: %python_version%
23
+
24
+ set PATH=%PATH%;%~dp0env\Lib\site-packages\openvino\libs
25
+ call "%~dp0env\Scripts\activate.bat" && %PYTHON_COMMAND% "%~dp0\src\app.py" -w
start-webui.sh ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ echo Starting FastSD CPU please wait...
3
+ set -e
4
+ PYTHON_COMMAND="python3"
5
+
6
+ if ! command -v python3 &>/dev/null; then
7
+ if ! command -v python &>/dev/null; then
8
+ echo "Error: Python not found, please install python 3.8 or higher and try again"
9
+ exit 1
10
+ fi
11
+ fi
12
+
13
+ if command -v python &>/dev/null; then
14
+ PYTHON_COMMAND="python"
15
+ fi
16
+
17
+ echo "Found $PYTHON_COMMAND command"
18
+
19
+ python_version=$($PYTHON_COMMAND --version 2>&1 | awk '{print $2}')
20
+ echo "Python version : $python_version"
21
+
22
+ BASEDIR=$(pwd)
23
+ # shellcheck disable=SC1091
24
+ source "$BASEDIR/env/bin/activate"
25
+ $PYTHON_COMMAND src/app.py -w
start.bat ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal
3
+ echo Starting fastsdcpu...
4
+
5
+ set "PYTHON_COMMAND=python"
6
+
7
+ call python --version > nul 2>&1
8
+ if %errorlevel% equ 0 (
9
+ echo Python command check :OK
10
+ ) else (
11
+ echo "Error: Python command not found, please install Python (Recommended : Python 3.10 or Python 3.11) and try again"
12
+ pause
13
+ exit /b 1
14
+
15
+ )
16
+
17
+ :check_python_version
18
+ for /f "tokens=2" %%I in ('%PYTHON_COMMAND% --version 2^>^&1') do (
19
+ set "python_version=%%I"
20
+ )
21
+
22
+ echo Python version: %python_version%
23
+
24
+ set PATH=%PATH%;%~dp0env\Lib\site-packages\openvino\libs
25
+ call "%~dp0env\Scripts\activate.bat" && %PYTHON_COMMAND% "%~dp0\src\app.py" --gui
start.sh ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ echo Starting FastSD CPU please wait...
3
+ set -e
4
+ PYTHON_COMMAND="python3"
5
+
6
+ if ! command -v python3 &>/dev/null; then
7
+ if ! command -v python &>/dev/null; then
8
+ echo "Error: Python not found, please install python 3.8 or higher and try again"
9
+ exit 1
10
+ fi
11
+ fi
12
+
13
+ if command -v python &>/dev/null; then
14
+ PYTHON_COMMAND="python"
15
+ fi
16
+
17
+ echo "Found $PYTHON_COMMAND command"
18
+
19
+ python_version=$($PYTHON_COMMAND --version 2>&1 | awk '{print $2}')
20
+ echo "Python version : $python_version"
21
+
22
+ BASEDIR=$(pwd)
23
+ # shellcheck disable=SC1091
24
+ source "$BASEDIR/env/bin/activate"
25
+ $PYTHON_COMMAND src/app.py --gui