Skip to content

Commit 2035182

Browse files
committed
Fix checking disk cached latents
1 parent 73daac1 commit 2035182

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

library/strategy_sd.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ def get_latents_npz_path(self, absolute_path: str, image_size: Tuple[int, int])
159159
return os.path.splitext(absolute_path)[0] + f"_{image_size[0]:04d}x{image_size[1]:04d}" + self.suffix
160160

161161
def is_disk_cached_latents_expected(self, bucket_reso: Tuple[int, int], npz_path: str, flip_aug: bool, alpha_mask: bool):
162-
return self._default_is_disk_cached_latents_expected(8, bucket_reso, npz_path, flip_aug, alpha_mask)
162+
# FOR SD/SDXL latents, the keys INSIDE the npz always have a resolution suffix.
163+
# So, we pass multi_resolution=True to the default checker.
164+
return self._default_is_disk_cached_latents_expected(
165+
8, bucket_reso, npz_path, flip_aug, alpha_mask, multi_resolution=True
166+
)
163167

164168
# TODO remove circular dependency for ImageInfo
165169
def cache_batch_latents(self, vae, image_infos: List, flip_aug: bool, alpha_mask: bool, random_crop: bool, random_crop_padding_percent: float = 0.05):

0 commit comments

Comments
 (0)