|
|
|
@ -25,6 +25,7 @@ class UpscalerLDSR(Upscaler):
|
|
|
|
yaml_path = os.path.join(self.model_path, "project.yaml")
|
|
|
|
yaml_path = os.path.join(self.model_path, "project.yaml")
|
|
|
|
old_model_path = os.path.join(self.model_path, "model.pth")
|
|
|
|
old_model_path = os.path.join(self.model_path, "model.pth")
|
|
|
|
new_model_path = os.path.join(self.model_path, "model.ckpt")
|
|
|
|
new_model_path = os.path.join(self.model_path, "model.ckpt")
|
|
|
|
|
|
|
|
safetensors_model_path = os.path.join(self.model_path, "model.safetensors")
|
|
|
|
if os.path.exists(yaml_path):
|
|
|
|
if os.path.exists(yaml_path):
|
|
|
|
statinfo = os.stat(yaml_path)
|
|
|
|
statinfo = os.stat(yaml_path)
|
|
|
|
if statinfo.st_size >= 10485760:
|
|
|
|
if statinfo.st_size >= 10485760:
|
|
|
|
@ -33,6 +34,9 @@ class UpscalerLDSR(Upscaler):
|
|
|
|
if os.path.exists(old_model_path):
|
|
|
|
if os.path.exists(old_model_path):
|
|
|
|
print("Renaming model from model.pth to model.ckpt")
|
|
|
|
print("Renaming model from model.pth to model.ckpt")
|
|
|
|
os.rename(old_model_path, new_model_path)
|
|
|
|
os.rename(old_model_path, new_model_path)
|
|
|
|
|
|
|
|
if os.path.exists(safetensors_model_path):
|
|
|
|
|
|
|
|
model = safetensors_model_path
|
|
|
|
|
|
|
|
else:
|
|
|
|
model = load_file_from_url(url=self.model_url, model_dir=self.model_path,
|
|
|
|
model = load_file_from_url(url=self.model_url, model_dir=self.model_path,
|
|
|
|
file_name="model.ckpt", progress=True)
|
|
|
|
file_name="model.ckpt", progress=True)
|
|
|
|
yaml = load_file_from_url(url=self.yaml_url, model_dir=self.model_path,
|
|
|
|
yaml = load_file_from_url(url=self.yaml_url, model_dir=self.model_path,
|
|
|
|
|