Allow overriding the batch size on a per dataset level

This commit is contained in:
Jaret Burkett
2026-08-21 12:56:04 -06:00
parent 89102f76dc
commit b96476a841
5 changed files with 30 additions and 6 deletions

View File

@@ -915,6 +915,7 @@ class DatasetConfig:
"""
def __init__(self, **kwargs):
self.batch_size: Union[int, None] = kwargs.get('batch_size', None)
self.type = kwargs.get('type', 'image') # sd, slider, reference
# will be legacy
self.folder_path: str = kwargs.get('folder_path', None)
@@ -1504,7 +1505,4 @@ def validate_configs(
raise ValueError(f"Cannot cache unload text encoder with {model_config.arch} model. Control images are encoded with text embeddings. You can cache the text embeddings though")
if train_config.diff_output_preservation and train_config.blank_prompt_preservation:
raise ValueError("Cannot use both differential output preservation and blank prompt preservation at the same time. Please set one of them to False.")
if train_config.batch_size > 1 and any(dataset_config.auto_frame_count for dataset_config in dataset_configs):
raise ValueError("Cannot use batch size greater than 1 with auto_frame_count. Please set batch_size to 1 or auto_frame_count to False.")
raise ValueError("Cannot use both differential output preservation and blank prompt preservation at the same time. Please set one of them to False.")