🚀 flux-lora-training
このプロジェクトは、black-forest-labs/FLUX.1-dev をベースとした標準的なPEFT LoRAです。このLoRAを使用することで、特定の画像生成タスクをより効果的に行うことができます。
🚀 クイックスタート
このLoRAは、特定のベースモデルから派生しており、特定のプロンプトを使用してトレーニングされています。以下に、トレーニング時に使用された主な検証用プロンプトを示します。
(ultra detailed,photo,photograph,best quality,high resolution,4k,8k,photorealistic,Japanese early twenties,(slim) and curvy body,waist,detailed beautiful eyes,super detailed eyes and skins,very beautiful woman:3.0), (Wearing tight short sleeves white (one piece) sailor uniform, blue collar, red neckerchief, dark blue pleated dress, standing in empty classroom,sweet smiling:2.0), long straight hair, standing in empty classroom,
📚 ドキュメント
検証設定
- CFG:
3.5
- CFG Rescale:
0.0
- Steps:
20
- Sampler:
FlowMatchEulerDiscreteScheduler
- Seed:
42
- Resolution:
1024x1024
- Skip-layer guidance:
注意: 検証設定は、トレーニング設定 と必ずしも同じではありません。
トレーニング設定
-
トレーニングエポック数: 92
-
トレーニングステップ数: 2400
-
学習率: 0.0001
- 学習率スケジュール: constant_with_warmup
- ウォームアップステップ数: 100
-
最大勾配値: 1.0
-
有効バッチサイズ: 1
- マイクロバッチサイズ: 1
- 勾配累積ステップ数: 1
- GPU数: 1
-
勾配チェックポインティング: True
-
予測タイプ: flow-matching (追加パラメータ=['flow_schedule_auto_shift', 'shift=0.0', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flow_matching_loss=compatible', 'flux_lora_target=all+ffs'])
-
オプティマイザ: adamw_bf16
-
学習可能パラメータの精度: Pure BF16
-
ベースモデルの精度: no_change
-
キャプションドロップアウト確率: 0.0%
-
LoRAランク: 16
-
LoRAアルファ: None
-
LoRAドロップアウト: 0.1
-
LoRA初期化スタイル: default
データセット
cissy
- 繰り返し回数: 0
- 画像総数: 26
- アスペクトバケット総数: 1
- 解像度: 1.0メガピクセル
- クロップ: true
- クロップスタイル: center
- クロップアスペクト: square
- 正則化データとしての使用: No
推論
import torch
from diffusers import DiffusionPipeline
model_id = 'black-forest-labs/FLUX.1-dev'
adapter_id = 'hok00i3/flux-lora-training'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
pipeline.load_lora_weights(adapter_id)
prompt = "(ultra detailed,photo,photograph,best quality,high resolution,4k,8k,photorealistic,Japanese early twenties,(slim) and curvy body,waist,detailed beautiful eyes,super detailed eyes and skins,very beautiful woman:3.0), (Wearing tight short sleeves white (one piece) sailor uniform, blue collar, red neckerchief, dark blue pleated dress, standing in empty classroom,sweet smiling:2.0), long straight hair, standing in empty classroom,"
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.5,
).images[0]
model_output.save("output.png", format="PNG")
📄 ライセンス
ライセンス情報: other