ComfyUIでFlux.1モデルにLoRAを適用する方法|手順と生成結果の紹介

5分で読了
更新日

この記事ではComfyUIでFlux.1モデルのLoRAを使用する方法を解説します。

前回の記事

新モデル「Flux.1」の実力をComfyUIで検証:導入手順と実際の生成結果を紹介

>-

blog.otama-playground.com

LoRAとは

LoRAの概要については以下の記事を参照ください。

LoRA(Low-Rank Adaptation)とは?大規模モデルを低コストでファインチューニングする手法とメリット

>-

blog.otama-playground.com

基本的には同じようなものなので、Flux.1モデルのどこかにLoRA用の次元を足してそこだけ学習する形をとっていると思われます。

ComfyUIでFlux.1モデルのLoRAを使用する手順

Flux.1の導入までは以下の記事と同じなのでそちらを読んでください。

新モデル「Flux.1」の実力をComfyUIで検証:導入手順と実際の生成結果を紹介

>-

blog.otama-playground.com

1. LoRAのダウンロード

ウェブから探してきます。

XLabs-AI/flux-lora-collection at main

We’re on a journey to advance and democratize artificial intelligence through open source and open science.

huggingface.co

2. ワークフローの拡張

LoraLoaderModelOnlyノードを追加して、Load CheckPointとKSamplerの間につなげます。

ノードのつなげ方
ノードのつなげ方

3. 生成する

モデルを選択して生成します。

生成結果

Anime LoRA

animeをプロンプトに含める

An anime style portrait of a woman with long, flowing hair tied in a ponytail. She is wearing a cozy sweater, looking slightly to the side with her mouth wide open in a big, joyful laugh. A speech bubble is placed near her mouth, with the text ‘It worked with FP8!!’ in a playful and excited font.

Anime LoRA
Anime LoRA

Realism LoRA

A realistic photo of a woman with long, flowing hair tied in a ponytail. She is wearing a cozy sweater, looking slightly to the side with her mouth wide open in a big, joyful laugh. A speech bubble is placed near her mouth, with the text ‘It worked with FP8!!’ in a playful and excited font.

womanにすると皺深くなりがち

Realism LoRA
Realism LoRA

Disney LoRA

disney styleをプロンプトに含める

A disney style image of a woman with long, flowing hair tied in a ponytail. She is wearing a cozy sweater, looking slightly to the side with her mouth wide open in a big, joyful laugh. A speech bubble is placed near her mouth, with the text ‘It worked with FP8!!’ in a playful and excited font.

文字生成は失敗してるが画風はそれっぽいので良し

Disney LoRA
Disney LoRA

最後に

今回の記事ではFlux.1のLoRAを試してみました。fp8のモデルで試しましたが、ちゃんと動作してそうで良かったです。

実はFlux.1用のControlNetも公開されているのですが、構造的におそらくスペックが足りないのでやめておきます(StableDiffusionと同様であればDiTが2つ並列につながる構造)。

試してみたい!自分の環境ならいける!って方は↓のリンク先にあるインストラクションを見ながら頑張ってみてください。

XLabs-AI/flux-controlnet-collections · Hugging Face

We’re on a journey to advance and democratize artificial intelligence through open source and open science.

huggingface.co