From 3dc62a88574f0f40a0400368fc934a7b4574c995 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Thu, 22 Jun 2023 23:48:55 +0200 Subject: [PATCH 1/5] Basic embeddings support --- ui/easydiffusion/model_manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/easydiffusion/model_manager.py b/ui/easydiffusion/model_manager.py index de2c10ac..a9b42594 100644 --- a/ui/easydiffusion/model_manager.py +++ b/ui/easydiffusion/model_manager.py @@ -27,6 +27,7 @@ MODEL_EXTENSIONS = { "realesrgan": [".pth"], "lora": [".ckpt", ".safetensors"], "codeformer": [".pth"], + "embeddings": [".pt", ".bin", ".safetensors"], } DEFAULT_MODELS = { "stable-diffusion": [ @@ -58,6 +59,9 @@ def init(): def load_default_models(context: Context): set_vram_optimizations(context) + config = app.getConfig() + context.embeddings_path = os.path.join(app.MODELS_DIR, "embeddings") + # init default model paths for model_type in MODELS_TO_LOAD_ON_START: context.model_paths[model_type] = resolve_model_to_use(model_type=model_type, fail_if_not_found=False) @@ -318,6 +322,7 @@ def getModels(): "hypernetwork": [], "lora": [], "codeformer": ["codeformer"], + "embeddings": [], }, } @@ -374,6 +379,7 @@ def getModels(): listModels(model_type="hypernetwork") listModels(model_type="gfpgan") listModels(model_type="lora") + listModels(model_type="embeddings") if models_scanned > 0: log.info(f"[green]Scanned {models_scanned} models. Nothing infected[/]") From 75c57f646d7d70640232bc028fccb277c1cc915c Mon Sep 17 00:00:00 2001 From: JeLuF Date: Fri, 30 Jun 2023 08:41:15 +0200 Subject: [PATCH 2/5] embedding support popup --- ui/index.html | 23 ++++++++++++++ ui/media/css/main.css | 27 ++++++++++++++++ ui/media/js/main.js | 71 +++++++++++++++++++++++++++++++++++++++++++ ui/media/js/utils.js | 16 ++++++++++ 4 files changed, 137 insertions(+) diff --git a/ui/index.html b/ui/index.html index 9565c726..89f62944 100644 --- a/ui/index.html +++ b/ui/index.html @@ -244,6 +244,9 @@
+ + + +   + +
+
+ + +