From 516660bbb112fd15142dafe48f8eccdf0e602807 Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Fri, 18 Sep 2026 16:23:43 +0300 Subject: [PATCH] fix: hide the raw-filename duplicate of a Media Bin reference in widget pickers A reference's file lives in ComfyUI's own input folder (so the node can load it), which means it was also showing up a second time in the combo's plain choice list under its on-disk name (funpack_movie_.mp4) -- indistinguishable from any other reference, right next to the friendly "R1 - name" entry for the same file. Drop the raw duplicate; the friendly one is always the better pick. Co-Authored-By: Claude Sonnet 5 --- movie_editor/frontend/models.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/movie_editor/frontend/models.js b/movie_editor/frontend/models.js index 5079a5f7..6ab5c4c9 100644 --- a/movie_editor/frontend/models.js +++ b/movie_editor/frontend/models.js @@ -609,7 +609,7 @@ const m = bin.find((x) => x.id === id); if (!m || (m.kind || "image") !== refKind) return; const n = window.References.referenceNumber(marks, bin, id); - out.push({ value: `ref:${id}`, label: `R${n} · ${m.name}` }); + out.push({ value: `ref:${id}`, label: `R${n} · ${m.name}`, filename: m.filename }); }); return out; } @@ -627,7 +627,16 @@ refOpts.forEach((o) => { const opt = el("option", null, o.label); opt.value = o.value; if (o.value === value) opt.selected = true; og.append(opt); }); ctrl.append(og); } - (spec.choices || []).forEach((c) => { const o = el("option", null, String(c)); o.value = c; if (c === value) o.selected = true; ctrl.append(o); }); + // A Media Bin reference's file lives right in ComfyUI's own input folder (so the node + // itself can load it), which means it ALSO shows up here under its raw on-disk name — + // the same clip, twice, once as "R1 · clip.mp4" above and once as an unreadable + // "funpack_movie_.mp4" below. The second copy is pure noise, never worth picking + // over the friendly one, so it's dropped rather than left to confuse the choice. + const refFilenames = new Set(refOpts.map((o) => o.filename).filter(Boolean)); + (spec.choices || []).forEach((c) => { + if (refFilenames.has(c) && c !== value) return; + const o = el("option", null, String(c)); o.value = c; if (c === value) o.selected = true; ctrl.append(o); + }); // Gated on spec.ref_kind, not just the "ref:" prefix: only the fields FunPack itself // knows are reference-capable (WIDGET_REFERENCE_FIELDS, nodes.py) should ever be read // as a sentinel. An ordinary combo can have a real installed file that happens to be