Skip to content

Conversation

@knd0331
Copy link

@knd0331 knd0331 commented Dec 10, 2025

…_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

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.

…_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 huggingface#12778
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.

AttributeError: type object 'Flux2ImageProcessor' has no attribute 'image_processor'

1 participant