🚀 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++ |