Skip to content

Commit

Permalink
Merge pull request #1205 from feffy380/patch-1
Browse files Browse the repository at this point in the history
register reg images with correct subset
  • Loading branch information
kohya-ss authored Mar 24, 2024
2 parents 691f043 + 0c7baea commit ad97410
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ def load_dreambooth_dir(subset: DreamBoothSubset):
for img_path, caption in zip(img_paths, captions):
info = ImageInfo(img_path, subset.num_repeats, caption, subset.is_reg, img_path)
if subset.is_reg:
reg_infos.append(info)
reg_infos.append((info, subset))
else:
self.register_image(info, subset)

Expand All @@ -1575,7 +1575,7 @@ def load_dreambooth_dir(subset: DreamBoothSubset):
n = 0
first_loop = True
while n < num_train_images:
for info in reg_infos:
for info, subset in reg_infos:
if first_loop:
self.register_image(info, subset)
n += info.num_repeats
Expand Down

0 comments on commit ad97410

Please sign in to comment.