KEMBAR78
Loading Flux Dev transformers from_single_file fails since support for Flux Fill was added · Issue #10540 · huggingface/diffusers · GitHub
Skip to content

Loading Flux Dev transformers from_single_file fails since support for Flux Fill was added #10540

@dxqb

Description

@dxqb

Describe the bug

Flux models are sometimes distributed as transformer only, because all the other pipeline components are usually not changed.

Examples include:

Since support for Flux Fill was added here 862a7d5, diffusers.FluxTransformer2DModel.from_single_file fails to load these files:

File "/.../src/diffusers/src/diffusers/loaders/single_file_utils.py", line 598, in infer_diffusers_model_type
    if checkpoint["img_in.weight"].shape[1] == 384:
       ~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'img_in.weight'

Reproduction

Download one of the example mentioned above, and run

from diffusers import FluxTransformer2DModel

transformer = FluxTransformer2DModel.from_single_file(your_file)

Logs

No response

System Info

HEAD

Who can help?

@DN6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions