Skip to content

Commit

Permalink
Use Spandrel for upscaling and face restoration architectures (aside …
Browse files Browse the repository at this point in the history
…from GFPGAN and LDSR)
  • Loading branch information
akx committed Dec 27, 2023
1 parent cfbaffd commit 6014c97
Show file tree
Hide file tree
Showing 20 changed files with 263 additions and 3,754 deletions.
13 changes: 2 additions & 11 deletions extensions-builtin/ScuNET/scripts/scunet_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

import modules.upscaler
from modules import devices, modelloader, script_callbacks, errors
from scunet_model_arch import SCUNet

from modules.modelloader import load_file_from_url
from modules.shared import opts


Expand Down Expand Up @@ -120,17 +118,10 @@ def load_model(self, path: str):
device = devices.get_device_for('scunet')
if path.startswith("http"):
# TODO: this doesn't use `path` at all?
filename = load_file_from_url(self.model_url, model_dir=self.model_download_path, file_name=f"{self.name}.pth")
filename = modelloader.load_file_from_url(self.model_url, model_dir=self.model_download_path, file_name=f"{self.name}.pth")
else:
filename = path
model = SCUNet(in_nc=3, config=[4, 4, 4, 4, 4, 4, 4], dim=64)
model.load_state_dict(torch.load(filename), strict=True)
model.eval()
for _, v in model.named_parameters():
v.requires_grad = False
model = model.to(device)

return model
return modelloader.load_spandrel_model(filename, device=device)


def on_ui_settings():
Expand Down
268 changes: 0 additions & 268 deletions extensions-builtin/ScuNET/scunet_model_arch.py

This file was deleted.

Loading

0 comments on commit 6014c97

Please sign in to comment.