🚀 SDXL LoRA DreamBooth - LinoyTsaban/2000_ads
本項目是針對Stable Diffusion XL基礎模型的LoRA適配權重,可用於生成特定風格的廣告圖像,為文本到圖像的轉換提供了獨特的風格選擇。
🚀 快速開始
你可以通過以下方式使用本模型:
使用用戶界面(如AUTOMATIC1111、Comfy UI、SD.Next、Invoke)
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('LinoyTsaban/2000_ads', weight_name='pytorch_lora_weights.safetensors')
embedding_path = hf_hub_download(repo_id='LinoyTsaban/2000_ads', filename='2000_ads_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('<s0><s1> ad of a llama wearing headphones').images[0]
更多詳細信息,包括權重設置、合併和融合LoRAs,請查看 diffusers中加載LoRAs的文檔。
✨ 主要特性
- 本模型是LinoyTsaban/2000_ads的LoRA適配權重,基於
stabilityai/stable-diffusion-xl-base-1.0
基礎模型。
- 可通過用戶界面(如AUTOMATIC1111、Comfy UI等)或
diffusers
庫方便地使用。
- 支持特定觸發詞,能生成特定風格的廣告圖像。
📦 安裝指南
下載模型
💻 使用示例
基礎用法
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('LinoyTsaban/2000_ads', weight_name='pytorch_lora_weights.safetensors')
embedding_path = hf_hub_download(repo_id='LinoyTsaban/2000_ads', filename='2000_ads_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('<s0><s1> ad of a llama wearing headphones').images[0]
📚 詳細文檔
觸發詞
要觸發訓練概念的圖像生成,在提示詞中用新插入的標記替換每個概念標識符:
要觸發概念 TOK
→ 在提示詞中使用 <s0><s1>
。
模型詳情
🔧 技術細節
本模型是基於Stable Diffusion XL基礎模型的LoRA適配權重。訓練過程中使用了特定的訓練腳本和特殊的VAE,並且在文本編碼器的LoRA和關鍵調優等方面有特定的設置。這些技術細節確保了模型能夠生成特定風格的廣告圖像。
📄 許可證
本模型使用 openrail++
許可證。
屬性 |
詳情 |
模型類型 |
SDXL LoRA DreamBooth |
基礎模型 |
stabilityai/stable-diffusion-xl-base-1.0 |
許可證 |
openrail++ |