Fixes, cleanup.
This commit is contained in:
parent
d73741794d
commit
435fd2112a
@ -101,8 +101,10 @@ class LDSR:
|
|||||||
print("Foo")
|
print("Foo")
|
||||||
down_sample_rate = target_scale / 4
|
down_sample_rate = target_scale / 4
|
||||||
print(f"Downsample rate is {down_sample_rate}")
|
print(f"Downsample rate is {down_sample_rate}")
|
||||||
width_downsampled_pre = width_og * down_sample_rate
|
wd = width_og * down_sample_rate
|
||||||
height_downsampled_pre = height_og * down_sample_method
|
hd = height_og * down_sample_rate
|
||||||
|
width_downsampled_pre = int(wd)
|
||||||
|
height_downsampled_pre = int(hd)
|
||||||
|
|
||||||
if down_sample_rate != 1:
|
if down_sample_rate != 1:
|
||||||
print(
|
print(
|
||||||
|
@ -118,11 +118,9 @@ def load_upscalers():
|
|||||||
for cls in Upscaler.__subclasses__():
|
for cls in Upscaler.__subclasses__():
|
||||||
name = cls.__name__
|
name = cls.__name__
|
||||||
module_name = cls.__module__
|
module_name = cls.__module__
|
||||||
print(f"Class: {name} and {module_name}")
|
|
||||||
module = importlib.import_module(module_name)
|
module = importlib.import_module(module_name)
|
||||||
class_ = getattr(module, name)
|
class_ = getattr(module, name)
|
||||||
cmd_name = f"{name.lower().replace('upscaler', '')}-models-path"
|
cmd_name = f"{name.lower().replace('upscaler', '')}-models-path"
|
||||||
print(f"CMD Name: {cmd_name}")
|
|
||||||
opt_string = None
|
opt_string = None
|
||||||
try:
|
try:
|
||||||
opt_string = shared.opts.__getattr__(cmd_name)
|
opt_string = shared.opts.__getattr__(cmd_name)
|
||||||
@ -130,18 +128,6 @@ def load_upscalers():
|
|||||||
pass
|
pass
|
||||||
scaler = class_(opt_string)
|
scaler = class_(opt_string)
|
||||||
for child in scaler.scalers:
|
for child in scaler.scalers:
|
||||||
print(f"Appending {child.name}")
|
|
||||||
datas.append(child)
|
datas.append(child)
|
||||||
|
|
||||||
shared.sd_upscalers = datas
|
shared.sd_upscalers = datas
|
||||||
|
|
||||||
# for scaler in subclasses:
|
|
||||||
# print(f"Found scaler: {type(scaler).__name__}")
|
|
||||||
# try:
|
|
||||||
# scaler = scaler()
|
|
||||||
# for child in scaler.scalers:
|
|
||||||
# print(f"Appending {child.name}")
|
|
||||||
# datas.append[child]
|
|
||||||
# except:
|
|
||||||
# pass
|
|
||||||
# shared.sd_upscalers = datas
|
|
||||||
|
@ -52,7 +52,7 @@ class UpscalerSwinIR(Upscaler):
|
|||||||
|
|
||||||
def load_model(self, path, scale=4):
|
def load_model(self, path, scale=4):
|
||||||
if "http" in path:
|
if "http" in path:
|
||||||
dl_name = "%s%s" % (self.name.replace(" ", "_"), ".pth")
|
dl_name = "%s%s" % (self.model_name.replace(" ", "_"), ".pth")
|
||||||
filename = load_file_from_url(url=path, model_dir=self.model_path, file_name=dl_name, progress=True)
|
filename = load_file_from_url(url=path, model_dir=self.model_path, file_name=dl_name, progress=True)
|
||||||
else:
|
else:
|
||||||
filename = path
|
filename = path
|
||||||
|
Loading…
Reference in New Issue
Block a user