CoolFace
Modelpublic

Kontext-Style/Chinese_Ink_lora

sourceHugging Faceupdated 1y agoView on Hugging Face
6likes72downloads
README.md73 linesDownload Raw Back to root
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 25![Chinese Ink Style Example](./example-1.png)26![Chinese Ink Style Example](./example-2.png)27![Chinese Ink Style Example](./example-3.png)28![Chinese Ink Style Example](./example-4.png)29![Chinese Ink Style Example](./example-5.png)30![Chinese Ink Style Example](./example-6.png)31 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