Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions jobs/process/BaseSDTrainProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,9 @@ def process_general_training_batch(self, batch: 'DataLoaderBatchDTO'):
if self.sd.is_flux or 'flex' in self.sd.arch:
# flux is a patch size of 1, but latents are divided by 2, so we need to double it
patch_size = 2
elif getattr(self.sd, 'patch_size', None) is not None:
# Prefer a model-declared patch size when available.
patch_size = self.sd.patch_size
elif hasattr(self.sd.unet, 'config') and hasattr(self.sd.unet.config, 'patch_size'):
patch_size = self.sd.unet.config.patch_size

Expand Down