Skip to content

Conversation

@arrdel
Copy link

@arrdel arrdel commented Dec 3, 2025

What does this PR do?

Fixes #12779

This PR fixes an error in the Flux2 dreambooth training script.

The Problem

The argument parser defined the argument as (line 358):

parser.add_argument(
    "--validation_image",
    type=str,
    default=None,
    help="path to an image that is used during validation as the condition image to verify that the model is learning.",
)

However, the code on line 1422 references :

validation_image = load_image(args.validation_image_path).convert("RGB")

This naming mismatch causes an when the script tries to access the non-existent attribute.

The Solution

Renamed the argument from to to match what the code expects.

Testing

The fix ensures that:

  • ✅ The argument can be properly parsed
  • ✅ The code can access without error
  • ✅ The script no longer crashes with AttributeError when using validation images

…--validation_image_path

The argument was defined as --validation_image but the code references args.validation_image_path (line 1422), causing an AttributeError. This fixes the naming mismatch.

Fixes huggingface#12779
Copilot AI review requested due to automatic review settings December 3, 2025 17:07
Copilot finished reviewing on behalf of arrdel December 3, 2025 17:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an AttributeError in the Flux2 dreambooth img2img training script by renaming the --validation_image argument to --validation_image_path to match its usage in the code.

Key Changes:

  • Renamed argument parser parameter from --validation_image to --validation_image_path to align with the code that accesses args.validation_image_path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Flux2 dreambooth: AttributeError: 'Namespace' object has no attribute 'validation_image_path'

1 participant