Instructions to use Kontext-Style/Irasutoya_lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Kontext-Style/Irasutoya_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/Irasutoya_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
- Draw Things
| language: | |
| - en | |
| base_model: | |
| - black-forest-labs/FLUX.1-Kontext-dev | |
| pipeline_tag: image-to-image | |
| library_name: diffusers | |
| tags: | |
| - Style | |
| - lora | |
| - Irasutoya | |
| - FluxKontext | |
| - Image-to-Image | |
| # Irasutoya Style LoRA for FLUX.1 Kontext Model | |
| This repository provides the **Irasutoya** 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 Showcase | |
| Here are some examples of images generated using this style LoRA: | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| ## Inference Example | |
| ```python | |
| from diffusers import FluxKontextPipeline | |
| from diffusers.utils import load_image | |
| import torch | |
| # Load the base pipeline | |
| pipeline = FluxKontextPipeline.from_pretrained( | |
| "black-forest-labs/FLUX.1-Kontext-dev", | |
| torch_dtype=torch.bfloat16 | |
| ).to('cuda') | |
| # Load the LoRA adapter for the Irasutoya style directly from the Hub | |
| pipeline.load_lora_weights("Kontext-Style/Irasutoya_lora", weight_name="Irasutoya_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 = "Irasutoya" | |
| prompt = f"Turn this image into the Irasutoya style." | |
| # Run inference | |
| result_image = pipeline( | |
| image=image, | |
| prompt=prompt, | |
| height=1024, | |
| width=1024, | |
| num_inference_steps=24 | |
| ).images[0] | |
| # Save the result | |
| output_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! | |