🚀 Flux-Super-Portrait-LoRA
Flux-Super-Portrait-LoRA 是一款文本到图像的模型,借助 LoRA 技术,能依据输入的文本描述生成高质量的人物特写肖像。它在图像生成领域具有较高的应用价值,可满足多样化的创意需求。
🚀 快速开始
安装依赖
import torch
from pipelines import DiffusionPipeline
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
lora_repo = "strangerzonehf/Flux-Super-Portrait-LoRA"
trigger_word = "Super Portrait"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
触发图像生成
你应该使用 Super Portrait
来触发图像生成。
下载模型
此模型的权重以 Safetensors 格式提供。
点击下载(在“文件与版本”选项卡中)。
✨ 主要特性
- 文本到图像转换:能够根据输入的文本描述生成对应的人物特写肖像。
- 高质量输出:生成的图像具有较高的质量和细节。
- 特定触发词:使用
Super Portrait
作为触发词,方便控制图像生成。
📦 安装指南
安装依赖库
import torch
from pipelines import DiffusionPipeline
加载基础模型
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
加载 LoRA 模型
lora_repo = "strangerzonehf/Flux-Super-Portrait-LoRA"
trigger_word = "Super Portrait"
pipe.load_lora_weights(lora_repo)
设备设置
device = torch.device("cuda")
pipe.to(device)
💻 使用示例
基础用法
import torch
from pipelines import DiffusionPipeline
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
lora_repo = "strangerzonehf/Flux-Super-Portrait-LoRA"
trigger_word = "Super Portrait"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
text = "Super Portrait, A close-up portrait of a young man with dark brown eyes and dark brown eyebrows. He is wearing a green and yellow striped polo shirt with a black collar. His earring is adorned with a silver earring. The backdrop is a light blue color."
image = pipe(text).images[0]
image.save("output.png")
📚 详细文档
图像生成示例
以下是一些图像生成的示例:
输入文本 |
输出图像 |
Super Portrait, A close-up portrait of a young man with dark brown eyes and dark brown eyebrows. He is wearing a green and yellow striped polo shirt with a black collar. His earring is adorned with a silver earring. The backdrop is a light blue color. |
点击查看 |
Super Portrait, A close-up shot of a young blonde girl with blue eyes and a black beanie on her head. The beanie is adorned with a pink patch that reads "CUTIE REBEL" in bold white letters. The girls hair is pulled back in a ponytail and she is wearing a black turtleneck. The background is a vibrant brown color. |
点击查看 |
Super Portrait, a close-up shot of a young mans face is adorned with a beige baseball cap adorned with red lettering. The mans eyes are a piercing blue, and he is wearing a pink t-shirt. His hair is dark brown, adding a touch of texture to his face. The backdrop is a vibrant shade of blue, creating a stark contrast to the mans head and the cap. |
点击查看 |
Super Portrait, a close-up shot of a young girls face is featured prominently in the frame. The girls eyes are a piercing blue, and her hair is pulled back in a ponytail, adding a pop of color to her face. She is wearing a gray baseball cap, adorned with a white logo that reads "E-NILS" in a cursive font, while the rest of the text is in a darker shade of white. Her eyebrows are a lighter shade of blue, while her lips are a darker pink. She is wearing a long-sleeved gray sweater, with a slight smile on her lips. The backdrop is a vibrant orange, creating a stark contrast to the girls outfit. |
点击查看 |
Super Portrait, A close-up of a young girl with almond-shaped hazel eyes and long jet-black hair tied in twin braids. She wears a bright red turtleneck sweater and a pair of small silver hoop earrings. The background is a soft peach, highlighting her vibrant outfit. |
点击查看 |
Super Portrait, A close-up of a young man with dark brown eyes and wavy black hair. He is wearing a dark green trench coat with a high collar and a light brown scarf around his neck. The backdrop is a cloudy gray, adding an air of mystery to the scene. |
点击查看 |
图像生成参数
参数 |
详情 |
LR Scheduler |
constant |
Noise Offset |
0.03 |
Optimizer |
AdamW |
Multires Noise Discount |
0.1 |
Network Dim |
64 |
Network Alpha |
32 |
Epoch |
14 |
Save Every N Epochs |
1 |
Multires Noise Iterations |
10 |
Repeat & Steps |
17 & 2650 |
最佳尺寸与推理
尺寸 |
长宽比 |
推荐情况 |
1280 x 832 |
3:2 |
最佳 |
1024 x 1024 |
1:1 |
默认 |
推理范围
标注信息
标注使用 florence2-en(自然语言 & 英语)。
训练图像总数
总共使用 19 张 [Flat 4K] 图像进行训练。
🔧 技术细节
模型训练参数
参数 |
详情 |
LR Scheduler |
constant |
Noise Offset |
0.03 |
Optimizer |
AdamW |
Multires Noise Discount |
0.1 |
Network Dim |
64 |
Network Alpha |
32 |
Epoch |
14 |
Save Every N Epochs |
1 |
Multires Noise Iterations |
10 |
Repeat & Steps |
17 & 2650 |
标注与训练数据
- 标注:使用 florence2-en(自然语言 & 英语)进行标注。
- 训练图像总数:总共使用 19 张 [Flat 4K] 图像进行训练。
最佳尺寸与推理
尺寸 |
长宽比 |
推荐情况 |
1280 x 832 |
3:2 |
最佳 |
1024 x 1024 |
1:1 |
默认 |
推理范围
📄 许可证
本模型使用 creativeml-openrail-m 许可证。