🚀 奇幻巫师与女巫模型
本项目是一个基于文本生成图像的模型,借助LoRA技术为Stable Diffusion模型增添奇幻风格,能生成如女巫、巫师等充满魔法与幻想元素的精美图像。
🚀 快速开始
下载模型
此模型的权重以Safetensors格式提供。你可以在Files & versions标签页中下载。
使用🧨 diffusers库
from diffusers import AutoPipelineForText2Image
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.bfloat16).to(device)
pipeline.load_lora_weights('Keltezaa/fantasy-wizard-witches', weight_name='FantasyWizardWitchesFluxV2-000001.safetensors')
image = pipeline('`hkmagic`').images[0]
更多细节,包括LoRA的加权、合并和融合等操作,请查看diffusers中加载LoRA的文档。
✨ 主要特性
- 文本到图像转换:支持文本输入生成对应的图像。
- LoRA增强:使用LoRA技术为图像增添更多细节。
- 奇幻风格:专注于生成女巫、巫师等奇幻风格的图像。
- 多场景适用:可生成不同场景和风格的奇幻图像,如魔法房间、洞穴等。
📦 安装指南
使用此模型前,需安装diffusers
库和torch
库。可使用以下命令进行安装:
pip install diffusers torch
💻 使用示例
基础用法
from diffusers import AutoPipelineForText2Image
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.bfloat16).to(device)
pipeline.load_lora_weights('Keltezaa/fantasy-wizard-witches', weight_name='FantasyWizardWitchesFluxV2-000001.safetensors')
image = pipeline('`hkmagic`').images[0]
高级用法
from diffusers import AutoPipelineForText2Image
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.bfloat16).to(device)
pipeline.load_lora_weights('Keltezaa/fantasy-wizard-witches', weight_name='FantasyWizardWitchesFluxV2-000001.safetensors')
prompt = 'Beautiful adult witch with purple hair and purple skin, wearing magical jewelry with magical gems and ha black corset wiht golden details, cleavage, holding a blue magical ball in her right hand, in a full-body portrait, in a fantasy illustration style, old magical room in background, highly detailed, a digital, hkmagic, fsstyle'
image = pipeline(prompt).images[0]
📚 详细文档
模型描述
- Flux版本2发布:Flux版本2已发布,能生成更多奇幻风格的图像。
- 触发词使用:使用触发词
hkmagic
来触发图像生成。
- LoRA效果:此LoRA在为图像添加细节方面表现出色。
- 数据集特点:数据集中的大部分图像中,人物的一只手会拿着一本书,因此在提示词中可以尝试添加“spellbook in one hand”。
XL使用提示
- LoRA权重:推荐使用的LoRA权重为0.85,但你可以自行尝试不同的权重。
- 参数设置:采样器使用
dpmpp_3m_sde
,调度器使用Karras
,步数设置为40,CFG值设置为3.6。
- 示例提示词:"A beautiful fairy with glowing wings reads an ancient book of magic and spells. She has detailed facial features and there is a glowing green light in the background with cinematic lighting, fairycore, hkmagic"
Flux使用提示
- LoRA权重:推荐使用的LoRA权重为0.85 - 1,你可以进行实验。
- 参数设置:步数设置为40,CFG值设置为3.6。
- 示例提示词(版本2):"An evil necromancer witch casting colorful magic from her skeleton wand, purple black necrotic green, necrotic dark green armour made of bones and skulls, magical particles in the air, rusty skull armour, casting screaming tranparent skulls, face covered in glowing skull mask, hkmagic"
触发词
使用hkmagic
来触发图像生成。
模型下载
模型权重以Safetensors格式提供,可在Files & versions标签页中下载。
使用diffusers库
使用diffusers
库加载模型和LoRA权重,示例代码如下:
from diffusers import AutoPipelineForText2Image
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
pipeline = AutoPipelineForText2Image.from_pretrained('black-forest-labs/FLUX.1-dev', torch_dtype=torch.bfloat16).to(device)
pipeline.load_lora_weights('Keltezaa/fantasy-wizard-witches', weight_name='FantasyWizardWitchesFluxV2-000001.safetensors')
image = pipeline('`hkmagic`').images[0]
📄 许可证
本模型使用的许可证为bespoke-lora-trained-license。
🔧 技术细节
本模型基于black-forest-labs/FLUX.1-dev
基础模型,使用LoRA技术进行训练。LoRA(Low-Rank Adaptation)是一种高效的模型微调技术,通过在预训练模型的基础上添加低秩矩阵来适应特定任务,从而减少了需要训练的参数数量,提高了训练效率。在图像生成过程中,通过输入包含触发词hkmagic
的文本提示,模型会根据文本内容生成相应的奇幻风格图像。同时,通过调整LoRA权重和其他参数,可以进一步优化生成图像的效果。