diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Fix Flux2ImageProcessor AttributeError in train_dreambooth_lora_flux2…

Open knd0331 opened this issue 3 weeks ago • 0 comments

…_img2img.py

The training script incorrectly accessed Flux2ImageProcessor.image_processor which doesn't exist as a class attribute, causing AttributeError when running Flux2 img2img DreamBooth training.

Changes:

  • Initialize Flux2ImageProcessor instance in DreamBoothDataset.init
  • Replace incorrect class attribute access with instance method calls

Fixes #12778

What does this PR do?

Title: Fix Flux2ImageProcessor AttributeError in train_dreambooth_lora_flux2_img2img.py

Body:

Summary

Fix AttributeError: type object 'Flux2ImageProcessor' has no attribute 'image_processor' when running Flux2 img2img DreamBooth training script.

Problem

The training script incorrectly accesses Flux2ImageProcessor.image_processor which doesn't exist as a class attribute.

Solution

Initialize Flux2ImageProcessor instance in DreamBoothDataset.__init__ and use instance methods.

Changes

  • Initialize Flux2ImageProcessor instance in DreamBoothDataset.__init__
  • Replace incorrect class attribute access with instance method calls

Before submitting

  • [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • [x] Did you read the contributor guideline?
  • [ ] Did you read our philosophy doc (important for complex PRs)?
  • [x] Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
  • [x] Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

knd0331 avatar Dec 10 '25 01:12 knd0331