-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[training ] add Kontext i2i training #11858
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
to_tensor = transforms.ToTensor() | ||
normalize = transforms.Normalize([0.5], [0.5]) |
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.
Should initialize one-time only. All deterministic transformations should be initialized only once. Future PR.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
diffusers/examples/dreambooth/train_dreambooth_lora_flux_kontext.py
Lines 1380 to 1393 in bce55a9
target_modules = [ | |
"attn.to_k", | |
"attn.to_q", | |
"attn.to_v", | |
"attn.to_out.0", | |
"attn.add_k_proj", | |
"attn.add_q_proj", | |
"attn.add_v_proj", | |
"attn.to_add_out", | |
"ff.net.0.proj", | |
"ff.net.2", | |
"ff_context.net.0.proj", | |
"ff_context.net.2", | |
] |
let's add
proj_out,proj_mlp
too here, seems to improve results and other trainers target these as well
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.
But proj_out
will also include the final output layer also right? 👁️
self.proj_out = nn.Linear(self.inner_dim, patch_size * patch_size * self.out_channels, bias=True) |
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.
indeed it will
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.
So, maybe let's just add proj_mlp
for now given #11874?
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.
yes good catch!
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com>
@bot /style |
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.
thanks @sayakpaul 🚀
add note on installing from commit `05e7a854d0a5661f5b433f6dd5954c224b104f0b`
What does this PR do?
Test command:
I haven't finished it fully.
Additionally, I have taken the liberty to modify our training script to precompute the text embeddings when we have
train_dataset.custom_instance_prompts
. These are better calledcustom_instruction_prompts
, IMO. So, in a future PR, we could switch to better variable names.