Nodes/comfyui-case-insensitive-dropdowns/Alphabetical Sort πŸ”€
ComfyUI Node

Alphabetical Sort πŸ”€

Your ComfyUI dropdowns finally sort A→Z, case-insensitively — and the node does literally nothing

By siw6819Β·Created 5 months agoΒ·Updated 5 months agoΒ· 0
Alphabetical Sort πŸ”€

      ComfyUI sorts its dropdowns like a database with a case-sensitivity fetish: every model, LoRA, and sampler list comes out in a pile where apple, Banana, and cherry are "ordered" as Banana, apple, cherry. Once you've got a few hundred LoRAs, hunting through that mess for mythosV2 while Zephyr hovers above aether is the kind of small, daily annoyance that adds up. This pack fixes it: Alphabetical Sort πŸ”€ makes every combo dropdown in ComfyUI sort Aβ†’Z, ignoring case, with no fiddling and no Python dependencies.

      Here's the thing you need to understand immediately, because it's the whole pack: the node you add to the canvas does nothing. It's a decoy - a marker. The actual sorting is a JavaScript extension that runs globally the moment the pack is installed, whether or not you ever place the node. The "Alphabetical Sort" node exists purely so a saved workflow can show that the extension is active, the way a comment in code documents a global behavior. Don't expect inputs or outputs - there are none. Its info_schema is empty on both sides, and it's flagged as an output node so the scheduler won't prune it as "unused."

      How it actually works

      ComfyUI auto-loads every .js file in a custom node's js/ folder into the browser. That's the whole trick - no backend changes, no model files, no requirements.txt. The extension hooks three official ComfyUI frontend hooks:

      • beforeRegisterNodeDef - sorts the raw combo value lists before any widget is built, the earliest and cleanest interception point.
      • nodeCreated - re-sorts widgets on any node instance after creation, catching dynamic or runtime values.
      • afterConfigureGraph - re-sorts everything when a workflow finishes loading. Belt and suspenders.

      The sort uses JavaScript's localeCompare with sensitivity: "base", which is genuinely case-insensitive and accent-aware, and it skips non-string combos (numeric lists, edge-case widgets). It also preserves your current selection after re-sorting, and deliberately leaves values alone if they're missing - so a workflow referencing a LoRA you don't have still highlights it as missing, just like stock ComfyUI.

      One more clever bit: it wraps window.fetch to intercept rgthree's Power Lora Loader, which pulls its LoRA list from the backend at runtime instead of using a standard combo widget. If you're an rgthree user - and a huge chunk of the ecosystem is, per how often it shows up next to Manager in "what should I install" threads - your Power Lora Loader picker gets sorted too.

      Installing it

      Either route works:

      cd ComfyUI/custom_nodes
      git clone https://github.com/siw6819/comfyui-case-insensitive-dropdowns
      

      or search "comfyui-case-insensitive-dropdowns" in ComfyUI Manager. Then restart the server (Python has to scan the new __init__.py) and hard-refresh the browser (Ctrl+Shift+R / Cmd+Shift+R) to clear cached JS. That restart-then-refresh combo trips everyone up, because a browser refresh alone won't load the new extension.

      Troubleshooting

      • No "Alphabetical Sort" in the menu? You restarted your browser, not the server. Full server restart required.
      • Dropdowns still case-sensitive? Hard-refresh, then check the console for [AlphabeticalSort] Combo dropdowns will sort case-insensitively. - that line confirms the extension loaded.
      • Some dropdowns still unsorted? A handful of nodes build combo widgets in unusual ways or use non-string values. Known edge case, not a bug in your setup.

      One honest caveat: this is a frontend-only change. If you run ComfyUI headless or through the API, it does nothing - and given the pack's tiny footprint on Reddit, treat it as a quiet utility, not a solved-with-authority ecosystem standard. But for a daily driver, a few minutes of setup to never alphabet-hunt a 400-entry LoRA list again is a solid trade.

      Categoryutils

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs