SDXL Analyzer + Selective Loader V2
Find the block that's ruining your SDXL LoRA
- model
- positive
- negative
- model
- positive
- negative
- analysis
- analysis_json
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:strengthpairs 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
.safetensorsLoRA. - 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."
Inputs (40)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| positive | CONDITIONING | Positive conditioning from CLIP encode | |
| negative | CONDITIONING | Negative conditioning from CLIP encode | |
| lora_name | COMBO | LoRA file to load and analyze | |
| strength | FLOAT | 1.00-10–10 | Overall LoRA strength (ignored when using schedule) |
| preset | COMBO | Default | Quick preset selection. Individual toggles below override when changed. |
| text_encoder_1 | BOOLEAN | true | — |
| text_encoder_1_str | FLOAT | 1.00-5–5 | — |
| text_encoder_2 | BOOLEAN | true | — |
| text_encoder_2_str | FLOAT | 1.00-5–5 | — |
| input_4 | BOOLEAN | true | — |
| input_4_str | FLOAT | 1.00-5–5 | — |
| input_5 | BOOLEAN | true | — |
| input_5_str | FLOAT | 1.00-5–5 | — |
| input_7 | BOOLEAN | true | — |
| input_7_str | FLOAT | 1.00-5–5 | — |
| input_8 | BOOLEAN | true | — |
| input_8_str | FLOAT | 1.00-5–5 | — |
| unet_mid | BOOLEAN | true | — |
| unet_mid_str | FLOAT | 1.00-5–5 | — |
| output_0 | BOOLEAN | true | — |
| output_0_str | FLOAT | 1.00-5–5 | — |
| output_1 | BOOLEAN | true | — |
| output_1_str | FLOAT | 1.00-5–5 | — |
| output_2 | BOOLEAN | true | — |
| output_2_str | FLOAT | 1.00-5–5 | — |
| output_3 | BOOLEAN | true | — |
| output_3_str | FLOAT | 1.00-5–5 | — |
| output_4 | BOOLEAN | true | — |
| output_4_str | FLOAT | 1.00-5–5 | — |
| output_5 | BOOLEAN | true | — |
| output_5_str | FLOAT | 1.00-5–5 | — |
| other_weights | BOOLEAN | true | — |
| other_weights_str | FLOAT | 1.00-5–5 | — |
| lora_path_optopt | STRING | Optional: Override LoRA selection with a path | |
| schedule_presetopt | COMBO | Custom | Select a preset schedule (populates the text field below for editing) |
| strength_scheduleopt | STRING | Strength schedule: 0:.2,.5:.8,1:1.0 (step:strength pairs). Edit freely after selecting preset. | |
| save_refined_loraopt | BOOLEAN | false | Enable to save the refined LoRA to disk |
| save_pathopt | STRING | Directory to save refined LoRA | |
| save_filenameopt | STRING | Filename for saved LoRA (timestamp auto-appended). Leave empty for auto-name. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| model | MODEL | Model with LoRA applied (filtered by enabled blocks). |
| positive | CONDITIONING | Positive conditioning (with hooks if using schedule). |
| negative | CONDITIONING | Negative conditioning (with hooks if using schedule). |
| analysis | STRING | Per-block analysis showing impact scores. |
| analysis_json | STRING | JSON analysis data for UI coloring. |