InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[enhancement]: Support of LoKR (type of LORA) for FLUX

Open vrubzov1957 opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Contact Details

No response

What should this feature add?

Please, implement support for Lora type of LoKr for Flux models.

Why? LoKR is - a more advanced and efficient version of LoRA, which provides a higher degree of detail and, in some cases, more stable model operation. What can be important when generating characters, and can be especially noticeable in FLUX models.

Alternatives

No response

Additional Content

Now in version 5.0.0 Lora LoKr-type correctly added to InvokeAI. But when try generate with it - we get this message from invokeAI: ValueError: Unsupported Linear LoRA layer type: <class 'invokeai.backend.lora.layers.lokr_layer.LoKRLayer'> PS: LoKR-type lora was downloaded from TensorArt.

vrubzov1957 avatar Oct 01 '24 18:10 vrubzov1957

Please share a link to a LoRA in this format so we have something to test with.

psychedelicious avatar Oct 02 '24 20:10 psychedelicious

@psychedelicious Sure, here: https://drive.google.com/file/d/1UFoheQlv3xCGiccTzFYHXnCbHZ6eiXGq/view?usp=sharing

This is portrait of woman (if this need for testing).

vrubzov1957 avatar Oct 02 '24 21:10 vrubzov1957

@RyanJDick @brandonrising another lora format here

psychedelicious avatar Oct 03 '24 00:10 psychedelicious

I tested this today. As of v5.6.0rc4, LoKR models work with most base FLUX models. The one exception is bitsandbytes NF4 quantized base models, which will be addressed in https://github.com/invoke-ai/InvokeAI/pull/7577. Once that PR gets merged, I'll mark this as closed.

RyanJDick avatar Jan 20 '25 20:01 RyanJDick