-
Notifications
You must be signed in to change notification settings - Fork 6k
(SDXL) load lora error #4061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here we go with SDXL and Loras haha, @zbulrush where did you take the LoRA from / how did you train it? |
cc @sayakpaul |
I was trained using the latest version of kohya_ss. The base mode is lsdxl, and it can work well in comfyui. I want to do more custom development. If necessary, I can provide the LoRa file. |
If you install But please be aware of the following: If you load your LoRA file, I am almost certain that you will notice that there are keys and parameters not yet supported by Diffusers. We're working on it here: #3756. |
pipe.load_lora_weights(".", "last-000010.safetensors") |
Could you try with pipe.load_lora_weights(".", weight_name ="last-000010.safetensors") ? |
pipe.load_lora_weights(".", weight_name ="last-000010.safetensors") Then I tried another model(https://civitai.com/models/106582/aogamisdxl), and it returned the following error. Both of these models can work on ComfyUI. pipe.load_lora_weights(".", weight_name ="aogami_v4_12800_style.safetensors") |
Then it seems to be a new format altogether. So, I would like to kindly draw your attention to my comment here: #3725 (comment). There are numerous LoRA formats in the community, and it's really painful for us to attempt to support all of them. |
enh, I think the lora based on sdxl could be a whole new topic, The structure is different from the previous. looking forward to update |
Can we have some list of supported lora formats? It's getting confusing now, there's lora, lorcois, loha, lora without text encoder and list goes on. Or maybe a function to find out if given lora is which format? Even if it doesn't support |
This would be super useful for real world diffusers integrations. We are currently building a generic (any base model / checkpoint) SD text to image API with support for any loras that can be uploaded on top of existing diffusers pipelines and utilities. But unfortunately there is no easy way for us to know whether a LoRA is going to work, and if it does with what precision (e.g. unloaded keys). For a very naive version of this, we started writing an internal script but it is mainly heruistic-based for the examples we saw out in the wild and might not be %100 accurate (e.g. it matches every Conv LoRA to LyCORIS): https://gist.github.com/isidentical/b9133961df0a72109b1bcbcece1a25b7. Since there is no standardized metadata, it is going to be super hard to keep track of it without a centralized library like diffusers providing the detection support. I'd really love a |
Would love a contribution on this. I think it should be possible to base its logic from diffusers/src/diffusers/loaders.py Line 965 in 8b18cd8
Completely empathize with this and something we're also struggling with unfortunately :( |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Describe the bug
pipe.load_lora_weights(".", model_path)
File "/root/autodl-tmp/tools/demo/venv/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 137, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'StableDiffusionXLPipeline' object has no attribute 'load_lora_weights'
Reproduction
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-0.9", torch_dtype=torch.float16)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(
pipe.scheduler.config, use_karras_sigmas=True
)
model_path = "./models/last-000010.safetensors"
pipe.load_lora_weights(".", model_path)
Logs
No response
System Info
Name: diffusers
Version: 0.18.2
ubuntu, python3.10.8
Who can help?
No response
The text was updated successfully, but these errors were encountered: