diff options
author | MalumaDev <piano.lu92@gmail.com> | 2022-10-16 15:53:56 +0000 |
---|---|---|
committer | MalumaDev <piano.lu92@gmail.com> | 2022-10-16 15:53:56 +0000 |
commit | 9324cdaa3199d65c182858785dd1eca42b192b8e (patch) | |
tree | 47dc89324b5b4528a1744e269d82a5106bfa4e60 /modules/shared.py | |
parent | e4f8b5f00dd33b7547cc6b76fbed26bb83b37a64 (diff) | |
download | stable-diffusion-webui-gfx803-9324cdaa3199d65c182858785dd1eca42b192b8e.tar.gz stable-diffusion-webui-gfx803-9324cdaa3199d65c182858785dd1eca42b192b8e.tar.bz2 stable-diffusion-webui-gfx803-9324cdaa3199d65c182858785dd1eca42b192b8e.zip |
ui fix, re organization of the code
Diffstat (limited to 'modules/shared.py')
-rw-r--r-- | modules/shared.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/shared.py b/modules/shared.py index e2c98b2d..e19ca779 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -3,6 +3,7 @@ import datetime import json
import os
import sys
+from collections import OrderedDict
import gradio as gr
import tqdm
@@ -94,15 +95,15 @@ os.makedirs(cmd_opts.hypernetwork_dir, exist_ok=True) hypernetworks = hypernetwork.list_hypernetworks(cmd_opts.hypernetwork_dir)
loaded_hypernetwork = None
-aesthetic_embeddings = {f.replace(".pt",""): os.path.join(cmd_opts.aesthetic_embeddings_dir, f) for f in
- os.listdir(cmd_opts.aesthetic_embeddings_dir) if f.endswith(".pt")}
-aesthetic_embeddings = aesthetic_embeddings | {"None": None}
+aesthetic_embeddings = {}
def update_aesthetic_embeddings():
global aesthetic_embeddings
aesthetic_embeddings = {f.replace(".pt",""): os.path.join(cmd_opts.aesthetic_embeddings_dir, f) for f in
os.listdir(cmd_opts.aesthetic_embeddings_dir) if f.endswith(".pt")}
- aesthetic_embeddings = aesthetic_embeddings | {"None": None}
+ aesthetic_embeddings = OrderedDict(**{"None": None}, **aesthetic_embeddings)
+
+update_aesthetic_embeddings()
def reload_hypernetworks():
global hypernetworks
@@ -381,6 +382,11 @@ sd_upscalers = [] sd_model = None
+clip_model = None
+
+from modules.aesthetic_clip import AestheticCLIP
+aesthetic_clip = AestheticCLIP()
+
progress_print_out = sys.stdout
|