FLUX Klein 4B Analyzer + Selective Loader V2
Pick which of Klein's 25 blocks a LoRA actually uses
- model
- positive
- negative
- model
- positive
- negative
- analysis
- analysis_json
Klein 4B is the little Flux 2 model everyone underrates - Apache 2.0, runs in under 9GB, does text-to-image and editing in one checkpoint. It also has 25 transformer blocks, and a LoRA trained on it doesn't spread evenly across them. This node analyzes exactly where the weight went, then lets you dial each block up, down, or off.
What it is and why you'd reach for it
Klein 4B's DiT splits into 5 "double" blocks (where image and text streams are processed separately) and 20 "single" blocks (where they're concatenated and actually interact). This is a combined analyzer-and-loader - the V2 generation of this pack's node line - so you get a live impact score per block plus the toggles to act on it, in one node, instead of wiring an analyzer into a separate selective loader.
It comes from ShootTheSound/comfyUI-Realtime-Lora, a 31-node suite that also trains LoRAs for Klein via Musubi Tuner and ships a much deeper sub-component debiaser for the same architecture (worth knowing about if block-level control isn't fine-grained enough - see the DIT Deep Debiaser article for that).
How it works
The node loads the LoRA's tensors, buckets them by which of the 25 blocks they patch, and scores each 0-100% on weight magnitude - high score means the LoRA learned a lot there, which usually correlates with "this is where your character's face or your style lives." Double blocks tend to carry more of the composition-level signal since they're where each modality is still being shaped independently; single blocks are where cross-modal interaction happens, which the pack's own architecture notes on the deeper debiaser describe as "where the model overwrites your image" when it goes wrong. Same intuition applies here at coarser granularity.
There's also an other_weights toggle for anything the LoRA touches outside those 25 numbered blocks - don't skip it. LoKR and LoHa formats (common for newer architectures, and explicitly supported here) sometimes concentrate meaningful weight in exactly that bucket.
Inputs and outputs that matter
- model / positive / negative - the pipeline this patches; positive/negative get touched too because V2's strength-scheduling hooks route through conditioning.
- lora_name, strength - the usual pick-and-weight.
- preset - quick groupings (Double Only, Single Only, High Impact Double 2-4, Late Singles 10-19) so you're not clicking 25 checkboxes from scratch.
- double_0 through double_4, single_0 through single_19 - each a toggle plus a -5 to 5 strength slider.
- strength_schedule (optional) -
step:strengthpairs (0:0,1:1fades in) for varying the LoRA's influence across the sampling steps, with 40+ built-in presets. - save_refined_lora (optional) - bake whatever block combination you settled on into a new
.safetensorsfile so you're not re-clicking toggles every session. - Outputs: model, positive, negative (patched, feed to your sampler), analysis (text report), analysis_json (for chaining into another selective loader's impact-coloring).
Installing it
ComfyUI Manager: search "Realtime LoRA Trainer." Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/ShootTheSound/comfyUI-Realtime-Lora
Restart ComfyUI. This node runs out of the box - no training backend, no separate model download. That requirement is only for the pack's trainer nodes, and even then only if you're training, not loading.
Troubleshooting
The lora_name list is empty. It only shows LoRAs already in your loras folder. If you just trained one with this pack's own Klein trainer, feed its lora_path output straight into the lora_path_opt string input instead - the dropdown selection is ignored whenever that's connected, which is deliberate: it's the intended train-then-selectively-load path.
4B and 9B LoRAs behave differently, and this node is 4B-specific. Klein's 4B and 9B checkpoints don't share LoRAs - a LoRA trained on one won't map cleanly onto the other's block layout even if you force it through this loader. Match the analyzer variant to the model size you're actually running.
Killing "low impact" blocks lost the effect entirely. Klein's single blocks are where text and image tokens actually talk to each other; zeroing too many of them removes the mechanism the LoRA needs to apply its style, not just the noise. Disable a couple of the lowest scorers first, check the result, and go from there rather than aggressively pruning on the first pass.
Inputs (64)
| 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. |
| double_0 | BOOLEAN | true | — |
| double_0_str | FLOAT | 1.00-5–5 | — |
| double_1 | BOOLEAN | true | — |
| double_1_str | FLOAT | 1.00-5–5 | — |
| double_2 | BOOLEAN | true | — |
| double_2_str | FLOAT | 1.00-5–5 | — |
| double_3 | BOOLEAN | true | — |
| double_3_str | FLOAT | 1.00-5–5 | — |
| double_4 | BOOLEAN | true | — |
| double_4_str | FLOAT | 1.00-5–5 | — |
| single_0 | BOOLEAN | true | — |
| single_0_str | FLOAT | 1.00-5–5 | — |
| single_1 | BOOLEAN | true | — |
| single_1_str | FLOAT | 1.00-5–5 | — |
| single_2 | BOOLEAN | true | — |
| single_2_str | FLOAT | 1.00-5–5 | — |
| single_3 | BOOLEAN | true | — |
| single_3_str | FLOAT | 1.00-5–5 | — |
| single_4 | BOOLEAN | true | — |
| single_4_str | FLOAT | 1.00-5–5 | — |
| single_5 | BOOLEAN | true | — |
| single_5_str | FLOAT | 1.00-5–5 | — |
| single_6 | BOOLEAN | true | — |
| single_6_str | FLOAT | 1.00-5–5 | — |
| single_7 | BOOLEAN | true | — |
| single_7_str | FLOAT | 1.00-5–5 | — |
| single_8 | BOOLEAN | true | — |
| single_8_str | FLOAT | 1.00-5–5 | — |
| single_9 | BOOLEAN | true | — |
| single_9_str | FLOAT | 1.00-5–5 | — |
| single_10 | BOOLEAN | true | — |
| single_10_str | FLOAT | 1.00-5–5 | — |
| single_11 | BOOLEAN | true | — |
| single_11_str | FLOAT | 1.00-5–5 | — |
| single_12 | BOOLEAN | true | — |
| single_12_str | FLOAT | 1.00-5–5 | — |
| single_13 | BOOLEAN | true | — |
| single_13_str | FLOAT | 1.00-5–5 | — |
| single_14 | BOOLEAN | true | — |
| single_14_str | FLOAT | 1.00-5–5 | — |
| single_15 | BOOLEAN | true | — |
| single_15_str | FLOAT | 1.00-5–5 | — |
| single_16 | BOOLEAN | true | — |
| single_16_str | FLOAT | 1.00-5–5 | — |
| single_17 | BOOLEAN | true | — |
| single_17_str | FLOAT | 1.00-5–5 | — |
| single_18 | BOOLEAN | true | — |
| single_18_str | FLOAT | 1.00-5–5 | — |
| single_19 | BOOLEAN | true | — |
| single_19_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. |