Queue up videos with multiple threads when caching latents so the VAE is not waiting on videos to process

This commit is contained in:
Jaret Burkett
2026-08-03 15:41:36 -06:00
parent 546eb7daff
commit 41676bb258
2 changed files with 147 additions and 100 deletions

View File

@@ -1030,6 +1030,8 @@ class DatasetConfig:
self.num_workers: int = kwargs.get('num_workers', 2)
self.prefetch_factor: int = kwargs.get('prefetch_factor', 2)
# threads used to prep (decode/resize) items ahead of the VAE while caching latents
self.cache_latents_num_workers: int = kwargs.get('cache_latents_num_workers', min(6, os.cpu_count() or 1))
self.extra_values: List[float] = kwargs.get('extra_values', [])
self.square_crop: bool = kwargs.get('square_crop', False)
# apply same augmentations to control images. Usually want this true unless special case