🚀 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++
许可证。