0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Anima LoRA FactoryでLoRAを作った!!

0
Posted at

前回はKohya ssでLoRAを自作したものの、出来上がったLoRAの質は低いものだったね。
元の姿をほとんど学習していない様子だった。

今回は学習ツールを変更してAnima LoRA Factoryを利用してみようと思ったよ。
▼参考にした記事
https://note.com/cocoat/n/n63633d631148

画面構成や項目はKohya ssに比べて見やすい。
image.png
画像素材を指定し、

image.png
タグを設定してーー

スクリーンショット 2026-09-16 230305.png
checkpointやvaeやtext encoderを設定して、出力先と生成loRA名を選ぶ。

スクリーンショット 2026-09-16 230319.png
あとは、ちょっとした設定をしたら学習開始。
image.png

学習プロセスを開始しています...
--- Connection Established ---
[TRAIN] 2026-09-16 16:29:47 INFO Loading dataset config from train_network.py:502
[TRAIN] C:\Users\xxx\Anima-LoRA-Factory-v
[TRAIN] 5.1\backend\dataset_config.to
[TRAIN] ml
[TRAIN] INFO prepare images. train_util.py:2141
[TRAIN] INFO get image size from name of train_util.py:2016
[TRAIN] cache files
[TRAIN]
[TRAIN] 0%| | 0/33 [00:00<?, ?it/s]
[TRAIN] 100%|██████████| 33/33 [00:00<?, ?it/s]
[TRAIN] INFO set image size from cache train_util.py:2046
[TRAIN] files: 0/33
[TRAIN] INFO found directory train_util.py:2088
[TRAIN] C:\Users\xxx\im
[TRAIN] g_src\10_fum2asahi contains 33
[TRAIN] image files
[TRAIN]
[TRAIN] read caption: 0%| | 0/33 [00:00<?, ?it/s]
[TRAIN] read caption: 100%|██████████| 33/33 [00:00<00:00, 5251.23it/s]
[TRAIN] INFO 132 train images with repeats. train_util.py:2187
[TRAIN] INFO 0 reg images with repeats. train_util.py:2191
[TRAIN] WARNING no regularization images / train_util.py:2196
[TRAIN] 正則化画像が見つかりませんでし
[TRAIN] た
[TRAIN] INFO [Dataset 0] config_util.py:584
[TRAIN] batch_size: 1
[TRAIN] resolution: (1024, 1024)
[TRAIN] skip_image_resolution: None
[TRAIN] resize_interpolation: None
[TRAIN] enable_bucket: True
[TRAIN] min_bucket_reso: 256
[TRAIN] max_bucket_reso: 2048
[TRAIN] bucket_reso_steps: 64
[TRAIN] bucket_no_upscale: False
[TRAIN]
[TRAIN] [Subset 0 of Dataset 0]
[TRAIN] image_dir:
[TRAIN] "C:\Users\xxx\im
[TRAIN] g_src\10_fum2asahi"
[TRAIN] image_count: 33
[TRAIN] num_repeats: 4
[TRAIN] shuffle_caption: False
[TRAIN] keep_tokens: 0
[TRAIN] caption_dropout_rate: 0.0
[TRAIN] caption_dropout_every_n_epo
[TRAIN] chs: 0
[TRAIN] caption_tag_dropout_rate:
[TRAIN] 0.0
[TRAIN] caption_prefix: None
[TRAIN] caption_suffix: None
[TRAIN] color_aug: False
[TRAIN] flip_aug: False
[TRAIN] face_crop_aug_range: None
[TRAIN] random_crop: False
[TRAIN] token_warmup_min: 1,
[TRAIN] token_warmup_step: 0,
[TRAIN] alpha_mask: False
[TRAIN] resize_interpolation: None
[TRAIN] custom_attributes: {}
[TRAIN] is_reg: False
[TRAIN] class_tokens: None
[TRAIN] caption_extension: .txt
[TRAIN]
[TRAIN]
[TRAIN] INFO [Prepare dataset 0] config_util.py:596
[TRAIN] INFO loading image sizes. train_util.py:995
[TRAIN]
[TRAIN] 0%| | 0/33 [00:00<?, ?it/s]
[TRAIN] 100%|██████████| 33/33 [00:00<00:00, 8885.67it/s]
[TRAIN] INFO make buckets train_util.py:1018
[TRAIN] INFO number of images (including train_util.py:1064
[TRAIN] repeats) /
[TRAIN] 各bucketの画像枚数(繰り返し回
[TRAIN] 数を含む)
[TRAIN] INFO bucket 0: resolution (1344, train_util.py:1069
[TRAIN] 768), count: 132
[TRAIN] INFO mean ar error (without train_util.py:1077
[TRAIN] repeats): 0.028666666666666618
[TRAIN] INFO preparing accelerator train_network.py:576
[TRAIN] INFO Loading Qwen3 text anima_train_network.py:86
[TRAIN] encoder...
[TRAIN] INFO Loading Qwen3 text encoder from anima_utils.py:201
[TRAIN] C:/Users/xxx/qwen_3_0
[TRAIN] 6b_base.safetensors
[TRAIN] 2026-09-16 16:29:51 INFO Loaded Qwen3 state dict: <All anima_utils.py:248
[TRAIN] keys matched successfully>
[TRAIN] INFO Loaded Qwen3 text encoder. anima_utils.py:256
[TRAIN] Parameters: 596,049,920
[TRAIN] 2026-09-16 16:29:52 INFO Loading Anima VAE... anima_train_network.py:91
[TRAIN] INFO Initializing VAE qwen_image_autoencoder_kl.py:1609
[TRAIN] INFO Loading VAE from qwen_image_autoencoder_kl.py:1631
[TRAIN] C:/Users/xxx/anima
[TRAIN] _qwen_image_vae.
[TRAIN] safetensors
[TRAIN] INFO Converted qwen_image_autoencoder_kl.py:1538
[TRAIN] ComfyUI
[TRAIN] AutoencoderKL
[TRAIN] state dict keys
[TRAIN] to official
[TRAIN] format
[TRAIN] INFO Loaded VAE: <All qwen_image_autoencoder_kl.py:1638
[TRAIN] keys matched
[TRAIN] successfully>
[TRAIN] INFO Loading Anima DiT model anima_train_network.py:112
[TRAIN] with attn_mode=torch,
[TRAIN] split_attn: False...
[TRAIN] 2026-09-16 16:29:53 INFO Loading DiT model from anima_utils.py:105
[TRAIN] C:/Users/xxx/anim
[TRAIN] a_baseV10.safetensors,
[TRAIN] device=cpu
[TRAIN] INFO Loading model files: lora_utils.py:90
[TRAIN] ['C:/Users/xxx/anima_ba
[TRAIN] seV10.safetensors']
[TRAIN] INFO Loading state dict without FP8 lora_utils.py:264
[TRAIN] optimization. Dtype of weight:
[TRAIN] torch.bfloat16, hook enabled:
[TRAIN] False
[TRAIN] accelerator device: cuda
[TRAIN]
[TRAIN] Loading anima_baseV10.safetensors: 0%| | 0/685 [00:00<?, ?it/s]
[TRAIN] Loading anima_baseV10.safetensors: 5%|▍ | 33/685 [00:00<00:02, 323.96it/s]
[TRAIN] Loading anima_baseV10.safetensors: 10%|█ | 71/685 [00:00<00:01, 352.95it/s]
[TRAIN] Loading anima_baseV10.safetensors: 16%|█▌ | 107/685 [00:00<00:01, 340.87it/s]
[TRAIN] Loading anima_baseV10.safetensors: 21%|██ | 142/685 [00:00<00:01, 334.46it/s]
[TRAIN] Loading anima_baseV10.safetensors: 26%|██▌ | 176/685 [00:00<00:01, 329.71it/s]
[TRAIN] Loading anima_baseV10.safetensors: 31%|███ | 213/685 [00:00<00:01, 342.77it/s]
[TRAIN] Loading anima_baseV10.safetensors: 37%|███▋ | 253/685 [00:00<00:01, 343.95it/s]
[TRAIN] Loading anima_baseV10.safetensors: 43%|████▎ | 293/685 [00:00<00:01, 346.99it/s]
[TRAIN] Loading anima_baseV10.safetensors: 49%|████▊ | 333/685 [00:00<00:01, 347.01it/s]
[TRAIN] Loading anima_baseV10.safetensors: 54%|█████▍ | 373/685 [00:01<00:00, 350.96it/s]
[TRAIN] Loading anima_baseV10.safetensors: 60%|██████ | 413/685 [00:01<00:00, 348.41it/s]
[TRAIN] Loading anima_baseV10.safetensors: 66%|██████▌ | 453/685 [00:01<00:00, 356.73it/s]
[TRAIN] Loading anima_baseV10.safetensors: 72%|███████▏ | 492/685 [00:01<00:00, 356.57it/s]
[TRAIN] Loading anima_baseV10.safetensors: 77%|███████▋ | 528/685 [00:01<00:00, 352.81it/s]
[TRAIN] Loading anima_baseV10.safetensors: 82%|████████▏ | 564/685 [00:01<00:00, 349.07it/s]
[TRAIN] Loading anima_baseV10.safetensors: 98%|█████████▊| 668/685 [00:01<00:00, 542.49it/s]
[TRAIN]
[TRAIN] 2026-09-16 16:29:54 INFO Loaded DiT model from anima_utils.py:146
[TRAIN] C:/Users/xxx/anim
[TRAIN] a_baseV10.safetensors,
[TRAIN] unexpected missing keys: 0,
[TRAIN] unexpected keys: 0
[TRAIN] INFO enable block swap: anima_train_network.py:131
[TRAIN] blocks_to_swap=20
[TRAIN] INFO Anima: Block swap enabled. anima_models.py:1262
[TRAIN] Swapping 20 blocks, total
[TRAIN] blocks: 28, device: cuda.
[TRAIN] INFO create LoRA network. base dim lora_anima.py:426
[TRAIN] (rank): 16, alpha: 16.0
[TRAIN] INFO neuron dropout: p=None, rank lora_anima.py:427
[TRAIN] dropout: p=None, module dropout:
[TRAIN] p=None
[TRAIN] INFO create LoRA for Text Encoder 1: lora_anima.py:531
[TRAIN] INFO create LoRA for Text Encoder 1: lora_anima.py:533
[TRAIN] 196 modules.
[TRAIN] 2026-09-16 16:29:55 INFO create LoRA for Anima DiT: 280 lora_anima.py:545
[TRAIN] modules.
[TRAIN] INFO enable LoRA for text encoder: lora_anima.py:584
[TRAIN] 196 modules
[TRAIN] INFO enable LoRA for DiT: 280 modules lora_anima.py:589
[TRAIN] INFO Text Encoder 1 (Qwen3): 196 lora_anima.py:717
[TRAIN] modules, LR 5e-05
[TRAIN] INFO use AdamW optimizer | {} train_util.py:5159
[TRAIN] fatal: not a git repository (or any of the parent directories): .git
[TRAIN] 2026-09-16 16:29:59 INFO unet dtype: torch.bfloat16, train_network.py:1332
[TRAIN] device: cuda:0
[TRAIN] INFO text_encoder [0] dtype: train_network.py:1338
[TRAIN] torch.bfloat16, device:
[TRAIN] cuda:0
[TRAIN] import network module: networks.lora_anima
[TRAIN] prepare optimizer, data loader etc.
[TRAIN] override steps. steps for 10 epochs is / 指定エポックまでのステップ数: 1320
[TRAIN] running training / 学習開始
[TRAIN] num train images * repeats / 学習画像の数×繰り返し回数: 132
[TRAIN] num validation images * repeats / 学習画像の数×繰り返し回数: 0
[TRAIN] num reg images / 正則化画像の数: 0
[TRAIN] num batches per epoch / 1epochのバッチ数: 132
[TRAIN] num epochs / epoch数: 10
[TRAIN] batch size per device / バッチサイズ: 1
[TRAIN] gradient accumulation steps / 勾配を合計するステップ数 = 1
[TRAIN] total optimization steps / 学習ステップ数: 1320
[TRAIN]
[TRAIN] steps: 0%| | 0/1320 [00:00<?, ?it/s] INFO epoch is incremented. train_util.py:787
[TRAIN] current_epoch: 0, epoch: 1
[TRAIN]
[TRAIN] steps: 0%| | 1/1320 [00:05<2:08:41, 5.85s/it]
[TRAIN] steps: 0%| | 1/1320 [00:05<2:08:48, 5.86s/it, avr_loss=0.011]
[TRAIN] steps: 0%| | 2/1320 [00:10<1:59:46, 5.45s/it, avr_loss=0.011]
[TRAIN] steps: 0%| | 2/1320 [00:10<1:59:49, 5.45s/it, avr_loss=0.0115]
略
[TRAIN] steps: 100%|█████████▉| 1319/1320 [1:51:22<00:05, 5.07s/it, avr_loss=0.0102]
[TRAIN] steps: 100%|█████████▉| 1319/1320 [1:51:22<00:05, 5.07s/it, avr_loss=0.0102]
[TRAIN] steps: 100%|██████████| 1320/1320 [1:51:27<00:00, 5.07s/it, avr_loss=0.0102]
[TRAIN] steps: 100%|██████████| 1320/1320 [1:51:27<00:00, 5.07s/it, avr_loss=0.0102]2026-09-16 18:21:27 WARNING Failed to get git commit sai_model_spec.py:288
[TRAIN] hash, using fallback
[TRAIN] INFO model saved. train_network.py:1714
[TRAIN]
[TRAIN] steps: 100%|██████████| 1320/1320 [1:51:27<00:00, 5.07s/it, avr_loss=0.0102]
[TRAIN]
[TRAIN] epoch 1/10
[TRAIN]
[TRAIN]
[TRAIN] epoch 2/10
[TRAIN]
[TRAIN]
[TRAIN] epoch 3/10
[TRAIN]
[TRAIN]
[TRAIN] epoch 4/10
[TRAIN]
[TRAIN]
[TRAIN] epoch 5/10
[TRAIN]
[TRAIN]
[TRAIN] epoch 6/10
[TRAIN]
[TRAIN]
[TRAIN] epoch 7/10
[TRAIN]
[TRAIN]
[TRAIN] epoch 8/10
[TRAIN]
[TRAIN]
[TRAIN] epoch 9/10
[TRAIN]
[TRAIN]
[TRAIN] epoch 10/10
[TRAIN]
[TRAIN]
[TRAIN] saving checkpoint: C:/Users/xxx/Anima-LoRA-Factory-v5.1/output\fum2asahi2609161630_unet.safetensors
[TRAIN]
--- TRAIN Finished ---
[TRAIN]
--- Starting Conversion to ComfyUI ---
[TRAIN] 2026-09-16 18:21:31 INFO Loading source convert_anima_lora_to_comfy.py:20
[TRAIN] file
[TRAIN] C:/Users/xxx/Anima-LoRA-
[TRAIN] Factory-v5.1/out
[TRAIN] put\fum2asahi260
[TRAIN] 9161630_unet.saf
[TRAIN] etensors
[TRAIN] INFO Converting... convert_anima_lora_to_comfy.py:27
[TRAIN] INFO Converted 1428 convert_anima_lora_to_comfy.py:124
[TRAIN] keys
[TRAIN] INFO Calculating convert_anima_lora_to_comfy.py:134
[TRAIN] hashes and
[TRAIN] creating
[TRAIN] metadata...
[TRAIN] 2026-09-16 18:21:32 INFO Saving convert_anima_lora_to_comfy.py:140
[TRAIN] destination
[TRAIN] file
[TRAIN] C:/Users/xxx/Anima-Lo
[TRAIN] RA-Factory-v5.1
[TRAIN] /output\fum2asa
[TRAIN] hi2609161630_co
[TRAIN] mfy.safetensors
[TRAIN]
--- TRAIN Finished ---
[TRAIN] Cleaning up temporary UNET file: fum2asahi2609161630_unet.safetensors
[TRAIN]
--- All Processes Finished Successfully ---

出力先フォルダにLoRAが格納された!
image.png
じゃあStableDiffusionで生成してみよう。
image.png
あれ、エラー?
学習時と同じcheckpointとvaeを選んだのに?

仕方ないから違うAnima系vaeで生成。
image.png
ええ……真っ黒なの?
これじゃあKohya ssより酷い結果じゃないか……。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?