ai-toolkit icon indicating copy to clipboard operation
ai-toolkit copied to clipboard

How to use the trained lora with diffuser or python code, without comfyui

Open WM-Wu opened this issue 1 year ago • 1 comments

I had train my own lora and got the safetensors. but i don't know how to use it in py code. Can someone give me an example? Thanks!

WM-Wu avatar Aug 22 '24 14:08 WM-Wu

upload it to hugging face and then click Use this model > Diffusers

you'll get something like this:

from diffusers import DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev")
pipeline.load_lora_weights("username/lora")

martintomov avatar Aug 22 '24 14:08 martintomov