mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-01 12:25:06 +08:00
SwinIR: use prefer_half
This commit is contained in:
parent
e4dcdcc955
commit
dfdc51246c
@ -1,6 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import torch
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
from modules import devices, modelloader, script_callbacks, shared, upscaler_utils
|
from modules import devices, modelloader, script_callbacks, shared, upscaler_utils
|
||||||
@ -69,7 +70,7 @@ class UpscalerSwinIR(Upscaler):
|
|||||||
model_descriptor = modelloader.load_spandrel_model(
|
model_descriptor = modelloader.load_spandrel_model(
|
||||||
filename,
|
filename,
|
||||||
device=self._get_device(),
|
device=self._get_device(),
|
||||||
dtype=devices.dtype,
|
prefer_half=(devices.dtype == torch.float16),
|
||||||
expected_architecture="SwinIR",
|
expected_architecture="SwinIR",
|
||||||
)
|
)
|
||||||
if getattr(shared.opts, 'SWIN_torch_compile', False):
|
if getattr(shared.opts, 'SWIN_torch_compile', False):
|
||||||
|
Loading…
Reference in New Issue
Block a user