🚀 PVC Style LoRA for AnimagineXL 4.0 opt
このLoRAモデルは、AnimagineXL 4.0に対応したPVCスタイルの画像生成を行うためのものです。ComfyUIでのみテストされています。
🚀 クイックスタート
このモデルはComfyUIでのみテストされています。以下のトリガーワードを使用することで、画像生成をトリガーできます。
✨ 主な機能
- PVCスタイルの画像生成:特定のトリガーワードを使用することで、PVCスタイルの画像を生成できます。
- Safetensors形式:モデルの重みはSafetensors形式で提供されています。
📦 インストール
モデルの重みはSafetensors形式で提供されています。以下のリンクからダウンロードできます。
Download(Files & versionsタブ)
💻 使用例
基本的な使用法
特定のトリガーワードを使用して画像生成を行います。例えば、以下のようなプロンプトを使用します。
pvc, 1girl, solo, blue background, halftone background, looking at viewer, animal ears, school uniform, yellow eyes, black hair, long hair, sitting, crossed legs, cat ears, border, halftone, white border, couch, open mouth, shirt, skirt, long sleeves, white shirt, black skirt, pleated skirt, serafuku, neckerchief, black sailor collar, socks, white socks, outside border, sailor collar, animal ear fluff, black neckerchief, masterpiece, best quality, high score, great score, latest, figma
高度な使用法
以下のように、ネガティブプロンプトを使用して、生成される画像の質を向上させることができます。
negative_prompt: lowres, bad anatomy, bad hands, text, error, missing finger, extra digits, fewer digits, cropped, worst quality, low quality, low score, bad score, average score, signature, watermark, username, blurry
📚 ドキュメント
データセット
このモデルの学習には、約7000枚のPVCフィギュアの画像が使用されています。
トレーニング
トレーニングコード
トレーニングコードは以下のリポジトリにあります。
https://github.com/p1atdev/vision-ft
トレーニング設定
トレーニング設定は以下のconfig.yml
とpreview.yml
に記載されています。
`config.yml`
model:
checkpoint_path: "./models/animagine-xl-4.0-opt.bnb_nf4.safetensors"
pretrained_model_name_or_path: cagliostrolab/animagine-xl-4.0
dtype: bfloat16
denoiser:
attn_implementation: "flash_attention_2"
peft:
config:
type: lora
rank: 2
alpha: 1.0
dropout: 0.0
dtype: bfloat16
include_keys:
- "attn1"
- "attn2"
- ".ff."
exclude_keys: ["text_encoder", "vae"]
dataset:
folder: "data/pvc"
num_repeats: 4
batch_size: 4
bucket_base_size: 1024
step: 128
min_size: 384
do_upscale: true
caption_processors:
- type: shuffle
split_separator: ","
optimizer:
name: "schedulefree.RAdamScheduleFree"
args:
lr: 0.005
scheduler:
tracker:
project_name: "sdxl-pvc-1"
loggers:
- wandb
saving:
strategy:
per_epochs: 0.25
per_steps: null
save_last: true
callbacks:
- type: "safentensors"
name: "sdxl-pvc"
save_dir: "./output/sdxl-pvc-2"
preview:
strategy:
per_epochs: 1
per_steps: 100
callbacks:
- type: "local"
save_dir: "./output/sdxl-lora/preview"
data:
path: "./projects/pvc-sdxl/preview.yml"
seed: 42
num_train_epochs: 10
trainer:
gradient_checkpointing: true
torch_compile: true
torch_compile_args:
backend: eager
mode: default
fullgraph: false
fp32_matmul_precision: "high"
allow_tf32: true
`preview.yml`
- prompt: |-
pvc style, 1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings,
green background, hat, hoop earrings, jewelry, looking at viewer,
shirt, short hair, simple background, solo, upper body, yellow shirt,
masterpiece, high score, great score, absurdres
negative_prompt: |-
lowres, bad anatomy, bad hands, text, error, missing finger, extra digits,
fewer digits, cropped, worst quality, low quality, low score, bad score,
average score, signature, watermark, username, blurry
height: 1024
width: 1024
cfg_scale: 5.0
num_steps: 20
seed: 0
トレーニングは9エポック目で停止されました。これは、トレーニングにより部屋が高温になったためです。
デバイスと時間
トレーニングにはRTX 4070 Ti Super(VRAM 16GB)が使用され、約27時間かかりました。
📄 ライセンス
このモデルはApache-2.0ライセンスの下で提供されています。