Wan2.1:
This lora depicts the character Igarashi Rika(五十嵐梨花) from Nijisanji
Trigger Word:Igarashi Rika, anime-style girl. The image features an anime-style character with long, light orange hair styled in a high bun adorned with a white bow and a yellow star-shaped hair accessory. The character has large, expressive blue eyes with a hint of sparkle. She is wearing a black choker with a small pendant, a green top with thin straps, and a yellow belt with a cat-shaped buckle. Her outfit includes a white collar and a black jacket with a white hood. The character also wears knee-high socks with black stripes and white shoes with star-shaped decorations.
Trained: musubi-tuner, 30 images
Caption: adjusted caption from Qwen2.5-VL-3B (includes described background)
lr:(2e-4,flow_shift3.0)
epoch:200
train_step:6000
lora_strength:0.8
sample prompt:Igarashi Rika, anime-style girl. The image features an anime-style character with long, light orange hair styled in a high bun adorned with a white bow and a yellow star-shaped hair accessory. The character has large, expressive blue eyes with a hint of sparkle. She is wearing a black choker with a small pendant, a green top with thin straps, and a yellow belt with a cat-shaped buckle. Her outfit includes a white collar and a black jacket with a white hood. The character also wears knee-high socks with black stripes and white shoes with star-shaped decorations. (she is dancing:2.5), (chibi Nendoroid:3.5) in bedroom.
アクションは強調promptによって2.0~4.0に調整する必要があります。またはモーションloraを併用ください。
Action prompt should be adjusted to 2.0 to 4.0 depending on emphasis prompt. Or motion lora use together.
-------------------------
Wan2.2ver2:
Trigger Word:Igarashi Rika, anime-style girl. The image features an anime-style character with long, light pink hair styled in a high ponytail adorned with a star-shaped hair accessory. The character has blue eyes and is wearing a black choker with a small pendant. She is dressed in a teal and orange outfit that includes a short skirt and a jacket with a hood. The dress has a short skirt and a high collar, complemented by a black jacket with a yellow pocket and a small bow on the chest. The character also wears knee-high socks with black stripes and white shoes with star-shaped decorations.
lr:(3e-4,flow_shift7.0,timestep_boundary 885)
epoch:140
train_step:4200
lora_strength:0.8
sample prompt:Igarashi Rika, anime-style girl. The image features an anime-style character with long, light pink hair styled in a high ponytail adorned with a star-shaped hair accessory. The character has blue eyes and is wearing a black choker with a small pendant. She is dressed in a teal and orange outfit that includes a short skirt and a jacket with a hood. The dress has a short skirt and a high collar, complemented by a black jacket with a yellow pocket and a small bow on the chest. The character also wears knee-high socks with black stripes and white shoes with star-shaped decorations. (she is dancing:4.0), (chibi Nendoroid:4.5) in bedroom.
アクションは強調promptによって3.0~5.0に調整する必要があります。またはモーションloraを併用ください。
lightx2v Wan2.2 v1.1との併用を推奨します。
Action prompt should be adjusted to 3.0 to 5.0 depending on emphasis prompt. Or motion lora use together.
It is recommended to use with lightx2v Wan2.2 v1.1 lora.
・何故--timestep_boundary 885にしたか
dpm++、step=8、shift=7.0ではtimestepは[1.0000, 0.9800, 0.9545, 0.9210, "0.8750", 0.8077, 0.7000, 0.5000]となる。
ここでlow_noiseモデルの最初の1stepは0.8750であるが、この時品質はいいがキャラクターの再現度が低かった。
ここでshiftを小さくして0.8750→0.865とするとキャラクターの再現度が上がることに気づいた。(同時に品質はちょっと落ちる)
どうもmusubi-tunerはhigh/lowモデルからひとつのloraしか学習させず、かつ--timestep_boundary 875の場合、この境界点を上手く学習できてないようだ。
これは0.876ではhighモデルで学習され、0.874ではlowモデルで学習される。つまり、0.875付近ではhigh/lowモデルは50%の確率で選択される。
生成時は0.875はlowモデルを使用するが、この境界点をlowモデルのみで学習できない。二個のloraを学習する場合はこのような事は起こらない。
学習時の--timestep_boundary 885にした場合、キャラクターの再現度が上がった。
--------------------------------------------
Wan2.2ver1:
This lora depicts the character Igarashi Rika(五十嵐梨花) from Nijisanji
Trigger Word:Igarashi Rika, anime-style girl. The image features an anime-style character with long, light orange hair styled in a high bun adorned with a white bow and a yellow star-shaped hair accessory. The character has large, expressive blue eyes with a hint of sparkle. She is wearing a black choker with a small pendant, a green overall with thin straps, and a yellow belt with a cat-shaped buckle. Her outfit includes a white collar and a orange and black jacket with a white hood. The character also wears knee-high socks with black stripes and white shoes with star-shaped decorations.
Trained: musubi-tuner, 30 images
Caption: adjusted caption from Qwen2.5-VL-3B (includes described background)
lr:(2e-4,flow_shift7.0)
epoch:200
train_step:6000
lora_strength:1.0
sample prompt:Igarashi Rika, anime-style girl. The image features an anime-style character with long, light orange hair styled in a high bun adorned with a white bow and a yellow star-shaped hair accessory. The character has large, expressive blue eyes with a hint of sparkle. She is wearing a black choker with a small pendant, a green overall with thin straps, and a yellow belt with a cat-shaped buckle. Her outfit includes a white collar and a orange and black jacket with a white hood. The character also wears knee-high socks with black stripes and white shoes with star-shaped decorations. (She is breakdancing:3.5) in bedroom.
アクションは強調promptによって3.0~5.0に調整する必要があります。またはモーションloraを併用ください。
Action prompt should be adjusted to 3.0 to 5.0 depending on emphasis prompt. Or motion lora use together.
スタイルlora(試作)とキャラクターloraはそれぞれhigh/low両方のモデルに同じ重みを適応ください。lightx2v wan2.2 V1.1は別の重みを適応ください。
Style lora(M1_prototype) and character lora should be adapted same weight to both high and low models. lightx2v wan2.2 V1.1 apply a different weight.
スタイルlora(試作)は一応添付しておきますが、調整中です。
---------------------------------------------------------------------
lora制作メモ:
・musubi-tunerでwan2.2を最初学習しようとしたとき、wan2.1の学習手法で
--dit models/wan2.1_t2v_14B_fp16.safetensors → --dit models/wan2.2_t2v_high_noise_14B_fp16.safetensors
とおきかえてhigh_noiseモデルだけ学習させた。
このときキャラクターの再現度がいまいちなのと背景が白くなっていた。
更にloraの適用強度を上げると再現度は上がるが、動きがほとんどなくなり、背景が真っ白になるといった状況だった。
・wan2.2の2段のワークフローでモデルを両方wan2.1に差し替え、前半か後半のlora強度をなくしてみた。
しかし、キャラクターloraはhigh_noiseやlow_noiseのどちらの領域にもまたがるようでhighかlowのどっちかの学習だけでよいわけではないようだ。
・(wan2.2_high_noise_model+wan2.2 lora)+(wan2.1_model+wan2.1 lora)という構成も試したが解決はしなかった。
・--min_timestep 875 --max_timestep 1000とか--discrete_flow_shift 0.33の逆数にするとかやったが改善しなかった。
・Wan2.2の動画の作成設定に関しても当時色々試行錯誤した。
・またwan2.2のlow_noise modelのstyle loraの学習を試したが、これを入れても品質はそんなに変わらなかった。
☆そうこうする間にmusubi-tunerでwan2.2の学習が実装された。
high/low modelから一個のloraを学習する。
VRAMを多く使用するのでローカルの4070Ti(12GB)だとblocks_to_swap 38でも学習できない。Google ColabのA100を使用して学習した。
あと「%pip install -e .」とか「%pip install --upgrade bitsandbytes」を実行する。
画像30枚、学習解像度576、モデルの読み込み時間を含めて200stepで2時間30分、300stepで3時間30分くらいだった。
--discrete_flow_shiftは最初3.0で次は7.0にした。epoch200でのlora重みだと7.0の方が良かったが、単に過学習が解消されただけかもしれない。
参考までに自分の学習コマンドを示す。
!accelerate launch --num_cpu_threads_per_process 1 --mixed_precision bf16 wan_train_network.py --task t2v-A14B --dit models/wan2.2_t2v_low_noise_14B_fp16.safetensors --dit_high_noise models/wan2.2_t2v_high_noise_14B_fp16.safetensors --dataset_config configs/config.toml --sdpa --mixed_precision bf16 --fp8_base --optimizer_type adamw8bit --learning_rate 2e-4 --gradient_checkpointing --max_data_loader_n_workers 2 --persistent_data_loader_workers --network_module networks.lora_wan --network_dim 32 --timestep_sampling shift --discrete_flow_shift 7.0 --max_train_epochs 301 --save_every_n_epochs 20 --seed 42 --output_dir outputs --output_name wan22_multi2_test004 --blocks_to_swap 4 --preserve_distribution_shape --mixed_precision fp16
・だが、このloraで生成しても動きはいいけど結局生成品質はそこそこだった。
そしてlightx2v wan2.2 V1.1を使ったら普通に品質も良くなった。
その前に学習してたstyle loraもlightx2v後は効果を発揮するようになった。
また仮にstyle loraなしでも結構良い。style loraのメリットはcfg=1でも品質が高いくらい。
また再現度がいまいちなのは生成promptが正確でないせいだけだった。これは生成promptを微調整して良くなった。
wan2.1のほうがpromptが多少違っていてもキャラが生成できる柔軟性があった。逆に言うとwan2.2が間違ったpromptを無視しないという事なのかもしれない。
生成条件は前半4step後半4stepの計8step、両方のcfg=1である。