kohya-ss / kohya-ss/sd-scripts

[Feature Request] Multiplier-Based Image Selection Over Repeat Counts - Improved Subject Balancing

Open
#826 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

I'm used to [EveryDream2](https://github.com/victorchall/EveryDream2trainer) trainer, which gives users the option to select a portion of images from a folder using a multiplier instead of a repeat count. For instance, by applying a 0.5 multiplier to a folder, the trainer will randomly select half of the images for each epoch. This system isn't limited to fractions; users can set multipliers such as 1.6 or any other positive value. On the other hand, using a negative multiplier will exclude the folder.

This multiplier approach retains the repeat functionality users are accustomed to while offering a significant improvement in balancing training across different subjects without having to delete any images.

To illustrate, consider three subjects: A with 1000 images, B with 200 images, and C with 100 images. If the goal is to train on 25 images per epoch, we can set multipliers of 0.025 for A, 0.125 for B, and 0.25 for C. This eliminates the need to delete images or train on all 1000 images from subject A. This method effectively balances subjects, especially when the number of images in their datasets varies. As the number and diversity of subjects increase, this approach provides better control over training, avoiding the need to discard images.

I believe that adding this feature to Kohya is essential.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry points. Start by locating the Python training code that handles folder repeat counts, then determine how multiplier-based selection, negative exclusion, and existing repeat behavior should coexist; done means the balancing examples can be configured without deleting images.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.