Fixed issues with dataloader bucketing. Allow using standard base image for t2i adapters.

This commit is contained in:
Jaret Burkett
2023-09-24 05:19:57 -06:00
parent 830e87cb87
commit e5153d87c9
5 changed files with 41 additions and 20 deletions

View File

@@ -83,7 +83,8 @@ def get_bucket_for_image_size(
width: int,
height: int,
bucket_size_list: List[BucketResolution] = None,
resolution: Union[int, None] = None
resolution: Union[int, None] = None,
divisibility: int = 8
) -> BucketResolution:
if bucket_size_list is None and resolution is None:
@@ -93,7 +94,7 @@ def get_bucket_for_image_size(
# if real resolution is smaller, use that instead
real_resolution = get_resolution(width, height)
resolution = min(resolution, real_resolution)
bucket_size_list = get_bucket_sizes(resolution=resolution)
bucket_size_list = get_bucket_sizes(resolution=resolution, divisibility=divisibility)
# Check for exact match first
for bucket in bucket_size_list: