Fix AttributeError in train_dreambooth_lora_flux2_img2img validation#13520
Open
Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Open
Fix AttributeError in train_dreambooth_lora_flux2_img2img validation#13520Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Ricardo-M-L wants to merge 1 commit intohuggingface:mainfrom
Conversation
The validation block referenced `args.validation_image_path`, but the CLI argument is defined as `--validation_image`, so argparse stores it as `args.validation_image`. When a user passes `--validation_prompt`, the script crashes immediately with `AttributeError: 'Namespace' object has no attribute 'validation_image_path'` before any training starts. Other Flux2 img2img-style dreambooth scripts (e.g. `train_dreambooth_lora_flux2_klein_img2img.py` and `train_dreambooth_lora_flux_kontext.py`) already use the correct `args.validation_image`; this just aligns this script with them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes an
AttributeErrorinexamples/dreambooth/train_dreambooth_lora_flux2_img2img.pythat makes the validation flow unusable.The validation block references
args.validation_image_path:But the CLI argument is defined as
--validation_image:Argparse stores it as
args.validation_image, so accessingargs.validation_image_pathraisesAttributeError: 'Namespace' object has no attribute 'validation_image_path'the moment a user passes--validation_prompt, before any training actually starts.Sibling scripts like
train_dreambooth_lora_flux2_klein_img2img.py(L1437) andtrain_dreambooth_lora_flux_kontext.pyalready use the correctargs.validation_image; this aligns this script with them.Fixes
Before submitting
Who can review?
@sayakpaul @linoytsaban