Skip to content

Commit 253091e

Browse files
committed
Fix AttributeError in train_dreambooth_lora_flux2_img2img validation
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.
1 parent c8c8401 commit 253091e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

examples/dreambooth/train_dreambooth_lora_flux2_img2img.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ def _encode_single(prompt: str):
14831483
)
14841484

14851485
if args.validation_prompt is not None:
1486-
validation_image = load_image(args.validation_image_path).convert("RGB")
1486+
validation_image = load_image(args.validation_image).convert("RGB")
14871487
validation_kwargs = {"image": validation_image}
14881488
if args.remote_text_encoder:
14891489
validation_kwargs["prompt_embeds"] = compute_remote_text_embeddings(args.validation_prompt)

0 commit comments

Comments
 (0)