Commit 1d7e9eca authored by AUTOMATIC1111's avatar AUTOMATIC1111

Merge pull request #16275 from AUTOMATIC1111/fix-image-upscale-on-cpu

fix image upscale on cpu
parent c19d0443
......@@ -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():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment