Comments (9)
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.
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.
Do you mean this ?
https://huggingface.co/docs/diffusers/training/lora#inference
from safetensors.
I created a PR to enable support in diffusers
. Is that what you meant ?
from safetensors.
I created a PR to enable support in
diffusers
. Is that what you meant ?
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.
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 withsafetensors.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.
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.
@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.
Closing the issue. Feel free to reopen
from safetensors.
Related Issues (20)
- safetensors.tensorflow.save modifies its input argument HOT 1
- Error when using map_location="cuda:0" with multiple GPUs HOT 1
- ModuleNotFoundError: No module named 'torch._higher_order_ops' HOT 1
- misleading error message in `safe_open` HOT 4
- Register a MIME type for the `safetensors` format. HOT 1
- README is inaccurate HOT 3
- Unable to save llama3 since complex64 is not supported HOT 1
- How to save model checkpoint from a distributed training from multiple nodes? HOT 2
- Compilation fail due to test error HOT 3
- SafetensorError is not pickleable, potentially causing hangs in multi-process environments HOT 2
- inconsistent behavior of slicing in certain model file HOT 4
- get_slice has the same speed as get_tensor HOT 1
- get_tensor returns an empty tensor on LoRa safetensors adapter saved by SFTTrainer HOT 1
- pytorch: safetensors library hardcodes using CUDA if only device index is provided HOT 3
- Wrong device when using device="cpu" with torch.device HOT 3
- Problem serializing quantized weights HOT 3
- converting weight of more than 50G‘s .bin to .safetensors failed
- Some layers are not loaded(‘encoder.embed_token.weight’ and 'shared.weight') when loading converted safetensors into transfomrers.MT5EncoderModel.
- Retrieving saved metadata HOT 3
- SafetensorError does not appear in `__init__.pyi`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from safetensors.