Git Product home page Git Product logo

Comments (9)

khimaros avatar khimaros commented on September 14, 2024 3

it seems like this will soon be merged into diffusers library huggingface/diffusers#2448 and in the meantime this script may be useful: https://github.com/haofanwang/Lora-for-Diffusers/blob/main/format_convert.py

from safetensors.

Narsil avatar Narsil commented on September 14, 2024 1

Well, LoRA are just regular weights, so there's nothing blocking from using safetensors for those.

No offense but both your links are code I have never heard about. I'm happy to help provide guidance in creating safetensors lora support in all of them, but I cannot reasonably create all the PRs in all the repos. Just understanding what's going on is going to take me too long.

But basically search of torch.load/torch.save and replace with safetensors.torch.save_file/load_file and you should be good.

from safetensors.

Narsil avatar Narsil commented on September 14, 2024

Do you mean this ?

https://huggingface.co/docs/diffusers/training/lora#inference

from safetensors.

Narsil avatar Narsil commented on September 14, 2024

I created a PR to enable support in diffusers. Is that what you meant ?

huggingface/diffusers#2448

from safetensors.

sunhaha123 avatar sunhaha123 commented on September 14, 2024

I created a PR to enable support in diffusers. Is that what you meant ?

huggingface/diffusers#2448

Absoultely not! Training lora has at least 4 methods, https://github.com/kohya-ss/sd-scripts; https://github.com/Akegarasu/lora-scripts; webui extention; https://github.com/huggingface/diffusers/tree/main/examples/dreambooth#inference-1. Thought them are in format of safetensors, but they are not same inside!

from safetensors.

sunhaha123 avatar sunhaha123 commented on September 14, 2024

Well, LoRA are just regular weights, so there's nothing blocking from using safetensors for those.

No offense but both your links are code I have never heard about. I'm happy to help provide guidance in creating safetensors lora support in all of them, but I cannot reasonably create all the PRs in all the repos. Just understanding what's going on is going to take me too long.

But basically search of torch.load/torch.save and replace with safetensors.torch.save_file/load_file and you should be good.

I wish it was. In https://civitai.com/, most of safetensors of lora cant't be loaded in diffusers.

from safetensors.

Narsil avatar Narsil commented on September 14, 2024

You mean these kind of checkpoints ? https://civitai.com/models/5373/makima-chainsaw-man-lora

It seems like this is a Lora and should be already usable in SD, no ?

from safetensors.

williamberman avatar williamberman commented on September 14, 2024

@Narsil's PR adds safetensor's to our current saving and loading of lora weights. Happy to discuss adding more lora/safetensors functionality but we would need more details and would recommend a separate, more detailed issue on diffusers :)

from safetensors.

Narsil avatar Narsil commented on September 14, 2024

Closing the issue. Feel free to reopen

from safetensors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.