🚀 lora-anime-test-02
這是一個從 black-forest-labs/FLUX.1-dev 派生而來的LoRA模型。它可用於文本到圖像的生成,特別是在動漫風格數字藝術圖像生成方面有一定效果。
🚀 快速開始
推理示例
以下是使用該LoRA模型進行推理的示例代碼:
import torch
from diffusers import DiffusionPipeline
model_id = 'black-forest-labs/FLUX.1-dev'
adapter_id = 'Disra/lora-anime-test-02'
pipeline = DiffusionPipeline.from_pretrained(model_id)
pipeline.load_lora_weights(adapter_id)
prompt = "anime style digital art of a girl with blue-green hair and green eyes wearing a one piece swimsuit"
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
image = pipeline(
prompt=prompt,
num_inference_steps=20,
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
width=1024,
height=1024,
guidance_scale=3.5,
).images[0]
image.save("output.png", format="PNG")
💻 使用示例
基礎用法
上述推理示例代碼就是基礎的使用方式,通過加載基礎模型和LoRA適配器,輸入提示詞,即可生成圖像。
高級用法
你可以根據自己的需求調整推理參數,如 num_inference_steps
(推理步數)、guidance_scale
(引導比例)等,以獲得不同風格和質量的圖像。
📚 詳細文檔
驗證設置
- CFG:
3.5
- CFG Rescale:
0.0
- 步數:
20
- 採樣器:
None
- 種子:
42
- 分辨率:
1024
注意:驗證設置不一定與訓練設置相同。
訓練設置
屬性 |
詳情 |
訓練輪數 |
142 |
訓練步數 |
5000 |
學習率 |
0.0001 |
有效批次大小 |
1 |
微批次大小 |
1 |
梯度累積步數 |
1 |
GPU數量 |
1 |
預測類型 |
flow-matching |
重新縮放的貝塔零SNR |
False |
優化器 |
adamw_bf16 |
精度 |
bf16 |
量化 |
是:int8 - quanto |
Xformers |
未使用 |
LoRA秩 |
4 |
LoRA Alpha |
無 |
LoRA Dropout |
0.1 |
LoRA初始化風格 |
默認 |
數據集
anime - test - 01
屬性 |
詳情 |
重複次數 |
0 |
圖像總數 |
35 |
縱橫比桶總數 |
1 |
分辨率 |
0.262144兆像素 |
是否裁剪 |
是 |
裁剪風格 |
居中 |
裁剪縱橫比 |
正方形 |
🔧 技術細節
訓練時使用的主要驗證提示詞為:
anime style digital art of a girl with blue-green hair and green eyes wearing a one piece swimsuit
文本編碼器未進行訓練,推理時可複用基礎模型的文本編碼器。
📄 許可證
本項目採用 creativeml - openrail - m 許可證。
示例圖像
基礎模型(無LoRA)生成的圖像在上方,使用LoRA模型(相同提示詞和種子)生成的圖像在下方。

你可以在以下圖庫中找到一些示例圖像: