🚀 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 許可證。