Skip to content
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

Must I use regulization imgs retrieved from laion? #58

Open
CoderZhangYx opened this issue May 6, 2023 · 2 comments
Open

Must I use regulization imgs retrieved from laion? #58

CoderZhangYx opened this issue May 6, 2023 · 2 comments

Comments

@CoderZhangYx
Copy link

Thanks for your wonderful work!
When i want to train a model for myself, i found that the code starts to download imgs from laion. Is this process necessary? Could i use local images? In other words, can i prepare the regulization images myself and specify them for the code?

@nupurkmr9
Copy link
Collaborator

Hi, you can provide your own regularization images as well. E.g., if using diffusers:

  1. If your regularization images have unique prompt for each image.
    Save images with path class_data_dir/{'_'.join(class_prompt.split())} and have an images.txt and caption.txt in class_data_dir. The images.txt should have the absolute path to the image and caption.txt its corresponding text caption. Also modify the num_class_images argument to the number of images you have.

  2. If all the regularization images have a single common prompt.
    Disable real_prior flag during training. And have num_class_images in the class_data_dir. And provide the common prompt as class_prompt argument.

Let me know if this doesn't suit your requirement. And I can try to make the code more modular to support this by default.
Thanks.

@CoderZhangYx
Copy link
Author

Hi! Thanks for your reply!
Useful solutions! But while following your "single common prompt" suggestion, there comes 2 cases:

  1. concept_list should be None, otherwise class_data_dir won't work. And this is useful for single-concept training only.

  2. for multi-concept training, it seems that further modification for the args should be taken. I'm done by modifying assets/concept_list.json, as well as disabling real_prior. In this way, class_prompt and class_data_dir are specified in assets/concept_list.json and thus not needed in args.

Hope that you can provide detailed instruction in documents for later followers! Thanks for your nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants