🚀 SDXL LoRA DreamBooth - m7n/engraving-sdxl-lora-001
本项目是基于Stable Diffusion XL的LoRA模型,用于生成特定风格的雕刻图像,解决了在特定风格图像生成上的需求,为图像创作提供了更多可能性。
🚀 快速开始
你可以使用以下方式快速体验该模型:
下载模型
可以结合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('m7n/engraving-sdxl-lora-001', weight_name='pytorch_lora_weights.safetensors')
embedding_path = hf_hub_download(repo_id='m7n/engraving-sdxl-lora-001', filename='engraving-sdxl-lora-001_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('engraving in the style of <s0><s1>, showing a skull and a technical instrument').images[0]
更多详细信息,包括LoRA的加权、合并和融合,请查看 diffusers中加载LoRA的文档。
触发词
要触发已训练概念的图像生成,需在提示词中用新插入的标记替换每个概念标识符:
若要触发概念 TOK
,可在提示词中使用 <s0><s1>
。
✨ 主要特性
- 特定风格生成:能够生成特定风格的雕刻图像,风格为
<s0><s1>
,图像内容包含头骨和技术仪器。
- 多界面支持:支持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('m7n/engraving-sdxl-lora-001', weight_name='pytorch_lora_weights.safetensors')
embedding_path = hf_hub_download(repo_id='m7n/engraving-sdxl-lora-001', filename='engraving-sdxl-lora-001_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('engraving in the style of <s0><s1>, showing a skull and a technical instrument').images[0]
📚 详细文档
模型描述
m7n/engraving-sdxl-lora-001
是 stabilityai/stable-diffusion-xl-base-1.0
的LoRA适配权重。
触发词说明
在提示词中使用 <s0><s1>
来触发特定风格的图像生成。
详细信息
所有 文件和版本。
权重是使用 🧨 diffusers高级Dreambooth训练脚本 进行训练的。
文本编码器的LoRA已启用:否。
关键调优已启用:是。
训练使用的特殊VAE:madebyollin/sdxl-vae-fp16-fix。
🔧 技术细节
📄 许可证
本项目采用 openrail++
许可证。