Instructions to use ostris/kontext_big_head_lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ostris/kontext_big_head_lora with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("ostris/kontext_big_head_lora") prompt = "give this person a big head" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
How is this Lora model trained?
Hello, I tried this LoRA model and it works really well. Could you please tell me how this LoRA model was trained, for example how the dataset was prepared?
I know that tools like FluxTrainer or kohya_ss can directly train LoRA models for Flux Dev, but from what I understand, the datasets prepared in this way usually consist of image-text pairs. However, the resulting Kontext LoRA seems to mainly enhance text-to-image capabilities, while editing capabilities seem to require datasets consisting of triplets like , , and .
May I ask if your LoRA training was done using such triplet datasets? Also, did you train the LoRA directly through Python code, or did you use any additional training frameworks?
Sorry, I just saw that there’s a video link provided in the description. Thanks for sharing — I’ll check it out and learn how to train it.