🚀 SDXL LoRA DreamBooth - rikhoffbauer2/naomi-makkelie-seaweed-painting-style-3
本項目是基於StableDiffusionXL的LoRA模型,用於生成具有特定海藻繪畫風格的圖像,為文本到圖像的生成任務提供了獨特的風格選擇。
✨ 主要特性
- 這是針對
stabilityai/stable-diffusion-xl-base-1.0
的rikhoffbauer2/naomi-makkelie-seaweed-painting-style-3
LoRA適配權重。
- 可與多種用戶界面(如AUTOMATIC1111、Comfy UI、SD.Next、Invoke)結合使用。
- 提供了使用🧨 diffusers庫的代碼示例,方便開發者集成。
📦 安裝指南
下載模型
- LoRA:點擊此處 💾下載
naomi-makkelie-seaweed-painting-style-3.safetensors
。
- 將其放置在
models/Lora
文件夾中。
- 在AUTOMATIC1111中,通過在提示詞中添加
<lora:naomi-makkelie-seaweed-painting-style-3:1>
來加載LoRA。在ComfyUI中,按照常規LoRA加載方式進行加載。
- Embeddings:點擊此處 💾下載
naomi-makkelie-seaweed-painting-style-3_emb.safetensors
。
- 將其放置在
embeddings
文件夾中。
- 在提示詞中添加
naomi-makkelie-seaweed-painting-style-3_emb
來使用,例如in the style of naomi-makkelie-seaweed-painting-style-3_emb
。(由於該LoRA是一起訓練的,因此需要同時使用LoRA和嵌入)
💻 使用示例
基礎用法
from diffusers import AutoPipelineForText2Image
import torch
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
pipeline = AutoPipelineForText2Image.from_pretrained('stabilityai/stable-diffusion-xl-base-1.0', torch_dtype=torch.float16).to('cuda')
pipeline.load_lora_weights('rikhoffbauer2/naomi-makkelie-seaweed-painting-style-3', weight_name='pytorch_lora_weights.safetensors')
embedding_path = hf_hub_download(repo_id='rikhoffbauer2/naomi-makkelie-seaweed-painting-style-3', filename='naomi-makkelie-seaweed-painting-style-3_emb.safetensors', repo_type="model")
state_dict = load_file(embedding_path)
pipeline.load_textual_inversion(state_dict["clip_l"], token=["<s0>", "<s1>"], text_encoder=pipeline.text_encoder, tokenizer=pipeline.tokenizer)
pipeline.load_textual_inversion(state_dict["clip_g"], token=["<s0>", "<s1>"], text_encoder=pipeline.text_encoder_2, tokenizer=pipeline.tokenizer_2)
image = pipeline('in the style of <s0><s1>').images[0]
更多細節
關於加載LoRA的更多細節,包括加權、合併和融合LoRA,請查看diffusers中加載LoRA的文檔。
📚 詳細文檔
觸發詞
要觸發訓練概念的圖像生成,在提示詞中用新插入的標記替換每個概念標識符:
要觸發概念TOK
→ 在提示詞中使用<s0><s1>
模型詳情
📄 許可證
本模型使用openrail++
許可證。