fix for the previous fix.

This commit is contained in:
AUTOMATIC1111 2023-12-31 00:43:41 +03:00
parent 8100e901ab
commit 3be9074031
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ def upscale_without_tiling(model, img: Image.Image):
img = np.ascontiguousarray(np.transpose(img, (2, 0, 1))) / 255 img = np.ascontiguousarray(np.transpose(img, (2, 0, 1))) / 255
img = torch.from_numpy(img).float() img = torch.from_numpy(img).float()
model_weight = next(iter(model.parameters())) model_weight = next(iter(model.model.parameters()))
img = img.unsqueeze(0).to(device=model_weight.device, dtype=model_weight.dtype) img = img.unsqueeze(0).to(device=model_weight.device, dtype=model_weight.dtype)
with torch.no_grad(): with torch.no_grad():