Spaces:
Runtime error
Runtime error
refactor gui.py
Browse files
app.py
CHANGED
@@ -206,10 +206,11 @@ logger.setLevel(logging.DEBUG)
|
|
206 |
|
207 |
|
208 |
# init GuiSD
|
209 |
-
sd_gen = GuiSD(
|
210 |
model_list=model_list,
|
211 |
task_stablepy=task_stablepy,
|
212 |
-
lora_model_list=lora_model_list
|
|
|
213 |
)
|
214 |
|
215 |
with open("app.css", "r") as f:
|
|
|
206 |
|
207 |
|
208 |
# init GuiSD
|
209 |
+
sd_gen: object = GuiSD(
|
210 |
model_list=model_list,
|
211 |
task_stablepy=task_stablepy,
|
212 |
+
lora_model_list=lora_model_list,
|
213 |
+
embed_list=embed_list,
|
214 |
)
|
215 |
|
216 |
with open("app.css", "r") as f:
|
gui.py
CHANGED
@@ -17,11 +17,16 @@ import logging
|
|
17 |
from utils.string_utils import extract_parameters
|
18 |
from stablepy import logger
|
19 |
|
|
|
|
|
20 |
logging.getLogger("diffusers").setLevel(logging.ERROR)
|
21 |
import diffusers
|
22 |
|
23 |
diffusers.utils.logging.set_verbosity(40)
|
24 |
import warnings
|
|
|
|
|
|
|
25 |
|
26 |
|
27 |
class GuiSD:
|
@@ -29,6 +34,7 @@ class GuiSD:
|
|
29 |
model_list,
|
30 |
task_stablepy,
|
31 |
lora_model_list,
|
|
|
32 |
stream=True):
|
33 |
self.model = None
|
34 |
|
@@ -43,6 +49,7 @@ class GuiSD:
|
|
43 |
self.model_list = model_list
|
44 |
self.task_stablepy = task_stablepy
|
45 |
self.lora_model_list = lora_model_list
|
|
|
46 |
self.stream = stream
|
47 |
|
48 |
def load_new_model(
|
@@ -359,7 +366,7 @@ class GuiSD:
|
|
359 |
"lora_scale_D": lora_scale4,
|
360 |
"lora_E": lora5 if lora5 != "None" else None,
|
361 |
"lora_scale_E": lora_scale5,
|
362 |
-
"textual_inversion": embed_list if textual_inversion and self.model.class_name != "StableDiffusionXLPipeline" else [],
|
363 |
"syntax_weights": syntax_weights, # "Classic"
|
364 |
"sampler": sampler,
|
365 |
"xformers_memory_efficient_attention": xformers_memory_efficient_attention,
|
|
|
17 |
from utils.string_utils import extract_parameters
|
18 |
from stablepy import logger
|
19 |
|
20 |
+
from models.upscaler import upscaler_dict_gui
|
21 |
+
|
22 |
logging.getLogger("diffusers").setLevel(logging.ERROR)
|
23 |
import diffusers
|
24 |
|
25 |
diffusers.utils.logging.set_verbosity(40)
|
26 |
import warnings
|
27 |
+
from utils.download_utils import download_things
|
28 |
+
|
29 |
+
hf_token: str = os.environ.get("HF_TOKEN")
|
30 |
|
31 |
|
32 |
class GuiSD:
|
|
|
34 |
model_list,
|
35 |
task_stablepy,
|
36 |
lora_model_list,
|
37 |
+
embed_list,
|
38 |
stream=True):
|
39 |
self.model = None
|
40 |
|
|
|
49 |
self.model_list = model_list
|
50 |
self.task_stablepy = task_stablepy
|
51 |
self.lora_model_list = lora_model_list
|
52 |
+
self.embed_list = embed_list
|
53 |
self.stream = stream
|
54 |
|
55 |
def load_new_model(
|
|
|
366 |
"lora_scale_D": lora_scale4,
|
367 |
"lora_E": lora5 if lora5 != "None" else None,
|
368 |
"lora_scale_E": lora_scale5,
|
369 |
+
"textual_inversion": self.embed_list if textual_inversion and self.model.class_name != "StableDiffusionXLPipeline" else [],
|
370 |
"syntax_weights": syntax_weights, # "Classic"
|
371 |
"sampler": sampler,
|
372 |
"xformers_memory_efficient_attention": xformers_memory_efficient_attention,
|