SwinIR: use prefer_half

This commit is contained in:
Aarni Koskela 2024-01-03 22:38:13 +02:00
parent e4dcdcc955
commit dfdc51246c
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import logging
import sys
import torch
from PIL import Image
from modules import devices, modelloader, script_callbacks, shared, upscaler_utils
@ -69,7 +70,7 @@ class UpscalerSwinIR(Upscaler):
model_descriptor = modelloader.load_spandrel_model(
filename,
device=self._get_device(),
dtype=devices.dtype,
prefer_half=(devices.dtype == torch.float16),
expected_architecture="SwinIR",
)
if getattr(shared.opts, 'SWIN_torch_compile', False):