🚀 Lumina2 DreamBooth LoRA - trained-lumina2-lora-yarn
這是一個基於DreamBooth LoRA技術訓練的模型,用於生成特定風格的圖像,解決了在特定藝術風格下生成圖像的需求,為圖像生成領域提供了新的選擇。
🚀 快速開始
下載模型
在“文件與版本”選項卡中下載 *.safetensors LoRA。
使用🧨 diffusers庫
import torch
from diffusers import Lumina2Text2ImgPipeline
pipe = Lumina2Text2ImgPipeline.from_pretrained(
"Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16
).to("cuda")
pipe.load_lora_weights("trained-lumina2-lora-yarn")
prompt = "a puppy in a pond, yarn art style"
image = pipe(
prompt,
negative_prompt="bad quality, worse quality, degenerate quality",
guidance_scale=6,
num_inference_steps=35,
generator=torch.manual_seed(0)
).images[0]
更多詳細信息,包括LoRA的加權、合併和融合,請查看 diffusers中加載LoRA的文檔。
✨ 主要特性
- 特定風格生成:能夠使用
yarn art style
觸發特定的圖像生成風格。
- 多環境支持:可以在不同的環境提示下生成不同氛圍的圖像,如黑暗環境、明亮環境等。
📚 詳細文檔
模型描述
這些是 Alpha-VLLM/Lumina-Image-2.0 的 trained-lumina2-lora-yarn
DreamBooth LoRA 權重。權重使用 DreamBooth 和 Lumina2 diffusers 訓練器 進行訓練。
觸發詞
應使用 yarn art style
來觸發圖像生成。訓練期間還使用了以下 system_prompt
(如果為 None
則忽略):None。
結果展示
該模型受益於 system_prompt
。以下是不同系統提示下的對比:
無系統提示 |
"黑暗環境"系統提示 |
"明亮環境"系統提示 |
 |
 |
 |
原始提示:a puppy in a pond, yarn art style
代碼
import torch
from diffusers import Lumina2Text2ImgPipeline
pipe = Lumina2Text2ImgPipeline.from_pretrained(
"Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16
).to("cuda")
system_prompts = [
None,
"You are an assistant designed to generate superior images with a dark overall theme.",
"You are an assistant designed to generate superior images with a bright and shiny overall theme."
]
pipe.load_lora_weights("trained-lumina2-lora-yarn")
prompt = "a puppy in a pond, yarn art style"
for sp in system_prompts:
filename = "yarn_lora"
image = pipe(
prompt,
negative_prompt="bad quality, worse quality, degenerate quality",
system_prompt=sp,
guidance_scale=6,
num_inference_steps=35,
generator=torch.manual_seed(0)
).images[0]
if sp:
filename += "_" + "_".join(sp.split(" ")).replace(",", "").replace(".", "")
filename = filename[:100]
image.save(f"{filename}.png")
📄 許可證
本項目採用 apache-2.0 許可證。
📦 模型信息
屬性 |
詳情 |
基礎模型 |
Alpha-VLLM/Lumina-Image-2.0 |
庫名稱 |
diffusers |
許可證 |
apache-2.0 |
實例提示 |
a puppy, yarn art style |
標籤 |
text-to-image、diffusers-training、diffusers、lora、lumina2、lumina2-diffusers、template:sd-lora |