Model folders: one canonical name per model type, so users don't need the same multi-GB weights under several paths

Open
#18,119 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
ai, backend

Research direction

Start by reading the existing folder_paths implementation and the model path lookups described in the issue. The proposal spans canonical aliases, registry guidance, content hash lookup and duplicate cleanup tooling, so first determine which part has an agreed scope. Done would mean a defined approach that preserves compatibility across node packs and avoids duplicate downloads; the issue does not name files or tests.

Written by the indexing model from the issue text.

Description

Problem

There is no single registry of model folder names, so each custom node pack picks its own folder (or its own
file name) for the same model. To keep every pack working, users need the same weights under several paths.
On one real install (~1 TB models/) these byte-identical files are required in several places:

Model Paths needed Why
sam_vit_h_4b8939.pth (2.4 GB) models/sams/sam_vit_h_4b8939.pth, models/sam/sam_vit_h.pth Impact Pack, ReActor, Art Venture and Easy-Use read sams; comfyui-rmbg reads sam under a different file name and re-downloads if that name is missing
sam_vit_l_0b3195.pth (1.2 GB) models/sams/..., models/sam/sam_vit_l.pth same
model_base_capfilt_large.pth (2.0 GB) models/blip/, models/blip/checkpoints/ different BLIP loader / cache layouts
ip-adapter.bin (InstantID, 1.6 GB) models/InstantId/, models/InstantId/checkpoints/ HF repo layout vs. flat layout
Florence-2-large-ft pytorch_model.bin (1.4 GB) models/florence2/large-ft/, models/LLM/Florence-2-large-ft/ different Florence-2 node packs

That is about 8.5 GB that would be stored twice. On this install the duplicates had been replaced by NTFS
hard links by hand, which most users won't know how to do. Casing also differs (LLM vs. llm, InstantId
vs. instantid), which only works because Windows is case-insensitive.

Users can't safely clean this up themselves: deleting a "duplicate" silently breaks the node pack that hard-codes
the other path, or triggers a multi-GB re-download.

Proposal
  1. Canonical folder names in core: folder_paths registers well-known types (sams, blip, instantid,
    llm, florence2, ...) with aliases (sam -> sams, LLM -> llm), so a node that asks for an alias gets the
    canonical folder list.
  2. Registry guidance: the node registry / docs list these names, and new node packs are asked to use
    folder_paths.get_full_path() instead of os.path.join(models_dir, "...").
  3. Lookup by content, not name: before downloading, a node (or a core helper such as
    folder_paths.find_model(sha256=...)) checks for an existing file with the same hash anywhere under
    models/, and reuses it (or hard-links it) instead of downloading a renamed copy.
  4. Manager: ComfyUI-Manager could offer a "find duplicate models" view that replaces identical copies with
    hard links (same volume, no admin rights needed on Windows), so existing installs can be cleaned without
    breaking any pack.
Dominant language
Python
Stars
150k
Forks
17.9k
Avg merge
1d 1h
Merged PRs (30d)
181

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Comfy-Org/ComfyUI

All issues in Comfy-Org/ComfyUI

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.