Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34f2c89740 | ||
|
|
26c5416fc5 | ||
|
|
fbf5bad67e | ||
|
|
70d7e5374a |
@@ -41,10 +41,10 @@ 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@5fda3b95a4ea91299a34e894583c3862153e4b97
|
||||
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Validate data integrity
|
||||
@@ -109,7 +109,7 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
|
||||
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0
|
||||
with:
|
||||
python-version: "3.13"
|
||||
- name: Install ruff
|
||||
@@ -129,9 +129,9 @@ 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@820762786026740c76f36085b0efc47a31fe5020
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
|
||||
with:
|
||||
# registerHooks (tests/frontend/hooks.mjs) needs >=22.15.0 / >=23.5.0.
|
||||
node-version: "24"
|
||||
|
||||
@@ -8,12 +8,14 @@ investigation notes, 1.5.0+ — the reasoning for every item in the release list
|
||||
|
||||
## Current state
|
||||
|
||||
_Last verified: 2026-11-18_
|
||||
_Last verified: 2026-11-24_
|
||||
|
||||
- **Status:** in active development; main is v2.7.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).
|
||||
- **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".
|
||||
- **2.6.0** - Audit fixes: framing pins release what they refuse (`pin_framing`), the Outfit Sheet busts the cache, user archetypes keep lists and variants and user cosplayers keep alternates, back views and `subject`, gallery cache offline back-off and raster-only, roll route ignores non-text values, case-only vault rename, shared gallery page assets, ruff pinned, example workflows and node contracts tested. Adds the Scene Sheet node, picker stars, a random saved character on Vault Load, and Turnaround / Expression / Scene Sheet example workflows. Random characters unchanged. See docs/history.md -> "2.6.0".
|
||||
@@ -21,9 +23,6 @@ _Last verified: 2026-11-18_
|
||||
- **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".
|
||||
- **1.11.0** - Roster release: new cosplayers (incl. Birdie, Vecna on the mascot route), retro archetypes (Carhop at a new drive-in location, Zoot Suit men's only), four creatures, a `_GALLERY_SHOT` framing pin, Lola Bunny's paws, Tellarite's canon text (snout still unrendered). Random characters move only through the new location (about 5% of seeds, those drawing an urban outdoor place). Corinthian, Feyd-Rautha, barreleye, vampire squid and the pachuca variant declined on the render bar. See docs/history.md -> "1.11.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.
|
||||
|
||||
|
||||
+5
-29
@@ -223,7 +223,6 @@ and only the first was visible:
|
||||
2. **The identity was not actually fixed.** `index` advances between queues, so a complete set
|
||||
took N queues — and any upstream preset left on `control_after_generate="randomize"`
|
||||
re-rolled the character between them. A "turnaround" of six different people.
|
||||
3. It needed the ComfyUI#11905 NaN signature purely to work around its own `index` widget.
|
||||
|
||||
The rewrite deletes the questions rather than documenting answers, on one line:
|
||||
**Identity Forge owns the character and the scene; the Turnaround owns only the camera.**
|
||||
@@ -239,9 +238,6 @@ The rewrite deletes the questions rather than documenting answers, on one line:
|
||||
negative prompt, model, latent — broadcast off their last element (`slice_dict`). One queue,
|
||||
the whole set, from a single upstream resolution. Which also means an upstream node left on
|
||||
`randomize` is now a *feature*: each queue is one new character × N coherent views.
|
||||
- **No `fingerprint_inputs`.** With no auto-advancing widget and no RNG the node is a pure
|
||||
function of its inputs, so ComfyUI's normal caching is correct — see the counter-example
|
||||
note under "Seeded nodes re-roll every queue".
|
||||
- **`shot_type` is composed, not picked.** That field mixes distance ("full body shot"),
|
||||
orientation ("side profile") and lens in one pool, so a turnaround cannot express both halves
|
||||
by choosing a value. `compose_shot()` emits `"<distance>, <rotation>"`. The free text survives
|
||||
@@ -376,15 +372,12 @@ each of these. The Turnaround shipped its first draft missing the last two.
|
||||
3. `scripts/dump_frontend_fixtures.py` — `_NODE_CLASSES`. The fixture is what the jsdom
|
||||
suite builds fake nodes from, so a node absent from that map has **no** frontend
|
||||
coverage and its `--check` gate silently passes forever.
|
||||
4. `fingerprint_inputs` returning NaN **if** any widget sets `control_after_generate` —
|
||||
see "Seeded nodes re-roll every queue" below. The trigger is the auto-advancing
|
||||
widget, not the presence of a seed.
|
||||
5. A tooltip on **every** input and output. There is no lint for this; the frontend fixture
|
||||
4. A tooltip on **every** input and output. There is no lint for this; the frontend fixture
|
||||
records widget names and defaults, not help text. Since 2.6.0
|
||||
`tests/test_node_contracts.py` walks every class in `nodes/` and checks both tooltips and
|
||||
item 4, so a new node is covered without being listed (the Outfit Sheet had shipped with
|
||||
an auto-advancing `outfit_seed` and no cache buster).
|
||||
6. An example workflow, if the node is meant to be wired by hand: build it in a real
|
||||
`tests/test_node_contracts.py` walks every class in `nodes/` and checks the tooltips, so a
|
||||
new node is covered without being listed. No node needs a cache buster: a seed widget's
|
||||
value is already part of ComfyUI's cache signature (2.7.1).
|
||||
5. An example workflow, if the node is meant to be wired by hand: build it in a real
|
||||
frontend, then `tests/test_example_workflows.py` checks every pack node's
|
||||
`widgets_values` count and combo values against the fixture.
|
||||
|
||||
@@ -2636,16 +2629,6 @@ README gets a short "Using with Stylebook" section mirroring Stylebook's own, an
|
||||
Full preset comes out in tennis whites with a human tone, losing the green. To **layer** a tilt
|
||||
onto a cosplay instead of overwriting it, set the archetype (or cosplayer) to **Essentials** so it
|
||||
emits only the look groups and leaves the rest to flow through.
|
||||
- **Every node with an auto-advancing widget re-executes each queue via `fingerprint_inputs`.**
|
||||
`IdentityForge`, `Archetype`, `Cosplayer` and `Creature` return `float("nan")` from
|
||||
`fingerprint_inputs`, forcing ComfyUI to re-execute them -- otherwise a widget advanced by
|
||||
`control_after_generate` can be served from cache and the output "sticks" (ComfyUI#11905).
|
||||
The trigger is the auto-advancing widget, not the seed as such. Pure cache control (no RNG):
|
||||
a *fixed* seed still reproduces exactly, and identical output keeps expensive downstream nodes
|
||||
cached. **The Turnaround is the counter-example and stays one:** it carries no
|
||||
`control_after_generate` widget and no RNG, so it is a pure function of its inputs and
|
||||
ComfyUI's normal caching is correct for it. It had the NaN signature at 0.98.0 only because
|
||||
its `index` combo auto-advanced; 0.99.0 deleted the widget, so the workaround went with it.
|
||||
- Adding RNG draws in the creature node mid-sequence shifts seed→creature mapping — append draws
|
||||
at the end.
|
||||
- The roster is large (~1300 cosplayers across ~263 franchises, ~195 creatures): always grep
|
||||
@@ -3535,13 +3518,6 @@ that relaxation. This means `random_pool` **stacks** with `random_scope` — "Fr
|
||||
"Mascot suits and beasts only" is a real, correctly-intersected query, not two competing filters
|
||||
that only one of which can win.
|
||||
|
||||
**`fingerprint_inputs` needed no change.** This node's `fingerprint_inputs` already ignores every
|
||||
kwarg and unconditionally returns `float("nan")` — a pre-existing workaround for
|
||||
ComfyUI#11905 that forces a re-roll on every queue regardless of any single field's value. Since
|
||||
caching is already bypassed for every input, there is nothing to add for `random_pool`
|
||||
specifically; the code documents this in a comment rather than a no-op kwargs read that would
|
||||
otherwise look like an oversight to a future reader.
|
||||
|
||||
`_announce_scope` folds `pool` into its cache key and message text, but the default pool
|
||||
(`All characters`) omits the note entirely, so a pre-1.1.0 announcement string is unchanged
|
||||
byte-for-byte — the new widget is additive to the message surface, never a rewording of it.
|
||||
|
||||
@@ -1841,3 +1841,44 @@ A "same seed, one lock changed" row was considered and dropped: locking an early
|
||||
field (age) re-rolls nearly everything after it, so the pair would show two different
|
||||
people and teach the wrong thing. A late field (the location setting) does keep the
|
||||
person, which is worth a note in the usage docs if the row is ever wanted.
|
||||
|
||||
## 2.7.1 - downstream nodes cache again
|
||||
|
||||
Contributed by sobakasu in PR #20. The seeded nodes (Identity Forge, Archetype, Cosplayer,
|
||||
Creature), the Outfit Sheet and a random Vault Load pick returned `float("nan")` from
|
||||
`fingerprint_inputs` as a workaround for ComfyUI#11905. That was wrong: ComfyUI builds a
|
||||
node's cache key from every ancestor's fingerprint (`comfy_execution/caching.py`,
|
||||
`get_node_signature`), and NaN never equals itself, so the sampler, VAE decode and everything
|
||||
else downstream re-ran on every queue even with a fixed seed. The old comment claiming identical
|
||||
output kept downstream cached described a cache ComfyUI does not have. A seed value is already
|
||||
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.");
|
||||
|
||||
@@ -5116,16 +5116,6 @@ if _COMFY_AVAILABLE:
|
||||
],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def fingerprint_inputs(cls, **kwargs: Any) -> float:
|
||||
# Force a fresh roll on every queue. ComfyUI can serve a stale cached
|
||||
# result when control_after_generate auto-advances the seed (ComfyUI
|
||||
# #11905); returning a never-equal value (NaN) makes this node's cache
|
||||
# signature always differ, so it re-executes and reads the new seed.
|
||||
# Pure cache control -- no RNG here, so a fixed seed still reproduces
|
||||
# exactly and nothing biases the randomization.
|
||||
return float("nan")
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
return io.NodeOutput(*run_identity_forge(kwargs))
|
||||
|
||||
@@ -275,16 +275,6 @@ if _COMFY_AVAILABLE:
|
||||
)],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def fingerprint_inputs(cls, **kwargs: Any) -> float:
|
||||
# Force a fresh roll on every queue. ComfyUI can serve a stale cached
|
||||
# result when control_after_generate auto-advances the seed (ComfyUI
|
||||
# #11905); returning a never-equal value (NaN) makes this node's cache
|
||||
# signature always differ, so it re-executes and reads the new seed.
|
||||
# Pure cache control -- no RNG here, so a fixed seed still reproduces
|
||||
# exactly and nothing biases the randomization.
|
||||
return float("nan")
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
own = build_archetype_json(
|
||||
|
||||
@@ -1041,20 +1041,6 @@ if _COMFY_AVAILABLE:
|
||||
)],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def fingerprint_inputs(cls, **kwargs: Any) -> float:
|
||||
# Force a fresh roll on every queue. ComfyUI can serve a stale cached
|
||||
# result when control_after_generate auto-advances the seed (ComfyUI
|
||||
# #11905); returning a never-equal value (NaN) makes this node's cache
|
||||
# signature always differ, so it re-executes and reads the new seed.
|
||||
# Pure cache control -- no RNG here, so a fixed seed still reproduces
|
||||
# exactly and nothing biases the randomization. Unconditional (ignores
|
||||
# kwargs entirely), so a new widget such as random_pool needs no entry
|
||||
# here: caching is already bypassed for every input, not enumerated
|
||||
# per-field -- see docs/architecture.md "Seeded nodes re-roll every
|
||||
# queue".
|
||||
return float("nan")
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
own = build_cosplayer_json(
|
||||
|
||||
@@ -483,16 +483,6 @@ if _COMFY_AVAILABLE:
|
||||
)],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def fingerprint_inputs(cls, **kwargs: Any) -> float:
|
||||
# Force a fresh roll on every queue. ComfyUI can serve a stale cached
|
||||
# result when control_after_generate auto-advances the seed (ComfyUI
|
||||
# #11905); returning a never-equal value (NaN) makes this node's cache
|
||||
# signature always differ, so it re-executes and reads the new seed.
|
||||
# Pure cache control -- no RNG here, so a fixed seed still reproduces
|
||||
# exactly and nothing biases the randomization.
|
||||
return float("nan")
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
own = build_creature_json(
|
||||
|
||||
@@ -187,7 +187,6 @@ if _COMFY_AVAILABLE:
|
||||
],
|
||||
)
|
||||
|
||||
# No fingerprint_inputs: no RNG and no auto-advancing widget (see Turnaround).
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
|
||||
@@ -256,13 +256,6 @@ if _COMFY_AVAILABLE:
|
||||
],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def fingerprint_inputs(cls, **kwargs: Any) -> Any:
|
||||
# 2.6.0: outfit_seed auto-advances (control_after_generate), and
|
||||
# ComfyUI#11905 can serve a stale cached result for that; NaN never equals
|
||||
# itself, so the node always re-runs. Identical prompts keep downstream cached.
|
||||
return float("nan")
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
prompts, labels = resolve_outfit_sheet(
|
||||
|
||||
@@ -31,9 +31,6 @@ Why a list output rather than an auto-incrementing ``index`` widget:
|
||||
downstream once per element (``execution.py`` -> ``merge_result_data``), and
|
||||
shorter inputs — the negative prompt, the model, the latent — broadcast off
|
||||
their last element, so an ordinary graph needs no rewiring.
|
||||
* **No cache hack.** With no auto-advancing widget and no RNG this node is a pure
|
||||
function of its inputs, so it needs no ``fingerprint_inputs`` (contrast the
|
||||
four seeded nodes — architecture.md -> "Seeded nodes re-roll every queue").
|
||||
|
||||
Why the resolved document is enough to re-render from: ``prompt_json`` is
|
||||
self-describing by contract — it is exactly what Vault Save writes and Vault Load
|
||||
@@ -529,11 +526,6 @@ if _COMFY_AVAILABLE:
|
||||
],
|
||||
)
|
||||
|
||||
# No fingerprint_inputs on purpose. The four seeded nodes need one because
|
||||
# control_after_generate silently advances a widget between queues
|
||||
# (ComfyUI#11905); this node has no such widget and no RNG, so it is a
|
||||
# pure function of its inputs and ComfyUI's normal caching is correct.
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
prompts, labels = resolve_turnaround(
|
||||
|
||||
@@ -232,8 +232,7 @@ def _character_fingerprint(vault_root: Path | str, name: str) -> Any:
|
||||
cached ``character_json`` instead of re-reading the file. Folding the
|
||||
selected entry's mtime + size into :meth:`fingerprint_inputs` makes a
|
||||
changed (or now-missing) file force a cache miss; an unchanged file still
|
||||
caches normally, unlike the NaN pattern the other preset nodes use (which
|
||||
disables caching on every queue, not only on a real change).
|
||||
caches normally.
|
||||
"""
|
||||
try:
|
||||
entry = _entry_dir(Path(vault_root), name)
|
||||
@@ -307,17 +306,25 @@ 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
|
||||
# mtime+size into the cache key so an Overwrite/rename/delete that
|
||||
# left the `character` widget unchanged still invalidates the cache.
|
||||
# 2.6.0: a random pick rides an auto-advancing seed, which ComfyUI#11905
|
||||
# can serve stale from cache; NaN never equals itself, so it always re-runs
|
||||
# (cheap: one file read, and identical output keeps downstream cached).
|
||||
if kwargs.get("character") == _RANDOM:
|
||||
return float("nan")
|
||||
return _character_fingerprint(_vault_root(), kwargs.get("character", _NO_CHARACTERS))
|
||||
# 2.7.1: a random pick folds in WHICH entry the seed lands on, so a save or
|
||||
# delete that moves the pick re-runs; the seed itself is already in the key.
|
||||
root = _vault_root()
|
||||
name = resolve_selection(root, kwargs.get("character", _NO_CHARACTERS),
|
||||
int(kwargs.get("seed", 0) or 0))
|
||||
return (name, _character_fingerprint(root, name))
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "comfyui-identity-forge"
|
||||
version = "2.7.0"
|
||||
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();
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
"""Contracts every node class in ``nodes/`` keeps (2.6.0).
|
||||
|
||||
These were per-node tests (the Turnaround's tooltip check) or memory-only rules, and
|
||||
the Outfit Sheet shipped in 2.3.0 with an auto-advancing ``outfit_seed`` and no cache
|
||||
buster. Walking every module means a new node is covered without anyone listing it.
|
||||
These were per-node tests (the Turnaround's tooltip check) or memory-only rules.
|
||||
Walking every module means a new node is covered without anyone listing it.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -43,20 +42,14 @@ class NodeContractTests(unittest.TestCase):
|
||||
self.assertTrue((output.tooltip or "").strip(),
|
||||
f"{name} output {output.display_name}")
|
||||
|
||||
def test_an_auto_advancing_widget_busts_the_cache(self):
|
||||
"""ComfyUI#11905 can serve a cached result after a control_after_generate
|
||||
widget advances; such a node must define fingerprint_inputs (NaN when it
|
||||
matters, see the seeded nodes and Vault Load's random pick)."""
|
||||
def test_no_node_returns_a_nan_fingerprint(self):
|
||||
"""2.7.1: NaN never equals itself, and ComfyUI folds every ancestor's
|
||||
fingerprint into a node's cache key, so one NaN re-runs the whole graph
|
||||
downstream (sampler included) every queue. A seed is already in the key."""
|
||||
for name, cls in self.classes.items():
|
||||
if any(getattr(spec, "control_after_generate", None)
|
||||
for spec in cls.define_schema().inputs):
|
||||
self.assertIn("fingerprint_inputs", cls.__dict__, name)
|
||||
|
||||
def test_outfit_sheet_and_a_random_vault_pick_always_rerun(self):
|
||||
self.assertTrue(math.isnan(
|
||||
self.classes["IdentityForgeOutfitSheet"].fingerprint_inputs(outfit_seed=3)))
|
||||
self.assertTrue(math.isnan(self.classes["IdentityForgeVaultLoad"].fingerprint_inputs(
|
||||
character="(random saved character)", seed=3)))
|
||||
if "fingerprint_inputs" in cls.__dict__:
|
||||
value = cls.fingerprint_inputs(character="(random saved character)", seed=3)
|
||||
self.assertFalse(isinstance(value, float) and math.isnan(value), name)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -452,16 +452,11 @@ class SchemaShapeTests(unittest.TestCase):
|
||||
"only 'pose' may share a name with an IdentityForge input")
|
||||
|
||||
def test_no_widget_auto_advances(self):
|
||||
# The corollary of having no fingerprint_inputs: this node is a pure
|
||||
# function, so ComfyUI's normal caching is correct. A widget with
|
||||
# control_after_generate would reintroduce ComfyUI#11905 and need the
|
||||
# NaN signature back (architecture.md -> "Seeded nodes re-roll every queue").
|
||||
for spec in self.schema.inputs:
|
||||
self.assertIsNone(getattr(spec, "control_after_generate", None), spec.id)
|
||||
# `vars`, not `hasattr`: the real comfy_api's ComfyNode base declares
|
||||
# fingerprint_inputs (raising NotImplementedError), so hasattr is True on
|
||||
# every node and would assert nothing. The stub declares no such method,
|
||||
# which is exactly how a hasattr check passes here and fails in ComfyUI.
|
||||
# every node. The test stub also declares the base method.
|
||||
self.assertNotIn("fingerprint_inputs", vars(IdentityForgeTurnaround))
|
||||
|
||||
def test_character_json_is_a_required_socket_not_a_multiline_box(self):
|
||||
|
||||
@@ -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