Nodes/ComfyUI-TJ_NODE/Index LoRA Loader (TJ)
ComfyUI Node

Index LoRA Loader (TJ)

Sweep your LoRA library by number — the loader that plays well with queue loops

By designloves2·Created 4 months ago·Updated 3 days ago· 13
Index LoRA Loader (TJ)
  • model
  • clip
  • MODEL
  • CLIP
  • lora_name
  • current_index
  • total_count
index1
auto_setfalse
folder_filter(all)
overflow_modeERROR
get_name_model(none)
get_name_clip(none)
get_name_index(none)
lora_1[none]
strength_11.00
lora_2[none]
strength_21.00
lora_3[none]
strength_31.00
lora_4[none]
strength_41.00
lora_5[none]
strength_51.00
lora_6[none]
strength_61.00
lora_7[none]
strength_71.00
lora_8[none]
strength_81.00
lora_9[none]
strength_91.00
lora_10[none]
strength_101.00
lora_11[none]
strength_111.00
lora_12[none]
strength_121.00
lora_13[none]
strength_131.00
lora_14[none]
strength_141.00
lora_15[none]
strength_151.00
lora_16[none]
strength_161.00
lora_17[none]
strength_171.00
lora_18[none]
strength_181.00
lora_19[none]
strength_191.00
lora_20[none]
strength_201.00

Index LoRA Loader (TJ) lets you pick a LoRA by position number instead of by scrolling a dropdown, and that one choice makes automated sweeping possible. Connect a Queue Loop's index output to the index input and each queue iteration loads a different LoRA from your folder - LoRA #1 on pass 1, #2 on pass 2, and so on. It's the loader half of a "test every LoRA in this folder against the same prompt" workflow, which is a job ComfyUI makes surprisingly awkward with normal loaders.

How it works

The node keeps a numbered list of LoRAs from your models/loras folder (and subfolders - folder_filter narrows the list to one subfolder if you want to sweep only part of your collection). index is 1-based: 1 is the first LoRA in the active list. Because you can connect index to a loop, the selection becomes data rather than a hand-picked widget.

The list itself isn't a flat list of one - you get up to 20 lora_N + strength_N slots, so the "index" selects a combination of up to 20 LoRAs applied together. [none] slots are excluded from the active count and skipped, which is how you build a sweep of "one or two LoRAs at a time." Each slot's strength applies to both model and clip.

overflow_mode decides what happens when the index runs past the end of the list, and this is the setting that determines whether your sweep dies or loops:

  • ERROR - raise an error. Safest, but it stops the queue.
  • CLAMP - hold at the last index, so later passes just repeat the final LoRA.
  • LOOP - wrap around to the start and keep going.
  • BYPASS - stop applying LoRAs entirely; pass the raw model/clip through.

