Nodes/Realtime LoRA Trainer/SDXL Analyzer + Selective Loader V2
ComfyUI Node

SDXL Analyzer + Selective Loader V2

Find the block that's ruining your SDXL LoRA

By shootthesound·Created 8 months ago·Updated 2 months ago· 538
SDXL Analyzer + Selective Loader V2
  • model
  • positive
  • negative
  • model
  • positive
  • negative
  • analysis
  • analysis_json
lora_name
strength1.00
presetDefault
text_encoder_1true
text_encoder_1_str1.00
text_encoder_2true
text_encoder_2_str1.00
input_4true
input_4_str1.00
input_5true
input_5_str1.00
input_7true
input_7_str1.00
input_8true
input_8_str1.00
unet_midtrue
unet_mid_str1.00
output_0true
output_0_str1.00
output_1true
output_1_str1.00
output_2true
output_2_str1.00
output_3true
output_3_str1.00
output_4true
output_4_str1.00
output_5true
output_5_str1.00
other_weightstrue
other_weights_str1.00
lora_path_opt
schedule_presetCustom
strength_schedule
save_refined_lorafalse
save_path
save_filename

SDXL is old enough that most people stopped thinking about its LoRAs as anything other than "load it, set the strength, done." This node reopens that box. SDXL's UNet only has 13 blocks worth caring about, small enough that you can actually reason about each one - and this node scores and toggles every single one, live, from inside the loader.

What it is and why you'd reach for it

SDXL is quietly having a moment - it trains in minutes, runs on modest hardware, and the pack's own author calls it out by name as "due for a revival" in the README. Selective block loading is one of the reasons why: instead of accepting a LoRA's whole personality at strength 1.0, you can keep the composition it learned and drop the color shift it also picked up, or vice versa. This is the V2, combined-analyzer-and-loader generation of the node - one drop, no separate analyzer step.

It's one of 31 nodes in ShootTheSound/comfyUI-Realtime-Lora, a pack that also trains SDXL LoRAs directly in ComfyUI via Kohya's sd-scripts, if you want to close the loop from dataset to selectively-loaded LoRA in one workflow.

How it works

SDXL's 13 tracked blocks map to real, learnable roles, and the node's own description spells them out: text_encoder_1/text_encoder_2 are the two CLIP encoders; input_4/input_5 are mid-encoder blocks with attention; input_7/input_8 are deep encoder blocks - typically high impact, tied to composition; unet_mid is the bottleneck; output_0 is the primary decoder block, also high-impact for composition; output_1 is the one the pack's author flags as strongest for style and color; output_2 through output_5 taper off in impact as you move later in the decoder. Each block gets scored 0-100% by weight magnitude, and the checkboxes color themselves accordingly once you've got an analysis connected - blue for low impact, red for the blocks doing the heavy lifting.

There's also an other_weights slider for anything a LoKR- or LoHa-format LoRA (both supported, and detected automatically) puts outside those 13 named blocks.

Inputs and outputs that matter

  • model / positive / negative - the pipeline this patches.
  • lora_name, strength - pick and global weight.
  • preset - jump straight to useful groupings: Style Focus, Composition Focus, Face Focus, Text Encoders Only, UNet Only, Half Strength, or Custom once you're hand-tuning.
  • text_encoder_1, text_encoder_2, input_4, input_5, input_7, input_8, unet_mid, output_0 through output_5, plus other_weights - each a toggle with its own -5 to 5 strength slider.
  • strength_schedule (optional) - step:strength pairs to fade the LoRA's influence across the run, with 40+ named presets so you rarely need to hand-write one.
  • save_refined_lora (optional) - export your block combination as a standalone .safetensors LoRA.
  • Outputs: model, positive, negative (patched, wire to your sampler), analysis (text summary), analysis_json (for chaining to another selective loader's impact coloring).

Installing it

Search "Realtime LoRA Trainer" in ComfyUI Manager, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ShootTheSound/comfyUI-Realtime-Lora

Restart ComfyUI. No extra install for this node specifically - analyzers and selective loaders in this pack work out of the box. Training backends are only needed if you're using the pack's trainer nodes.

Troubleshooting

lora_name shows nothing. The dropdown only lists LoRAs ComfyUI can already see in your loras folder. Trained one with this pack's own SDXL trainer? Wire its lora_path output into the lora_path_opt string input instead - the dropdown gets ignored when that's connected, on purpose.

Turning off output_1 (the "style" block) barely changed anything. Not every LoRA distributes its style signal the same way - that block guide is a strong prior from typical SDXL LoRA behavior, not a hard rule for every checkpoint someone trained. Trust the analysis's actual per-block scores over the general block guide when they disagree; a LoRA trained with unusual settings can put style weight somewhere atypical.

A LoKR or LoHa LoRA scores oddly across the 13 blocks. These decomposed formats don't map onto attention layers as cleanly as a plain LoRA, which is exactly why the other_weights catch-all exists - check it before concluding a block is "unused."

Categoryloaders/lora

Inputs (40)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONINGPositive conditioning from CLIP encode
negativeCONDITIONINGNegative conditioning from CLIP encode
lora_nameCOMBOLoRA file to load and analyze
strengthFLOAT1.00-10–10Overall LoRA strength (ignored when using schedule)
presetCOMBODefaultQuick preset selection. Individual toggles below override when changed.
text_encoder_1BOOLEANtrue
text_encoder_1_strFLOAT1.00-5–5
text_encoder_2BOOLEANtrue
text_encoder_2_strFLOAT1.00-5–5
input_4BOOLEANtrue
input_4_strFLOAT1.00-5–5
input_5BOOLEANtrue
input_5_strFLOAT1.00-5–5
input_7BOOLEANtrue
input_7_strFLOAT1.00-5–5
input_8BOOLEANtrue
input_8_strFLOAT1.00-5–5
unet_midBOOLEANtrue
unet_mid_strFLOAT1.00-5–5
output_0BOOLEANtrue
output_0_strFLOAT1.00-5–5
output_1BOOLEANtrue
output_1_strFLOAT1.00-5–5
output_2BOOLEANtrue
output_2_strFLOAT1.00-5–5
output_3BOOLEANtrue
output_3_strFLOAT1.00-5–5
output_4BOOLEANtrue
output_4_strFLOAT1.00-5–5
output_5BOOLEANtrue
output_5_strFLOAT1.00-5–5
other_weightsBOOLEANtrue
other_weights_strFLOAT1.00-5–5
lora_path_optoptSTRINGOptional: Override LoRA selection with a path
schedule_presetoptCOMBOCustomSelect a preset schedule (populates the text field below for editing)
strength_scheduleoptSTRINGStrength schedule: 0:.2,.5:.8,1:1.0 (step:strength pairs). Edit freely after selecting preset.
save_refined_loraoptBOOLEANfalseEnable to save the refined LoRA to disk
save_pathoptSTRINGDirectory to save refined LoRA
save_filenameoptSTRINGFilename for saved LoRA (timestamp auto-appended). Leave empty for auto-name.

Outputs (5)

NameTypeDescription
modelMODELModel with LoRA applied (filtered by enabled blocks).
positiveCONDITIONINGPositive conditioning (with hooks if using schedule).
negativeCONDITIONINGNegative conditioning (with hooks if using schedule).
analysisSTRINGPer-block analysis showing impact scores.
analysis_jsonSTRINGJSON analysis data for UI coloring.