Upload .safetensors file

#1
by jharax1 - opened

Hello, is it possible to upload the .safetensors file for be able to train lora's on this model with ostris ai tool kit? Thanks!!

here.
https://huggingface.co/datasets/John6666/flux1-backup-202411/tree/main

Hello, I think we need this .safetensors ( the v5 of jib checkpoint ) into the same repo https://huggingface.co/John6666/jib-mix-flux-v5itsalive-fp8-flux/tree/main for be able to train with ostris tool kit

Yeah... I try to avoid that kind of thing as much as possible.😞
And ostris doesn't seem to be designed that way... If it doesn't work, it's probably more suspicious that this repo isn't bfloat16.
https://github.com/ostris/ai-toolkit/?tab=readme-ov-file

Yeah... I try to avoid that kind of thing as much as possible.😞
And ostris doesn't seem to be designed that way... If it doesn't work, it's probably more suspicious that this repo isn't bfloat16.
https://github.com/ostris/ai-toolkit/?tab=readme-ov-file

sorry Im a bit lost, how can I train my lora's on the v5 of jib flux checkpoint ? "John6666/jib-mix-flux-v5itsalive-fp8-flux" not working, I get a message who said that I need the .safetensors

Try this. Just a experiment. (BF16 with .safetensors)
https://huggingface.co/John6666/jib-mix-flux-v6realpix-bf16-flux

Try this. Just a experiment.
https://huggingface.co/John6666/jib-mix-flux-v6realpix-bf16-flux

Thanks you very much, will try ( btw is this version that need a fix for the hands ? I saw that on civitai from jib, anyway Im gonna try it in few minutes )

Oh, 5 is better?

Oh, 5 is better?

https://civitai.com/models/686814?modelVersionId=1096166

V6 Hands issues - some users have noticed V6 is messing up hands badly quite often. I think I know what has caused it, and how to fix it, but I might not have time to get the new release uploaded until later in the week.

5
https://huggingface.co/John6666/jib-mix-flux-v5itsalive-bf16-flux

thanks you, training on v6 is on going, will let you know how its going compare to training on flux base model. BTW may I ask you how you upload theses files so quickly haha ?

There is no trick to the fast upload speed, it's just that the transfer from HF to HF is fast. It's probably being transferred internally. That's why it's convenient to put the model on HF as a backup.
The conversion process itself is done by copying the following space to private in advance, and setting the environment variable, so I only change it to Zero GPU space when I run it. Because there are not enough slots in Zero GPU space.
The bfloat16 conversion of the FLUX model crashes because there is not enough RAM in the free CPU space...

The actual work is just pressing a few buttons and leaving it alone for a few minutes.πŸ˜…
https://huggingface.co/spaces/John6666/safetensors_to_diffusers

There is no trick to the fast upload speed, it's just that the transfer from HF to HF is fast. It's probably being transferred internally. That's why it's convenient to put the model on HF as a backup.
The conversion process itself is done by copying the following space to private in advance, and setting the environment variable, so I only change it to Zero GPU space when I run it. Because there are not enough slots in Zero GPU space.
The bfloat16 conversion of the FLUX model crashes because there is not enough RAM in the free CPU space...

The actual work is just pressing a few buttons and leaving it alone for a few minutes.πŸ˜…
https://huggingface.co/spaces/John6666/safetensors_to_diffusers

Thanks a lot for your tool and informations, it's awesome :D

hope theres v8 page

Isn't this?
https://huggingface.co/John6666/jib-mix-flux-v8accentueight-nsfw-bf16-flux
Thank you very much
didn't know it was already there. much appreciated. you are god. I worship you
also I need to learn how to make this page. very new to hugging face and those transformer thingy and stuff.
I just wish I'm able to make this page with any model I want so I can train lora with aitoolkit

Can you give me a brief rundown of how you are converting these to diffusers? I've tried the script from the diffusers repo, but this doesn't work on some finetunes (maybe ones not trained on base flux?).

how you are converting these to diffusers?

I didn't do anything particularly fancy this time. The following is almost the actual code. It is assumed that Hugging Face libraries such as PyTorch, Diffusers, Transformers, and Accelerate are installed.
Also, although VRAM does not require much, if you do not have about 32GB of RAM, or preferably 64GB, your PC may break. It's huge...

Basic conversion

from diffusers import FluxPipeline, FluxTransformer2DModel
from huggingface_hub import hf_hub_download

TEMP_DIR = "./temp"
repo_id = "camenduru/FLUX.1-dev-diffusers"
dtype = torch.bfloat16
cp = hf_hub_download("John6666/flux1-backup-202502", "jibMixFlux_v8AccentueightNSFW.safetensors", repo_type="dataset") # modify this line to your target safetensors
transformer = FluxTransformer2DModel.from_single_file(cp, subfolder="transformer", torch_dtype=dtype, config=repo_id)
pipe = FluxPipeline.from_pretrained(repo_id, transformer=transformer, torch_dtype=dtype)
pipe.save_pretrained(TEMP_DIR)

With applying Hyper-FLUX 8 steps

from diffusers import FluxPipeline, FluxTransformer2DModel
from huggingface_hub import hf_hub_download

TEMP_DIR = "./temp"
repo_id = "camenduru/FLUX.1-dev-diffusers"
dtype = torch.bfloat16
cp = hf_hub_download("John6666/flux1-backup-202502", "jibMixFlux_v8AccentueightNSFW.safetensors", repo_type="dataset") # modify this line to your target safetensors
transformer = FluxTransformer2DModel.from_single_file(cp, subfolder="transformer", torch_dtype=dtype, config=repo_id)
pipe = FluxPipeline.from_pretrained(repo_id, transformer=transformer, torch_dtype=dtype)

pipe.load_lora_weights(hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8steps-lora.safetensors"), adapter_name="hyper-sd")
pipe.set_adapters(["hyper-sd"], adapter_weights=[0.125])
pipe.fuse_lora()
pipe.unload_lora_weights()

pipe.save_pretrained(TEMP_DIR)

If schnell or so

from diffusers import FluxPipeline, FluxTransformer2DModel
from huggingface_hub import hf_hub_download

TEMP_DIR = "./temp"
#repo_id = "camenduru/FLUX.1-dev-diffusers" # if dev
repo_id = "black-forest-labs/FLUX.1-schnell" # if schnell
#repo_id = "aoxo/flux.1dev-abliteratedv2" # if dev.abl
dtype = torch.bfloat16
cp = hf_hub_download("John6666/flux1-backup-202502", "jibMixFlux_v8AccentueightNSFW.safetensors", repo_type="dataset") # modify this line to your target safetensors
transformer = FluxTransformer2DModel.from_single_file(cp, subfolder="transformer", torch_dtype=dtype, config=repo_id)
pipe = FluxPipeline.from_pretrained(repo_id, transformer=transformer, torch_dtype=dtype)
pipe.save_pretrained(TEMP_DIR)

A converter that can be used as is if it is duplicated in the Zero GPU space. If it is in the CPU space, there is not enough RAM...😭

https://huggingface.co/spaces/John6666/flux-to-diffusers-zero-test

Thanks so much for sharing this, it works great!

Sign up or log in to comment