Inputs and outputs that matter

  • model, clip - what gets patched.
  • index - which combination to load (connect Queue Loop's index here).
  • folder_filter - restrict to a subfolder.
  • overflow_mode - the end-of-list policy.
  • lora_1lora_20, strength_1strength_20 - the combos being indexed.
  • Wireless: get_name_model, get_name_clip, get_name_index, auto_set.

Outputs: MODEL, CLIP (patched), plus lora_name (which one is active), current_index, and total_count - the last two are exactly what a Queue Loop needs to size itself.

Install

ComfyUI Manager → Install Custom Nodes → search TJ_NODE, or:

cd ComfyUI/custom_nodes
git clone https://github.com/designloves2/ComfyUI-TJ_NODE

Restart ComfyUI. No extra dependencies or models. Category: ✨ TJ_Node/Loaders.

The pairing you'll actually use

The pack ships a purpose-built companion, Index LoRA Loader Counter (TJ), which reports how many LoRAs are active in your loader without a graph link - wire its total_count into Queue Loop's queue_count and the sweep runs exactly as many passes as there are LoRAs. You can't do that by connecting the loader directly to the Queue Loop's count input, because that would create a circular dependency and ComfyUI refuses to run it; the Counter exists precisely to sidestep that. Set overflow_mode to CLAMP or LOOP as a belt-and-suspenders in case your index ever overshoots, and you've got a hands-off LoRA test harness.

Category ✨ TJ_Node/Loaders

Inputs (49)

NameTypeDefaultDescription
modelMODEL
clipCLIP
indexINT11–201부터 시작. 첫 번째 LoRA는 index 1.
auto_setBOOLEANfalse
folder_filterCOMBO(all)폴더를 선택하면 해당 폴더의 LoRA를 슬롯에 자동으로 채웁니다. 슬롯은 이후에도 직접 수정 가능합니다.
overflow_modeCOMBOERROR4 options: ERROR, CLAMP, LOOP, BYPASS
get_name_modelCOMBO(none)1 options: (none)
get_name_clipCOMBO(none)1 options: (none)
get_name_indexCOMBO(none)1 options: (none)
lora_1COMBO[none]슬롯 1. [none]이면 활성 목록에서 제외합니다.
strength_1FLOAT1.00-20–20슬롯 1의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_2COMBO[none]슬롯 2. [none]이면 활성 목록에서 제외합니다.
strength_2FLOAT1.00-20–20슬롯 2의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_3COMBO[none]슬롯 3. [none]이면 활성 목록에서 제외합니다.
strength_3FLOAT1.00-20–20슬롯 3의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_4COMBO[none]슬롯 4. [none]이면 활성 목록에서 제외합니다.
strength_4FLOAT1.00-20–20슬롯 4의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_5COMBO[none]슬롯 5. [none]이면 활성 목록에서 제외합니다.
strength_5FLOAT1.00-20–20슬롯 5의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_6COMBO[none]슬롯 6. [none]이면 활성 목록에서 제외합니다.
strength_6FLOAT1.00-20–20슬롯 6의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_7COMBO[none]슬롯 7. [none]이면 활성 목록에서 제외합니다.
strength_7FLOAT1.00-20–20슬롯 7의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_8COMBO[none]슬롯 8. [none]이면 활성 목록에서 제외합니다.
strength_8FLOAT1.00-20–20슬롯 8의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_9COMBO[none]슬롯 9. [none]이면 활성 목록에서 제외합니다.
strength_9FLOAT1.00-20–20슬롯 9의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_10COMBO[none]슬롯 10. [none]이면 활성 목록에서 제외합니다.
strength_10FLOAT1.00-20–20슬롯 10의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_11COMBO[none]슬롯 11. [none]이면 활성 목록에서 제외합니다.
strength_11FLOAT1.00-20–20슬롯 11의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_12COMBO[none]슬롯 12. [none]이면 활성 목록에서 제외합니다.
strength_12FLOAT1.00-20–20슬롯 12의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_13COMBO[none]슬롯 13. [none]이면 활성 목록에서 제외합니다.
strength_13FLOAT1.00-20–20슬롯 13의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_14COMBO[none]슬롯 14. [none]이면 활성 목록에서 제외합니다.
strength_14FLOAT1.00-20–20슬롯 14의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_15COMBO[none]슬롯 15. [none]이면 활성 목록에서 제외합니다.
strength_15FLOAT1.00-20–20슬롯 15의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_16COMBO[none]슬롯 16. [none]이면 활성 목록에서 제외합니다.
strength_16FLOAT1.00-20–20슬롯 16의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_17COMBO[none]슬롯 17. [none]이면 활성 목록에서 제외합니다.
strength_17FLOAT1.00-20–20슬롯 17의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_18COMBO[none]슬롯 18. [none]이면 활성 목록에서 제외합니다.
strength_18FLOAT1.00-20–20슬롯 18의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_19COMBO[none]슬롯 19. [none]이면 활성 목록에서 제외합니다.
strength_19FLOAT1.00-20–20슬롯 19의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.
lora_20COMBO[none]슬롯 20. [none]이면 활성 목록에서 제외합니다.
strength_20FLOAT1.00-20–20슬롯 20의 LoRA 강도. model/clip 양쪽에 동일하게 적용됩니다.

Outputs (5)

NameTypeDescription
MODELMODEL
CLIPCLIP
lora_nameSTRING
current_indexINT
total_countINT