Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
OFT 
posted an update 8 days ago
Post
370
[Update 2024-12-20]
Topic Closed, a big thank you to John6666 for helping me out!

[Original post]
Who can help?
I got a safetensor file and want to make a working txt2img diffuser on HF. You may explain or even link me to the right tutorial (I dont think it is inside the diffusers turorial?). Thank you ❤️

If you have a safetensor file and want to set up a working txt2img pipeline using Hugging Face diffusers, you're on the right track! The diffusers library itself doesn't have a dedicated tutorial for safetensors, but integrating them is possible with a bit of customization. Here's a brief guide:

Install Required Libraries: Make sure you have diffusers, transformers, and safetensors installed.

Load the safetensor File: Use torch or diffusers to load the model. Safetensors ensures a faster and more secure way to handle the weights.

Set Up the txt2img Pipeline: Use StableDiffusionPipeline from diffusers and point it to your safetensor-loaded model.

For any additional support while working on your project, if you happen to run into connectivity issues, you might want to get in touch with BT Business https://www.pissedconsumer.com/company/bt-business-direct/customer-service.htmlvfor assistance. They offer reliable customer support to help with any business-related concerns.

·

Thank you for your fast reply @apontemy , I think I might need to rephrase my question a bit.

I got a safetensor file on my PC but I wish to upload it onto the HF model hub (website). About 2 years ago I made a model (OFT/MODEL_SD15_RockRaiderRuby_v01) , I totally forgot how I did it. I remember there was a google collab file involved (with a HF writting token) but it kinda worked half and I had to manually upload certain files to the HF website with the upload button to make it work.

So I am kinda trying to achieve a copy of the model structure on HF but with a different safetensor file.

Do you mean a single safetensors file?
If it's a complete all-in-one safetensors file, it can often be read using from_single_file().
If you only have a transformer, this method cannot be used. You will need to import individual classes, load the transformer, and load the rest of the files from somewhere else.
https://huggingface.co./docs/diffusers/main/api/loaders/single_file
https://github.com/huggingface/diffusers/issues/9165#issue-2462431761

·

Thank you for your fast reply @John6666 , I think I might need to rephrase my question a bit.

I have like a safetensor file on my PC and I want to achieve this: "https://huggingface.co./John6666/mala-anime-mix-nsfw-pony-xl-v3-sdxl/tree/main" (for example). So the result should be a HF model page that can be used by others (by API etc) just like your model.

I did something similar in the past (it was 2 years ago) but I totally forgot how I did it. I remember using a HF writting token and a google collab file (but it worked half and had to upload certain files manually).
I think it was training something with dreambooth, getting a clk file and uploading those, but it is too long ago to clearly remember.

In this post