Mastering LoRA Testing in ComfyUI with XYZ Plot

In a previous post, Training Face LoRA, I detailed the use of XYZplot in A1111 to examine a batch of trained LoRA.

While XYZplot in A1111 proved quite resourceful, its processing speed in handling a large number of images was notably slower than ComfyUI, often exceeding half an hour.

This article aims to guide you through the faster, more efficient process of using XYZplot within ComfyUI for LoRA testing, a method that simplifies the workflow to just four nodes.

comfyui lora plot workflow

Let’s dive in!

For those who love diving into Stable Diffusion with video content, you’re invited to check out the engaging video tutorial that complements this article:

Step 1: Setting Up the Efficiency Loader and KSampler

Begin by launching the ComfyUI interface. To access the search node toolbar, double-click using the left mouse button. Type “efficient” into the search box to locate and select the “Efficient Loader” node.

comfyui 1
comfyui 2

If this node is unfamiliar to you, feel free to revisit my prior discussion on its functionality in How to Use LoRA in ComfyUI.

Next, we need to integrate a KSampler for image generation. Reopen the search bar, enter “efficient” again, and select the KSampler node tagged as “Efficient.”

comfyui 3

This node is specifically tailored to function alongside the Efficiency Loader. Once connected, your basic setup is complete.

comfyui 4

Step 2: Selecting a Model and Generating a Test Image

Now, it’s time to select an appropriate checkpoint and enter the required prompts. Generate a test image in ComfyUI , ensuring it displays correctly.

comfyui 5

Step 3: Accessing and Configuring XYZplot

Adjust the placement of the Efficiency Loader and KSampler nodes to allow space for subsequent nodes. Locate the “script” input port on the KSampler node. Click and drag this port to select the “XY Plot” option that appears.

comfyui 6

Connect the “dependencies” input of this plot to the Efficiency Loader’s corresponding output.

comfyui 7

Configure the axes of the XY plot by clicking and dragging its input. For the X-axis, type “lora” into the search box, select the displayed LoRA plot.

comfyui 8

And set the number of LoRAs to test (e.g., 10 versions). For the Y-axis, input a weight range (e.g., from 0.6 to 1 across five points), starting at 0.6 and ending at 1. Ensure you also connect the output of the Y-axis.

comfyui 9

Step 4: Generating and Saving XYZplot

After finalizing the settings, generate the plot and review the results.

comfyui 8

By right-clicking on the KSampler node and selecting “Open Image,” you can view the 10 LoRAs displayed along the X-axis and the range of weights from 0.6 to 1 along the Y-axis.

lora plot by comfyui

If you wish to save the image, simply right-click on it and choose “Save Image As.”

Additionally, return to the ComfyUI settings to confirm that the “ksampler_output_image” parameter is appropriately configured in the plot.

comfyui 10

Then, drag a “save image” node onto the image output of the KSampler node and run ComfyUI again. This allows the XYplot to be saved to the ComfyUI output directory for easy access and utilization.

comfyui 11

This concludes our guide on utilizing XYZplot for testing LoRA in ComfyUI. I hope you find this tutorial beneficial as you navigate the intricacies of LoRA testing with enhanced efficiency and precision. Happy testing!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *