mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-04-28 18:21:16 +00:00
Fix check for making sure vae is on the right device.
This commit is contained in:
@@ -2516,7 +2516,7 @@ class StableDiffusion:
|
||||
|
||||
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)
|
||||
@@ -2558,7 +2558,7 @@ class StableDiffusion:
|
||||
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_torch)
|
||||
latents = latents.to(self.device_torch, dtype=self.torch_dtype)
|
||||
latents = (latents / self.vae.config['scaling_factor']) + self.vae.config['shift_factor']
|
||||
|
||||
Reference in New Issue
Block a user