Nodes/LoRA Power-Merger ComfyUI/PM LoRA Parameter Sweep Sampler
ComfyUI Node

PM LoRA Parameter Sweep Sampler

Sweep merge parameters visually instead of guessing — the merge dial-testing node

By larsupb·Created 2 years ago·Updated 29 days ago· 75
PM LoRA Parameter Sweep Sampler
  • vae
  • noise
  • guider
  • sampler
  • sigmas
  • latent_image
  • merge_context
  • latents
  • image_grid
parameter_namet
parameter_values0.25 - 0.75 | 3
parameter_name_2
parameter_values_2

Every merge method has knobs - SLERP's t, TIES and DARE's density, the normalize toggles - and the standard way to tune them is to change a value, sample, look, repeat, for an hour. This node collapses that loop: it takes the merge context from PM LoRA Merger, re-runs the merge across a range of one or two parameter values, and samples an annotated grid so you can see the whole sweep at once.

It's the tool that turns merge tuning from a chore into a ten-second glance. The author originally shipped XY-plot components with the pack (that was the headline feature in the 2024 launch post), and this is the modern, more general version of the same idea.

How it works

Instead of feeding it a merged LoRA, you feed it the merge_context output from the merger - the reusable merge configuration. For each parameter value it re-runs the merge, samples, and labels the image with the parameter name and value. The parameter value format is flexible:

  • Linspace: "0.25 - 0.75 | 3" → three evenly spaced points
  • Step: "0.25 - 0.75 : 0.25" → increments
  • Explicit: "0.25, 0.5, 0.75" → exact list
  • Boolean: a boolean parameter auto-expands to [False, True] and ignores the values field

With parameter_name_2 and parameter_values_2 filled in you get a 2D sweep - density by rank, say - arranged as a rows-by-columns grid. There's a hard cap of 64 images to keep you from launching a compute disaster.

The inputs that matter

  • merge_context - from PM LoRA Merger. This is what makes the whole thing work; wire it in instead of the LoRA output.
  • parameter_name and parameter_values - what to sweep and over which values.
  • parameter_name_2 and parameter_values_2 - optional second dimension (leave blank for 1D).
  • Plus the standard noise, guider, sampler, sigmas, latent_image, and vae rig.

Outputs: latents and the annotated image_grid.

Installing

Ships in the LoRA Power-Merger pack. ComfyUI Manager (search "LoRA Power-Merger") or:

cd ComfyUI/custom_nodes
git clone https://github.com/larsupb/LoRA-Merger-ComfyUI
cd LoRA-Merger-ComfyUI
pip install -r requirements.txt

Restart ComfyUI. Dependencies: PyTorch, lxml, mergekit.

Common issues

The parameter name must match the merge method's actual setting - try to sweep "density" on SLERP and you'll get an error listing the valid parameters, which is at least a helpful failure. A 2D sweep multiplies fast: 3×3 is fine, but keep the 64-image cap in mind when designing your grid. And remember the sampler is doing a full merge plus sample per point, so a big sweep is a long queue - the progress bar (fixed to span all iterations in 2.3.0) is your friend.

CategoryLoRA PowerMerge/sampling

Inputs (11)

NameTypeDefaultDescription
vaeVAE
noiseNOISE
guiderGUIDER
samplerSAMPLER
sigmasSIGMAS
latent_imageLATENT
merge_contextMergeContextMerge configuration from LoRA Merger (Mergekit) node
parameter_nameSTRINGtName of the parameter to sweep (e.g., 't' for SLERP, 'density' for TIES)
parameter_valuesSTRING0.25 - 0.75 | 3Parameter values to test. Formats: '0.25 - 0.75 | 3' (linspace), '0.25 - 0.75 : 0.25' (step), '0.25, 0.5, 0.75' (explicit). Ignored for boolean parameters (auto uses [False, True]).
parameter_name_2STRINGOptional second parameter name for 2D sweep (leave empty for single parameter)
parameter_values_2STRINGSecond parameter values (same formats as parameter_values). Ignored for boolean parameters.

Outputs (2)

NameTypeDescription
latentsLATENT
image_gridIMAGE