Kontext-Style/Chinese_Ink_lora
672
1---2language:3- en4base_model:5- black-forest-labs/FLUX.1-Kontext-dev6pipeline_tag: image-to-image7library_name: diffusers8tags:9- Style10- lora11- Chinese Ink12- FluxKontext13- Image-to-Image14---15 16# Chinese Ink Style LoRA for FLUX.1 Kontext Model17This repository provides the **Chinese Ink** style LoRA adapter for the [FLUX.1 Kontext Model](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev).18This 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.19 20Contributor: Tian YE & Song FEI, HKUST Guangzhou.21 22## Style Showcase23Here are some examples of images generated using this style LoRA:24 25262728293031 32## Inference Example33```python34from diffusers import FluxKontextPipeline35from diffusers.utils import load_image36import torch37 38# Load the base pipeline39pipeline = FluxKontextPipeline.from_pretrained(40 "black-forest-labs/FLUX.1-Kontext-dev", 41 torch_dtype=torch.bfloat1642).to('cuda')43 44# Load the LoRA adapter for the Chinese Ink style directly from the Hub45pipeline.load_lora_weights("Kontext-Style/Chinese_Ink_lora", weight_name="Chinese_Ink_lora_weights.safetensors", adapter_name="lora")46pipeline.set_adapters(["lora"], adapter_weights=[1])47 48# Load a source image (you can use any image)49image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))50 51# Prepare the prompt52# The style_name is used in the prompt and for the output filename.53style_name = "Chinese Ink"54prompt = f"Turn this image into the Chinese_Ink style."55 56# Run inference57result_image = pipeline(58 image=image, 59 prompt=prompt, 60 height=1024, 61 width=1024, 62 num_inference_steps=2463).images[0]64 65# Save the result66output_filename = f"{style_name.replace(' ', '_')}.png"67result_image.save(output_filename)68 69print(f"Image saved as {output_filename}")70```71 72Feel free to open an issue or contact us for feedback or collaboration!73 