This commit is contained in:
lllyasviel
2024-01-25 13:17:51 -08:00
parent e2169c75be
commit a286338859
2 changed files with 7 additions and 1 deletions

View File

@@ -48,7 +48,7 @@ fp8: bool = False
device: torch.device = model_management.get_torch_device()
device_interrogate: torch.device = cpu # not used
device_gfpgan: torch.device = cpu
device_esrgan: torch.device = cpu # not used
device_esrgan: torch.device = model_management.get_torch_device() # will be managed in special way
device_codeformer: torch.device = cpu
dtype: torch.dtype = model_management.unet_dtype()
dtype_vae: torch.dtype = model_management.vae_dtype()

View File

@@ -6,6 +6,12 @@ from PIL import Image
import modules.shared
from modules import modelloader, shared
from ldm_patched.modules import model_management
def prepare_free_memory():
model_management.free_memory(memory_required=1024*1024*3, device=model_management.get_torch_device())
LANCZOS = (Image.Resampling.LANCZOS if hasattr(Image, 'Resampling') else Image.LANCZOS)
NEAREST = (Image.Resampling.NEAREST if hasattr(Image, 'Resampling') else Image.NEAREST)