Image Generation AI with ComfyUI: LoRA Edition

2 min read
Modified
Progress 3 / 15
Table of Contents

I introduced mechanism of LoRA in article here (↓).

【Stable Diffusion】ComfyUIを使って画像生成AIで遊んでみよう【LoRA編】

>-

blog.otama-playground.com

Since I learned mechanism, this time I will introduce method to actually use LoRA using ComfyUI. Furthermore, verify its effect through generation results, and compare differences in generation results.

Note: I will not introduce learning this time

Work Flow

1. Introduction of ComfyUI

Please refer to following article for introduction method of ComfyUI

【Stable Diffusion】ComfyUIを使って画像生成AIで遊んでみよう【導入編】

>-

blog.otama-playground.com

2. Create Workflow

For operation understanding, I will mess with default workflow.

  1. Initialize workflow from “Load Default”
    Initial Workflow
    Initial Workflow
  2. Add “Load LoRA” node
    Add "Load LoRA" node
    Add "Load LoRA" node
Final Workflow
Final Workflow

3. Download LoRA you want to use

Place favorite LoRA in ComfyUI/models/loras

Mask_Lora - v1.3 | Other LoRA | Civitai

Girl with a mask / 面具少女 I run this lora with breakdomain_M2000 and GhostMix 、hires.fix and vae is kl-f8-anime2.ckpt

civitai.com

4. Generate

Select Model and LoRA then generate

What are strength_model and strength_clip settable in “Load LoRA” node?

Frequently Asked Questions

Examples of ComfyUI workflows

comfyanonymous.github.io

You can adjust LoRA strength individually for CLIP model (strength_clip) and main model (strength_model). In normal UI, LoRA strength is controlled by single number, but in ComfyUI, since learning concepts of CLIP and MODEL/UNET parts are different, adjusting each individually yields better images. For example, if setting strength to 0.8, both strengths are set to 0.8.

Generation Result

Generation Result 1
Generation Result 1
Generation Result 2
Generation Result 2

In case using multiple LoRAs

Connect in series as shown in figure

In case using multiple LoRAs
In case using multiple LoRAs

If connecting Pixel Art LoRA plus previous LoRA, output becomes like following.

Masked Woman LoRA + Pixel Art LoRA
Masked Woman LoRA + Pixel Art LoRA

Conclusion

Looking at output, it seems to be relatively consistent output.

I wanted to try up to learning, but gave up as ComfyUI doesn’t support it. Since I heard Kohya is good for learning, I will try from introduction next time if I feel like it.

If you want to try other techniques related to image generation, please utilize the link collection below.

Stable Diffusionガイド:画像生成に役立つリンク集

>-

blog.otama-playground.com