mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-04-30 03:01:28 +00:00
Fix check for making sure vae is on the right device.
This commit is contained in:
@@ -1084,7 +1084,7 @@ class BaseModel:
|
||||
|
||||
latent_list = []
|
||||
# Move to vae to device if on cpu
|
||||
if self.vae.device == 'cpu':
|
||||
if self.vae.device == torch.device("cpu"):
|
||||
self.vae.to(device)
|
||||
self.vae.eval()
|
||||
self.vae.requires_grad_(False)
|
||||
@@ -1127,7 +1127,7 @@ class BaseModel:
|
||||
dtype = self.torch_dtype
|
||||
|
||||
# Move to vae to device if on cpu
|
||||
if self.vae.device == 'cpu':
|
||||
if self.vae.device == torch.device('cpu'):
|
||||
self.vae.to(self.device)
|
||||
latents = latents.to(device, dtype=dtype)
|
||||
latents = (
|
||||
|
||||
Reference in New Issue
Block a user