Skip to content

QwenImageTransformer2DModel.from_single_file #12423

@dxqb

Description

@dxqb

Describe the bug

QwenImageTransformer2DModel.from_single_file requires the following arguments:

QwenImageTransformer2DModel.from_single_file(
  local_safetensors_file,
  config="Qwen/Qwen-Image",
  subfolder="transformer",
  torch_dtype = torch.bfloat16
)

if config and subfolder are not provided, it tries to load a SD15 configuration - see log below.
I cannot find specific documentation so this might also be expected behaviour - but it is different from the Flux and Chroma transformers. There a filename is enough.

Reproduction

see above

Logs

transformer = QwenImageTransformer2DModel.from_single_file(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/OneTrainer/venv/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/workspace/OneTrainer/venv/src/diffusers/src/diffusers/loaders/single_file_model.py", line 383, in from_single_file
    diffusers_model_config = cls.load_config(
                             ^^^^^^^^^^^^^^^^
  File "/workspace/OneTrainer/venv/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/workspace/OneTrainer/venv/src/diffusers/src/diffusers/configuration_utils.py", line 419, in load_config
    raise EnvironmentError(
OSError: stable-diffusion-v1-5/stable-diffusion-v1-5 does not appear to have a file named config.json.

System Info

https://github.com/huggingface/diffusers.git@9b721db

Who can help?

No response

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