kohya-ss / sd-scripts

Apache License 2.0
5.14k stars 856 forks source link

how to use flux full-finetune safetensors in diffusers? #1626

Open neuron-party opened 1 month ago

neuron-party commented 1 month ago

essentially the title. i've tried the following:

transformer = diffusers.Flux2DTransformer.from_single_file(path_to_kohya_safetensors, torch.dtype=torch.bfloat16)
pipeline = diffusers.FluxPipeline.from_pretrained(..., transformer=transformer, torch.dtype=torch.bfloat16)

however all generated images have weird artifacts, regardless of checkpoint number i've tried with both lr 1e-5 and 1e-4

neuron-party commented 5 days ago

@kohya-ss

kohya-ss commented 4 days ago

Sorry, I seem to have overlooked the issue. Does the safetensors work with other inference environments, such as ComfyUI or flux_minimum_inference.py?