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

[Training] QoL improvements in the Flux Control training scripts #10461

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Jan 6, 2025

What does this PR do?

  • Introduce a flag only_target_transformer_blocks in the train_control_flux.py script. This only trains the transformer blocks along with the x_embedder layer. Results show that it works.
  • Introduce a flag log_dataset_samples which lets users log samples to wandb (properly guarded). One can check this wandb run page to see that it works.
  • Modifies the dataloader such that when a dataset caption column has a list of different captions we only take the largest one. This lets us train on datasets like this: https://huggingface.co/datasets/TIGER-Lab/OmniEdit-Filtered-1.2M. We could randomly sample, too but for now, this is okay IMO.
  • Some additional changes to the README, fixing some argument names.

@@ -797,6 +807,12 @@ def main(args):
assert torch.all(flux_transformer.x_embedder.weight[:, initial_input_channels:].data == 0)
flux_transformer.register_to_config(in_channels=initial_input_channels * 2, out_channels=initial_input_channels)

if args.only_target_transformer_blocks:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't apply to the LoRA script.

@HuggingFaceDocBuilderDev

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.

@sayakpaul sayakpaul requested a review from a-r-r-o-w January 6, 2025 02:29
Copy link
Member

@a-r-r-o-w a-r-r-o-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sayakpaul sayakpaul merged commit b94cfd7 into main Jan 7, 2025
12 checks passed
@sayakpaul sayakpaul deleted the updates-flux-control branch January 7, 2025 06:26
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.

3 participants