Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34f2c89740 |
@@ -41,7 +41,7 @@ jobs:
|
||||
# Pinned to the same commit SHA (v7.0.1) the publish workflow uses.
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
# Pinned to an immutable commit SHA (v7.0.0), matching the publish
|
||||
# Pinned to an immutable commit SHA (v7.1.0), matching the publish
|
||||
# workflow's SHA-pinning convention. Re-verify and bump when updating:
|
||||
# git ls-remote https://github.com/actions/setup-python refs/tags/v7
|
||||
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0
|
||||
@@ -129,7 +129,7 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
- name: Set up Node
|
||||
# Pinned to an immutable commit SHA (v7.0.0). Re-verify and bump when
|
||||
# Pinned to an immutable commit SHA (v7.1.0). Re-verify and bump when
|
||||
# updating: git ls-remote https://github.com/actions/setup-node refs/tags/v7
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
|
||||
with:
|
||||
|
||||
@@ -8,12 +8,13 @@ investigation notes, 1.5.0+ — the reasoning for every item in the release list
|
||||
|
||||
## Current state
|
||||
|
||||
_Last verified: 2026-11-19_
|
||||
_Last verified: 2026-11-24_
|
||||
|
||||
- **Status:** in active development; main is v2.7.1 (`pyproject.toml`); 2.0.0 was the seed epoch (every seed resolves differently from 1.x, by design). Published to the Comfy Registry via `.github/workflows/publish_action.yml`, which fires on a `pyproject.toml` version change on `main` - bump the version on every functional commit or the release never ships. CI (`.github/workflows/ci.yml`) is deliberately dependency-free, has a Windows leg, and `publish-node` needs it (1.8.0).
|
||||
- **Status:** in active development; main is v2.8.0 (`pyproject.toml`); 2.0.0 was the seed epoch (every seed resolves differently from 1.x, by design). Published to the Comfy Registry via `.github/workflows/publish_action.yml`, which fires on a `pyproject.toml` version change on `main` - bump the version on every functional commit or the release never ships. CI (`.github/workflows/ci.yml`) is deliberately dependency-free, has a Windows leg, and `publish-node` needs it (1.8.0).
|
||||
- **Works:** the constraint engine resolving dropdowns into coherent prose plus structured JSON, seed-reproducible; the four preset layer nodes (Archetype, Creature, Modifier, Cosplayer); searchable dropdown widgets, live preview, the `franchise_filter`, the `random_pool` scope-composing filter, and the save/load vault in `js/` (an atomic overwrite, a disk-change-aware cache fingerprint, and Windows-reserved-name handling as of 1.5.5); a searchable **in-node roster picker** (`js/identity_forge_picker.js`) on the Cosplayer/Archetype/Creature nodes - trait facets, gender and franchise filters, cross-tab search, opt-in gallery thumbnails, backed by a generated `js/identity_forge_roster.json` search index; Stylebook interop, the composition axis, and the **Turnaround** reference-set node (which emits every camera view of one resolved character as a list, so one queue renders the set) and its face-side sibling the **Expression Sheet** (1.10.0: one view per curated expression/mood/smile triple); a free-text `held_item` on the Modifier node; a jsdom frontend suite alongside the Python one; generated reference docs and JS data, and a committed field-marginals baseline (`scripts/sweep_marginals.py`, 1.5.5 - catches a value drawing far more or less often than intended), plus a reachability gate (`--unreachable`, 1.8.0: every pool value some gender can draw, or a reasoned exception in `tests/fixtures/unreachable_by_design.json`), all with `--check` modes wired into the gate. A cosplay entry may render as a **person in a costume**, as a **mascot suit** (`covers_face` + `covers_body` + `mask`), or - since 0.95.0 - as the **beast itself** (`body_plan: "feral"`, which emits the Creature node's Species & Anatomy payload instead of a costume); see architecture.md -> "Animal characters split four ways". `scripts/render_gallery.py` renders a roster entry's gallery image by driving a running ComfyUI over HTTP and publishes it to `gh-pages`, and `gallery/render_manifest.json` + `--check` fail CI when an entry's text changes without a re-render (architecture.md -> "The gallery render pipeline"). Since 0.97.0 every roster entry also carries a **release stamp** (`data/versions.py`, written by `scripts/stamp_versions.py`, gated in CI), which is what lets the three sample gallery pages offer **A-Z / Newest first** and a **New in `<version>`** filter. Since 2.0.0: a **`gaze`** field drawn last with `pose` (both with live constraint rules; architecture.md -> "pose and gaze draw last"), opt-in **`costume_back`** for Turnaround back views, **per-garment `{slot}` variation** in the outfit corpus on its own seed stream, and a gallery hash over **resolved prose** so an engine change marks images stale. Since 2.3.0: the **Outfit Sheet** and **Age Progression** sheet nodes (they release the fields a pin refuses via `lock_clash` rather than override them; architecture.md -> "Sheets that change the person"), and picker previews served through a **server-side gallery cache** (`nodes/gallery_cache.py`) so they work under ComfyUI `--offline`. Since 2.6.0: the **Scene Sheet** node (one person in several places, dressed for each), `pin_framing()` for every sheet's framing pin, picker stars, a seeded random pick on Vault Load, example workflows for every sheet, and one `gallery/shared/` copy of the gallery page assets. Since 2.7.0: a fourth gallery, **`gallery/people/`** - fixed seeds on the plain node at its defaults (`PEOPLE` in `scripts/render_gallery.py`, same prose-hash gate), each card showing its seed and full prompt with a copy button (gallery/README.md -> "The people gallery").
|
||||
- **In progress:** roster and coherence curation is the ongoing work, not a milestone - each release adds characters/creatures/archetypes and closes coherence bugs found by rendering them. `docs/suggested-additions.md` is the live backlog (under consideration / decided against / still to consider). Next: more `costume_back` entries (2.3.0 covered the first caped and back-emblem heroes; continue with the rest of the capes) and more slotted corpus phrases; both are seed-safe additions now (a slot draws from its own stream; a back text touches only back views).
|
||||
- **Recent releases** — one line each. **This list is a pointer, not a changelog:** the reasoning for every item is in `docs/history.md` (the sections are named there per release) and the full messages are in `git log`. Keep roughly the last eight and let older ones drop off; do not let an entry grow into a paragraph.
|
||||
- **2.8.0** - Vault Load accepts a name this vault lacks (`validate_inputs`; it passes the upstream through instead of failing the queue), Refresh no longer swaps the pick for another saved character, rename follows the pick; picker plural search ("boots" finds "boot") and a Queue random button. Random characters unchanged. See docs/history.md -> "2.8.0".
|
||||
- **2.7.1** - No more NaN `fingerprint_inputs` (PR #20): it re-ran every downstream node, sampler included, on every queue. Vault Load's random pick fingerprints the entry it lands on. Random characters unchanged. See docs/history.md -> "2.7.1".
|
||||
- **2.7.0** - Roster batch (Sheena Fujibayashi with her three looks, Tales, Hellsing, Final Fantasy, Metal Gear, KOS-MOS, Skullgirls, Kula, Beatrix and others), Pyra/Mythra corrected to canon, a nose prose fix (existing tiles rehashed), and the people gallery (`gallery/people/`). Random characters unchanged (the Cosplayer node's Random pick moves, as with any roster addition). See docs/history.md -> "2.7.0".
|
||||
- **2.6.1** - Trims the `pyproject.toml` description under the Registry's 1000-character limit (2.6.0's publish failed on it) and tests the limit. See docs/history.md -> "2.6.1".
|
||||
@@ -22,8 +23,6 @@ _Last verified: 2026-11-19_
|
||||
- **2.4.0** - Figure Skater on the ice with standing poses (Hockey Goalie, Roller Derby, Carhop, Scuba Diver and Samurai pose locks too), several archetypes moved to a location that fits them, four new venues (wrestling ring, tennis court, pit lane, racecourse paddock), no leaning or perching in open landscapes, no blank-backdrop composition indoors, Indie Sleaze men's costumes split from the women's, a man keeps a locked eyeliner, 1980s New Wave women draw 80s makeup, a prop in each hand drops one-handed poses, and Yoda, Ahsoka, Piccolo, Bane and the Star Wars guards no longer draw a random human under the costume. Anthropomorphic creatures render as one clothed hybrid (Monsters/Aliens lead "humanoid X", an optional per-creature `anthro` text block, and the optional Krea2T Enhancer in the gallery renderer). Random characters move (marginals re-baselined). See docs/history.md -> "2.4.0".
|
||||
- **2.3.0** - Picker previews through a server-side cache (they now show under `--offline`, with a Clear cached previews button), Outfit Sheet and Age Progression nodes (shared `replay_base` / `release_fields` helpers in the Turnaround module), an Aztec Noble archetype, and `costume_back` for caped and back-emblem heroes. Random characters unchanged (the Archetype node's Random pick moves, as with any archetype addition). See docs/history.md -> "2.3.0".
|
||||
- **2.2.0** - Cyberpunk roster (David Martinez, Panam and Rebecca rebuilt to canon; new Maine, Kiwi, Talia Yang, Adam Smasher, Song So Mi with a weighted netrunner alternate), Volcana, four period court archetypes (Rococo Courtier, Medieval Monarch, Ottoman Court, Heian Court) and a Female variant for Ancient Roman Patrician, a `tattoos` lock kept in Essentials, a costume-named earring or necklace suppressing the random one, a `gilded palace throne room` location, tattoo and piercing locks on eleven period archetypes, a franchise filter in the roster picker, and four punk/pinup outfit-corpus phrases (the location and the outfits move random seeds). See docs/history.md -> "2.2.0".
|
||||
- **2.1.0** - R2-D2, BB-8 and Gonk Droid render as the droid (non-humanoid machines now take `body_plan: "feral"` with a cosplay-only `creature_class: "Machines"`), new machine and object entries (Claptrap, WALL-E, Dalek, Johnny 5, Codsworth, Mrs. Potts, Cogsworth), the sd-character-finder survey batch (first Touhou entries, Snoopy, Doraemon, Hello Kitty, Meta Knight and others), Blue Beetle (Ted Kord) recoloured to canon, a Female/Male filter in the roster picker, an optional cosplay `subject` lead noun (Tellarite, aliens, and mascots that drew a person with a plush now render as the character; single-eye cyclopes remain a model limit), Orion with a weighted alternate look (`costume_weights`), and the survey's second tier (RWBY, Nanoha, BlazBlue, Tiger & Bunny and others). Random characters unchanged (the droids move between the Masked, People-only and Beast scopes). See docs/history.md -> "2.1.0".
|
||||
- **2.0.0** - Seed epoch: a `gaze` field (the old `looking` poses) drawn last with a deferred `pose` (`_repair_pose` retired), women's hair-length and 75/80 age weights, a portrait rig gated out of everyday interiors (`studio_shape` / `studio_mood` split), per-garment `{slot}` variation, opt-in `costume_back` for Turnaround back views, no "Name (Name)" label, an article for noun expressions, and a prose-based gallery hash (existing tiles accepted with `--rehash`, no full re-render). See docs/history.md -> "2.0.0".
|
||||
- **Known gaps / next steps:** two deliberate, open items — not to be re-litigated without a fresh case (the old pockets-allowlist gap was measured and closed in 1.10.0): (1) the Turnaround node's back view still draws a costume's front-facing detail (e.g. a chest emblem) on the back for any entry without a `costume_back` (opt-in since 2.0.0, so far only a handful of flagship heroes); never parse the front text for back clauses (the regex-over-prose trap), add `costume_back` to the entry instead. (2) Costume text that asserts a body trait against an unpinned random field (e.g. "on a hulking frame" beside a random, unlocked `build`) — the `signature`/`physique` split that causes it is deliberate; measure again from scratch before touching it, a naive regex sweep has reported a wrong count here before. `docs/suggested-additions.md` is the live backlog for roster/field-option candidates.
|
||||
- **Deep docs:** `docs/architecture.md` (deep reference — read before engine or data changes), `docs/history.md` (per-release investigation notes, 1.5.0+), `docs/usage.md`, `docs/cosplayer-notes.md`, `docs/creature-notes.md`, `docs/suggested-additions.md` (backlog), `docs/reference/*.md` (generated).
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ The Cosplayer node is where Identity Forge really shines. Most character wildcar
|
||||
|
||||
Ask a plain wildcard for Chun-Li and your prompt says `Chun-Li`. Ask this Cosplayer node and you get: *the blue qipao with gold trim, brown tights, white cross-laced boots, and spiked bracelets.* The look renders even on checkpoints that have never heard of the character.
|
||||
|
||||
**Find one fast:** open the in-node picker to browse and search the whole roster without leaving the node - trait facets (Giant, Masked, Mascot/full-suit, Beast), Female/Male and a type-to-filter franchise box, a **Queue each** button that runs every match in turn, starred favourites, and optional thumbnail previews (fetched once by your ComfyUI server and cached on disk, so they still show when ComfyUI runs with `--offline`). The picker remembers your search, tab and facet while the workflow is open, so you can pick, close and come back to the same filtered view, scrolled to your current pick; reloading starts fresh. Search rules are in [docs/usage.md](docs/usage.md#searching-the-picker).
|
||||
**Find one fast:** open the in-node picker to browse and search the whole roster without leaving the node - trait facets (Giant, Masked, Mascot/full-suit, Beast), Female/Male and a type-to-filter franchise box, a **Queue each** button that runs every match in turn (or **Queue random** for one of them), starred favourites, and optional thumbnail previews (fetched once by your ComfyUI server and cached on disk, so they still show when ComfyUI runs with `--offline`). The picker remembers your search, tab and facet while the workflow is open, so you can pick, close and come back to the same filtered view, scrolled to your current pick; reloading starts fresh. Search rules are in [docs/usage.md](docs/usage.md#searching-the-picker).
|
||||
|
||||
**Characters from every major franchise:** Marvel, DC, Star Wars, anime, video games, fantasy, sci-fi, horror. Each one with multiple costume variants where applicable (Harley Quinn's three iconic looks, Catwoman's different suits, etc.). Characters rotate between variants by seed, so the same name yields a different signature costume each roll.
|
||||
|
||||
|
||||
@@ -1856,3 +1856,29 @@ part of the key, so an auto-advanced seed re-runs the node without any override.
|
||||
Vault Load keeps a fingerprint, now `(picked entry, its mtime+size)` for a random pick too, so a
|
||||
save or delete that moves the pick still re-runs. `tests/test_node_contracts.py` now fails any
|
||||
node that returns NaN. Random characters unchanged.
|
||||
|
||||
## 2.8.0 - a vault pick that survives, and two picker backlog items
|
||||
|
||||
**Vault Load no longer fails validation on a name this vault lacks.** The node's docstring has
|
||||
always promised that a missing entry logs a warning and passes the upstream through, but
|
||||
ComfyUI checks a combo value against the live option list before `execute()` runs, so the
|
||||
prompt was rejected first ("Value not in list"). The common way in: build a workflow on an
|
||||
empty vault (the widget holds `(no characters saved)`), save a character, queue again without
|
||||
pressing Refresh. A shared workflow naming someone else's save failed the same way. ComfyUI
|
||||
skips its combo check for any input a `validate_inputs` override names, so the node now
|
||||
names `character` and accepts it; `execute()` already handled the rest.
|
||||
|
||||
**Refresh no longer swaps the pick for another character.** The frontend replaced any value
|
||||
missing from the list with the first entry, on every refresh, including the one that runs when
|
||||
a workflow loads. A deleted or foreign name silently recalled a different saved person, a
|
||||
failed fetch replaced the pick with the "vault unavailable" placeholder, and renaming the
|
||||
current pick in Manage Vault moved the node to the first entry. Now only a placeholder moves
|
||||
to the first entry, a rename follows the pick, and deleting the pick hands the node the first
|
||||
remaining entry.
|
||||
|
||||
**Picker backlog.** Both open picker items from the 2.5.0 review shipped. A plural query also
|
||||
finds the lone singular ("boots" finds "boot"), but only as a whole word, so "pants" never
|
||||
reaches "panther", and a word ending in "ss" gains nothing ("glasses" never becomes "glass", the
|
||||
trap the backlog named). **Queue random** sits beside Queue each and queues one run with one
|
||||
random matching entry, without the confirm prompt; it shows while filtering with two or more
|
||||
matches. Random characters unchanged.
|
||||
|
||||
@@ -27,14 +27,8 @@ that is what the Creature node is for.
|
||||
tight-shot legwear, free-text `held_item` and expression-sheet rows in 1.10.0, see
|
||||
`docs/history.md`):
|
||||
|
||||
The gaze field and the noun-expression article both shipped in 2.0.0. Open, from the 2.5.0
|
||||
picker-search review (maintainer is considering them):
|
||||
|
||||
- **Random from these** - a picker button that queues one run with a random pick from the
|
||||
filtered set, a lighter option than Queue each.
|
||||
- **Plural search** - "boots" does not find a costume that says "boot" (word-start matching
|
||||
already covers the reverse). Rare in practice; a naive trailing-s strip turns "glasses" into
|
||||
"glass".
|
||||
The gaze field and the noun-expression article both shipped in 2.0.0; the two items from the
|
||||
2.5.0 picker-search review (Queue random, plural search) shipped in 2.8.0. Nothing open here.
|
||||
|
||||
**Researched and skipped — do not re-survey.** Valorant, Apex Legends,
|
||||
Monster Hunter, Skyrim, Splatoon, FNAF, Among Us, Minecraft, Mortal Shell. Each is an armoured,
|
||||
|
||||
+10
-1
@@ -307,6 +307,9 @@ emits one view as resolved. Labels read `1-age-20` and so on. A ready-made workf
|
||||
jeans, `suit` finds bodysuits and jumpsuits, `sword` finds katanas, `gray` finds grey. The
|
||||
list is `SEARCH_ALSO` in `js/identity_forge_picker.js`; it is one-way (`jeans` does not
|
||||
find slacks).
|
||||
- **Plurals find the singular (2.8.0).** `boots` also finds a lone "boot" and `gloves` a lone
|
||||
"glove". The singular must be a whole word, so `pants` never finds "panther", and words
|
||||
ending in "ss" (`dress`, `glasses`) are left as typed.
|
||||
- **Franchise box (Cosplayer node):** type part of a name. `star` keeps Star Wars and Star
|
||||
Trek; picking a suggestion, or typing a full name, keeps that franchise only. Trait, gender
|
||||
and franchise filters only appear on nodes where they can narrow something.
|
||||
@@ -314,7 +317,8 @@ emits one view as resolved. Labels read `1-age-20` and so on. A ready-made workf
|
||||
with the same search and filters, so you can pick, queue, and come back to the next one.
|
||||
- **Queue each (N)** appears while you are filtering: it queues one run per matching entry the
|
||||
node can take, then puts your original pick back. Each run uses the rest of the workflow as it
|
||||
stands, so a seed set to randomize gives each one a new person.
|
||||
stands, so a seed set to randomize gives each one a new person. **Queue random** (2.8.0), beside
|
||||
it, queues a single run with one random matching entry and does not ask first.
|
||||
- **Star your favourites (2.6.0).** Click the star on a card (or press S on the focused card),
|
||||
then tick **Starred only** to see just those. Stars are kept in this browser, shared by all
|
||||
three pickers, and work with every other filter and with Queue each.
|
||||
@@ -325,6 +329,11 @@ Vault Load's `character` list ends with `(random saved character)` once anything
|
||||
(2.6.0). It picks one saved character by the node's `seed`: the same seed and vault give the
|
||||
same pick, and `randomize` gives a different one each queue.
|
||||
|
||||
If the node names a character this vault does not hold (a workflow from another machine, or
|
||||
an entry deleted since), it logs a warning and passes the `upstream` through instead of
|
||||
failing the queue (2.8.0). Refresh keeps such a name rather than swapping in a different
|
||||
saved character; pick another from the list to replace it.
|
||||
|
||||
## Preview images in the picker
|
||||
|
||||
"Show preview images" in the roster picker is off by default. When it is on, your ComfyUI
|
||||
|
||||
@@ -196,6 +196,11 @@ function tokenPattern(token) {
|
||||
let re = tokenPatterns.get(token);
|
||||
if (!re) {
|
||||
const words = [token, ...(SEARCH_ALSO[token] || [])].map(escapeRegExp);
|
||||
// 2.8.0: "boots" also finds a lone "boot". The singular must end its word, so
|
||||
// "pants" never reaches "panther"; "glasses" gains only "glasse", never "glass".
|
||||
if (/[a-z]{3}s$/.test(token) && !token.endsWith("ss")) {
|
||||
words.push(escapeRegExp(token.slice(0, -1)) + "(?![a-z0-9])");
|
||||
}
|
||||
re = new RegExp("(?:^|[^a-z0-9])(?:" + words.join("|") + ")");
|
||||
tokenPatterns.set(token, re);
|
||||
}
|
||||
@@ -719,6 +724,18 @@ class IdentityForgePicker {
|
||||
queueAll.addEventListener("click", () => this.queueEach());
|
||||
this.queueAllButton = queueAll;
|
||||
|
||||
// 2.8.0: the lighter option - one run with one random matching entry, no prompt.
|
||||
const queueRandom = document.createElement("button");
|
||||
queueRandom.type = "button";
|
||||
queueRandom.className = "if-picker-btn if-picker-queue-random";
|
||||
queueRandom.textContent = "Queue random";
|
||||
queueRandom.title = "Queue one run with a random matching entry, then put your current pick back.";
|
||||
queueRandom.addEventListener("click", () => {
|
||||
const entries = this.queueableEntries();
|
||||
if (entries.length) this.queueEach([entries[Math.floor(Math.random() * entries.length)]], false);
|
||||
});
|
||||
this.queueRandomButton = queueRandom;
|
||||
|
||||
// 2.5.0: trait and franchise filters match cosplayers only, and creatures carry
|
||||
// no gender, so a node shows only the filters that can narrow what it can pick.
|
||||
const kind = this.config.kind;
|
||||
@@ -727,7 +744,7 @@ class IdentityForgePicker {
|
||||
...(kind === "cosplayer" ? [facet] : []),
|
||||
...(kind !== "creature" ? [genderSelect] : []),
|
||||
...(kind === "cosplayer" ? [franchiseInput, franchiseList] : []),
|
||||
count, queueAll, starredLabel, previewLabel, close,
|
||||
count, queueAll, queueRandom, starredLabel, previewLabel, close,
|
||||
);
|
||||
|
||||
const notice = document.createElement("div");
|
||||
@@ -1010,8 +1027,7 @@ class IdentityForgePicker {
|
||||
* Each app.queuePrompt() call snapshots the graph, so setting the widget and
|
||||
* awaiting the call in turn gives one job per character.
|
||||
*/
|
||||
async queueEach() {
|
||||
const entries = this.queueableEntries();
|
||||
async queueEach(entries = this.queueableEntries(), ask = true) {
|
||||
const node = this.config.node;
|
||||
const widget = findWidget(node, this.config.targetWidgetName);
|
||||
if (!entries.length || !widget || this._queueing) return;
|
||||
@@ -1020,7 +1036,7 @@ class IdentityForgePicker {
|
||||
return;
|
||||
}
|
||||
const noun = entries.length === 1 ? "run" : "runs";
|
||||
if (!confirm("Queue " + entries.length + " " + noun + ", one for each matching entry?")) return;
|
||||
if (ask && !confirm("Queue " + entries.length + " " + noun + ", one for each matching entry?")) return;
|
||||
this._queueing = true;
|
||||
const original = widget.value;
|
||||
const button = this.queueAllButton;
|
||||
@@ -1055,6 +1071,7 @@ class IdentityForgePicker {
|
||||
const n = this.isFiltering() ? this.queueableEntries().length : 0;
|
||||
button.style.display = n ? "" : "none";
|
||||
button.textContent = "Queue each (" + n + ")";
|
||||
if (this.queueRandomButton) this.queueRandomButton.style.display = n > 1 ? "" : "none";
|
||||
}
|
||||
|
||||
/** Re-run franchise_filter's callback so the node's pick stays in its combo list. */
|
||||
|
||||
@@ -110,7 +110,11 @@ function applyCharacterList(node, characters) {
|
||||
list = names.length ? [...names, RANDOM_CHARACTER] : [NO_CHARACTERS];
|
||||
}
|
||||
setComboValues(w, list);
|
||||
if (!list.includes(w.value)) w.value = list[0];
|
||||
// 2.8.0: only a placeholder moves to the first entry. A saved name this vault does
|
||||
// not list (a workflow from elsewhere, or a failed fetch) stays put: the node then
|
||||
// passes the upstream through with a warning instead of recalling someone else.
|
||||
const placeholder = !w.value || [NO_CHARACTERS, VAULT_UNAVAILABLE, RANDOM_CHARACTER].includes(w.value);
|
||||
if (!list.includes(w.value) && placeholder) w.value = list[0];
|
||||
updatePreview(node);
|
||||
node.setDirtyCanvas(true, true);
|
||||
}
|
||||
@@ -278,6 +282,10 @@ function openManager(node) {
|
||||
if (data && data.error) detail = data.error;
|
||||
} catch (parseError) { /* not JSON - keep the status */ }
|
||||
alert(`Delete failed: ${detail}`);
|
||||
} else {
|
||||
// Deleting the current pick hands the node the first remaining entry.
|
||||
const w = getCharacterWidget(node);
|
||||
if (w && names.includes(w.value)) w.value = "";
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("[IdentityForge] delete failed:", e);
|
||||
@@ -296,6 +304,9 @@ function openManager(node) {
|
||||
});
|
||||
const data = await resp.json();
|
||||
if (!resp.ok) { alert(data.error || "Rename failed."); return; }
|
||||
// Renaming the current pick keeps it picked, under its new name.
|
||||
const w = getCharacterWidget(node);
|
||||
if (w && w.value === from && data.name) setSelection(node, data.name);
|
||||
} catch (e) {
|
||||
console.error("[IdentityForge] rename failed:", e);
|
||||
alert("Rename failed — see console.");
|
||||
|
||||
@@ -306,6 +306,14 @@ if _COMFY_AVAILABLE:
|
||||
)],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate_inputs(cls, character: Any = None) -> bool:
|
||||
# 2.8.0: the vault is per-machine, so a workflow can name an entry that was
|
||||
# deleted, renamed or never saved here, or still hold "(no characters saved)"
|
||||
# after the first save. ComfyUI's combo check rejected those before execute()
|
||||
# could pass the upstream through as documented; naming the input here skips it.
|
||||
return True
|
||||
|
||||
@classmethod
|
||||
def fingerprint_inputs(cls, **kwargs: Any) -> Any:
|
||||
# 1.5.5: see _character_fingerprint. Folds the SELECTED entry's
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "comfyui-identity-forge"
|
||||
version = "2.7.1"
|
||||
version = "2.8.0"
|
||||
description = "Create believable, coherent people, cosplayers and creatures from dropdowns - no prompt engineering required. A constraint engine keeps every trait sensible and a seed makes any result reproducible. Cosplay characters carry a hand-written, canon-checked costume description - garments, colours, masks, markings, signature props - that renders on any checkpoint, and are searchable from an in-node picker with trait facets, gender and franchise filters, and thumbnail previews that also show offline. Sheet nodes build one-queue reference sets of the same resolved character: Turnaround (camera views), Expression Sheet, Outfit Sheet, Scene Sheet (several places) and Age Progression. Public galleries showcase every entry with a sample render and its exact workflow. Optional preset layers add themed archetypes, creature/monster/alien hybridization, per-element style modifiers, and a save/load character vault."
|
||||
license = { text = "MIT" }
|
||||
readme = "README.md"
|
||||
|
||||
@@ -394,6 +394,19 @@ test("search matches from a word's start, quoted phrases, and the SEARCH_ALSO sy
|
||||
'"suit" finds bodysuits');
|
||||
});
|
||||
|
||||
test("a plural query also finds the lone singular, and only as a whole word (2.8.0)", () => {
|
||||
const find = (q) => REAL_ROSTER.filter((e) => __testing.matchesQuery(e, __testing.tokenize(q)));
|
||||
const lone = (word) => (e) => new RegExp("(^|[^a-z0-9])" + word + "([^a-z0-9]|$)").test(e.haystack);
|
||||
const bootOnly = REAL_ROSTER.filter((e) => lone("boot")(e) && !/boots/.test(e.haystack));
|
||||
assert.ok(bootOnly.length > 0, "sanity: some entries say boot, never boots");
|
||||
assert.ok(bootOnly.every((e) => find("boots").includes(e)), '"boots" finds a lone "boot"');
|
||||
const pantherOnly = (e) => /panther/.test(e.haystack) && !/pant/.test(e.haystack.replace(/panther/g, ""))
|
||||
&& !/trousers|slacks|jeans|sweatpants|breeches/.test(e.haystack) && !e.name.toLowerCase().includes("pants");
|
||||
assert.ok(!find("pants").some(pantherOnly), '"pants" must not reach "panther"');
|
||||
assert.ok(!find("glasses").some((e) => lone("glass")(e) && !/glasses|sunglasses|spectacles|eyeglasses/.test(e.haystack)
|
||||
&& !e.name.toLowerCase().includes("glasses")), '"glasses" must not find "glass"');
|
||||
});
|
||||
|
||||
test("reopening lands on the node's current pick, marked, instead of the top of the list", async () => {
|
||||
resetDom();
|
||||
__testing.__resetForTests();
|
||||
@@ -439,6 +452,36 @@ test("Queue each queues one run per matching entry, then restores the pick", asy
|
||||
}
|
||||
});
|
||||
|
||||
test("Queue random queues one matching entry without asking, then restores the pick (2.8.0)", async () => {
|
||||
resetDom();
|
||||
__testing.__resetForTests();
|
||||
const stub = installFetchStub(rosterOkHandler);
|
||||
const seen = [];
|
||||
const originalConfirm = globalThis.confirm;
|
||||
globalThis.confirm = () => { throw new Error("Queue random must not ask"); };
|
||||
try {
|
||||
const picker = await openPicker();
|
||||
assert.equal(picker.queueRandomButton.style.display, "none", "hidden with no filter");
|
||||
const widget = picker.config.node.widgets.find((w) => w.name === "character");
|
||||
widget.value = "None";
|
||||
app.queuePrompt = async () => { seen.push(widget.value); return true; };
|
||||
picker.franchise = "Star Wars";
|
||||
picker.renderGrid();
|
||||
assert.equal(picker.queueRandomButton.style.display, "");
|
||||
const names = picker.queueableEntries().map((e) => e.name);
|
||||
picker.queueRandomButton.click();
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
assert.equal(seen.length, 1);
|
||||
assert.ok(names.includes(seen[0]), "the pick comes from the filtered set");
|
||||
assert.equal(widget.value, "None", "the original pick is put back");
|
||||
picker.close();
|
||||
} finally {
|
||||
globalThis.confirm = originalConfirm;
|
||||
delete app.queuePrompt;
|
||||
stub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test("while filtering, every tab shows its own match count so other kinds stay discoverable", async () => {
|
||||
resetDom();
|
||||
__testing.__resetForTests();
|
||||
|
||||
@@ -128,6 +128,68 @@ test("delete posts to the delete route with a JSON content type", async () => {
|
||||
});
|
||||
|
||||
|
||||
/* --- A refresh never swaps the pick for another character (2.8.0) -------- */
|
||||
test("a saved name this vault lacks survives a refresh; a placeholder moves to the first entry", async () => {
|
||||
const node = await setup();
|
||||
const charW = node.widgets.find((w) => w.name === "character");
|
||||
const refreshBtn = node.widgets.find((w) => w.name === "🔄 Refresh");
|
||||
charW.value = "From another machine";
|
||||
refreshBtn.callback();
|
||||
await flush();
|
||||
assert.equal(charW.value, "From another machine", "must not silently recall someone else");
|
||||
charW.value = "(no characters saved)";
|
||||
refreshBtn.callback();
|
||||
await flush();
|
||||
assert.equal(charW.value, SAMPLE_CHARACTERS[0].name);
|
||||
});
|
||||
|
||||
test("a failed refresh keeps the current pick", async () => {
|
||||
const node = await setup();
|
||||
const charW = node.widgets.find((w) => w.name === "character");
|
||||
charW.value = SAMPLE_CHARACTERS[1].name;
|
||||
__setFetchApiHandler(async () => { throw new Error("connection refused"); });
|
||||
node.widgets.find((w) => w.name === "🔄 Refresh").callback();
|
||||
await flush();
|
||||
assert.deepEqual(charW.options.values, ["(vault unavailable — press Refresh)"]);
|
||||
assert.equal(charW.value, SAMPLE_CHARACTERS[1].name);
|
||||
});
|
||||
|
||||
test("renaming the current pick follows it; deleting it moves to the first entry", async () => {
|
||||
const node = await setup();
|
||||
const charW = node.widgets.find((w) => w.name === "character");
|
||||
charW.value = SAMPLE_CHARACTERS[1].name;
|
||||
let characters = SAMPLE_CHARACTERS;
|
||||
__setFetchApiHandler(async (route, opts) => {
|
||||
if (route === "/identity_forge/vault/rename") {
|
||||
const { to } = JSON.parse(opts.body);
|
||||
characters = [SAMPLE_CHARACTERS[0], { ...SAMPLE_CHARACTERS[1], name: to }];
|
||||
return { ok: true, json: async () => ({ name: to }) };
|
||||
}
|
||||
if (route === "/identity_forge/vault/delete") {
|
||||
const { names } = JSON.parse(opts.body);
|
||||
characters = characters.filter((c) => !names.includes(c.name));
|
||||
return { ok: true, json: async () => ({ characters: characters.map((c) => c.name) }) };
|
||||
}
|
||||
return { ok: true, json: async () => ({ characters }) };
|
||||
});
|
||||
const originals = { prompt: globalThis.prompt, confirm: globalThis.confirm };
|
||||
globalThis.prompt = () => "Renamed";
|
||||
globalThis.confirm = () => true;
|
||||
try {
|
||||
node.widgets.find((w) => w.name === "🗂 Manage Vault…").callback();
|
||||
await flush();
|
||||
const overlay = document.body.firstElementChild;
|
||||
[...overlay.querySelectorAll("button")].filter((b) => b.title === "Rename")[1].click();
|
||||
await flush();
|
||||
assert.equal(charW.value, "Renamed");
|
||||
[...overlay.querySelectorAll("button")].filter((b) => b.title === "Delete")[1].click();
|
||||
await flush();
|
||||
assert.equal(charW.value, SAMPLE_CHARACTERS[0].name);
|
||||
} finally {
|
||||
Object.assign(globalThis, originals);
|
||||
}
|
||||
});
|
||||
|
||||
/* --- Re-entry guard (0.97.0) --------------------------------------------- */
|
||||
test("a second onNodeCreated adds no second Refresh, Manage or preview widget", async () => {
|
||||
resetDom();
|
||||
|
||||
@@ -447,5 +447,21 @@ class FingerprintTests(unittest.TestCase):
|
||||
self.assertEqual(after, _NO_FINGERPRINT)
|
||||
|
||||
|
||||
class StaleSelectionTests(unittest.TestCase):
|
||||
"""2.8.0: a name this vault does not hold must reach execute(), not fail validation."""
|
||||
|
||||
def test_validate_inputs_names_character_and_accepts_anything(self):
|
||||
import inspect
|
||||
|
||||
from nodes import identity_forge_vault_load as vault_load
|
||||
node = getattr(vault_load, "IdentityForgeVaultLoad", None)
|
||||
if node is None:
|
||||
self.skipTest("comfy_api stub not registered")
|
||||
# ComfyUI skips its combo check only for inputs validate_inputs names.
|
||||
self.assertIn("character", inspect.getfullargspec(node.validate_inputs).args)
|
||||
for stale in ("deleted long ago", "(no characters saved)", "(random saved character)"):
|
||||
self.assertIs(node.validate_inputs(character=stale), True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(verbosity=2)
|
||||
|
||||
Reference in New Issue
Block a user