Skip to content

Conversation

Barque-S
Copy link

@Barque-S Barque-S commented Sep 30, 2025

What does this PR do?

The current version of the examples folder contains a bug in the prior preservation calculation in train_dreambooth_sd3.py and train_dreambooth_lora_sd3.py.

Taking the LoRA version as an example: when using --with_prior_preservation, encode_prompt() incorrectly receives args.instance_prompt instead of prompts (i.e., instance_prompt + class_prompt). This prevents correct encoding of the class prior, which negatively affects subsequent training.

A similar issue exists in the non-LoRA version, where encode_prompt() is called incorrectly.

This PR aims to fix these bugs.

Before submitting

Who can review?

@sayakpaul

…param instead of None; 2. tokenizers should be a list; 3. and max_sequence_length should be provided; 4. _encode_with_t5(...) now behave similar as train_dreambooth_lora_sd3.py does; when calling encode_prompt(...).
…instance_prompt should be passed to param prompt, when calling encode_prompt(...) here..
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

Successfully merging this pull request may close these issues.

1 participant