Lora Trainingのロゴ

Lora Training

コミュニティ
mojomast
lora-training

Train a LoRA (character, product, style or motion) for an open-weights image or video model with ostris/ai-toolkit, behind a hard human approval gate on the dataset. Use for "train a LoRA of my product", "make a style LoRA", "teach the model this character". Nothing trains until the user approves the dataset.

概要

公開者mojomast
リポジトリopen-higgsfield-skills
スキル名lora-training
スター
97
フォーク
19
同梱ファイル
3
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 3個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    mojomastがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Lora Training」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/mojomast/open-higgsfield-skills/tree/main/skills/lora-training
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mojomast/open-higgsfield-skills.git /tmp/open-higgsfield-skills
mkdir -p .claude/skills
cp -r /tmp/open-higgsfield-skills/skills/lora-training .claude/skills/lora-training
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでLora Trainingを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にLora Trainingを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Lora Trainingは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

lora-training

Train with ostris/ai-toolkit (MIT, https://github.com/ostris/ai-toolkit). It is an external install that the user does on the training machine. This skill never installs or runs it for them. The design follows agentY's lora-training skill (MIT, copied to references/agentY-lora-training.md; its tool names are agentY-specific). Use open-weights base models only.

0. Should this be a LoRA?

Only when an identity, style, product or motion has to come back reliably across many prompts. For a single look, use a reference image with image-edit (Qwen edit) or fix.edit instead. It is cheaper and needs no training.

1. Build the dataset (scripts/dataset_check.py)

python scripts/dataset_check.py <folder> --kind character|product|style|motion [--trigger tok]. It is stdlib only and reads nothing over the network. It checks:

  • the item count against the targets (character 15–40, product 15–30, style 25–60, motion 10–30 clips of 2–5 s)
  • for each item, a matching <name>.txt caption
  • exact duplicates (by sha256) and empty captions
  • tiny images (PNG/JPEG headers are read for the size)
  • whether a caption contains the trigger word, which it should not, because the trainer prepends it

It writes dataset.json (items, warnings and a sha256 of the whole set) and prints the warnings.

Captions describe what should stay changeable: setting, pose, clothes, light, camera, motion. They do not describe what the LoRA must learn (the face, the product's shape, the style's look). Write natural sentences for FLUX.2, Qwen and Z-Image. For video, write subject, action and camera move in one paragraph.

2. Gate: the user approves the dataset (hard)

Show the user a contact sheet (ffmpeg -pattern_type glob -i '<folder>/*.png' -vf tile=6x6,scale=1600:-1 sheet.png) plus the trigger word and the warnings. End your turn and wait. Never approve on the user's behalf.

  • When the user says yes: python scripts/dataset_check.py <folder> --approve "<their words>" writes APPROVED.json with the dataset hash.
  • If any file changes after that, the hash no longer matches and the approval is void.

3. Config and command (scripts/aitoolkit_config.py)

python scripts/aitoolkit_config.py <folder> --model flux2_klein_4b|qwen_image|wan22_14b|ltx2 --trigger tok --out train.yaml

  • It refuses to run without a valid APPROVED.json whose hash matches the current files.
  • It writes an ai-toolkit-style YAML with the preset steps, rank and learning rate, and prints the command (python run.py train.yaml inside the user's ai-toolkit checkout). It does not run the command.
  • The presets are starting points and are unverified. Check the field names against the ai-toolkit config/examples/ for the version the user has installed.
presetstepsranklrVRAM (unverified)base weights license
flux2_klein_4b2000161e-4~16–24 GBcheck the model card (unverified)
qwen_image2500161e-4~24 GB+Apache-2.0 (unverified)
wan22_14b2000321e-424–48 GBApache-2.0 (unverified)
ltx22000321e-4~32 GB INT8 (agentY notes this is uncertain)Lightricks LTX-2 license (not OSI)

Training occupies the GPU for minutes to hours. On Google Colab it spends compute units, so ask before starting and show the estimate.

4. Test

Copy the LoRA to ComfyUI/models/loras/. Render the same prompts and seed at strength 0, 0.8 and 1.0 using the base model's usual graph (for example flux3-klein-stills), then judge them with still-qa.

  • Under-trained: the trigger word does nothing.
  • Overfit: the subject appears without the trigger word, or the training backgrounds repeat. Use an earlier checkpoint or fewer steps.

Register the result in the video-director manifest's bible.cast[].lora. Note that this field is free text in log, not part of the schema.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Lora Training」では何ができますか?

Train a LoRA (character, product, style or motion) for an open-weights image or video model with ostris/ai-toolkit, behind a hard human approval gate on the dataset. Use for "train a LoRA of my product", "make a style LoRA", "teach the model this character". Nothing trains until the user approves the dataset.

TypingMindでLora Trainingを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Lora Trainingはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにLora Trainingをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/mojomast/open-higgsfield-skills/tree/main/skills/lora-trainingを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Lora Trainingを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Lora Trainingで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもLora Trainingを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Lora Training」は無料ですか?

mojomastがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