First workaround fix for upscalers loading
This commit is contained in:
+10
-4
@@ -1596,15 +1596,21 @@ def replacewildcard(completeprompt, insanitylevel, wildcard,listname, activatehy
|
||||
else:
|
||||
|
||||
while wildcard in completeprompt:
|
||||
if(unique_dist(insanitylevel) and activatehybridorswap == True):
|
||||
if(unique_dist(insanitylevel) and activatehybridorswap == True and len(listname)>2):
|
||||
hybridorswaplist = ["hybrid", "swap"]
|
||||
hybridorswap = random.choice(hybridorswaplist)
|
||||
hybridorswapreplacementvalue = "[" + random.choice(listname)
|
||||
replacementvalue = random.choice(listname)
|
||||
listname.remove(replacementvalue)
|
||||
hybridorswapreplacementvalue = "[" + replacementvalue
|
||||
|
||||
if(hybridorswap == "hybrid"):
|
||||
hybridorswapreplacementvalue += "|" + random.choice(listname) + "] "
|
||||
replacementvalue = random.choice(listname)
|
||||
listname.remove(replacementvalue)
|
||||
hybridorswapreplacementvalue += "|" + replacementvalue + "] "
|
||||
if(hybridorswap == "swap"):
|
||||
hybridorswapreplacementvalue += ":" + random.choice(listname) + ":" + str(random.randint(1,20)) + "] "
|
||||
replacementvalue = random.choice(listname)
|
||||
listname.remove(replacementvalue)
|
||||
hybridorswapreplacementvalue += ":" + replacementvalue + ":" + str(random.randint(1,20)) + "] "
|
||||
|
||||
completeprompt = completeprompt.replace(wildcard, hybridorswapreplacementvalue,1)
|
||||
|
||||
|
||||
@@ -12,9 +12,10 @@ cosplaying as -fictional-
|
||||
with -color- skin
|
||||
with -material- skin
|
||||
feeling -mood-
|
||||
expression is -mood-
|
||||
bathing in a river
|
||||
-pose- under a waterfall
|
||||
torn -minioutfit-
|
||||
, torn -minioutfit-
|
||||
wearing -elaborateoutfit-
|
||||
-animal- hybrid
|
||||
as -culture- -rpgclass-
|
||||
|
||||
|
+30
-2
@@ -1,8 +1,8 @@
|
||||
import modules.scripts as scripts
|
||||
import os
|
||||
from modules import modelloader, paths, shared, sd_models
|
||||
from modules.paths import models_path
|
||||
|
||||
from modules.paths import models_path, script_path
|
||||
import importlib
|
||||
|
||||
def get_models():
|
||||
modellist = sd_models.checkpoint_tiles()
|
||||
@@ -13,8 +13,24 @@ def get_upscalers():
|
||||
latentlist=["Latent","Latent (antialiased)","Latent (bicubic)","Latent (bicubic antialiased)","Latent (nearest)","Latent (nearest-exact)","Lanczos","Nearest"]
|
||||
|
||||
upscalerlistfromwWebUI = [x.name for x in shared.sd_upscalers]
|
||||
# From 1.4 onwards, the shared.sd_upscalers isn't available on startup. Run load_upscalers first
|
||||
if(bool(upscalerlistfromwWebUI) == False):
|
||||
modelloader.cleanup_models()
|
||||
modelloader.load_upscalers()
|
||||
upscalerlistfromwWebUI = [x.name for x in shared.sd_upscalers]
|
||||
|
||||
# deduplicate the list
|
||||
upscalerlistfromwWebUI = list(dict.fromkeys(upscalerlistfromwWebUI))
|
||||
|
||||
if("None" in upscalerlistfromwWebUI):
|
||||
upscalerlistfromwWebUI.remove("None")
|
||||
|
||||
|
||||
upscalerlist = latentlist + upscalerlistfromwWebUI
|
||||
|
||||
# Just to be sure, deduplicate again
|
||||
upscalerlist = list(dict.fromkeys(upscalerlist))
|
||||
|
||||
return upscalerlist
|
||||
|
||||
def get_samplers():
|
||||
@@ -25,8 +41,19 @@ def get_samplers():
|
||||
|
||||
def get_upscalers_for_img2img():
|
||||
upscalerlistfromwWebUI = [x.name for x in shared.sd_upscalers]
|
||||
|
||||
# From 1.4 onwards, the shared.sd_upscalers isn't available on startup. Run load_upscalers first
|
||||
if(bool(upscalerlistfromwWebUI) == False):
|
||||
modelloader.cleanup_models()
|
||||
modelloader.load_upscalers()
|
||||
upscalerlistfromwWebUI = [x.name for x in shared.sd_upscalers]
|
||||
|
||||
# deduplicate the list
|
||||
upscalerlistfromwWebUI = list(dict.fromkeys(upscalerlistfromwWebUI))
|
||||
|
||||
if("None" in upscalerlistfromwWebUI):
|
||||
upscalerlistfromwWebUI.remove("None")
|
||||
|
||||
return upscalerlistfromwWebUI
|
||||
|
||||
def get_samplers_for_img2img():
|
||||
@@ -34,3 +61,4 @@ def get_samplers_for_img2img():
|
||||
samplerlist = ["Euler a", "Euler", "LMS","Heun","DPM2","DPM2 a","DPM++ 2S a","DPM++ 2M","DPM++ SDE","DPM fast","DPM adaptive","LMS Karras","DPM2 Karras","DPM2 a Karras","DPM++ 2S a Karras","DPM++ 2M Karras","DPM++ SDE Karras"]
|
||||
samplerlist += ["DDIM"] #UniPC and PLMS dont support upscaling apparently
|
||||
return samplerlist
|
||||
|
||||
|
||||
Reference in New Issue
Block a user