🚀 simpletuner-lora
simpletuner-lora是一個標準的PEFT LoRA,源自black-forest-labs/FLUX.1-dev,可用於文本到圖像、圖像到圖像等轉換任務。
🚀 快速開始
推理示例
import torch
from diffusers import DiffusionPipeline
model_id = 'black-forest-labs/FLUX.1-dev'
adapter_id = 'binarydaddy/simpletuner-lora'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
pipeline.load_lora_weights(adapter_id)
prompt = "A 2D vfx of flame effect in red and yellow, glazing against black background"
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
model_output = 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(42),
width=1024,
height=1024,
guidance_scale=3.0,
).images[0]
model_output.save("output.png", format="PNG")
✨ 主要特性
- 基於
black-forest-labs/FLUX.1-dev
模型派生,可用於文本到圖像、圖像到圖像等轉換。
- 訓練過程中使用特定的驗證提示和設置,以確保模型效果。
- 文本編碼器未進行訓練,推理時可複用基礎模型的文本編碼器。
📚 詳細文檔
驗證設置
- CFG:
3.0
- CFG Rescale:
0.0
- 步數:
20
- 採樣器:
FlowMatchEulerDiscreteScheduler
- 種子:
42
- 分辨率:
1024x1024
- 跳過層引導:
注意:驗證設置不一定與訓練設置相同。
你可以在以下圖庫中找到一些示例圖像:
訓練設置
屬性 |
詳情 |
訓練輪數 |
0 |
訓練步數 |
1000 |
學習率 |
0.0001 |
學習率調度 |
多項式 |
熱身步數 |
100 |
最大梯度值 |
2.0 |
有效批量大小 |
8 |
微批量大小 |
1 |
梯度累積步數 |
1 |
GPU數量 |
8 |
梯度檢查點 |
啟用 |
預測類型 |
flow_matching (額外參數=['shift=3', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flux_lora_target=all']) |
優化器 |
adamw_bf16 |
可訓練參數精度 |
Pure BF16 |
基礎模型精度 |
no_change |
字幕丟棄概率 |
0.1% |
LoRA秩 |
512 |
LoRA Alpha |
無 |
LoRA丟棄率 |
0.1 |
LoRA初始化風格 |
默認 |
數據集
mapledata_aug
- 重複次數:5
- 圖像總數:~9560
- 縱橫比桶總數:1
- 分辨率:1.0 兆像素
- 裁剪:否
- 裁剪風格:無
- 裁剪縱橫比:無
- 是否用於正則化數據:否
📄 許可證
許可證類型:其他