🚀 FLUX.1 Kontext模型風格LoRA適配器
本倉庫為FLUX.1 Kontext模型提供了20多種風格的LoRA適配器,能夠實現多種藝術和卡通風格的高質量圖像到圖像生成。這些LoRA是在由GPT - 4o生成的高質量配對數據上進行訓練的。數據來源於Omniconsistency。
語言與模型信息
屬性 |
詳情 |
語言 |
英文 |
基礎模型 |
black - forest - labs/FLUX.1 - Kontext - dev |
任務類型 |
圖像到圖像 |
庫名稱 |
diffusers |
標籤 |
Style、Ghibli、FluxKontext、Image - to - Image |
🚀 快速開始
本倉庫提供了一系列風格的LoRA適配器,可用於為FLUX.1 Kontext模型賦予多種藝術和卡通風格,實現高質量的圖像到圖像生成。
✨ 主要特性
- 提供20多種風格的LoRA適配器,可實現多種藝術和卡通風格的圖像生成。
- LoRA適配器在由GPT - 4o生成的高質量配對數據上訓練。
- 數據來源於Omniconsistency。
最新消息!
我們創建了[Kontext - Style](https://huggingface.co/Kontext - Style)來為每個LoRA單獨建立倉庫!並且我們提供了[空間演示](https://huggingface.co/spaces/Kontext - Style/Kontext - Style - LoRAs),可以直接在線運行我們的LoRA!

貢獻者:香港科技大學(廣州)的葉天和費松。
💻 使用示例
基礎用法
from huggingface_hub import hf_hub_download
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import torch
STYLE_NAME = "3D_Chibi"
style_type_lora_dict = {
"3D_Chibi": "3D_Chibi_lora_weights.safetensors",
"American_Cartoon": "American_Cartoon_lora_weights.safetensors",
"Chinese_Ink": "Chinese_Ink_lora_weights.safetensors",
"Clay_Toy": "Clay_Toy_lora_weights.safetensors",
"Fabric": "Fabric_lora_weights.safetensors",
"Ghibli": "Ghibli_lora_weights.safetensors",
"Irasutoya": "Irasutoya_lora_weights.safetensors",
"Jojo": "Jojo_lora_weights.safetensors",
"Oil_Painting": "Oil_Painting_lora_weights.safetensors",
"Pixel": "Pixel_lora_weights.safetensors",
"Snoopy": "Snoopy_lora_weights.safetensors",
"Poly": "Poly_lora_weights.safetensors",
"LEGO": "LEGO_lora_weights.safetensors",
"Origami" : "Origami_lora_weights.safetensors",
"Pop_Art" : "Pop_Art_lora_weights.safetensors",
"Van_Gogh" : "Van_Gogh_lora_weights.safetensors",
"Paper_Cutting" : "Paper_Cutting_lora_weights.safetensors",
"Line" : "Line_lora_weights.safetensors",
"Vector" : "Vector_lora_weights.safetensors",
"Picasso" : "Picasso_lora_weights.safetensors",
"Macaron" : "Macaron_lora_weights.safetensors",
"Rick_Morty" : "Rick_Morty_lora_weights.safetensors"
}
hf_hub_download(repo_id="Owen777/Kontext-Style-Loras", filename=style_type_lora_dict[STYLE_NAME], local_dir="./LoRAs")
image = load_image("https://huggingface.co/datasets/black-forest-labs/kontext-bench/resolve/main/test/images/0003.jpg").resize((1024, 1024))
image.save("0037.png")
pipeline = FluxKontextPipeline.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16).to('cuda')
pipeline.load_lora_weights(f"./LoRAs/{style_type_lora_dict[STYLE_NAME]}", adapter_name="lora")
pipeline.set_adapters(["lora"], adapter_weights=[1])
image = pipeline(image=image, prompt=f"Turn this image into the {STYLE_NAME.replace('_', ' ')} style.",height=1024,width=1024,num_inference_steps=24).images[0]
image.save(f"{STYLE_NAME}.png")
如果您有任何反饋或合作需求,歡迎提出問題或與我們聯繫!我們將盡快發佈更多風格的LoRA適配器!