esrgan gpu id

This commit is contained in:
hlky 2022-09-03 09:04:38 +01:00
parent b0c1ac9f7b
commit b61b453a02
No known key found for this signature in database
GPG Key ID: 55A99F1E80D907D5

View File

@ -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