From b61b453a0214ab7e0482c3a2ce042da8b220b0b7 Mon Sep 17 00:00:00 2001 From: hlky <106811348+hlky@users.noreply.github.com> Date: Sat, 3 Sep 2022 09:04:38 +0100 Subject: [PATCH] esrgan gpu id --- webui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webui.py b/webui.py index ee5efc6..af0f4e5 100644 --- a/webui.py +++ b/webui.py @@ -332,9 +332,9 @@ def load_RealESRGAN(model_name: str): instance.device = torch.device('cpu') instance.model.to('cpu') elif opt.extra_models_gpu: - instance = RealESRGANer(scale=2, model_path=model_path, model=RealESRGAN_models[model_name], pre_pad=0, half=not opt.no_half, device=torch.device(f'cuda:{opt.esrgan_gpu}')) + instance = RealESRGANer(scale=2, model_path=model_path, model=RealESRGAN_models[model_name], pre_pad=0, half=not opt.no_half, gpu_id=opt.esrgan_gpu) else: - instance = RealESRGANer(scale=2, model_path=model_path, model=RealESRGAN_models[model_name], pre_pad=0, half=not opt.no_half, device=torch.device(f'cuda:{opt.gpu}')) + instance = RealESRGANer(scale=2, model_path=model_path, model=RealESRGAN_models[model_name], pre_pad=0, half=not opt.no_half) instance.model.name = model_name return instance