Run this model with HF Jobs
Run Kontext-Style/Poly_lora on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Kontext-Style/Poly_lora. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Kontext-Style/Poly_lora on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Kontext-Style/Poly_lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Kontext-Style/Poly_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("Kontext-Style/Poly_lora") prompt = "Turn this cat into a dog" 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 Settings
- Draw Things
Update README.md
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071---language:- enbase_model:- black-forest-labs/FLUX.1-Kontext-devpipeline_tag: image-to-imagelibrary_name: diffuserstags:- Style- Poly- FluxKontext- Image-to-Image---
# Poly Style LoRA for FLUX.1 Kontext ModelThis repository provides the **Poly** style LoRA adapter for the [FLUX.1 Kontext Model](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev).This LoRA is part of a collection of 20+ style LoRAs trained on high-quality paired data generated by GPT-4o from the [OmniConsistency](https://huggingface.co/datasets/showlab/OmniConsistency) dataset.
Contributor: Tian YE & Song FEI, HKUST Guangzhou.
## Style ShowcaseHere are some examples of images generated using this style LoRA:

## Inference Example```pythonfrom diffusers import FluxKontextPipelinefrom diffusers.utils import load_imageimport torch
# Load the base pipelinepipeline = FluxKontextPipeline.from_pretrained( "black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16).to('cuda')
# Load the LoRA adapter for the Poly style directly from the Hubpipeline.load_lora_weights("Kontext-Style/Poly_lora", weight_name="Poly_lora_weights.safetensors", adapter_name="lora")pipeline.set_adapters(["lora"], adapter_weights=[1])
# Load a source image (you can use any image)image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
# Prepare the prompt# The style_name is used in the prompt and for the output filename.style_name = "Poly"prompt = f"Turn this image into the Poly style."
# Run inferenceresult_image = pipeline( image=image, prompt=prompt, height=1024, width=1024, num_inference_steps=24).images[0]
# Save the resultoutput_filename = f"{style_name.replace(' ', '_')}.png"result_image.save(output_filename)
print(f"Image saved as {output_filename}")```
Feel free to open an issue or contact us for feedback or collaboration!README.mdAdded+71