-
Couldn't load subscription status.
- Fork 6.5k
[Dreambooth] Editable number of class images #2251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
|
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
|
From a quick glance this makes sense to me - @patil-suraj could you quickly check this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be so late here, makes sense, looks good!
| tokenizer, | ||
| class_data_root=None, | ||
| class_prompt=None, | ||
| class_num=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be None actually, otherwise the min call will fail. When it's None we should set it to the value of len(self.class_images_path)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's my mistake. Change the code like this:
if class_num is not None:
self.num_class_images = min(len(self.class_images_path), class_num)
else:
self.num_class_images = len(self.class_images_path)|
Hi all, thanks for checking this PR and reviewing the code! I have committed the new code😊 |
|
Cool, good for merge then! |
* [Dreambooth] Editable number of class images * 'class_num=None' bug fix --------- Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* [Dreambooth] Editable number of class images * 'class_num=None' bug fix --------- Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Recently the code in class
DreamboothDatasetwill directly make num ofclass_imagesto the length of the class_images folder:However, if user want to test different effects with different class images (for example user want to test
50but the folder contains100), it will ignore the number50and still use100, thus fail to handle it. So, it seems better to modify the code to:All three dreambooth training scripts in this PR have been modified in the same way.