Skip to content

Generate Image with LoRA #12

@alfredplpl

Description

@alfredplpl

I have create a LoRA file.
But, I cannot load the file by the following code.

pipeline.dit_model.load_lora_weights("/media/user/NVM/F-Lite-DiT/final_model")

I got the error:

Traceback (most recent call last):
  File "/mnt/raid0/github/f-lite/inference.py", line 14, in <module>
    pipeline.dit_model.load_lora_weights("/media/user/NVM/F-Lite-DiT/final_model")
  File "/mnt/raid0/github/f-lite/f_lite/model.py", line 379, in load_lora_weights
    set_peft_model_state_dict(self, lora_state_dict)
  File "/mnt/raid0/github/f-lite/.venv/lib/python3.12/site-packages/peft/utils/save_and_load.py", line 343, in set_peft_model_state_dict
    config = model.peft_config[adapter_name]
             ^^^^^^^^^^^^^^^^^
  File "/mnt/raid0/github/f-lite/.venv/lib/python3.12/site-packages/diffusers/models/modeling_utils.py", line 291, in __getattr__
    return super().__getattr__(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/raid0/github/f-lite/.venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1940, in __getattr__
    raise AttributeError(
AttributeError: 'DiT' object has no attribute 'peft_config'. Did you mean: 'from_config'?

How can I do?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions