Skip to content

Commit

Permalink
Merge pull request AUTOMATIC1111#16275 from AUTOMATIC1111/fix-image-u…
Browse files Browse the repository at this point in the history
…pscale-on-cpu

fix image upscale on cpu
  • Loading branch information
AUTOMATIC1111 committed Jul 27, 2024
1 parent c19d044 commit 1d7e9ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/upscaler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def upscale_pil_patch(model, img: Image.Image) -> Image.Image:
"""
param = torch_utils.get_param(model)

with torch.no_grad():
with torch.inference_mode():
tensor = pil_image_to_torch_bgr(img).unsqueeze(0) # add batch dimension
tensor = tensor.to(device=param.device, dtype=param.dtype)
with devices.without_autocast():
Expand Down

0 comments on commit 1d7e9ec

Please # to comment.