LoRA Rank Reader
What rank is that LoRA, actually?
- info
LoRA rank (r) is the bottleneck dimension the training squeezed through - higher rank means more capacity, and it's the main reason one LoRA file is 60 MB and another is 300 MB. But the model card doesn't always tell you the rank, and the file name rarely does. TK3R LoRA Rank Reader just reads the file and tells you. Select a LoRA from the dropdown, and the node prints its rank, its network alpha, and how many LoRA layers it contains.
It's the kind of utility you don't need often, and then suddenly you need it three times in an hour - checking whether a "fast" LoRA is rank 4 or rank 64, or trying to understand why a LoRA behaves more aggressively than its file size suggested. It also prints the info to the console and, because it's an output node, shows it in the node's widget.
How it works
It opens the safetensors file with safe_open and scans the keys for the first lora_A or lora_down matrix - those are the low-rank factor matrices, and their shape is (rank, hidden_dim). Rank is the first (bottleneck) dimension of that shape. It also reads ss_network_alpha from the file's metadata when present and counts the total number of LoRA layers. No model loading, no VRAM, no network calls - it just reads tensor metadata off disk, so it's instant.
Input and output
One input, one output:
- lora_name - a dropdown populated from your
ComfyUI/models/lorasfolder. Pick the LoRA. - info - a STRING with the file name, rank, sample tensor key and shape, alpha (if present), and total layer count.
Installing
Part of the TK3R Extensions pack:
- ComfyUI Manager → search "TK3R Extensions" → Install, then restart.
- Or
cd ComfyUI/custom_nodes && git clone https://github.com/TK3R/ComfyUI_TK3R_Extand restart.
The safetensors library it uses is already part of ComfyUI, so there's nothing extra to install.
The context that makes the number useful
Rank is only half the story, and it's worth remembering the other half. The LoRA applies alpha / rank scaling, so a rank-128 LoRA with a low alpha can behave like a much smaller one - which is exactly why the node reporting alpha too is a feature, not trivia. And don't assume the rank alone predicts quality: modern post-Flux adapters often ship as LoKRs, and "rank" in the classic sense maps differently onto those. The reader handles the classic kohya-style lora_A/lora_down layout, which covers the overwhelming majority of files on CivitAI. If you feed it a file with a totally different naming scheme and it reports "could not find LoRA weight matrices," that's the file being unusual, not the node being broken - and knowing that is also information.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| lora_name | COMBO | The name of the LoRA. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| info | STRING | — |