Skip to content

v0.46.0 — Gallery validator + 11 rounds of audit polish

Choose a tag to compare

@Deaththegrim Deaththegrim released this 07 May 01:33
· 54 commits to main since this release

v0.46.0 — Gallery-wired library validator + 11 rounds of audit polish

The cumulative changeset since v0.39 (the last tagged release). Eleven rounds of audit-driven work, 34 items shipped, 2 silent data-loss / curation bugs surfaced, 261 tests (was 242, +19), 3 new standalone CLI tools. All changes internal — no socket / widget / workflow JSON shape changes.


v0.46.0 highlights — library validator wired into the gallery

The gallery now surfaces library-health issues directly in the toolbar. A new ⚠ N badge appears only when there are unhealed issues (clean libraries get no UI clutter). Click it to open a categorised modal:

  • Broken LoRA references — entries whose loras list references a .safetensors no longer in models/loras/. Per-row Edit button opens the entry so you can re-pick or delete the row.
  • Orphan thumbnails — image files with no matching entry. Single "Remove orphan thumbnails" action calls the new POST /prompt_library/fix_orphans endpoint.
  • Invalid entry IDs — entries whose id doesn't match [A-Za-z0-9_-]{1,64} (would refuse to upsert).
  • Empty-text entries — entries with no prompt text from a half-completed save.

Two new HTTP routes:

  • GET /prompt_library/validate — read-only findings dict
  • POST /prompt_library/fix_orphans — bulk-delete stray thumbnails

The badge re-fetches after every gallery refresh so the count stays accurate. Network failures hide the badge silently — the gallery itself works whether the validator endpoint is reachable or not.

Round J — drag insertion line + library_validate CLI

  • Drag-reorder visual — the previous "outline the target tile" gave an ambiguous "replace or sit next to?" affordance. Now a 3px accent-coloured line on the leading edge of the target tile (top edge in list view) literally shows where the dragged tile will land.
  • tools/library_validate.py — the same checks as the gallery validator, runnable from the shell. Read-only by default; --fix-orphans deletes stray thumbnails.

Round I — search + modal usability

  • Gallery search now matches LoRA fields + negative + notes — used to walk only name / text / tags / id. A query like turbo (LoRA filename) or green eyes (trigger word) used to miss matching entries.
  • Visible missing-LoRA warning — modal LoRA rows whose path isn't in the loaded list now show a red banner above the dropdown, not just a (missing) marker the user has to click the dropdown to see.
  • PromptLibrarySave loras_json input — workflows can now save entries with attached LoRAs programmatically. Empty input leaves existing loras untouched; [] explicitly clears.

Earlier rounds (v0.40 → v0.45)

Round What landed
A v0.40.0 zip-bomb cap, CSV cap, /list directory cache, JSON validation, atomic prompt_log writes
B v0.40.1 SHA cache LRU, named depth constants, deep-copy loras
C v0.40.2 end-to-end roundtrip tests + fix negative field silently lost on every export → import
D v0.41.0 dual M/C strength sliders + LoRA-row soft-delete + Scene empty-output warning
E v0.42.0 Comic Page per-panel panel_strengths override + cycle test + loras-in-record test
F v0.42.1 LoRA Picker port discovery, Random IS_CHANGED tracking, watcher try/except resilience
G v0.43.0 tools/civitai_backfill.py CLI
H v0.44.0 snapshot path-traversal hardening, watcher coalesce, modal try/catch, gallery lazy-render via requestIdleCallback, strength link-toggle

Two real bugs found by the audit

  1. Negative-field round-trip leak (Round C) — every export → import lost the entry's negative prompt. Found by the new end-to-end test.
  2. Empty-text "Cyberpunk" entry (Round J/K) — surfaced by the validator running against the maintainer's live 718-entry library; would never have been noticed otherwise.

Backward compat

All changes internal — no socket / widget / workflow JSON shape changes since v0.39. Drop-in safe.

Install / upgrade

cd ComfyUI/custom_nodes/ComfyUI-GrimmRibbity
git pull
# restart ComfyUI / hard-refresh browser tab

Three standalone CLI tools (in tools/)

# Diagnose library issues (read-only by default)
python3 tools/library_validate.py [--fix-orphans]

# Backfill Civitai SHA hashes onto legacy PNGs
python3 tools/civitai_backfill.py /path/to/output [--recursive] [--dry-run]

# Capture screenshots of the live gallery (since v0.36)
python3 tools/screenshots/run.py