Skip to content

Commit 850e149

Browse files
Merge pull request AUTOMATIC1111#16275 from AUTOMATIC1111/fix-image-upscale-on-cpu
fix image upscale on cpu
2 parents 834297b + 8e0881d commit 850e149

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/upscaler_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def upscale_pil_patch(model, img: Image.Image) -> Image.Image:
4141
"""
4242
param = torch_utils.get_param(model)
4343

44-
with torch.no_grad():
44+
with torch.inference_mode():
4545
tensor = pil_image_to_torch_bgr(img).unsqueeze(0) # add batch dimension
4646
tensor = tensor.to(device=param.device, dtype=param.dtype)
4747
with devices.without_autocast():

0 commit comments

Comments
 (0)