🚀 SDXL LoRA DreamBooth - prampampam/sofa-and-light-sdxl-lora
本项目是基于Stable Diffusion XL的LoRA模型,可用于生成带有特定风格沙发和灯光的客厅照片,为文本到图像的生成任务提供了新的选择。
🚀 快速开始
模型描述
这些是 prampampam/sofa-and-light-sdxl-lora
的LoRA适配权重,基于 stabilityai/stable-diffusion-xl-base-1.0
模型。
下载模型
可在以下用户界面(UI)中使用该模型,如AUTOMATIC1111、Comfy UI、SD.Next、Invoke。
使用 🧨 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('prampampam/sofa-and-light-sdxl-lora', weight_name='pytorch_lora_weights.safetensors')
embedding_path = hf_hub_download(repo_id='prampampam/sofa-and-light-sdxl-lora', filename='sofa-and-light-sdxl-lora_emb.safetensors', repo_type="model")
state_dict = load_file(embedding_path)
pipeline.load_textual_inversion(state_dict["clip_l"], token=["<s0>", "<s1>", "<s2>", "<s3>"], text_encoder=pipeline.text_encoder, tokenizer=pipeline.tokenizer)
pipeline.load_textual_inversion(state_dict["clip_g"], token=["<s0>", "<s1>", "<s2>", "<s3>"], text_encoder=pipeline.text_encoder_2, tokenizer=pipeline.tokenizer_2)
image = pipeline('a photo of living room with <s0><s1> and <s2><s3>').images[0]
更多细节,包括LoRA的加权、合并和融合,请查看 diffusers中加载LoRA的文档。
触发词
要触发训练概念的图像生成,需在提示词中用新插入的标记替换每个概念标识符:
- 触发概念
TOK1
→ 在提示词中使用 <s0><s1>
。
- 触发概念
TOK2
→ 在提示词中使用 <s2><s3>
。
📚 详细文档
模型文件
所有 文件和版本。
训练详情
📄 许可证
本模型使用的许可证为 openrail++
。