add --realesrgan-no-half

This commit is contained in:
Qing
2023-04-03 13:32:04 +08:00
parent dd1d45aa79
commit 03206fb8d6
3 changed files with 10 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ from lama_cleaner.plugins.base_plugin import BasePlugin
class RealESRGANUpscaler(BasePlugin):
name = "RealESRGAN"
def __init__(self, name, device):
def __init__(self, name, device, no_half=False):
super().__init__()
from basicsr.archs.rrdbnet_arch import RRDBNet
from realesrgan import RealESRGANer
@@ -69,7 +69,7 @@ class RealESRGANUpscaler(BasePlugin):
scale=model_info["scale"],
model_path=model_path,
model=model_info["model"](),
half=True if "cuda" in str(device) else False,
half=True if "cuda" in str(device) and not no_half else False,
tile=512,
tile_pad=10,
pre_pad=10,