Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29dcb52f68 | ||
|
|
a0d5c84d57 |
@@ -8,20 +8,20 @@ investigation notes, 1.5.0+ — the reasoning for every item in the release list
|
||||
|
||||
## Current state
|
||||
|
||||
_Last verified: 2026-10-24 (2.1.0)_
|
||||
_Last verified: 2026-10-30 (2.3.0)_
|
||||
|
||||
- **Status:** in active development; main is v2.1.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, 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.
|
||||
- **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 (start with caped or back-emblem heroes) 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).
|
||||
- **Status:** in active development; main is v2.3.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`.
|
||||
- **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.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".
|
||||
- **1.10.0** - Expression Sheet node, free-text `held_item` on the Modifier, legwear dropped from prose in leg-cropping shots, "a coat of fur" no longer read as a pocketed garment, an overload drift test, and a gallery gate that fails on rendered-but-unpublished images (`--publish-pending`). Random characters unchanged; Bartok (now feral), Lola Bunny and Tasmanian Devil repaired and re-rendered (Tellarite deferred to 1.11.0). See docs/history.md -> "1.10.0".
|
||||
- **1.9.0** - Sandman and independent-comics curation, Savage Dragon likeness repair, a Morris Dancer archetype, deployment-only gallery manifests, and accurate engine/preset typing. See docs/history.md -> "1.9.0".
|
||||
- **1.8.0** — Picker trait facets read structured `traits` (Poison Ivy is no longer "Tiny"); ethnicity and skin tone lock only in Full character / Full preset; a seventh `subject_text` output (person and outfit, no scene); colour and pattern modifiers reach a generated outfit; widgets_values saved in schema order for headless tools; `--unreachable` gate; publish depends on CI with a Windows leg; new cosplayers (incl. The Invisibles), three archetypes and a stegosaurus; the duplicate Julia Carpenter entry folded into one. See docs/history.md → "1.8.0".
|
||||
- **1.7.0** — Engine and UX fixes from the 1.6.0 review: "Roll + lock all" locks one engine roll (a new read-only `POST /identity_forge/roll` route) instead of uniform per-dropdown picks; a framing that crops the feet no longer names the shoes in the prose (the JSON keeps them); hair styles and noun lengths are voiced as prose, not a tag list; a footwear or legwear modifier now reaches a generated outfit; the Modifier help example decorates single fields; `generate_character` is keyword-only from `widget_locked`. See docs/history.md → "1.7.0".
|
||||
- **1.6.0** — Content only, mined from third-party wildcard packs: weather as two `lighting` families (rain/drizzle/fog, falling snow) gated outdoors and by season; a `troubled` expression family for the heavy mood; social hand gestures; mohawk, faux hawk and three braid styles; new hair colours and highlights (skunk stripe weighted rare); new outfit-corpus entries weighted to the thin menswear/unisex cells, pyjamas under `loungewear`; new archetypes (Wedding Groom, Lehenga & Sherwani, Yukata, Hanfu, Kebaya, Metalhead and others) and alternate bridal gowns; three cultural archetypes no longer pin a pale skin tone in Full preset. Engine/UX findings are queued for 1.7.0. See docs/history.md → "1.6.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).
|
||||
|
||||
@@ -44,6 +44,7 @@ _Last verified: 2026-10-24 (2.1.0)_
|
||||
| `scripts/` | Reference doc generator, JS data sync generator, frontend schema fixture generator, release stamper, gallery renderer + hash gate |
|
||||
| `docs/` | Usage, architecture (deep reference), cosplayer/creature notes |
|
||||
| `gallery/` | Sample render manifests and build scripts (images on `gh-pages` only) |
|
||||
| `example_workflows/` | Ready-made workflows; ComfyUI lists them in its template browser. Build them in the real frontend (an isolated instance), never by hand: `widgets_values` order is positional |
|
||||
|
||||
## Build / test / run
|
||||
|
||||
|
||||
@@ -27,7 +27,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), a Female/Male filter, and optional thumbnail previews. Franchise is searchable too, just not a dedicated facet chip. 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; reloading starts fresh.
|
||||
**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 franchise filters, 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; reloading starts fresh.
|
||||
|
||||
**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.
|
||||
|
||||
@@ -46,6 +46,13 @@ The **Expression Sheet** node is its face-side sibling: the same resolved charac
|
||||
expression (neutral, smile, laughing, surprised, serious, sad, and more), with only the expression,
|
||||
mood and smile changing. See [docs/usage.md](docs/usage.md#expression-sheets).
|
||||
|
||||
Two more sheets work the same way. The **Outfit Sheet** keeps the person and redresses them once per
|
||||
outfit style (casual, business formal, evening formal and so on) on a plain studio backdrop, and the
|
||||
**Age Progression** node shows the same person at several ages, greying natural hair as they age.
|
||||
See [docs/usage.md](docs/usage.md#outfit-sheets) and [docs/usage.md](docs/usage.md#age-progression).
|
||||
Ready-made workflows for both are in [example_workflows/](example_workflows/) and in ComfyUI's
|
||||
template browser under Identity Forge.
|
||||
|
||||
### Additional layers
|
||||
|
||||
- **Archetype:** Themed looks (knight, sorceress, astronaut, surgeon, 1950s homemaker…) that set the *look* while the person randomizes.
|
||||
@@ -139,6 +146,8 @@ randomized identities, so your own results will vary:
|
||||
| **Vault Save / Load** | Save a generated character (with a thumbnail) to a local vault; recall it later as a chainable preset, with a Manage Vault gallery. |
|
||||
| **Turnaround** | A reference-sheet builder: wire Identity Forge's `prompt_json` in and it emits front / three-quarter / profile / back as a **list**, so one queue renders the whole set of the same person. It only moves the camera - the character and the scene stay configured on Identity Forge. |
|
||||
| **Expression Sheet** | The same idea for the face: wire `prompt_json` in and it emits one prompt per expression (Basic 6, Full 10 or Smiles 3) as a **list**. Only expression, mood and smile change (plus the gaze, if you pick one to hold). |
|
||||
| **Outfit Sheet** | Wire `prompt_json` in and it emits one prompt per outfit style (Range 6, Everyday 4, Work to evening 4 or Every style) as a **list**: the same person redressed, on a studio backdrop or in their own scene; `outfit_seed` re-rolls every outfit for the same person. Makeup, jewellery and hair styling follow the outfit; face and body stay. A cosplay or full-suit character gives a single view. |
|
||||
| **Age Progression** | Wire `prompt_json` in and it emits the same person at several ages (Life stages 4, Decades 6 or Young and old 2) as a **list**. Natural hair greys with age; dyed, vivid and costume hair stay as they are. A masked character gives a single view. |
|
||||
|
||||
---
|
||||
|
||||
|
||||
+70
-2
@@ -1,6 +1,6 @@
|
||||
"""comfyui-identity-forge — V3 custom node pack entrypoint.
|
||||
|
||||
Exposes nine nodes:
|
||||
Exposes eleven nodes:
|
||||
|
||||
* ``IdentityForge`` — a multi-field character description randomizer with a
|
||||
constraint engine and dual prose/JSON output.
|
||||
@@ -15,6 +15,10 @@ Exposes nine nodes:
|
||||
view of it as a list, so one queue renders a whole reference set.
|
||||
* ``IdentityForgeExpressionSheet`` - the same idea for the face: one resolved
|
||||
character, several expressions, as a list.
|
||||
* ``IdentityForgeOutfitSheet`` - the same idea for the clothes: one resolved
|
||||
character, several outfit styles, as a list.
|
||||
* ``IdentityForgeAgeProgression`` - one resolved character at several ages, as a
|
||||
list.
|
||||
* ``IdentityForgeVaultSave`` — save a generated character to a local vault.
|
||||
* ``IdentityForgeVaultLoad`` — recall a saved character as a chainable preset.
|
||||
|
||||
@@ -43,6 +47,8 @@ try:
|
||||
from .nodes.identity_forge_modifier import IdentityForgeModifier
|
||||
from .nodes.identity_forge_turnaround import IdentityForgeTurnaround
|
||||
from .nodes.identity_forge_expression_sheet import IdentityForgeExpressionSheet
|
||||
from .nodes.identity_forge_outfit_sheet import IdentityForgeOutfitSheet
|
||||
from .nodes.identity_forge_age_progression import IdentityForgeAgeProgression
|
||||
from .nodes.identity_forge_vault_save import IdentityForgeVaultSave
|
||||
from .nodes.identity_forge_vault_load import IdentityForgeVaultLoad
|
||||
except ImportError: # pragma: no cover
|
||||
@@ -53,6 +59,8 @@ except ImportError: # pragma: no cover
|
||||
from nodes.identity_forge_modifier import IdentityForgeModifier
|
||||
from nodes.identity_forge_turnaround import IdentityForgeTurnaround
|
||||
from nodes.identity_forge_expression_sheet import IdentityForgeExpressionSheet
|
||||
from nodes.identity_forge_outfit_sheet import IdentityForgeOutfitSheet
|
||||
from nodes.identity_forge_age_progression import IdentityForgeAgeProgression
|
||||
from nodes.identity_forge_vault_save import IdentityForgeVaultSave
|
||||
from nodes.identity_forge_vault_load import IdentityForgeVaultLoad
|
||||
|
||||
@@ -204,8 +212,67 @@ def _register_roll_route() -> None:
|
||||
return web.json_response({"values": roll_field_values(widgets, seed)})
|
||||
|
||||
|
||||
def _register_gallery_routes() -> None:
|
||||
"""2.3.0: the roster picker's preview images, served from ComfyUI's own origin.
|
||||
|
||||
The server fetches the gh-pages gallery on the browser's behalf and caches it on
|
||||
disk (see ``nodes/gallery_cache.py``), so previews work under ``--offline``'s CSP
|
||||
and survive a later loss of network. Only the picker's opt-in preview toggle calls
|
||||
these. ``clear`` is a POST with a JSON body for the CSRF reason in
|
||||
``_register_vault_routes``.
|
||||
"""
|
||||
try:
|
||||
import asyncio
|
||||
|
||||
from aiohttp import web
|
||||
from server import PromptServer # type: ignore[import-not-found]
|
||||
|
||||
from .nodes import gallery_cache
|
||||
except Exception as exc: # noqa: BLE001 - never block node registration
|
||||
_LOG.warning("Gallery routes not registered: %s", exc)
|
||||
return
|
||||
|
||||
routes = PromptServer.instance.routes
|
||||
|
||||
async def _serve(fetch, *args): # type: ignore[no-untyped-def]
|
||||
try:
|
||||
# urllib blocks; keep it off the event loop.
|
||||
path = await asyncio.to_thread(fetch, *args, gallery_cache.default_root())
|
||||
except gallery_cache.GalleryError as exc:
|
||||
return web.Response(status=404, text=str(exc))
|
||||
return web.FileResponse(path)
|
||||
|
||||
@routes.get("/identity_forge/gallery/{kind}/manifest.json")
|
||||
async def _manifest(request): # type: ignore[no-untyped-def]
|
||||
response = await _serve(gallery_cache.manifest_path, request.match_info["kind"])
|
||||
# Freshness is the cache's job (revalidated every 10 minutes); the browser
|
||||
# must ask again rather than hold its own copy.
|
||||
response.headers["Cache-Control"] = "no-cache"
|
||||
return response
|
||||
|
||||
@routes.get("/identity_forge/gallery/{kind}/{relative:images/.+}")
|
||||
async def _image(request): # type: ignore[no-untyped-def]
|
||||
return await _serve(gallery_cache.image_path, request.match_info["kind"],
|
||||
request.match_info["relative"])
|
||||
|
||||
@routes.get("/identity_forge/gallery/cache")
|
||||
async def _size(_request): # type: ignore[no-untyped-def]
|
||||
root = gallery_cache.default_root()
|
||||
return web.json_response(
|
||||
{"bytes": await asyncio.to_thread(gallery_cache.cache_bytes, root)})
|
||||
|
||||
@routes.post("/identity_forge/gallery/cache/clear")
|
||||
async def _clear(request): # type: ignore[no-untyped-def]
|
||||
_body, error = await _json_body(request)
|
||||
if error is not None:
|
||||
return error
|
||||
await asyncio.to_thread(gallery_cache.clear, gallery_cache.default_root())
|
||||
return web.json_response({"bytes": 0})
|
||||
|
||||
|
||||
_register_vault_routes()
|
||||
_register_roll_route()
|
||||
_register_gallery_routes()
|
||||
|
||||
|
||||
class IdentityForgeExtension(ComfyExtension):
|
||||
@@ -214,7 +281,8 @@ class IdentityForgeExtension(ComfyExtension):
|
||||
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||
return [IdentityForge, IdentityForgeArchetype, IdentityForgeCosplayer,
|
||||
IdentityForgeCreature, IdentityForgeModifier, IdentityForgeTurnaround,
|
||||
IdentityForgeExpressionSheet,
|
||||
IdentityForgeExpressionSheet, IdentityForgeOutfitSheet,
|
||||
IdentityForgeAgeProgression,
|
||||
IdentityForgeVaultSave, IdentityForgeVaultLoad]
|
||||
|
||||
|
||||
|
||||
+6
-3
@@ -1270,7 +1270,8 @@ for _places, _styles in (
|
||||
"art gallery opening night", "grand cathedral interior",
|
||||
"hotel lobby with marble floors", "grand hotel suite",
|
||||
"cruise ship interior corridor", "the back seat of a taxi", "rooftop cocktail bar",
|
||||
"rooftop terrace overlooking the skyline", "castle courtyard"], _DRESSY),
|
||||
"rooftop terrace overlooking the skyline", "castle courtyard",
|
||||
"gilded palace throne room"], _DRESSY),
|
||||
(["walk-in closet with mirrors", "tiled bathroom with a large mirror",
|
||||
"tidy bedroom with a neatly made bed"], _DRESSY | {"business formal"}),
|
||||
# A night out, a date, a wedding guest -- cocktail but not black tie.
|
||||
@@ -1340,7 +1341,8 @@ for _places, _styles in (
|
||||
"luxury retail boutique", "department store perfume counter",
|
||||
"courtroom", "grand cathedral interior", "small chapel interior",
|
||||
"mosque interior", "synagogue interior", "Buddhist temple hall",
|
||||
"Shinto shrine interior", "art gallery opening night", "city hall rotunda"],
|
||||
"Shinto shrine interior", "art gallery opening night", "city hall rotunda",
|
||||
"gilded palace throne room"],
|
||||
frozenset(["athletic"])),
|
||||
(["neon-lit nightclub"], frozenset(["athletic", "business formal"])),
|
||||
# 1.5.0 round 2: a hoodie-and-cargo look at a formal dinner or in court.
|
||||
@@ -1811,7 +1813,8 @@ for _style, _denied in PALETTE_DENIED_BY_STYLE.items():
|
||||
# --- casual headwear stays out of formal rooms; freckles on deep skin ----------------
|
||||
for _loc in ("fine dining restaurant interior", "elegant hotel dining room",
|
||||
"dimly lit cocktail lounge", "courtroom", "grand cathedral interior",
|
||||
"small chapel interior", "art gallery opening night", "formal dining room with chandelier"):
|
||||
"small chapel interior", "art gallery opening night", "formal dining room with chandelier",
|
||||
"gilded palace throne room"):
|
||||
CONSTRAINT_RULES.append({
|
||||
"type": "exclusion", "field": "location", "value": _loc,
|
||||
"excludes_field": "accessories",
|
||||
|
||||
+214
-37
@@ -323,6 +323,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"costume": "a brown Survey Corps jacket with the Wings of Freedom emblem, an "
|
||||
"omni-directional maneuver gear harness, white pants, brown mid-calf "
|
||||
"boots, and a red scarf",
|
||||
"costume_back": "a brown Survey Corps jacket with the large Wings of Freedom emblem across the back, an omni-directional maneuver gear harness, white pants, brown mid-calf boots, and a red scarf",
|
||||
"signature": {"hair_color": "jet black", "hair_length": "chin length bob",
|
||||
"hair_style": "worn down", "eye_color": "dark gray"},
|
||||
"physique": {"body_type": "athletic", "height": "average height", "skin_tone": "light medium"},
|
||||
@@ -1865,6 +1866,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Female",
|
||||
"costume": "a red, blue, and gold Kree flight suit with a gold eight-pointed "
|
||||
"starburst chest emblem, red gloves, and red boots",
|
||||
"costume_back": "a red, blue, and gold Kree flight suit, red gloves, and red boots",
|
||||
"costumes": [
|
||||
# Classic Ms. Marvel identity (black lightning-bolt leotard, red sash, domino mask).
|
||||
{
|
||||
@@ -2012,6 +2014,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Female",
|
||||
"costume": "a blue crop top with the Superman S-shield, a red miniskirt, a red "
|
||||
"cape, and red mid-thigh boots",
|
||||
"costume_back": "a blue crop top, a red cape falling down the back over a red miniskirt, and red mid-thigh boots",
|
||||
"costumes": [
|
||||
# Animated-series look (white crop top, sleek straight hair).
|
||||
{
|
||||
@@ -2479,6 +2482,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Male",
|
||||
"costume": "sleeveless silver and black armor with rows of circular silver chest "
|
||||
"discs, a flowing red cape, and engraved bracers",
|
||||
"costume_back": "a flowing red cape falling down the back over sleeveless silver and black armor, and engraved bracers",
|
||||
"signature": {"hair_color": "golden blonde", "hair_length": "long",
|
||||
"facial_hair": "short beard", "eye_color": "bright blue"},
|
||||
"physique": {"body_type": "athletic", "height": "tall", "skin_tone": "fair"},
|
||||
@@ -2531,6 +2535,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"costume": "a dark blue tunic with a wide sash and high collar, a flowing red "
|
||||
"Cloak of Levitation with a tall collar, and a golden Eye of Agamotto "
|
||||
"amulet at the throat",
|
||||
"costume_back": "a flowing red Cloak of Levitation with a tall collar falling down the back over a dark blue tunic and wide sash",
|
||||
"signature": {"hair_color": "gray-streaked dark hair", "hair_length": "very short",
|
||||
"facial_hair": "goatee", "eye_color": "gray"},
|
||||
"physique": {"body_type": "lean", "height": "tall", "skin_tone": "fair"},
|
||||
@@ -2723,6 +2728,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"costume": "a black bodysuit with a bright green torso and shoulders, a green "
|
||||
"circular lantern emblem on the chest, a green domino mask, green "
|
||||
"gloves and boots, and a glowing green power ring worn on the finger",
|
||||
"costume_back": "a black bodysuit with a bright green torso and shoulders, and green gloves and boots",
|
||||
"signature": {"hair_color": "dark brown", "hair_length": "very short",
|
||||
"eye_color": "green"},
|
||||
"physique": {"body_type": "athletic", "height": "tall", "skin_tone": "fair"},
|
||||
@@ -2820,6 +2826,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Male",
|
||||
"costume": "a red bodysuit with a golden lightning-bolt emblem on the chest, a "
|
||||
"short white half-cape with gold trim, a golden sash, and golden boots",
|
||||
"costume_back": "a red bodysuit under a short white half-cape with gold trim, a golden sash, and golden boots",
|
||||
"signature": {"hair_color": "jet black", "hair_length": "very short",
|
||||
"eye_color": "bright blue"},
|
||||
"physique": {"body_type": "athletic", "height": "tall", "skin_tone": "fair"},
|
||||
@@ -2982,8 +2989,13 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"franchise": "Star Wars",
|
||||
"gender": "Male",
|
||||
"covers_face": True,
|
||||
"costume": "a black ribbed chest control panel, a wide belt box, and a flowing "
|
||||
"black cape",
|
||||
# 2.2.0: the suit, gloves and boots were never named, so the render drew bare
|
||||
# human hands; nothing of the wearer shows, hence covers_body.
|
||||
"covers_body": True,
|
||||
"costume": "a black padded leather bodysuit with black armored shoulder plates, "
|
||||
"black leather gloves covering both hands, a black ribbed chest control "
|
||||
"panel, a wide belt with two small control boxes, tall black boots, and "
|
||||
"a flowing black cape",
|
||||
"mask": "a glossy black domed helmet and skull-like mask with triangular eye lenses",
|
||||
"physique": {"body_type": "athletic", "height": "very tall"},
|
||||
"prop": "an ignited lightsaber with a deep red energy blade and a black "
|
||||
@@ -3512,6 +3524,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Male",
|
||||
"costume": "a brown Survey Corps jacket with the wings-of-freedom crest, a green "
|
||||
"hooded cloak, and a body harness with handheld blades on ODM gear",
|
||||
"costume_back": "a green hooded cloak with the large Wings of Freedom emblem across the back, over a brown Survey Corps jacket and a body harness with handheld blades on ODM gear",
|
||||
"signature": {"hair_color": "jet black", "hair_length": "very short",
|
||||
"hair_style": "blunt bangs", "eye_color": "dark gray"},
|
||||
"physique": {"body_type": "lean", "height": "short", "skin_tone": "fair"},
|
||||
@@ -3521,6 +3534,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Male",
|
||||
"costume": "a brown Survey Corps jacket and straps over a white shirt, a green "
|
||||
"hooded cloak, and an ODM-gear harness",
|
||||
"costume_back": "a green hooded cloak with the large Wings of Freedom emblem across the back, over a brown Survey Corps jacket, straps, and an ODM-gear harness",
|
||||
"signature": {"hair_color": "dark brown", "hair_length": "jaw length",
|
||||
"eye_color": "green"},
|
||||
"physique": {"body_type": "athletic", "height": "average height", "skin_tone": "fair"},
|
||||
@@ -3530,16 +3544,22 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Male",
|
||||
"costume": "a yellow jumpsuit with a zip collar, a white cape, red gloves, red "
|
||||
"boots, a black belt, and a completely bald shiny head",
|
||||
"costume_back": "a white cape falling down the back over a yellow jumpsuit, red gloves, red boots, a black belt, and a completely bald shiny head",
|
||||
"physique": {"body_type": "lean", "height": "average height", "skin_tone": "fair"},
|
||||
},
|
||||
"Tatsumaki": {
|
||||
"franchise": "One Punch Man",
|
||||
"gender": "Female",
|
||||
"costume": "a form-fitting black sleeveless cocktail dress and black heels, "
|
||||
"wrapped in a faint swirling green psychic aura, floating just off the ground",
|
||||
# 2.2.0: canon dress is long-sleeved and high-collared with leg slits (it read
|
||||
# "sleeveless cocktail dress"); a "faint" aura at the end of the list did not render,
|
||||
# so the glow leads. Canon age 28, pinned (the sample drew a 55-year-old).
|
||||
"costume": "a bright glowing green psychic aura swirling around the whole body, "
|
||||
"floating just off the ground, a form-fitting black long-sleeved dress "
|
||||
"with a high collar and high slits up both legs, and low black heels",
|
||||
"signature": {"hair_color": "emerald green", "hair_texture": "curly",
|
||||
"hair_length": "short pixie", "eye_color": "green"},
|
||||
"physique": {"body_type": "petite and slim", "height": "very petite"},
|
||||
"physique": {"body_type": "petite and slim", "height": "very petite", "age": "28",
|
||||
"skin_tone": "fair"},
|
||||
},
|
||||
|
||||
# --- Nintendo (male) --------------------------------------------------
|
||||
@@ -3929,6 +3949,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Male",
|
||||
"costume": "a black Soul Reaper robe under a white captain's haori, white "
|
||||
"kenseikan hair ornaments, and a white scarf",
|
||||
"costume_back": "a white captain's haori over a black Soul Reaper robe, the black kanji for six inside a diamond on the back of the haori, white kenseikan hair ornaments, and a white scarf",
|
||||
"signature": {"hair_color": "near black", "hair_length": "shoulder length",
|
||||
"hair_texture": "sleek straight", "eye_color": "dark gray"},
|
||||
"physique": {"body_type": "lean", "height": "tall", "skin_tone": "fair"},
|
||||
@@ -6319,6 +6340,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Male",
|
||||
"costume": "a yellow cape and green-and-gold accents over smooth, flawless deep red "
|
||||
"android skin, with a glowing yellow gem set in the forehead",
|
||||
"costume_back": "a yellow cape falling down the back over smooth deep red android skin with green-and-gold accents",
|
||||
"eyes": "glowing white",
|
||||
"signature": {},
|
||||
"physique": {"body_type": "athletic", "height": "tall"},
|
||||
@@ -6627,11 +6649,17 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"Reverse-Flash": {
|
||||
"franchise": "DC",
|
||||
"gender": "Male",
|
||||
"costume": "a yellow speedster bodysuit with a red lightning-bolt emblem, red "
|
||||
# 2.2.0: no mask was named, so the render drew a bare head; the cowl mirrors
|
||||
# The Flash entry, inverted to yellow with red trim.
|
||||
"covers_face": True,
|
||||
"costume": "a full yellow bodysuit with a red lightning-bolt emblem in a black "
|
||||
"circle ringed in red on the chest, a red lightning-bolt belt, red "
|
||||
"boots, and crackling red lightning",
|
||||
"eyes": "glowing red",
|
||||
"signature": {"hair_color": "dark blonde", "hair_length": "very short"},
|
||||
"physique": {"body_type": "athletic", "height": "average height", "skin_tone": "fair"},
|
||||
"costume_back": "a full yellow bodysuit, a red lightning-bolt belt, red boots, and "
|
||||
"crackling red lightning",
|
||||
"mask": "a yellow cowl with small red lightning bolts at the ears and glowing red "
|
||||
"eyes",
|
||||
"physique": {"body_type": "athletic", "height": "average height"},
|
||||
},
|
||||
"Captain Cold": {
|
||||
"franchise": "DC",
|
||||
@@ -7274,6 +7302,25 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"eye_color": "ice blue"},
|
||||
"physique": {"body_type": "slender", "height": "tall"},
|
||||
},
|
||||
"Volcana": {
|
||||
"franchise": "DC",
|
||||
"gender": "Female",
|
||||
# Claire Selton, Superman: TAS. Wikipedia confirms a red-haired white woman (the
|
||||
# supplied "tan, olive" skin is wrong). No source found describes the costume, so
|
||||
# it ships as maintainer-supplied canon; recheck against a screenshot if a render
|
||||
# disagrees. The flames are her pyrokinesis, the one effect she always shows.
|
||||
"costume": "a form-fitting sleeveless red mock-neck crop top with a large keyhole "
|
||||
"cutout across the chest, cut short beneath the bust to bare the whole "
|
||||
"midriff, low-rise skin-tight black trousers, red opera gloves past the "
|
||||
"elbows, red calf-high boots, large gold hoop earrings, a beauty mark on "
|
||||
"one cheek, purple eyeshadow and red lipstick, the hair rising into "
|
||||
"flame-like points at the crown, and small flames flickering around "
|
||||
"both hands",
|
||||
"signature": {"hair_color": "orange", "hair_length": "lower back",
|
||||
"hair_texture": "thick and voluminous", "hair_style": "worn down",
|
||||
"makeup_style": "no makeup"}, # the costume names the canon makeup
|
||||
"physique": {"body_type": "hourglass", "height": "tall", "skin_tone": "fair"},
|
||||
},
|
||||
"Livewire": {
|
||||
"franchise": "DC",
|
||||
"gender": "Female",
|
||||
@@ -8763,10 +8810,15 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"franchise": "Star Wars",
|
||||
"gender": "Male",
|
||||
"covers_face": True,
|
||||
"costume": "layered tan desert robes and wrappings with a bandolier and a "
|
||||
"pouched belt",
|
||||
"mask": "a bandage-wrapped face with round metal goggle eyes and a hooded "
|
||||
"mouth grille",
|
||||
# 2.2.0: "a bandage-wrapped face" rendered a human face with bandages on it; no
|
||||
# skin shows anywhere, hence covers_body and a lead noun in place of "a man".
|
||||
"covers_body": True,
|
||||
"subject": "robed desert raider",
|
||||
"costume": "layered tan desert robes and wrappings with a bandolier, a pouched "
|
||||
"belt, and wrapped tan gloves",
|
||||
"mask": "a head completely wrapped in tan bandages and cloth with no skin "
|
||||
"showing, round metal goggle eyes, and a metal breathing grille over the "
|
||||
"mouth, all under a hood",
|
||||
"physique": {"body_type": "lean", "height": "average height"},
|
||||
"prop": "a gaderffii war staff, a long staff with bladed and bludgeoning ends",
|
||||
},
|
||||
@@ -10633,6 +10685,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Male",
|
||||
"costume": "a red tunic with a yellow R chest emblem, green shorts, gloves and "
|
||||
"boots, and a yellow-lined black cape",
|
||||
"costume_back": "a yellow-lined black cape falling down the back over a red tunic, green shorts, gloves and boots",
|
||||
"signature": {"hair_color": "jet black", "hair_length": "very short", "eye_color": "bright blue"},
|
||||
"physique": {"body_type": "lean", "height": "average height", "skin_tone": "fair"},
|
||||
},
|
||||
@@ -15804,10 +15857,14 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"gender": "Male",
|
||||
# Full purple costume with a toothy cowl and claws.
|
||||
"covers_face": True,
|
||||
# 2.2.0: the render showed a human face inside the cowl; the suit covers every inch
|
||||
# of the wearer, so covers_body, and a lead noun so "a man" no longer leads.
|
||||
"covers_body": True,
|
||||
"subject": "hulking purple costumed hero",
|
||||
"costume": "a bulky purple muscle-suit with yellow claws erupting from the backs of the "
|
||||
"hands and enormous brown boots",
|
||||
"mask": "a purple-and-yellow full head-cowl with big blank white eyes and a row of large "
|
||||
"white teeth across the lower jaw",
|
||||
"mask": "a purple-and-yellow full head-cowl that hides the whole face, with big blank "
|
||||
"white eyes and a row of large white teeth across the lower jaw",
|
||||
"physique": {"body_type": "stocky", "height": "very tall"},
|
||||
},
|
||||
"Midnighter": {
|
||||
@@ -17867,14 +17924,29 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"Rebecca (Cyberpunk)": {
|
||||
"franchise": "Cyberpunk: Edgerunners",
|
||||
"gender": "Female",
|
||||
"costume": "a cropped white and pink jacket over a bare midriff, baggy "
|
||||
"oversized shorts, chunky platform boots, and dense colourful "
|
||||
"tattoos covering both arms and legs",
|
||||
"eyes": "black sclera with small glowing green irises",
|
||||
"signature": {"hair_color": "lime green", "hair_length": "ear length",
|
||||
"hair_style": "space buns"},
|
||||
"physique": {"body_type": "petite and slim", "height": "very petite",
|
||||
"skin_tone": "very pale"},
|
||||
# 2.2.0: rebuilt from Wikipedia and the Cyberpunk wiki -- the old jacket, shorts,
|
||||
# boots, full-limb tattoos, black sclera and space buns were all wrong. Three pink
|
||||
# tattoos only; the oversized red/blue cyberarms are her late-series look.
|
||||
"costume": "an oversized black high-collared jacket with neon-green trim and "
|
||||
"lining, worn hanging open over a black bra and black briefs, black "
|
||||
"and green high-top sneakers, a black headband, smooth, flawless "
|
||||
"chalk-white skin with a faint blue tint and thin seam lines under the "
|
||||
"eyes and around the wrists, and three hot-pink tattoos: an emblem on "
|
||||
"the side of the neck, a ram skull on the stomach, and lettering on "
|
||||
"one thigh",
|
||||
"costumes": [
|
||||
"an oversized black high-collared jacket with neon-green trim and lining, "
|
||||
"worn hanging open over a black bra and black briefs, black and green high-top "
|
||||
"sneakers, a black headband, smooth, flawless chalk-white skin with a faint "
|
||||
"blue tint, hot-pink tattoos on the neck, stomach and one thigh, and huge "
|
||||
"oversized chrome cyberarms with giant mechanical hands, the right arm red and "
|
||||
"white and the left arm blue and white",
|
||||
],
|
||||
"costume_weights": [2, 1],
|
||||
"eyes": "glowing neon-green, red-sclera cybernetic",
|
||||
"signature": {"hair_color": "teal", "hair_length": "long",
|
||||
"hair_style": "high pigtails"},
|
||||
"physique": {"body_type": "petite and slim", "height": "very petite"},
|
||||
"prop": "an oversized double-barrelled shotgun",
|
||||
},
|
||||
"Nana Osaki": {
|
||||
@@ -18958,6 +19030,7 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"sleeveless captain's haori over it, straw sandals, a black "
|
||||
"eyepatch over the right eye, and hair spiked into stiff points "
|
||||
"tipped with small bells",
|
||||
"costume_back": "a white sleeveless captain's haori over a black Shinigami kimono, the black kanji for eleven inside a diamond on the back of the haori, straw sandals, and hair spiked into stiff points tipped with small bells",
|
||||
"prop": "a battered chipped-edged katana",
|
||||
"signature": {"hair_color": "jet black", "hair_length": "shoulder length"},
|
||||
"physique": {"body_type": "athletic", "height": "very tall",
|
||||
@@ -20116,13 +20189,64 @@ COSPLAYERS: dict[str, dict] = {
|
||||
"David Martinez": {
|
||||
"franchise": "Cyberpunk: Edgerunners",
|
||||
"gender": "Male",
|
||||
"costume": "an oversized red and black bomber jacket over a dark shirt, "
|
||||
"cargo trousers and heavy boots, with chrome cybernetic ports "
|
||||
"set behind the ear and along the spine",
|
||||
"signature": {"hair_color": "jet black", "hair_length": "ear length",
|
||||
"hair_texture": "thick and voluminous",
|
||||
"eye_color": "dark brown"},
|
||||
"physique": {"body_type": "lean", "height": "tall", "skin_tone": "light medium"},
|
||||
# 2.2.0: the jacket is his mother's yellow EMT jacket (Cyberpunk wiki, "David's
|
||||
# Jacket"), not a red bomber; outfit, hair and eyes rebuilt from the wiki.
|
||||
"costume": "a bright yellow high-visibility EMT jacket worn open, with a glowing "
|
||||
"blue lining inside the collar and a green edgerunner emblem painted "
|
||||
"on the back, over a plain black t-shirt, two thin gold chain "
|
||||
"necklaces with a small cross on the lower one, grey cropped "
|
||||
"sweatpants with yellow side straps, and white sneakers with blue "
|
||||
"straps, the dark hair swept up into a quiff over close-shaved sides",
|
||||
"signature": {"hair_color": "dark brown", "hair_length": "ear length",
|
||||
"hair_style": "undercut", "eye_color": "light brown"},
|
||||
"physique": {"body_type": "lean", "height": "average height", "skin_tone": "medium"},
|
||||
},
|
||||
"Maine": {
|
||||
"franchise": "Cyberpunk: Edgerunners",
|
||||
"gender": "Male",
|
||||
# The crew's borg leader. Wiki + tag survey: dark skin, flattop, beard, red-tinted
|
||||
# shades, heavy chrome arms with a built-in launcher. The vest is the least
|
||||
# attested detail (supplied as olive; the few references show it dark).
|
||||
"costume": "a sleeveless dark vest worn open over a bare scarred chest, heavy "
|
||||
"cargo trousers, a thick ammunition belt, combat boots, red-tinted "
|
||||
"sunglasses, and massive chrome cybernetic arms with armored "
|
||||
"forearms housing built-in launchers, on a hulking, heavily "
|
||||
"muscled frame",
|
||||
"signature": {"hair_color": "jet black", "hair_length": "very short",
|
||||
"hair_style": "high-top fade", "facial_hair": "goatee"},
|
||||
"physique": {"body_type": "stocky", "height": "very tall", "skin_tone": "dark brown"},
|
||||
},
|
||||
"Kiwi": {
|
||||
"franchise": "Cyberpunk: Edgerunners",
|
||||
"gender": "Female",
|
||||
# The jaw under the mask is missing, so the mask stays on (the lower-face regex
|
||||
# drops the mouth fields). Wiki: very tall and slender, long red coat, blonde bob.
|
||||
"costume": "a long bright-red high-collared coat over a dark form-fitting "
|
||||
"netrunner bodysuit, a black belt, black boots, and a segmented red "
|
||||
"cybernetic mask covering the mouth and lower face",
|
||||
"eyes": "narrow, yellow-sclera, feline red",
|
||||
"signature": {"hair_color": "light blonde", "hair_length": "chin length bob",
|
||||
"hair_style": "blunt bangs", "hair_texture": "sleek straight"},
|
||||
"physique": {"body_type": "very slim", "height": "very tall", "skin_tone": "pale"},
|
||||
},
|
||||
"Talia Yang": {
|
||||
"franchise": "Cyberpunk: Edgerunners",
|
||||
"gender": "Female",
|
||||
# Edgerunners 2 (2026) lead. Built from the tag survey of the first weeks of art:
|
||||
# dark skin, pink braided ponytail with hair vents and an ahoge, blue eyes, a
|
||||
# mandible mask over a missing jaw, chrome arms/hips and reverse-jointed legs.
|
||||
# The supplied text missed the skin tone; its pistol model is unverified, so no prop.
|
||||
# The mask leads: at the end of the list the 2.2.0 render dropped it.
|
||||
"costume": "a black segmented cybernetic mask covering the mouth and jaw, split "
|
||||
"like insect mandibles, a black jumpsuit unzipped and peeled open to the "
|
||||
"waist over a grey bra, heavy grey chrome cybernetic arms and mechanical "
|
||||
"hips, reverse-jointed chrome cyberlegs bent like a grasshopper's, thin "
|
||||
"seam lines across the remaining skin, small triangle earrings, small "
|
||||
"metal vents set into the hair, and a single tall cowlick sticking up on "
|
||||
"top",
|
||||
"signature": {"hair_color": "hot pink", "hair_length": "long",
|
||||
"hair_style": "braided ponytail", "eye_color": "bright blue"},
|
||||
"physique": {"body_type": "slender", "height": "tall", "skin_tone": "brown"},
|
||||
},
|
||||
|
||||
# === v0.77.0 franchise-lead audit: Video Games ======================
|
||||
@@ -23883,16 +24007,69 @@ COSPLAYERS: dict[str, dict] = {
|
||||
},
|
||||
],
|
||||
},
|
||||
"Adam Smasher": {
|
||||
"franchise": "Cyberpunk 2077",
|
||||
"gender": "Male",
|
||||
# Humanoid full-body conversion, so the suit route with covers_body (C-3PO),
|
||||
# not feral. 2077 look: dark armored frame, red optics, arm cannon, missiles.
|
||||
"covers_face": True,
|
||||
"covers_body": True,
|
||||
# "a very tall man" drew a human face over the armor (2.2.0 render).
|
||||
"subject": "towering armored cyborg",
|
||||
"costume": "a towering full-body cyborg conversion of matte black and gunmetal-grey "
|
||||
"military armor plating, exposed hydraulic pistons and bundled black "
|
||||
"cabling at the joints, massively oversized armored shoulders with a "
|
||||
"missile launcher pod mounted behind one shoulder, a heavy cannon built "
|
||||
"into the right forearm, and small Arasaka logos and warning stencils on "
|
||||
"the battle-scarred plating, on a hulking frame well over seven feet tall",
|
||||
"mask": "a smooth metal cyborg head with no hair or skin, a cluster of glowing red "
|
||||
"optical sensors in place of eyes, and a rigid metal grille over the jaw",
|
||||
"physique": {"body_type": "stocky", "height": "very tall"},
|
||||
},
|
||||
"Song So Mi": {
|
||||
"franchise": "Cyberpunk 2077",
|
||||
"gender": "Female",
|
||||
"aliases": ["Songbird", "So Mi"],
|
||||
# Phantom Liberty. The name avoids a clash with Marvel's Songbird. The backless
|
||||
# green gown baring her chrome spine is attested in fan art; the supplied feather
|
||||
# trim is not, so it is left out. The alternate is her netrunner look from the
|
||||
# Cyberpunk wiki (red-to-black suit, faded denim jacket with pins, untied high-tops).
|
||||
"costume": "a sleek emerald-green evening gown with a high neckline fastened at the "
|
||||
"throat and an open back that bares a polished chrome mechanical spine, "
|
||||
"chrome cybernetic arms with exposed yellow wiring at the joints, fine "
|
||||
"circuit-like lines of EMP threading across the cheeks, and dark red "
|
||||
"eyeshadow",
|
||||
"costumes": [
|
||||
"a form-fitting netrunner bodysuit fading from red at the shoulders to black "
|
||||
"at the legs, an open cropped grey-to-black faded denim jacket with a patch and "
|
||||
"four pin badges, a studded belt carrying a cyberdeck, untied white high-top "
|
||||
"sneakers, chrome cybernetic arms with exposed yellow wiring at the joints, and "
|
||||
"fine circuit-like lines of EMP threading across the cheeks",
|
||||
],
|
||||
"costume_weights": [2, 1],
|
||||
"signature": {"hair_color": "magenta", "hair_length": "jaw length",
|
||||
"hair_style": "worn down", "eye_color": "dark brown",
|
||||
"makeup_style": "no makeup"}, # the costume names the red eyeshadow
|
||||
"physique": {"body_type": "slim", "height": "slightly below average height",
|
||||
"skin_tone": "light"},
|
||||
},
|
||||
"Panam Palmer": {
|
||||
"franchise": "Cyberpunk 2077",
|
||||
"gender": "Female",
|
||||
"costume": "a cropped olive tank top under an open sand-colored Nomad "
|
||||
"jacket with rolled sleeves, a worn leather holster riding one "
|
||||
"hip, dusty cargo trousers patched at the knee, and scuffed "
|
||||
"brown boots",
|
||||
"signature": {"hair_color": "dark brown", "hair_length": "shoulder length",
|
||||
"hair_style": "worn down", "eye_color": "hazel"},
|
||||
"physique": {"body_type": "athletic", "height": "average height", "skin_tone": "olive"},
|
||||
# 2.2.0: the sand Nomad jacket, loose hair and hazel eyes were wrong. Her look is
|
||||
# the cropped red-and-black moto jacket over an olive bodysuit, harness, leather-
|
||||
# panelled jeans and fingerless gloves, hair up in a bun (tag survey + wiki).
|
||||
# She is 5'11" and has almost no visible chrome.
|
||||
"costume": "a cropped, weathered red-and-black leather moto jacket with a high "
|
||||
"reinforced collar, white trim and quilted sleeves, worn open over a "
|
||||
"sleeveless high-necked olive-green bodysuit, black harness straps "
|
||||
"with red buckles across the shoulders and waist, blue jeans "
|
||||
"reinforced with black leather panels on the thighs and shins, a "
|
||||
"thigh holster, black fingerless leather gloves, scuffed black "
|
||||
"motorcycle boots, and a light scatter of freckles across the nose",
|
||||
"signature": {"hair_color": "dark brown", "hair_length": "long",
|
||||
"hair_style": "messy bun", "eye_color": "dark brown"},
|
||||
"physique": {"body_type": "athletic", "height": "tall", "skin_tone": "tan"},
|
||||
"prop": "a sniper rifle slung across the back",
|
||||
},
|
||||
"Quiet": {
|
||||
|
||||
+17
-8
@@ -2263,9 +2263,12 @@ CREATURES: dict[str, dict] = {
|
||||
},
|
||||
"leprechaun": {
|
||||
"class": "Mythic & Fantasy", "palette": "ruddy freckled",
|
||||
# 2.2.0: the palette supplies "ruddy freckled", so the integument must not repeat
|
||||
# it. The beard is the folklore look; the gallery tile is pinned Male
|
||||
# (render_gallery._GALLERY_GENDER) since creature slots have no gender gate.
|
||||
"head": "a wizened impish face with a ruddy grin, pointed ears and a ginger beard",
|
||||
"eyes": "twinkling green eyes",
|
||||
"integument": "ruddy freckled skin",
|
||||
"integument": "skin",
|
||||
"arms": "wiry little arms",
|
||||
"hands": "nimble small hands",
|
||||
"legs_feet": "short bandy legs",
|
||||
@@ -2994,14 +2997,20 @@ CREATURES: dict[str, dict] = {
|
||||
"class": "Marine Life",
|
||||
"palette": "dark bronze",
|
||||
"palette_pool": ["dark bronze", "olive brown", "weathered slate"],
|
||||
"head": "a smooth domed horseshoe of chitin drawn low over the face",
|
||||
# 2.2.0: "drawn low over the face" rendered a plain man, and a "shell in place of
|
||||
# a head" rendered a man wearing it as a hat, and a negated "no human head" was
|
||||
# ignored. Lead with a positive "<creature> head", like the other arthropods.
|
||||
"head": "a faceless horseshoe crab head, a broad flat chitin dome with no face, "
|
||||
"no mouth and no human features",
|
||||
"eyes": "a pair of kidney-shaped compound eyes set wide on the shell above smaller simple eyes ranked along its ridge",
|
||||
"integument": "a hinged carapace plated in two smooth shields",
|
||||
"arms": "short jointed arms tucked beneath the shell",
|
||||
"hands": "small pincered claws",
|
||||
"legs_feet": "ranks of walking legs under a plated abdomen fringed with spines",
|
||||
"tail": "a long rigid spike of a tail",
|
||||
"extras": "stacked pages of book gills flexing beneath the rear shield",
|
||||
# 2.2.0: free-floating parts ("two shields", "a plated abdomen", "the rear
|
||||
# shield") rendered as a second whole crab held at the side; anchor each to the body.
|
||||
"integument": "a smooth hinged chitin carapace covering the back and chest",
|
||||
"arms": "segmented chitin arms",
|
||||
"hands": "small pincers in place of hands",
|
||||
"legs_feet": "chitin-plated legs, with a row of short spiny walking legs along each side of the belly",
|
||||
"tail": "a long rigid spike of a tail trailing from the lower back",
|
||||
"extras": "stacked book gills along the underside of the torso",
|
||||
},
|
||||
|
||||
# ======================================================================
|
||||
|
||||
+9
-4
File diff suppressed because one or more lines are too long
+223
-4
@@ -1160,6 +1160,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
"shot_type": "medium close-up from chest up", "mood": "intense",
|
||||
},
|
||||
"Renaissance Noble": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"accessories": "no accessories",
|
||||
# 1.5.1: a doublet is menswear and soft glam put makeup on men (render #00656):
|
||||
# each gender gets its own noble dress, and only the woman's look is made up.
|
||||
@@ -1744,6 +1747,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
},
|
||||
},
|
||||
"Egyptian Pharaoh": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"accessories": "no accessories",
|
||||
"ethnicity": "Egyptian", "body_type": "lean", "skin_tone": "caramel",
|
||||
"hair_color": ["jet black", "raven black", "near black"], "hair_style": "blunt bangs", "makeup_style": "bold glam",
|
||||
@@ -1761,6 +1767,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
"shot_type": "medium close-up from chest up", "mood": "tranquil",
|
||||
},
|
||||
"Greek Goddess": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"accessories": "no accessories",
|
||||
"gender": "Female", "ethnicity": "Greek", "body_type": "hourglass", "height": "tall",
|
||||
"hair_color": ["dark brown", "medium brown", "near black"], "hair_length": "very long", "hair_texture": "softly curled",
|
||||
@@ -1769,6 +1778,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
"lighting": "golden hour sunlight", "shot_type": "full body shot", "mood": "dreamy",
|
||||
},
|
||||
"Roman Centurion": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"accessories": "no accessories",
|
||||
"gender": "Male", "ethnicity": "Italian", "body_type": "athletic", "height": "tall",
|
||||
"fitness_level": "very fit", "facial_hair": "stubble",
|
||||
@@ -2138,6 +2150,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
},
|
||||
},
|
||||
"Victorian Lady": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"accessories": "no accessories",
|
||||
"gender": "Female", "ethnicity": "English", "body_type": "hourglass", "height": "average height",
|
||||
"hair_color": ["chestnut", "light chestnut", "warm brown"], "hair_length": "very long", "hair_texture": "softly curled",
|
||||
@@ -2147,12 +2162,31 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
"shot_type": "full body shot", "mood": "nostalgic",
|
||||
},
|
||||
"Ancient Roman Patrician": {
|
||||
# 2.2.0: a Female variant (stola and palla); the toga look moved into Male verbatim.
|
||||
"accessories": "no accessories",
|
||||
"gender": "Male", "ethnicity": "Italian", "body_type": "average", "height": "average height",
|
||||
"hair_color": ["dark brown", "medium brown", "near black"], "hair_length": "very short", "hair_texture": "loosely curled",
|
||||
"hair_style": "natural and unstyled", "skin_tone": "olive", "outfit_style": "evening formal",
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"bracelet": "none",
|
||||
"rings": "none",
|
||||
"gender": "Male", "ethnicity": "Italian", "height": "average height",
|
||||
"hair_color": ["dark brown", "medium brown", "near black"],
|
||||
"skin_tone": "olive", "outfit_style": "evening formal",
|
||||
"expression": "stern", "location": "outdoor amphitheater",
|
||||
"lighting": "harsh overhead midday sun", "shot_type": "full body shot", "mood": "commanding",
|
||||
"variants": {
|
||||
"Male": {
|
||||
"body_type": "average", "hair_length": "very short",
|
||||
"hair_texture": "loosely curled", "hair_style": "natural and unstyled",
|
||||
"outfit_description": "a draped white toga over a tunic with a {color} border, leather sandals, and a {metal} laurel wreath",
|
||||
},
|
||||
"Female": {
|
||||
"body_type": ["slim", "average"], "hair_length": "long",
|
||||
"hair_texture": "softly curled", "hair_style": "updo",
|
||||
"makeup_style": "soft natural makeup",
|
||||
"necklace": "no necklace", "earrings": "no earrings",
|
||||
"outfit_description": "a long ivory stola belted high under the bust, a {jewel_tone} palla draped over the shoulders and one arm, a gold fibula brooch at the shoulder, a fine gold hairnet over the curled updo, and leather sandals",
|
||||
},
|
||||
},
|
||||
},
|
||||
"Prehistoric Hunter": {
|
||||
"accessories": "no accessories",
|
||||
@@ -3015,6 +3049,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
"mood": "cheerful",
|
||||
},
|
||||
"Victorian Dandy": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"gender": "Male", "ethnicity": "English", "body_type": "slim", "height": "tall",
|
||||
"facial_hair": ["mustache", "van dyke", "clean shaven"],
|
||||
"hair_color": ["dark brown", "medium brown", "near black"], "hair_length": "ear length",
|
||||
@@ -3043,6 +3080,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
"lighting": "stage spotlight from above", "shot_type": "full body shot", "mood": "radiant",
|
||||
},
|
||||
"Gibson Girl": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"gender": "Female", "ethnicity": "English", "body_type": "hourglass", "height": "average height",
|
||||
"hair_color": ["chestnut", "warm brown", "dark brown"], "hair_length": "very long",
|
||||
"hair_texture": "softly curled", "hair_style": "updo", "skin_tone": "porcelain",
|
||||
@@ -3426,6 +3466,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
},
|
||||
# Lean unisex historical / sport / performer.
|
||||
"Musketeer": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"accessories": "no accessories", "bag": "no bag",
|
||||
"hair_length": ["long", "shoulder length"], "hair_texture": ["loosely curled", "wavy"],
|
||||
"outfit_style": "vintage retro", "expression": ["confident", "smirking"],
|
||||
@@ -3434,6 +3477,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
"shot_type": "full body shot", "mood": "self-assured",
|
||||
},
|
||||
"Medieval Peasant": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"accessories": "no accessories", "bag": "no bag", "outfit_style": "casual",
|
||||
"expression": ["neutral", "warm smile"],
|
||||
"location": ["castle courtyard", "country dirt road"],
|
||||
@@ -3610,6 +3656,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
},
|
||||
},
|
||||
"Regency Aristocrat": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"bag": "no bag",
|
||||
"gender": "Any",
|
||||
"variants": {
|
||||
@@ -5404,6 +5453,9 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
},
|
||||
# The name is gendered (the Mardi Gras Reveler sets the domino-mask precedent).
|
||||
"Highwayman": {
|
||||
# 2.2.0: a period look draws no modern tattoo or nose stud.
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"gender": "Male",
|
||||
"outfit_style": "vintage retro",
|
||||
"accessories": "no accessories",
|
||||
@@ -5822,6 +5874,174 @@ ARCHETYPES: dict[str, dict[str, Any]] = {
|
||||
"facial_hair": ["clean shaven", "stubble", "mustache"]},
|
||||
},
|
||||
},
|
||||
|
||||
# --- 2.2.0: historical court dress -------------------------------------
|
||||
# Courts nothing else covers: Renaissance Noble, Regency Aristocrat and the
|
||||
# Victorian pair already hold their eras. No palace location exists, so these
|
||||
# borrow the nearest grand interiors rather than move random seeds with a new one.
|
||||
"Rococo Courtier": {
|
||||
"gender": "Any",
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"bracelet": "none",
|
||||
"rings": "none",
|
||||
"age": ["20", "22", "25", "28", "30", "33", "35"],
|
||||
"ethnicity": ["French", "English"],
|
||||
"outfit_style": "evening formal",
|
||||
"accessories": "no accessories",
|
||||
"bag": "no bag",
|
||||
"necklace": "no necklace",
|
||||
"earrings": "no earrings",
|
||||
"hair_color": "white",
|
||||
"expression": ["sly", "quiet amusement"],
|
||||
"location": "gilded palace throne room",
|
||||
"lighting": "warm candlelight",
|
||||
"shot_type": "full body shot",
|
||||
"mood": "self-assured",
|
||||
"variants": {
|
||||
"Female": {
|
||||
"hair_length": "long", "hair_style": "updo", "makeup_style": "soft glam",
|
||||
"outfit_description": "a {pastel} silk robe a la francaise spread over wide side panniers, a fitted stomacher laced with ribbon bows, tiered lace ruffles at the elbows, a floral brocade petticoat, a pearl choker, and a towering powdered pouf hairstyle trimmed with feathers and ribbons",
|
||||
"held_item": "a painted silk folding fan",
|
||||
},
|
||||
"Male": {
|
||||
"hair_length": "shoulder length", "hair_style": "low ponytail",
|
||||
"makeup_style": "no makeup", "facial_hair": "clean shaven",
|
||||
"outfit_description": "a {jewel_tone} silk brocade frock coat embroidered in gold and silver thread, a long matching waistcoat, knee breeches, white silk stockings, buckled heeled shoes, a lace jabot at the throat with lace cuffs, and a powdered white wig tied back with a black silk ribbon",
|
||||
"held_item": "a black tricorn hat",
|
||||
},
|
||||
},
|
||||
},
|
||||
"Medieval Monarch": {
|
||||
"gender": "Any",
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"bracelet": "none",
|
||||
"rings": "none",
|
||||
"age": ["28", "30", "33", "35", "40", "45", "50", "55"],
|
||||
"outfit_style": "evening formal",
|
||||
"accessories": "no accessories",
|
||||
"bag": "no bag",
|
||||
"necklace": "no necklace",
|
||||
"earrings": "no earrings",
|
||||
"expression": "stern",
|
||||
"location": "grand cathedral interior",
|
||||
"lighting": "light through stained glass casting colors",
|
||||
"shot_type": "full body shot",
|
||||
"mood": "commanding",
|
||||
"held_item": "a jeweled golden scepter",
|
||||
"variants": {
|
||||
"Female": {
|
||||
"hair_length": "long", "hair_style": "worn down",
|
||||
"makeup_style": "soft natural makeup",
|
||||
"outfit_description": "a {jewel_tone} brocade surcoat over a silk gown with long trailing hanging sleeves, a heavy ermine-trimmed velvet mantle fastened at the chest with a gold clasp, a jeweled girdle at the hips, a sheer white veil, and a jeweled gold crown",
|
||||
},
|
||||
"Male": {
|
||||
"hair_length": "shoulder length", "hair_style": "worn down",
|
||||
"makeup_style": "no makeup", "facial_hair": ["short beard", "full beard"],
|
||||
"outfit_description": "a {jewel_tone} velvet tunic embroidered with gold thread over a long white undertunic, a heavy ermine-trimmed royal mantle fastened at the chest with a gold clasp, a jeweled sword belt, tall leather boots, and a jeweled gold crown",
|
||||
},
|
||||
},
|
||||
},
|
||||
"Ottoman Court": {
|
||||
"gender": "Any",
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"bracelet": "none",
|
||||
"rings": "none",
|
||||
"ethnicity": "Turkish",
|
||||
"outfit_style": "evening formal",
|
||||
"accessories": "no accessories",
|
||||
"bag": "no bag",
|
||||
"necklace": "no necklace",
|
||||
"earrings": "no earrings",
|
||||
"expression": "confident",
|
||||
"location": "gilded palace throne room",
|
||||
"lighting": "warm candlelight",
|
||||
"shot_type": "full body shot",
|
||||
"mood": "commanding",
|
||||
"variants": {
|
||||
"Female": {
|
||||
"hair_length": "long", "hair_style": "worn down",
|
||||
"makeup_style": "soft glam",
|
||||
"outfit_description": "a {jewel_tone} silk kaftan embroidered with gold thread and fastened down the front with jeweled buttons, worn over a long inner robe and full silk salvar trousers, a jeweled belt at the waist, a small embroidered cap draped with a sheer veil and pinned with a jeweled plume, and pointed embroidered slippers",
|
||||
},
|
||||
"Male": {
|
||||
"hair_length": "very short", "makeup_style": "no makeup",
|
||||
"facial_hair": ["full beard", "mustache"],
|
||||
"outfit_description": "a full-length {jewel_tone} brocade kaftan with long ornamental hanging sleeves over a silk robe and a wide sash, a towering white turban set with a jeweled plume, and soft yellow leather boots",
|
||||
},
|
||||
},
|
||||
},
|
||||
"Heian Court": {
|
||||
"gender": "Any",
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"bracelet": "none",
|
||||
"rings": "none",
|
||||
"ethnicity": "Japanese",
|
||||
"outfit_style": "evening formal",
|
||||
"accessories": "no accessories",
|
||||
"bag": "no bag",
|
||||
"necklace": "no necklace",
|
||||
"earrings": "no earrings",
|
||||
"hair_color": "jet black",
|
||||
"expression": "serene",
|
||||
"location": "Shinto shrine interior",
|
||||
"lighting": "warm lantern light",
|
||||
"shot_type": "full body shot",
|
||||
"mood": "tranquil",
|
||||
"variants": {
|
||||
"Female": {
|
||||
"hair_length": "hip length", "hair_texture": "sleek straight",
|
||||
"hair_style": "worn down", "makeup_style": "soft natural makeup",
|
||||
"outfit_description": "a junihitoe of many layered silk robes whose {jewel_tone}, {pastel} and white edges show in bands at the collar and wide sleeves, a stiff brocade jacket on top, a long pleated white train trailing behind, and wide crimson hakama trousers",
|
||||
"held_item": "a painted wooden folding fan",
|
||||
},
|
||||
"Male": {
|
||||
"hair_length": "long", "hair_style": "top knot",
|
||||
"makeup_style": "no makeup", "facial_hair": "clean shaven",
|
||||
"outfit_description": "a black sokutai court robe with wide sleeves over layered white and crimson under-robes, a long trailing train, wide white hakama trousers, and a stiff black lacquered court cap with a tall upright tail",
|
||||
"held_item": "a flat wooden shaku baton",
|
||||
},
|
||||
},
|
||||
},
|
||||
# 2.3.0: Mexica (Aztec) nobility, after the Codex Mendoza and Florentine Codex: the
|
||||
# knotted tilmatli cloak and maxtlatl for men, the huipil and cueitl for women, jade
|
||||
# ear spools for both (not matched as earrings, so the random pair is locked off).
|
||||
"Aztec Noble": {
|
||||
"gender": "Any",
|
||||
"tattoos": "no tattoos",
|
||||
"piercings": "no piercings beyond ears",
|
||||
"bracelet": "none",
|
||||
"rings": "none",
|
||||
"ethnicity": "Mexican",
|
||||
"outfit_style": "evening formal",
|
||||
"accessories": "no accessories",
|
||||
"bag": "no bag",
|
||||
"necklace": "no necklace",
|
||||
"earrings": "no earrings",
|
||||
"hair_color": "jet black",
|
||||
"hair_highlights": "none",
|
||||
"nails": "natural short nails",
|
||||
"expression": "confident",
|
||||
"location": "crumbling stone ruin",
|
||||
"lighting": "late afternoon warm sunlight",
|
||||
"shot_type": "full body shot",
|
||||
"mood": "commanding",
|
||||
"variants": {
|
||||
"Female": {
|
||||
"hair_length": "waist length", "hair_texture": "sleek straight",
|
||||
"hair_style": ["worn down", "loose braids"], "makeup_style": "no makeup",
|
||||
"outfit_description": "a white cotton huipil tunic woven with bands of {jewel_tone} and gold geometric pattern at the neck and hem, worn over a long wrapped cueitl skirt with an embroidered border, a collar of polished jade beads, jade ear spools, gold arm cuffs, and simple leather sandals",
|
||||
},
|
||||
"Male": {
|
||||
"hair_length": "shoulder length", "hair_style": "worn down",
|
||||
"makeup_style": "no makeup", "facial_hair": "clean shaven",
|
||||
"outfit_description": "a white cotton tilmatli cloak edged with a woven {jewel_tone} and gold geometric border and knotted at one shoulder, a maxtlatl loincloth with long embroidered hanging ends, a tall headdress of long green quetzal feathers rising from a gold band, jade ear spools, gold arm cuffs, and leather sandals with high heel guards",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -5974,7 +6194,6 @@ _COSTUMES: dict[str, str | list[str]] = {
|
||||
"1990s Goth": "layered black {fabric} clothing with torn fishnet sleeves, a studded leather choker, silver rings, and heavy buckled boots",
|
||||
"1980s Preppy": "a pastel polo shirt with a {color} sweater tied over the shoulders, pleated chinos, and leather boat shoes",
|
||||
"Victorian Lady": "a high-collared {jewel_tone} bustle gown of {fabric} with lace trim, puffed sleeves, buttoned boots, and a cameo brooch",
|
||||
"Ancient Roman Patrician": "a draped white toga over a tunic with a {color} border, leather sandals, and a {metal} laurel wreath",
|
||||
"Prehistoric Hunter": "rugged {fur} hide garments with bone-and-tooth jewelry, leather wraps, and a stone-tipped spear",
|
||||
"Tennis Player": "a {color} athletic tennis polo with matching shorts, a sweatband, wristbands, and court shoes",
|
||||
"Gymnast": "a sleek {jewel_tone} long-sleeved competition leotard with metallic trim and grip wristbands",
|
||||
|
||||
@@ -147,6 +147,8 @@ RELEASES: tuple[str, ...] = (
|
||||
"1.9.0",
|
||||
"1.11.0",
|
||||
"2.1.0",
|
||||
"2.2.0",
|
||||
"2.3.0",
|
||||
)
|
||||
|
||||
#: Entry name -> the release it first shipped in.
|
||||
@@ -166,6 +168,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Abomination': "0.22.0",
|
||||
'Acheron': "1.5.0",
|
||||
'Ada Wong': "0.6.0",
|
||||
'Adam Smasher': "2.2.0",
|
||||
'Admiral Ackbar': "0.20.0",
|
||||
'Aeon Flux': "1.0.0",
|
||||
'Aerith Gainsborough': "0.6.0",
|
||||
@@ -1141,6 +1144,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Kiss-Shot Acerola-Orion Heart-Under-Blade': "0.77.0",
|
||||
'Kitana': "0.6.0",
|
||||
'Kitty Pryde': "0.17.0",
|
||||
'Kiwi': "2.2.0",
|
||||
'Klingon': "0.57.0",
|
||||
'Klytus': "1.1.0",
|
||||
'Kokoro': "0.69.0",
|
||||
@@ -1302,6 +1306,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Mai Sakurajima': "0.76.0",
|
||||
'Mai Shiranui': "0.6.0",
|
||||
'Maid Marian': "0.85.0",
|
||||
'Maine': "2.2.0",
|
||||
'Majin Buu': "0.43.0",
|
||||
'Maka Albarn': "1.0.0",
|
||||
'Maki Genryusai': "0.58.0",
|
||||
@@ -1941,6 +1946,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Soma Yukihira': "0.79.0",
|
||||
'Sombra': "0.16.0",
|
||||
'Sona': "0.81.0",
|
||||
'Song So Mi': "2.2.0",
|
||||
'Songbird': "0.69.0",
|
||||
'Sonic the Hedgehog': "0.19.0",
|
||||
'Sonya Blade': "0.16.0",
|
||||
@@ -2025,6 +2031,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Taki': "0.58.0",
|
||||
'Tala': "0.18.0",
|
||||
"Tali'Zorah": "0.60.0",
|
||||
'Talia Yang': "2.2.0",
|
||||
'Talia al Ghul': "0.18.0",
|
||||
'Tamamo no Mae': "2.1.0",
|
||||
'Tanjiro Kamado': "0.16.0",
|
||||
@@ -2193,6 +2200,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Vivi Ornitier': "0.60.0",
|
||||
'Vixen': "0.69.0",
|
||||
'Vogue': "0.57.0",
|
||||
'Volcana': "2.2.0",
|
||||
'Voldo': "0.58.0",
|
||||
'Von Lycaon': "1.4.0",
|
||||
'Vulcan': "0.57.0",
|
||||
@@ -2345,6 +2353,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Astronaut': "0.5.0",
|
||||
'Astronomer': "0.29.0",
|
||||
'Athlete': "0.5.0",
|
||||
'Aztec Noble': "2.3.0",
|
||||
'B-Boy / B-Girl': "0.42.0",
|
||||
'Babushka': "0.42.0",
|
||||
'Backyard Country Casual': "0.35.0",
|
||||
@@ -2438,6 +2447,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Halfling Rogue': "0.5.0",
|
||||
'Hanfu': "1.6.0",
|
||||
'Hazmat Technician': "0.87.0",
|
||||
'Heian Court': "2.2.0",
|
||||
'Highland Scot': "0.42.0",
|
||||
'Highwayman': "1.6.0",
|
||||
'Hockey Goalie': "0.90.0",
|
||||
@@ -2474,6 +2484,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Matador': "0.90.0",
|
||||
'McBling Socialite': "0.34.0",
|
||||
'Mechanic': "0.5.0",
|
||||
'Medieval Monarch': "2.2.0",
|
||||
'Medieval Peasant': "0.67.0",
|
||||
'Metalhead': "1.6.0",
|
||||
'Metrosexual': "0.34.0",
|
||||
@@ -2492,6 +2503,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Oktoberfest': "0.50.0",
|
||||
'Opera Singer': "0.50.0",
|
||||
'Orchestra Conductor': "0.5.0",
|
||||
'Ottoman Court': "2.2.0",
|
||||
'Outback Bushman': "0.42.0",
|
||||
'Paramedic': "0.29.0",
|
||||
'Parisian Chic': "0.42.0",
|
||||
@@ -2521,6 +2533,7 @@ ADDED_IN: dict[str, dict[str, str]] = {
|
||||
'Roaring Flapper': "0.5.0",
|
||||
'Roaring Twenties Gent': "0.24.0",
|
||||
'Rock Climber': "0.17.0",
|
||||
'Rococo Courtier': "2.2.0",
|
||||
'Rodeo Rider': "1.11.0",
|
||||
'Roller Derby': "1.11.0",
|
||||
'Roman Centurion': "0.17.0",
|
||||
|
||||
@@ -289,6 +289,40 @@ Two engine-facing traps this rewrite hit, both silent, both now pinned by tests:
|
||||
by the "Auto (preset)" sentinel on the two widgets (see "Vault recall and the control
|
||||
sentinels"); the Turnaround did not wait, because it has no widget to add one to.
|
||||
|
||||
### Sheets that change the person: release, don't override (2.3.0)
|
||||
|
||||
The Turnaround and Expression Sheet override a few fields and replay the rest unchanged. The
|
||||
Outfit Sheet and Age Progression nodes change things other fields depend on (an outfit style
|
||||
gates makeup, jewellery and hair styling; an age gates hair colour, skin detail and some
|
||||
outfits), so overriding alone would replay a value a live rule now excludes, and the engine
|
||||
would log a "keeping lock" conflict. They use **release** instead. The shared helpers live in
|
||||
`nodes/identity_forge_turnaround.py`: `replay_base()` builds the common replay kwargs,
|
||||
`document_fields()` flattens a document, and `release_fields()` drops named fields from the
|
||||
document (and from `_meta.omitted`), so the engine redraws them under the new pin from its
|
||||
fixed replay seed.
|
||||
|
||||
- **What to release is asked, not hard-coded.** For each pin (`outfit_style`, `age`, a framing,
|
||||
a grey hair colour) the node asks `lock_clash(field, value, context)` which kept fields the
|
||||
pin refuses, and releases those. Face and body never clash, so the person stays.
|
||||
- **Outfit Sheet:** releases the whole Clothing group, and with a studio backdrop the scene
|
||||
fields (location, lighting, composition, season; a locked season otherwise clashes with a
|
||||
studio). Makeup, jewellery and hair styling are released per style when that style refuses
|
||||
them (`_RESTYLED`). A style that would refuse anything else is skipped and logged; with the
|
||||
default backdrop that never happened over the test sweep, while "Keep the character's scene"
|
||||
usually keeps 3 to 4 of 6 styles because many places refuse formal or athletic wear.
|
||||
- **Released fields need a per-character seed.** The fixed `_REPLAY_SEED` is right when a
|
||||
replay redraws nothing, but a released field redrawn from a fixed seed lands on the same
|
||||
value for every character: the first draft's per-style seeds gave 40 characters four casual
|
||||
outfits, most of them grey. `character_seed()` hashes the document (plus a salt: the style
|
||||
and the user's `outfit_seed`, or "age"), so a redraw differs between characters and repeats
|
||||
for the same one. Age Progression uses it for the fields an age refuses. A cosplay, a full-body suit or a suppressed
|
||||
Clothing group gives one view, unchanged.
|
||||
- **Age Progression:** only `age` is pinned, so face shape, eye colour, build and the rest stay.
|
||||
Hair greys only for a natural-scope, non-cosplay, uncovered head: a stage past 55 and older
|
||||
than the character turns dark hair salt and pepper (silver from 70), any other colour silver;
|
||||
a grey-haired character shown younger gets a natural colour drawn once at age 20 with hair
|
||||
colour released. A face-covering character, or one with no numeric age, gives one view.
|
||||
|
||||
### Vault recall and the control sentinels (1.0.0)
|
||||
|
||||
`wardrobe` and `hair_color_scope` are control fields — they live only in `_meta`, never in
|
||||
@@ -3529,6 +3563,33 @@ caught and fixed during this task's review rounds. `<img>` tags lazy-load via
|
||||
lazy-load pattern, so opening the dialog with previews on does not eagerly fetch hundreds of
|
||||
images at once.
|
||||
|
||||
**Superseded in 2.3.0: previews go through a server-side cache.** ComfyUI's `--offline` flag adds
|
||||
a Content-Security-Policy (`img-src 'self' data: blob:; connect-src 'self' ...`) that blocks the
|
||||
browser from reaching github.io at all, so the direct fetch above showed nothing for those users.
|
||||
The picker now asks its own ComfyUI origin (`/identity_forge/gallery/<folder>/manifest.json` and
|
||||
`/identity_forge/gallery/<folder>/images/...`, via `api.apiURL`), and `nodes/gallery_cache.py`
|
||||
fetches from `gh-pages` server-side and keeps the files under ComfyUI's user directory
|
||||
(`identity_forge/gallery_cache/`). The CSP binds only the browser, so the server fetch is allowed.
|
||||
Rules that keep it safe and small:
|
||||
|
||||
- **Only what is viewed is stored.** Images are fetched one at a time as the picker lazy-loads
|
||||
them; nothing is prefetched. The whole gallery is a few hundred MiB, a typical session a few MiB.
|
||||
- **Only manifest-listed paths are fetched,** always from the one fixed gh-pages root, and the
|
||||
resolved cache path must stay inside the cache folder. The kind is an allowlist. So a request
|
||||
can never make the server fetch an arbitrary URL or write outside its folder.
|
||||
- **Freshness:** the manifest is reused for 10 minutes, an image for 7 days, then revalidated
|
||||
with the stored ETag (a 304 just renews the file's mtime). Filenames are stable across
|
||||
re-renders, so a re-rendered image arrives on its next revalidation.
|
||||
- **Offline fallback:** any network failure serves the cached copy; with nothing cached the
|
||||
route returns 404 and the picker falls back to text-only, as before.
|
||||
- **Size caps and type checks:** a manifest must parse as JSON with an `entries` list, an image
|
||||
must come back as `image/*`, and each has a byte limit. Writes are atomic.
|
||||
- **Clear cached previews** in the picker POSTs `/identity_forge/gallery/cache/clear` (a JSON
|
||||
body is required, the same CSRF guard as the other POST routes) and reports the size freed.
|
||||
|
||||
The server-side fetch does mean the pack contacts github.io even under `--offline` once a user
|
||||
ticks "Show preview images"; the picker's notice says so, and the checkbox stays off by default.
|
||||
|
||||
**Two Critical bugs surfaced only by live testing**, not by the automated jsdom suite (documented
|
||||
at length in the task's own reports; named here because they shaped what shipped): the trigger
|
||||
button was fully clickable while its node was still an unplaced LiteGraph "ghost" (Escape then
|
||||
|
||||
+149
@@ -1394,3 +1394,152 @@ Komaeda, Chiaki Nanami, Jonathan Joestar, Tamamo no Mae, Falin Touden, Senshi, S
|
||||
Mercury, the four RWBY leads, Wild Tiger and Barnaby, Nanoha and Fate, Ragna and Noel,
|
||||
Arcueid Brunestud and Serval. Kiana Kaslana and Caesar Zeppeli were declined (no one stable
|
||||
outfit, colours not verifiable); see suggested-additions.md.
|
||||
|
||||
## 2.2.0 - Cyberpunk roster, Volcana, period court dress, a picker franchise filter
|
||||
|
||||
**Random characters move through the outfit corpus and one new location** (below). Four new phrases (three in
|
||||
`edgy alternative`, one in `vintage retro`) change which outfit a fixed seed draws in those
|
||||
two styles; field marginals still match the committed baseline (`sweep_marginals.py
|
||||
--check`). Nine creature gallery tiles whose outfit draw moved were re-rendered.
|
||||
|
||||
**Cyberpunk entries checked against Danbooru tag counts and the wiki, not the brief.**
|
||||
- David Martinez wore a red bomber; canon is the yellow EMT jacket with the glowing blue
|
||||
collar. Panam Palmer and Rebecca were rebuilt the same way (Rebecca's tagged skin is
|
||||
chalk-white with seam lines, her eyes green on red sclera; the huge cyberarms are a
|
||||
weighted alternate).
|
||||
- New: Maine, Kiwi, Talia Yang (Edgerunners 2), Adam Smasher (a full-body suit entry, the
|
||||
C-3PO precedent), Song So Mi (green gown primary, netrunner alternate at weight 1 of 3).
|
||||
- The brief's Maine (buzzcut, yellow optics) and Pilar (white pompadour, pink skin) did not
|
||||
match the sources; Maine follows the tags (flattop, red shades), Pilar was declined.
|
||||
|
||||
**Volcana (DC)** ships with fair skin and red-orange hair; the brief's olive skin is not in
|
||||
the sources.
|
||||
|
||||
**A costume that names earrings or a necklace now suppresses the random one**
|
||||
(`_COSTUME_JEWELRY_RES` in the Cosplayer node), so Volcana's gold hoops no longer sit beside
|
||||
a second pair in Costume-only mode. Full character already dropped random jewellery, so no
|
||||
gallery tile moved.
|
||||
|
||||
**An eyes override must not end in an eye part.** Kiwi's "feline red, yellow-sclera" dropped
|
||||
the noun "eyes" (`_EYE_PART_RE`); the adjectives were reordered.
|
||||
|
||||
**Period court dress.** Rococo Courtier, Medieval Monarch, Ottoman Court and Heian Court were
|
||||
added from a 15-prompt historical-costume list; the rest were existing looks under other
|
||||
names (see suggested-additions.md -> "Archetypes - declined"). Ancient Roman Patrician gained
|
||||
a Female variant (stola and palla). The new looks lock "no tattoos", and `_is_essential` now
|
||||
keeps a `tattoos` lock in Essentials: before this a Heian court lady drew a modern script
|
||||
tattoo. No older archetype locks tattoos, so nothing else moved.
|
||||
|
||||
**Picker franchise filter.** The roster picker gains a franchise select beside the gender
|
||||
filter, grouped by category, kept for the session like the other filters.
|
||||
|
||||
**The outfit wildcards were mostly not usable.** The punk and pinup packs are lingerie worn
|
||||
as outerwear, with footwear and fabric jargon built into each line; they break the corpus
|
||||
contract and would tilt women's outfits toward sexualized looks. Four phrases were taken,
|
||||
with pattern words (tartan, leopard, gingham) removed because the `pattern` field owns them.
|
||||
|
||||
**Render-review fixes.** Adam Smasher drew a human face over the armor ("a very tall man"
|
||||
led the prompt); a `subject` of "towering armored cyborg" fixed it. Talia Yang's mandible
|
||||
mask, last in a long costume list, was dropped; it now leads the costume. The leprechaun's
|
||||
integument repeated its palette ("ruddy freckled ruddy freckled skin", the only creature
|
||||
that did) and its gallery seed drew a woman with the folklore beard; the integument is now
|
||||
plain "skin" and the gallery tile is pinned Male (`_GALLERY_GENDER`). The node itself still
|
||||
gives a female leprechaun the beard: creature slots have no gender gate.
|
||||
|
||||
**A `gilded palace throne room` location.** Rococo Courtier and Ottoman Court were using a
|
||||
grand hotel suite and a European castle courtyard as stand-ins. The value joins the
|
||||
`civic_institutional` family (frozen family weight, so the family's share is unchanged; the
|
||||
new value draws about 0.5% of random characters) and the formal-room rules: dressy outfit
|
||||
styles, no athletic wear, no casual headwear, candlelight allowed. Medieval Monarch stays in
|
||||
the cathedral, where coronations happen. Every seed that draws the civic family re-picks
|
||||
within a longer list, so 94 gallery samples whose prompt moved were re-rendered, and the
|
||||
marginals baseline was rewritten.
|
||||
|
||||
**Period looks lock tattoos and piercings.** Renaissance Noble, Victorian Lady, Victorian
|
||||
Dandy, Gibson Girl, Regency Aristocrat, Greek Goddess, Egyptian Pharaoh, Roman Centurion,
|
||||
Medieval Peasant, Musketeer and Highwayman now lock "no tattoos" and "no piercings beyond
|
||||
ears", as the four new court looks do. Bracelets and rings are left free: pharaohs and
|
||||
nobles wore them. Warrior and living-tradition looks (Gladiator, Viking Shieldmaiden,
|
||||
Samurai, the cultural-dress archetypes) are unchanged.
|
||||
|
||||
**Maintainer render review of the re-rendered tiles.** Each fix names what the render
|
||||
lacked, because the model only draws what the prose says:
|
||||
- Darth Vader drew bare hands: the costume never named the suit, gloves or boots. They are
|
||||
named now, and `covers_body` drops the wearer's skin and build.
|
||||
- Reverse-Flash had no mask (none was written); a yellow cowl with red ear bolts now mirrors
|
||||
The Flash entry, with `covers_face` and a `costume_back`.
|
||||
- The Maxx and the Tusken Raider showed a human face inside the mask: the prose led with "a
|
||||
... man with ... skin". Both take `covers_body` and a `subject` lead noun, and the Tusken
|
||||
mask says the head is fully wrapped with no skin showing ("a bandage-wrapped face" drew a
|
||||
face). "Unmask (show face)" still shows the face.
|
||||
- Tatsumaki's "faint" aura, last in the list, did not render; the glow now leads. Her dress
|
||||
is canon (long sleeves, high collar, leg slits, not a sleeveless cocktail dress), and her
|
||||
age (28) and pale skin are pinned.
|
||||
- The horseshoe crab drew a plain man ("drawn low over the face"), then a man wearing the
|
||||
shell as a hat ("a shell in place of a head"). A negated "no human head at all" was
|
||||
ignored on most seeds, so the head now leads positively ("a faceless horseshoe crab
|
||||
head"), like the other arthropods. Body parts with no place on a biped ("two smooth
|
||||
shields", "a plated abdomen", "the rear shield") rendered as a second whole crab held at
|
||||
the side; each is now anchored (carapace over back and chest, tail from the lower back,
|
||||
gills under the torso). Chitin arms and pincers for hands; the tile is rerolled once.
|
||||
- Three creature tiles were rerolled without a data change (`--reroll`, recorded in the
|
||||
manifest): the biomechanical alien ("biomechanical" is a Giger style token and restyled
|
||||
a gilded palace around it), the ocean sunfish (drew a woman holding a fish) and the
|
||||
crystalline alien (a hoodie hid the translucent body).
|
||||
|
||||
## 2.3.0 - offline picker previews, Outfit Sheet, Age Progression, Aztec Noble, more back views
|
||||
|
||||
**Picker previews survive `--offline`.** ComfyUI's `--offline` adds a CSP that blocks the
|
||||
browser from fetching github.io, so the picker's thumbnails silently showed nothing. Checked in
|
||||
ComfyUI's `server.py`: the policy is a response header, so it binds the browser only. The pack's
|
||||
server now fetches the manifest and images and serves them from ComfyUI's own origin, caching
|
||||
them under the user directory. Measured before choosing the design: the published galleries
|
||||
total a few hundred MiB (about 100 KiB an image), so the cache is lazy, never a full mirror;
|
||||
GitHub Pages returns ETags and honours `If-None-Match`, and image filenames are stable across
|
||||
re-renders, so revalidation is cheap. Verified on an isolated ComfyUI started with `--offline`:
|
||||
a direct github.io fetch was blocked, the cached routes served the manifest and a JPEG, and
|
||||
unlisted, traversal and unknown-kind paths returned 404. Design and safety rules:
|
||||
architecture.md -> "Superseded in 2.3.0: previews go through a server-side cache".
|
||||
|
||||
**Outfit Sheet and Age Progression.** Both replay a resolved `prompt_json` like the Turnaround,
|
||||
but they change fields other fields depend on. The first Outfit Sheet draft overrode only the
|
||||
Clothing group and skipped nearly every style: makeup, jewellery and hair accessories are
|
||||
style-gated, so a casual look's ponytail or a formal look's earrings refused the next style.
|
||||
Overriding is the wrong tool; the nodes now ask `lock_clash` what each pin refuses and release
|
||||
those fields for a redraw (architecture.md -> "Sheets that change the person"). Three more
|
||||
conflict sources turned up in seed sweeps and are covered the same way: a locked season under
|
||||
a studio backdrop, a close-up framing against a locked composition or pose, and pinned grey hair
|
||||
against locked highlights. A 20-year-old also briefly gained laugh lines, because the natural
|
||||
hair colour was drawn from a replay that kept the old skin detail; both paths now share one
|
||||
helper. Final sweep: every studio-backdrop sheet and every age sheet kept all its views with no
|
||||
engine conflicts; keep-scene sheets usually keep 3 to 4 of 6 styles, by design. The first
|
||||
example render looked grey in four of six outfits: each style replayed with one fixed seed, so
|
||||
every character drew the same few outfits per style (40 characters, four casual looks). The
|
||||
seed now hashes the character, and an `outfit_seed` input re-dresses the same person; measured
|
||||
after, 36 to 40 distinct outfits per style over 40 characters and a grey share matching plain
|
||||
random characters.
|
||||
|
||||
**Period archetypes.** Edo, Victorian and Regency were proposed and dropped: Samurai, Geisha,
|
||||
Victorian Lady, Victorian Dandy and Regency Aristocrat already ship. Silk Road was declined as a
|
||||
blend of Mongolian Deel, Ottoman Court and Hanfu. Aztec Noble is new (Codex Mendoza and
|
||||
Florentine Codex dress: huipil and cueitl, or tilmatli and maxtlatl with a quetzal headdress).
|
||||
|
||||
**Gallery samples.** The first Aztec Noble tile, rendered at the gallery's default
|
||||
`Essentials` lock level, drew a random ethnicity; the look needs `Full preset`, now a per-entry
|
||||
gallery pin (`_GALLERY_LOCK_LEVEL` in `scripts/render_gallery.py`). The Ancient Roman Patrician
|
||||
sample is pinned Male (the toga is the expected look; the node still offers both). Example
|
||||
workflows for the two new nodes ship in `example_workflows/`, built in the real frontend on an
|
||||
isolated instance and reloaded to confirm what they execute. `--publish-pending` ignored
|
||||
`--dry-run` and pushed; it now only lists what it would publish.
|
||||
|
||||
**More `costume_back` entries,** starting with caped and back-emblem heroes (Survey Corps
|
||||
wings, Gotei 13 captains' haori, capes for Thor, Doctor Strange, Shazam, Supergirl, Robin,
|
||||
Saitama and Vision, plus suit backs for Captain Marvel and Green Lantern). Each is checked by
|
||||
rendering the Turnaround's back view text, never by parsing the front costume. Test renders of
|
||||
six back views (Thor, Doctor Strange, Saitama, Levi, Byakuya, Superman) showed the cape or back
|
||||
emblem and no chest emblem; Byakuya's kanji is not the right glyph (a model text limit).
|
||||
|
||||
Random characters are unchanged: no field pool, weight or draw order moved (verified by hashing
|
||||
the prose of several hundred seeds before and after, and the Turnaround and Expression Sheet
|
||||
output over the shared-helper refactor). The Archetype node's `Random` pick moves on some seeds,
|
||||
as with every archetype addition, because it chooses from a longer list.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
# Archetype reference
|
||||
|
||||
**287 archetypes.** Each is a curated look wired through the Archetype node. `gender` shows a locked gender (blank = either); `outfit` is the archetype's outfit style.
|
||||
**292 archetypes.** Each is a curated look wired through the Archetype node. `gender` shows a locked gender (blank = either); `outfit` is the archetype's outfit style.
|
||||
|
||||
- **1940s Factory Worker** [Female] -- vintage retro
|
||||
- **1940s Swing Dancer** [Any]
|
||||
@@ -42,6 +42,7 @@
|
||||
- **Astronaut** -- athletic
|
||||
- **Astronomer** -- smart casual
|
||||
- **Athlete** [Any] -- athletic
|
||||
- **Aztec Noble** [Any] -- evening formal
|
||||
- **B-Boy / B-Girl**
|
||||
- **Babushka** [Female] -- vintage retro
|
||||
- **Backyard Country Casual** [Any]
|
||||
@@ -135,6 +136,7 @@
|
||||
- **Halfling Rogue** -- casual
|
||||
- **Hanfu** [Any] -- vintage retro
|
||||
- **Hazmat Technician** -- athletic
|
||||
- **Heian Court** [Any] -- evening formal
|
||||
- **Highland Scot** [Any]
|
||||
- **Highwayman** [Male] -- vintage retro
|
||||
- **Hockey Goalie** -- athletic
|
||||
@@ -171,6 +173,7 @@
|
||||
- **Matador** [Any] -- evening formal
|
||||
- **McBling Socialite** [Female] -- streetwear
|
||||
- **Mechanic** [Any] -- edgy alternative
|
||||
- **Medieval Monarch** [Any] -- evening formal
|
||||
- **Medieval Peasant** -- casual
|
||||
- **Metalhead** [Any] -- edgy alternative
|
||||
- **Metrosexual** [Male] -- smart casual
|
||||
@@ -189,6 +192,7 @@
|
||||
- **Oktoberfest** [Any]
|
||||
- **Opera Singer** [Any]
|
||||
- **Orchestra Conductor** -- evening formal
|
||||
- **Ottoman Court** [Any] -- evening formal
|
||||
- **Outback Bushman** [Male] -- casual
|
||||
- **Paramedic** -- athletic
|
||||
- **Parisian Chic** [Any]
|
||||
@@ -218,6 +222,7 @@
|
||||
- **Roaring Flapper** [Female] -- vintage retro
|
||||
- **Roaring Twenties Gent** [Male] -- vintage retro
|
||||
- **Rock Climber** [Any] -- athletic
|
||||
- **Rococo Courtier** [Any] -- evening formal
|
||||
- **Rodeo Rider** [Any] -- vintage retro
|
||||
- **Roller Derby** [Any] -- athletic
|
||||
- **Roman Centurion** [Male] -- athletic
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
# Cosplayer reference
|
||||
|
||||
**2154 characters.** Flags: `F`/`M` = source gender, `giant`/`tiny` = size scale, `masked` = full-face covering, `beast` = rendered as the animal itself (`body_plan: feral`), `+N alt` = extra costumes, `prop` = signature held item.
|
||||
**2160 characters.** Flags: `F`/`M` = source gender, `giant`/`tiny` = size scale, `masked` = full-face covering, `beast` = rendered as the animal itself (`body_plan: feral`), `+N alt` = extra costumes, `prop` = signature held item.
|
||||
|
||||
## Anime & Manga (416)
|
||||
|
||||
@@ -1283,7 +1283,7 @@
|
||||
- **Suprema** (F)
|
||||
- **Vogue** (F)
|
||||
|
||||
## DC (178)
|
||||
## DC (179)
|
||||
|
||||
### DC
|
||||
|
||||
@@ -1405,7 +1405,7 @@
|
||||
- **Ratcatcher 2** (F, prop)
|
||||
- **Red Claw** (F)
|
||||
- **Red Hood** (M, masked)
|
||||
- **Reverse-Flash** (M)
|
||||
- **Reverse-Flash** (M, masked)
|
||||
- **Rick Flag** (M, prop)
|
||||
- **Robin** (M)
|
||||
- **Rose Wilson** (F, prop)
|
||||
@@ -1438,6 +1438,7 @@
|
||||
- **Tomar-Re** (M)
|
||||
- **Two-Face** (M, prop)
|
||||
- **Vixen** (F)
|
||||
- **Volcana** (F)
|
||||
- **Waverider** (M)
|
||||
- **Wildcat** (M, masked)
|
||||
- **Wonder Girl (Cassie Sandsmark)** (F)
|
||||
@@ -2821,7 +2822,7 @@
|
||||
- **Zorii Bliss** (F, masked, prop)
|
||||
- **Zuckuss** (M, masked)
|
||||
|
||||
## Video Games (515)
|
||||
## Video Games (520)
|
||||
|
||||
### A Certain Scientific Railgun
|
||||
|
||||
@@ -2930,15 +2931,20 @@
|
||||
|
||||
### Cyberpunk 2077
|
||||
|
||||
- **Adam Smasher** (M, masked)
|
||||
- **Johnny Silverhand** (M)
|
||||
- **Judy Alvarez** (F)
|
||||
- **Panam Palmer** (F, prop)
|
||||
- **Song So Mi** (F, +1 alt)
|
||||
|
||||
### Cyberpunk: Edgerunners
|
||||
|
||||
- **David Martinez** (M)
|
||||
- **Kiwi** (F)
|
||||
- **Lucy** (F)
|
||||
- **Rebecca (Cyberpunk)** (F, prop)
|
||||
- **Maine** (M)
|
||||
- **Rebecca (Cyberpunk)** (F, +1 alt, prop)
|
||||
- **Talia Yang** (F)
|
||||
|
||||
### Dark Souls
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ Closed with a reason. Reopen only with a **new** argument, not a repeat of the r
|
||||
|---|---|
|
||||
| A negative and/or tags output | Maintainer: not needed. (The subject/scene half of the same row shipped at 1.8.0 as `subject_text`.) |
|
||||
| An on-node readout of the resolved prompt | Maintainer: not needed. |
|
||||
| A pair / group node (two or more resolved characters in one prompt) (2.3.0 plan) | Maintainer: deferred, not refused. Most current t2i models blend or swap traits between two described people in one prompt, so the output would not match the characters. Reopen if models hold separate subjects reliably. |
|
||||
|
||||
### Individual characters
|
||||
|
||||
@@ -85,6 +86,8 @@ Closed with a reason. Reopen only with a **new** argument, not a repeat of the r
|
||||
| Anxiety (Inside Out) | **Declined at 1.8.0 on the render bar.** The look is a teal turtleneck, high trousers and boots over bright orange skin, and the model could not hold it: two renders kept pale human skin (the orange only reached the hair) and spread the teal from the sweater onto the trousers and boots, so the tile read as a pale redhead in a teal outfit. Body-paint wording that works for a single-colour figure (Megamind's blue) fails when a second saturated costume colour is present. Reopen with a costume that is not a second saturated colour, or if the model's skin-colour handling changes. |
|
||||
| Kliff (Crimson Desert) | **Revisited and DECLINED at 1.4.0.** The original reason was wrong: Kliff is a *fixed* protagonist (set face, body and voice, the Geralt model), not a vendor-built one -- only his hair, facial hair, tattoos and outfit *colours* are customizable. The decline stands on the other half: his equipment and clothing are explicitly "highly customizable", so there is still no single canonical outfit to describe, and what is left -- a bearded man in fantasy leathers -- is the silhouette `Geralt` and `Conan the Barbarian` already carry. Reopen only if a marketing-canonical outfit becomes the settled default look. |
|
||||
| M3GAN (1.5.0 maintainer shortlist) | **Adults-only bar.** Canonically a child-sized android doll modelled on a young girl: rendering her as a child breaks the bar, and rendering her as an adult is not canon. Approved on the shortlist, declined at research. |
|
||||
| Alt Cunningham, Goro Takemura, Rogue, Hanako Arasaka, Kerry Eurodyne, Dorio, Faraday (Cyberpunk 2077 / Edgerunners) | **Considered and declined by the maintainer at 2.2.0.** Proposed as the rest of the Cyberpunk cast after the 2.2.0 batch; not wanted. Do not re-propose without a new reason. |
|
||||
| Pilar (Cyberpunk: Edgerunners) | **Declined at 2.2.0 on sources.** The brief (white pompadour, pink skin, pointed ears) contradicts the wiki (black mohawk, golden robotic hands, goggle cyberware to the chin) and tag counts were too thin to settle it. Reopen with a reference image. |
|
||||
| Marinette Dupain-Cheng, Adrien Agreste (civilian) | Ordinary modern teen dress. Their transformed looks (Ladybug, Cat Noir) carry them. |
|
||||
| Jessica Jones, Marion Ravenwood, Baby Houseman, Frankie Foster, Peggy Hill, Luanne Platter | Everyday modern dress. Fails the "iconic *and* specific outfit" bar that admitted Trinity, Mia Wallace and Sandy Olsson. |
|
||||
| Anya Forger, Beatrice (Re:Zero) | Human children in ordinary clothes. Distinct from the accepted child *cosplays* (Dora, the Powerpuff Girls, Tina Belcher, Charlie Brown), whose looks are ordinary clothing on an adult wearer. See the mascot-suit distinction in architecture.md — it does **not** rescue these two. |
|
||||
@@ -342,6 +345,10 @@ From the third-party wildcard packs mined at 1.6.0. What shipped is in docs/hist
|
||||
| Techwear / Gorpcore | **Cyberpunk Netrunner already is a techwear look** — its costume is literally "a {dark_color} techwear jacket with {color} LED trim, utility straps, and a sleek visor". Stripping the sci-fi trim to leave shell-jacket-and-cargo-trousers is not a second silhouette, it is the same one with less to draw. |
|
||||
| A dark/gothic counterpart to Kawaii Street Fashion | Declined on two counts. The pastel silhouette is already `Kawaii Street Fashion` (ruffled blouse, tiered skirt, platform Mary-Janes) and the dark one is already `1990s Goth`, so the candidate sits between two shipped entries rather than beside them. The maintainer also rejected the subculture's usual name outright. **Do not re-propose it under a synonym.** |
|
||||
| Zoot Suit women's (pachuca) variant (1.11.0 plan) | **Declined at 1.11.0 on the render bar; `Zoot Suit` ships men's only.** The long drape jacket and the watch chain are the whole look. Both wordings failed: the first (a long-line jacket over a short pleated skirt) did not read as a zoot suit, and the retry (fingertip-length drape jacket, pegged trousers) drew a sleeveless cropped vest with no chain. |
|
||||
| Renaissance noblewoman, Victorian lady, Edwardian lady, Greek noblewoman, Steampunk aristocrat (2.2.0 historical list) | **Already ship** as `Renaissance Noble`, `Victorian Lady`, `Gibson Girl`, `Greek Goddess` and `Steampunk Inventor`. Baroque gentleman, Rococo marquise and Georgian gentleman were folded into the new `Rococo Courtier`. |
|
||||
| Edo, Victorian and Regency period looks (2.3.0 plan) | **Already ship** as `Samurai`, `Geisha`, `Stealth Ninja`, `Victorian Lady`, `Victorian Dandy` and `Regency Aristocrat`. `Aztec Noble` shipped from the same list. |
|
||||
| Silk Road merchant (2.3.0 plan) | A blend of `Mongolian Deel`, `Ottoman Court` and `Hanfu` with no silhouette of its own; the name would be doing the work. |
|
||||
| Mughal noblewoman, Belle Epoque gown, "cinematic period costume" (2.2.0 historical list) | Mughal court dress overlaps `Lehenga & Sherwani`; a Belle Epoque gown sits between `Victorian Lady` and `Gibson Girl`; "cinematic period costume" is a style, not a look. |
|
||||
| Rockabilly (1.11.0 plan) | Sits between two shipped entries: `1950s Greaser` carries the cuffed jeans, leather jacket and pompadour, and `Pin-up Model` the halter dress, victory rolls and red lip. A third entry would be a blend of the two, not a new look. |
|
||||
|
||||
---
|
||||
|
||||
@@ -227,6 +227,53 @@ Each view sets a fixed, curated expression/mood/smile combination, so a sheet is
|
||||
deterministic and no two views land on the same face. A face-covering character (a mascot
|
||||
head, a full helmet) has no visible expression, so the sheet emits one view, `1-masked`.
|
||||
|
||||
## Outfit sheets
|
||||
|
||||
The **Identity Forge Outfit Sheet** node is wired like the Turnaround and keeps the person while
|
||||
it redresses them once per outfit style.
|
||||
|
||||
- **`sheet`** - `Range (6)` (casual, smart casual, business formal, evening formal, athletic,
|
||||
resort vacation), `Everyday (4)`, `Work to evening (4)` or `Every style`.
|
||||
- **`backdrop`** - a grey (default), white or black studio backdrop, or `Keep the character's
|
||||
scene`. A studio backdrop also redraws lighting and composition to suit the studio, so every
|
||||
style fits.
|
||||
Keeping the scene skips styles the place does not allow (no evening gown on a hiking trail),
|
||||
so that sheet is often shorter.
|
||||
- **`framing`** - `Full body` by default, so the whole outfit shows. **`pose`** - a standing
|
||||
pose by default; `Keep the character's pose` keeps theirs.
|
||||
- **`outfit_seed`** - every outfit is drawn at random within its style, and differs from one
|
||||
character to the next. Change this number to re-dress the same person; set its control to
|
||||
`randomize` for new outfits every queue.
|
||||
|
||||
The face, body and hair colour stay; makeup, jewellery and hair styling follow each outfit when
|
||||
the old ones would clash with it. Labels read `1-casual`, `2-smart-casual` and so on. A cosplay
|
||||
character or a full-body suit has its costume, so the sheet emits one view as resolved.
|
||||
A ready-made workflow is `example_workflows/Identity Forge - Outfit Sheet.json` (also in
|
||||
ComfyUI's template browser).
|
||||
|
||||
## Age progression
|
||||
|
||||
The **Identity Forge Age Progression** node shows the same person at several ages.
|
||||
|
||||
- **`stages`** - `Life stages (4)` (20, 35, 50, 70), `Decades (6)` (20 to 70) or `Young and old
|
||||
(2)` (25, 70).
|
||||
- **`framing`** - `Head and shoulders` by default; `Unspecified` keeps the character's own.
|
||||
|
||||
Only the age and what depends on it change (skin detail, and an outfit or hair style the new
|
||||
age does not allow). With a natural hair colour scope, hair greys past 55: dark hair goes salt
|
||||
and pepper, then silver from 70. A grey-haired character shown younger gets a natural colour.
|
||||
Dyed or vivid scopes, cosplay hair and covered hair are left alone. A face-covering character
|
||||
emits one view as resolved. Labels read `1-age-20` and so on. A ready-made workflow is
|
||||
`example_workflows/Identity Forge - Age Progression.json`.
|
||||
|
||||
## Preview images in the picker
|
||||
|
||||
"Show preview images" in the roster picker is off by default. When it is on, your ComfyUI
|
||||
server downloads each sample image the first time you scroll to it and keeps it in
|
||||
`<ComfyUI user folder>/identity_forge/gallery_cache/`, so previews also show when ComfyUI runs
|
||||
with `--offline` (once the server has fetched them). Only images you view are stored. "Clear
|
||||
cached previews" in the picker deletes the folder and shows how much it freed.
|
||||
|
||||
## Holding something specific
|
||||
|
||||
The Modifier node's optional **`held_item`** box takes a free-text noun phrase - `a red
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+375
-216
File diff suppressed because it is too large
Load Diff
@@ -443,14 +443,19 @@ const COSPLAYER_FRANCHISES = {
|
||||
"Cuphead"
|
||||
],
|
||||
"Cyberpunk 2077": [
|
||||
"Adam Smasher",
|
||||
"Johnny Silverhand",
|
||||
"Judy Alvarez",
|
||||
"Panam Palmer"
|
||||
"Panam Palmer",
|
||||
"Song So Mi"
|
||||
],
|
||||
"Cyberpunk: Edgerunners": [
|
||||
"David Martinez",
|
||||
"Kiwi",
|
||||
"Lucy",
|
||||
"Rebecca (Cyberpunk)"
|
||||
"Maine",
|
||||
"Rebecca (Cyberpunk)",
|
||||
"Talia Yang"
|
||||
],
|
||||
"DC": [
|
||||
"Alan Scott",
|
||||
@@ -604,6 +609,7 @@ const COSPLAYER_FRANCHISES = {
|
||||
"Tomar-Re",
|
||||
"Two-Face",
|
||||
"Vixen",
|
||||
"Volcana",
|
||||
"Waverider",
|
||||
"Wildcat",
|
||||
"Wonder Girl (Cassie Sandsmark)",
|
||||
|
||||
+106
-10
@@ -1,4 +1,5 @@
|
||||
import { app } from "../../scripts/app.js";
|
||||
import { api } from "../../scripts/api.js";
|
||||
|
||||
/*
|
||||
* Identity Forge roster picker — Phase 4b (1.1.0).
|
||||
@@ -175,6 +176,22 @@ function matchesGender(entry, gender) {
|
||||
return gender === GENDER_ANY || !entry.gender || entry.gender === "Any" || entry.gender === gender;
|
||||
}
|
||||
|
||||
// Franchise filter (2.2.0). Only cosplayers carry a franchise, so picking one
|
||||
// narrows to cosplayers. Options come from the loaded roster, grouped by category.
|
||||
const FRANCHISE_ALL = "All franchises";
|
||||
|
||||
function franchiseGroups(entries) {
|
||||
const groups = new Map();
|
||||
for (const e of entries) {
|
||||
if (!e.franchise) continue;
|
||||
const category = e.category || "Other";
|
||||
if (!groups.has(category)) groups.set(category, new Set());
|
||||
groups.get(category).add(e.franchise);
|
||||
}
|
||||
const byText = (a, b) => a.localeCompare(b, undefined, { sensitivity: "base" });
|
||||
return [...groups.keys()].sort(byText).map((c) => [c, [...groups.get(c)].sort(byText)]);
|
||||
}
|
||||
|
||||
const FACET_PREDICATES = {
|
||||
[FACET_ALL]: () => true,
|
||||
[FACET_GIANT]: (e) => hasTrait(e, "giant"),
|
||||
@@ -201,19 +218,30 @@ function traitChips(entry) {
|
||||
// --- opt-in thumbnails --------------------------------------------------------
|
||||
//
|
||||
// Text-first, zero image payload by default. Enabling "Show preview images"
|
||||
// fetches the LIVE gh-pages gallery manifest for a kind with a plain, absolute
|
||||
// `fetch` -- explicitly not `api.fetchApi`, which targets the ComfyUI server,
|
||||
// not GitHub Pages -- and lazy-loads <img> tags via IntersectionObserver.
|
||||
// Gallery manifests are deployment output on gh-pages, not source artifacts
|
||||
// on main; only the published file is ever fetched here.
|
||||
// fetches the gallery manifest for a kind and lazy-loads <img> tags via
|
||||
// IntersectionObserver. 2.3.0: both go through the pack's own server routes
|
||||
// (nodes/gallery_cache.py), which fetch the gh-pages gallery and keep it on
|
||||
// disk -- ComfyUI's --offline CSP allows only the page's own origin, and the
|
||||
// cache also keeps previews showing after the network goes away. Gallery
|
||||
// manifests are deployment output on gh-pages, not source artifacts on main.
|
||||
|
||||
const GH_PAGES_GALLERY_ROOT = "https://enragedantelope.github.io/comfyui-identity-forge/gallery/";
|
||||
const PREVIEW_PREF_KEY = "identity_forge.picker.show_previews";
|
||||
|
||||
/** The public gallery page (the "Open the full gallery" links). */
|
||||
function galleryFolderURL(kind) {
|
||||
return GH_PAGES_GALLERY_ROOT + KIND_GALLERY_FOLDER[kind] + "/";
|
||||
}
|
||||
|
||||
/** The same folder through the server's cache, on ComfyUI's own origin. */
|
||||
function galleryCacheURL(kind) {
|
||||
return api.apiURL("/identity_forge/gallery/" + KIND_GALLERY_FOLDER[kind] + "/");
|
||||
}
|
||||
|
||||
function formatMegabytes(bytes) {
|
||||
return (bytes / (1024 * 1024)).toFixed(1) + " MB";
|
||||
}
|
||||
|
||||
function loadPreviewPref() {
|
||||
try {
|
||||
return window.localStorage.getItem(PREVIEW_PREF_KEY) === "1";
|
||||
@@ -262,7 +290,7 @@ const manifestFetches = new Map();
|
||||
|
||||
function loadManifest(kind) {
|
||||
if (manifestFetches.has(kind)) return manifestFetches.get(kind);
|
||||
const promise = fetch(galleryFolderURL(kind) + "manifest.json")
|
||||
const promise = fetch(galleryCacheURL(kind) + "manifest.json")
|
||||
.then((response) => {
|
||||
if (!response.ok) throw new Error("HTTP " + response.status);
|
||||
return response.json();
|
||||
@@ -330,6 +358,7 @@ class IdentityForgePicker {
|
||||
this.activeTab = config.kind;
|
||||
this.facet = FACET_ALL;
|
||||
this.gender = GENDER_ANY;
|
||||
this.franchise = FRANCHISE_ALL;
|
||||
this.showPreviews = loadPreviewPref();
|
||||
this.focusIndex = 0;
|
||||
this.visible = [];
|
||||
@@ -508,6 +537,17 @@ class IdentityForgePicker {
|
||||
});
|
||||
this.genderSelect = genderSelect;
|
||||
|
||||
const franchiseSelect = document.createElement("select");
|
||||
franchiseSelect.className = "if-picker-facet";
|
||||
franchiseSelect.setAttribute("aria-label", "Filter by franchise");
|
||||
franchiseSelect.addEventListener("change", () => {
|
||||
this.franchise = franchiseSelect.value;
|
||||
this.focusIndex = 0;
|
||||
this.renderGrid();
|
||||
});
|
||||
this.franchiseSelect = franchiseSelect;
|
||||
this.fillFranchiseOptions();
|
||||
|
||||
const previewLabel = document.createElement("label");
|
||||
previewLabel.className = "if-picker-preview-toggle";
|
||||
const previewCheckbox = document.createElement("input");
|
||||
@@ -528,12 +568,40 @@ class IdentityForgePicker {
|
||||
close.setAttribute("aria-label", "Close (" + this.config.title + ")");
|
||||
close.addEventListener("click", () => this.close());
|
||||
|
||||
header.append(search, facet, genderSelect, count, previewLabel, close);
|
||||
header.append(search, facet, genderSelect, franchiseSelect, count, previewLabel, close);
|
||||
|
||||
const notice = document.createElement("div");
|
||||
notice.className = "if-picker-notice";
|
||||
notice.textContent =
|
||||
"Enabling previews fetches images from this project's GitHub Pages site (enragedantelope.github.io) — nothing else phones home.";
|
||||
"Enabling previews has the ComfyUI server fetch images from this project's GitHub Pages site " +
|
||||
"(enragedantelope.github.io) and keep them on disk, so they still show offline. Nothing else phones home. ";
|
||||
const clearCache = document.createElement("button");
|
||||
clearCache.type = "button";
|
||||
clearCache.className = "if-picker-btn if-picker-clear-cache";
|
||||
clearCache.textContent = "Clear cached previews";
|
||||
clearCache.addEventListener("click", async () => {
|
||||
try {
|
||||
const resp = await api.fetchApi("/identity_forge/gallery/cache/clear", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: "{}",
|
||||
});
|
||||
clearCache.textContent = resp.ok ? "Cached previews cleared" : "Could not clear the cache";
|
||||
} catch (_) {
|
||||
clearCache.textContent = "Could not clear the cache";
|
||||
}
|
||||
});
|
||||
// Best-effort size readout; the button works without it.
|
||||
api
|
||||
.fetchApi("/identity_forge/gallery/cache")
|
||||
.then((resp) => (resp.ok ? resp.json() : null))
|
||||
.then((data) => {
|
||||
if (data && typeof data.bytes === "number" && data.bytes > 0) {
|
||||
clearCache.textContent = "Clear cached previews (" + formatMegabytes(data.bytes) + ")";
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
notice.append(clearCache);
|
||||
|
||||
const links = document.createElement("div");
|
||||
links.className = "if-picker-links";
|
||||
@@ -728,9 +796,32 @@ class IdentityForgePicker {
|
||||
if (this.gender !== GENDER_ANY) {
|
||||
list = list.filter((entry) => matchesGender(entry, this.gender));
|
||||
}
|
||||
if (this.franchise !== FRANCHISE_ALL) {
|
||||
list = list.filter((entry) => entry.franchise === this.franchise);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/** (Re)build the franchise dropdown; a no-op until the roster has loaded. */
|
||||
fillFranchiseOptions() {
|
||||
const select = this.franchiseSelect;
|
||||
if (!select || (roster && select.options.length > 1)) return;
|
||||
const all = document.createElement("option");
|
||||
all.value = all.textContent = FRANCHISE_ALL;
|
||||
select.replaceChildren(all);
|
||||
for (const [category, names] of franchiseGroups(roster || [])) {
|
||||
const group = document.createElement("optgroup");
|
||||
group.label = category;
|
||||
for (const name of names) {
|
||||
const option = document.createElement("option");
|
||||
option.value = option.textContent = name;
|
||||
group.appendChild(option);
|
||||
}
|
||||
select.appendChild(group);
|
||||
}
|
||||
select.value = this.franchise;
|
||||
}
|
||||
|
||||
/** The grid's contents: the query/facet matches, narrowed to the active tab. */
|
||||
visibleEntries(matching) {
|
||||
const list = matching || this.matchingEntries();
|
||||
@@ -750,12 +841,13 @@ class IdentityForgePicker {
|
||||
/** True while anything is narrowing the roster -- when the counts are worth showing. */
|
||||
isFiltering() {
|
||||
return Boolean(tokenize(this.query).length) || this.facet !== FACET_ALL
|
||||
|| this.gender !== GENDER_ANY;
|
||||
|| this.gender !== GENDER_ANY || this.franchise !== FRANCHISE_ALL;
|
||||
}
|
||||
|
||||
renderGrid() {
|
||||
if (!this.grid) return;
|
||||
if (!roster) return; // ensureData() is showing the placeholder
|
||||
this.fillFranchiseOptions();
|
||||
this.grid.replaceChildren();
|
||||
this._focused = null;
|
||||
|
||||
@@ -857,7 +949,10 @@ class IdentityForgePicker {
|
||||
if (!relative || el.querySelector("img")) continue;
|
||||
const img = document.createElement("img");
|
||||
img.alt = "";
|
||||
img.setAttribute("data-src", galleryFolderURL(kind) + relative);
|
||||
img.setAttribute(
|
||||
"data-src",
|
||||
galleryCacheURL(kind) + relative.split("/").map(encodeURIComponent).join("/"),
|
||||
);
|
||||
img.loading = "lazy";
|
||||
el.replaceChildren(img);
|
||||
if (this.imageObserver) this.imageObserver.observe(img);
|
||||
@@ -1168,6 +1263,7 @@ export const __testing = {
|
||||
matchesQuery,
|
||||
FACET_PREDICATES,
|
||||
FACETS,
|
||||
FRANCHISE_ALL,
|
||||
traitChips,
|
||||
loadRoster,
|
||||
loadManifest,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,171 @@
|
||||
"""Server-side cache of the gh-pages gallery, for the roster picker's preview images (2.3.0).
|
||||
|
||||
The picker used to fetch the manifest and every thumbnail straight from GitHub Pages in
|
||||
the browser. ComfyUI's ``--offline`` flag sends a Content-Security-Policy of
|
||||
``img-src 'self'; connect-src 'self'``, which blocks exactly that, so previews never
|
||||
loaded there. Routing them through the pack's own routes puts them on ComfyUI's origin,
|
||||
and the server keeps what it fetched:
|
||||
|
||||
* **Lazy.** An image is downloaded the first time a card scrolls into view, never in
|
||||
bulk; the cache holds what this install has looked at (about 100 KiB an image).
|
||||
* **Revalidated, not trusted forever.** Re-renders keep their filename, so a cached
|
||||
file is checked again with its ETag after :data:`MANIFEST_MAX_AGE` (manifest) or
|
||||
:data:`IMAGE_MAX_AGE` (image); an unchanged file costs one 304.
|
||||
* **Offline-tolerant.** Any network failure serves the cached copy if there is one.
|
||||
|
||||
Only one host is ever contacted, and an image path is served only if the current
|
||||
manifest lists it, so a request cannot name an arbitrary URL or escape the cache
|
||||
directory. Nothing here runs until the user enables previews in the picker.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
from typing import Callable
|
||||
|
||||
GALLERY_ROOT = "https://enragedantelope.github.io/comfyui-identity-forge/gallery/"
|
||||
#: Gallery folders on gh-pages (js KIND_GALLERY_FOLDER's values).
|
||||
KINDS: "frozenset[str]" = frozenset({"cosplay", "archetypes", "creatures"})
|
||||
|
||||
#: GitHub Pages serves both with ``max-age=600``; an image is re-checked weekly.
|
||||
MANIFEST_MAX_AGE = 600
|
||||
IMAGE_MAX_AGE = 7 * 24 * 3600
|
||||
#: Gallery images are optimized JPEGs of ~100 KiB; refuse anything absurd.
|
||||
MAX_IMAGE_BYTES = 5 * 1024 * 1024
|
||||
MAX_MANIFEST_BYTES = 8 * 1024 * 1024
|
||||
TIMEOUT = 15
|
||||
|
||||
_ETAG = ".etag"
|
||||
|
||||
|
||||
class GalleryError(Exception):
|
||||
"""A request that cannot be served: unknown kind/path, or nothing cached offline."""
|
||||
|
||||
|
||||
def default_root() -> Path:
|
||||
import folder_paths # type: ignore[import-not-found]
|
||||
|
||||
return Path(folder_paths.get_user_directory()) / "identity_forge" / "gallery_cache"
|
||||
|
||||
|
||||
def _urlopen(request: urllib.request.Request): # pragma: no cover - patched in tests
|
||||
return urllib.request.urlopen(request, timeout=TIMEOUT)
|
||||
|
||||
|
||||
def _write_atomic(path: Path, data: bytes) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
fd, tmp = tempfile.mkstemp(dir=path.parent, prefix=".tmp-")
|
||||
try:
|
||||
with os.fdopen(fd, "wb") as handle:
|
||||
handle.write(data)
|
||||
os.replace(tmp, path)
|
||||
except BaseException:
|
||||
Path(tmp).unlink(missing_ok=True)
|
||||
raise
|
||||
|
||||
|
||||
def _fetch(url: str, path: Path, max_age: float, limit: int,
|
||||
check: "Callable[[bytes, str], bool]", opener=None) -> Path:
|
||||
"""``path``, refreshed from ``url`` when older than ``max_age`` seconds.
|
||||
|
||||
A failed or rejected download keeps the cached copy; with none, GalleryError.
|
||||
"""
|
||||
opener = opener or _urlopen
|
||||
etag_path = path.with_name(path.name + _ETAG)
|
||||
if path.is_file() and time.time() - path.stat().st_mtime < max_age:
|
||||
return path
|
||||
request = urllib.request.Request(url, headers={"User-Agent": "comfyui-identity-forge"})
|
||||
if path.is_file() and etag_path.is_file():
|
||||
request.add_header("If-None-Match", etag_path.read_text(encoding="utf-8").strip())
|
||||
try:
|
||||
with opener(request) as response:
|
||||
data = response.read(limit + 1)
|
||||
content_type = response.headers.get("Content-Type", "")
|
||||
etag = response.headers.get("ETag", "")
|
||||
if len(data) > limit or not check(data, content_type):
|
||||
raise GalleryError(f"rejected response from {url}")
|
||||
_write_atomic(path, data)
|
||||
if etag:
|
||||
_write_atomic(etag_path, etag.encode("utf-8"))
|
||||
return path
|
||||
except urllib.error.HTTPError as exc:
|
||||
if exc.code == 304 and path.is_file():
|
||||
os.utime(path) # validated: fresh for another max_age
|
||||
return path
|
||||
failure: Exception = exc
|
||||
except (OSError, GalleryError, ValueError) as exc: # URLError is an OSError
|
||||
failure = exc
|
||||
if path.is_file():
|
||||
return path # offline or failing: what we had before
|
||||
raise GalleryError(f"{url} unavailable and not cached: {failure}")
|
||||
|
||||
|
||||
def _is_manifest(data: bytes, _content_type: str) -> bool:
|
||||
try:
|
||||
return isinstance(json.loads(data.decode("utf-8")).get("entries"), list)
|
||||
except (ValueError, AttributeError, UnicodeDecodeError):
|
||||
return False
|
||||
|
||||
|
||||
def _is_image(data: bytes, content_type: str) -> bool:
|
||||
return content_type.startswith("image/") and bool(data)
|
||||
|
||||
|
||||
def _check_kind(kind: str) -> None:
|
||||
if kind not in KINDS:
|
||||
raise GalleryError(f"unknown gallery {kind!r}")
|
||||
|
||||
|
||||
def manifest_path(kind: str, root: Path, opener=None) -> Path:
|
||||
_check_kind(kind)
|
||||
return _fetch(GALLERY_ROOT + kind + "/manifest.json", root / kind / "manifest.json",
|
||||
MANIFEST_MAX_AGE, MAX_MANIFEST_BYTES, _is_manifest, opener)
|
||||
|
||||
|
||||
#: kind -> (manifest mtime, image paths it lists); the manifest is ~400 KiB of JSON,
|
||||
#: too much to re-parse for every thumbnail request.
|
||||
_LISTED: "dict[tuple[Path, str], tuple[float, frozenset[str]]]" = {}
|
||||
|
||||
|
||||
def _listed_images(kind: str, root: Path, opener=None) -> "frozenset[str]":
|
||||
path = manifest_path(kind, root, opener)
|
||||
mtime = path.stat().st_mtime
|
||||
cached = _LISTED.get((root, kind))
|
||||
if cached and cached[0] == mtime:
|
||||
return cached[1]
|
||||
entries = json.loads(path.read_text(encoding="utf-8")).get("entries") or []
|
||||
images = frozenset(e["image"] for e in entries
|
||||
if isinstance(e, dict) and isinstance(e.get("image"), str))
|
||||
_LISTED[(root, kind)] = (mtime, images)
|
||||
return images
|
||||
|
||||
|
||||
def image_path(kind: str, relative: str, root: Path, opener=None) -> Path:
|
||||
"""The cached file for one manifest-listed image, downloading it if needed."""
|
||||
_check_kind(kind)
|
||||
if relative not in _listed_images(kind, root, opener):
|
||||
raise GalleryError(f"{relative!r} is not in the {kind} manifest")
|
||||
target = (root / kind / relative).resolve()
|
||||
if not target.is_relative_to((root / kind).resolve()): # defence in depth
|
||||
raise GalleryError(f"{relative!r} escapes the cache")
|
||||
url = GALLERY_ROOT + kind + "/" + urllib.parse.quote(relative)
|
||||
return _fetch(url, target, IMAGE_MAX_AGE, MAX_IMAGE_BYTES, _is_image, opener)
|
||||
|
||||
|
||||
def cache_bytes(root: Path) -> int:
|
||||
if not root.is_dir():
|
||||
return 0
|
||||
return sum(p.stat().st_size for p in root.rglob("*") if p.is_file())
|
||||
|
||||
|
||||
def clear(root: Path) -> None:
|
||||
_LISTED.clear()
|
||||
if root.is_dir():
|
||||
shutil.rmtree(root)
|
||||
@@ -0,0 +1,225 @@
|
||||
"""IdentityForgeAgeProgression node - one resolved character at several ages.
|
||||
|
||||
A sibling of :mod:`nodes.identity_forge_turnaround` (read its docstring first): it
|
||||
takes a **resolved** character (Identity Forge's ``prompt_json``), re-runs the engine
|
||||
over it once per life stage and emits the prompts as a **list**.
|
||||
|
||||
**Ownership line.** This node owns ``age``, and only what age forces:
|
||||
|
||||
* **Fields a live rule refuses at that age** are released and redrawn by the engine
|
||||
(``lock_clash``): laugh lines at 20, "porcelain smooth" skin at 70, pigtails from
|
||||
45, an undercut from 55. When the refused field is ``outfit_style`` the whole
|
||||
outfit goes with it, because the outfit text was written for that style.
|
||||
* **Hair greys forward, never back.** Under "Natural only" hair, a stage at 55 or
|
||||
older than the character turns natural colour grey (salt and pepper for dark hair,
|
||||
silver otherwise, silver for everyone from 70); a stage younger than a grey-haired
|
||||
character, and under 55, gets one natural colour drawn once for the whole sheet, so
|
||||
the person does not change hair colour between their twenties and forties. Dye
|
||||
(Full spectrum), a cosplayer's canon hair and covered hair are left alone.
|
||||
|
||||
Everything else (face, build, outfit, scene) is the document's, unchanged.
|
||||
Every stage is an exact ``age`` pool value, so the youngest is 18 by construction.
|
||||
A face-covering character, or a form with no age, emits one view.
|
||||
|
||||
Text-only, zero new dependencies, no RNG of its own.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
try:
|
||||
from comfy_api.latest import io # type: ignore[import-not-found]
|
||||
_COMFY_AVAILABLE: bool = True
|
||||
except ImportError: # pragma: no cover - exercised only outside ComfyUI
|
||||
_COMFY_AVAILABLE = False
|
||||
|
||||
try:
|
||||
from ..data.constraints import FIELD_FAMILIES, lock_clash
|
||||
from .identity_forge import FIELD_DEFINITIONS
|
||||
from .identity_forge_turnaround import (
|
||||
_FRAMINGS, _forge_class, _unwrap, document_fields, document_meta,
|
||||
character_seed, parse_document, release_fields, replay_base,
|
||||
)
|
||||
except ImportError: # pragma: no cover - standalone/test context
|
||||
from data.constraints import FIELD_FAMILIES, lock_clash
|
||||
from nodes.identity_forge import FIELD_DEFINITIONS
|
||||
from nodes.identity_forge_turnaround import (
|
||||
_FRAMINGS, _forge_class, _unwrap, document_fields, document_meta,
|
||||
character_seed, parse_document, release_fields, replay_base,
|
||||
)
|
||||
|
||||
_LOG = logging.getLogger(__name__)
|
||||
|
||||
#: The selectable progressions, in display order. Exact ``age`` pool values.
|
||||
_STAGES: "dict[str, tuple[str, ...]]" = {
|
||||
"Life stages (4)": ("20", "35", "50", "70"),
|
||||
"Decades (6)": ("20", "30", "40", "50", "60", "70"),
|
||||
"Young and old (2)": ("25", "70"),
|
||||
}
|
||||
|
||||
_CLOTHING: "frozenset[str]" = frozenset(
|
||||
name for name, field in FIELD_DEFINITIONS.items() if field.get("group") == "Clothing")
|
||||
|
||||
_GREY: "frozenset[str]" = frozenset(FIELD_FAMILIES["hair_color"]["gray_white"]["variants"])
|
||||
_DARK: "frozenset[str]" = frozenset(
|
||||
FIELD_FAMILIES["hair_color"]["black"]["variants"]
|
||||
+ FIELD_FAMILIES["hair_color"]["brunette"]["variants"])
|
||||
|
||||
#: From this age natural hair is grey more often than not (the engine's own
|
||||
#: ``_GREY_BY_AGE`` crosses one half at 55), so a progression shows it grey.
|
||||
_GREYS_AT = 55
|
||||
_SILVER_AT = 70
|
||||
|
||||
|
||||
def _stage_hair(original: str, character_age: int, stage: int, natural: str) -> str:
|
||||
"""The hair colour at ``stage``: greying forward from the character, never back."""
|
||||
if original in _GREY:
|
||||
return original if stage >= min(character_age, _GREYS_AT) else natural
|
||||
if stage > character_age and stage >= _GREYS_AT:
|
||||
return "salt and pepper" if original in _DARK and stage < _SILVER_AT else "silver"
|
||||
return original
|
||||
|
||||
|
||||
def _aged_view(
|
||||
document: "dict[str, Any]", base: "dict[str, Any]", pins: "dict[str, str]",
|
||||
also: "frozenset[str]" = frozenset(),
|
||||
) -> "dict[str, Any]":
|
||||
"""Replay kwargs with ``pins`` locked, and everything they refuse (laugh lines at
|
||||
20, highlights in grey hair) released, plus ``also``, for the engine to redraw."""
|
||||
fields = document_fields(document)
|
||||
refused = set(also) | {
|
||||
name for name, value in fields.items() if name not in pins
|
||||
and any(lock_clash(pin, pinned, {name: value}) for pin, pinned in pins.items())}
|
||||
if "outfit_style" in refused:
|
||||
refused |= _CLOTHING
|
||||
view_document = json.loads(json.dumps(document))
|
||||
release_fields(view_document, refused)
|
||||
return {**base, **pins, "archetype_json": json.dumps(view_document)}
|
||||
|
||||
|
||||
def _natural_colour(document: "dict[str, Any]", base: "dict[str, Any]") -> str:
|
||||
"""The colour a grey-haired character had young: one engine draw at age 20."""
|
||||
kwargs = _aged_view(document, base, {"age": "20"}, frozenset({"hair_color"}))
|
||||
resolved = parse_document(str(_unwrap(_forge_class().execute(**kwargs))[1]))
|
||||
return document_fields(resolved).get("hair_color", "")
|
||||
|
||||
|
||||
def resolve_age_progression(
|
||||
character_json: str, stages_name: str, framing_name: str,
|
||||
) -> "tuple[list[str], list[str]]":
|
||||
"""Render one resolved character once per age. Returns ``(prompts, labels)``."""
|
||||
forge = _forge_class()
|
||||
document = parse_document(character_json)
|
||||
meta = document_meta(document)
|
||||
fields = document_fields(document)
|
||||
base = replay_base(character_json)
|
||||
# Released fields (skin detail at 70, say) redraw per character, not one shared draw.
|
||||
base["seed"] = character_seed(character_json, "age")
|
||||
framing = _FRAMINGS.get(framing_name, "")
|
||||
if framing:
|
||||
base["shot_type"] = framing
|
||||
# A close-up refuses a horizon-line composition and a full-standing pose.
|
||||
release_fields(document, {name for name, value in fields.items()
|
||||
if lock_clash("shot_type", framing, {name: value})})
|
||||
|
||||
character_age = fields.get("age", "")
|
||||
if meta.get("covers_face") or not character_age.isdigit():
|
||||
_LOG.warning("This character shows no age (a covered face, or a form without "
|
||||
"one); emitting one view.")
|
||||
return [str(_unwrap(forge.execute(**base))[0])], ["1-as-resolved"]
|
||||
|
||||
hair = fields.get("hair_color", "")
|
||||
greys = bool(hair and base.get("hair_color_scope") == "Natural only"
|
||||
and not meta.get("cosplay_of") and not meta.get("covers_hair"))
|
||||
natural = ""
|
||||
if greys and hair in _GREY:
|
||||
natural = _natural_colour(document, base) or hair
|
||||
|
||||
prompts: "list[str]" = []
|
||||
labels: "list[str]" = []
|
||||
for position, stage in enumerate(_STAGES.get(stages_name, _STAGES["Life stages (4)"]),
|
||||
start=1):
|
||||
pins = {"age": stage}
|
||||
if greys:
|
||||
pins["hair_color"] = _stage_hair(hair, int(character_age), int(stage), natural)
|
||||
view = _aged_view(document, base, pins)
|
||||
prompts.append(str(_unwrap(forge.execute(**view))[0]))
|
||||
labels.append(f"{position}-age-{stage}")
|
||||
return prompts, labels
|
||||
|
||||
|
||||
if _COMFY_AVAILABLE:
|
||||
|
||||
class IdentityForgeAgeProgression(io.ComfyNode): # type: ignore[misc, valid-type]
|
||||
"""Emit one resolved character at several ages, as a list."""
|
||||
|
||||
@classmethod
|
||||
def define_schema(cls) -> "io.Schema":
|
||||
return io.Schema(
|
||||
node_id="IdentityForgeAgeProgression",
|
||||
display_name="Identity Forge Age Progression",
|
||||
category="conditioning/character",
|
||||
description=(
|
||||
"One character at several ages, from a single queue. Wire Identity "
|
||||
"Forge's 'prompt_json' in; the 'prompt' output is a LIST, so "
|
||||
"everything downstream runs once per age. The face, build, outfit "
|
||||
"and scene stay as resolved; hair greys with age, and anything "
|
||||
"that reads wrong at an age (laugh lines at 20, pigtails at 70) is "
|
||||
"redrawn."
|
||||
),
|
||||
inputs=[
|
||||
io.String.Input(
|
||||
"character_json",
|
||||
default="",
|
||||
force_input=True,
|
||||
tooltip="Connect Identity Forge's 'prompt_json' output. Every "
|
||||
"view is the same person at a different age. A "
|
||||
"face-covering character (mascot head, full helmet) "
|
||||
"emits one view.",
|
||||
),
|
||||
io.Combo.Input(
|
||||
"stages",
|
||||
options=list(_STAGES),
|
||||
default="Life stages (4)",
|
||||
tooltip="Which ages to emit, and so how many images one queue "
|
||||
"makes. Life stages (4) = 20, 35, 50, 70; Decades (6) = "
|
||||
"20 to 70 in tens; Young and old (2) = 25 and 70.",
|
||||
),
|
||||
io.Combo.Input(
|
||||
"framing",
|
||||
options=list(_FRAMINGS),
|
||||
default="Head and shoulders",
|
||||
tooltip="How much of the subject each view frames. 'Head and "
|
||||
"shoulders' keeps the face, where age shows, large. "
|
||||
"'Unspecified' keeps the character's own framing.",
|
||||
),
|
||||
],
|
||||
outputs=[
|
||||
io.String.Output(
|
||||
display_name="prompt",
|
||||
is_output_list=True,
|
||||
tooltip="One prompt per age, as a list. Wire into "
|
||||
"CLIPTextEncode.",
|
||||
),
|
||||
io.String.Output(
|
||||
display_name="view_label",
|
||||
is_output_list=True,
|
||||
tooltip="Matching list of sortable names ('1-age-20', "
|
||||
"'2-age-35', ...). Wire into Save Image's "
|
||||
"filename_prefix.",
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
# No fingerprint_inputs: no RNG and no auto-advancing widget (see Turnaround).
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
prompts, labels = resolve_age_progression(
|
||||
kwargs.get("character_json", ""),
|
||||
kwargs.get("stages", "Life stages (4)"),
|
||||
kwargs.get("framing", "Head and shoulders"),
|
||||
)
|
||||
return io.NodeOutput(prompts, labels)
|
||||
@@ -76,7 +76,9 @@ def _is_essential(field: str) -> bool:
|
||||
# 1.5.1: an `age` lock is part of the look too. Authors lock it only where the look
|
||||
# implies a life stage (K-Pop Idol young, Babushka old), and dropping it drew a
|
||||
# 70-year-old cheerleader in the gallery.
|
||||
if field in ("gender", "age"):
|
||||
# 2.2.0: so is a `tattoos` lock -- period looks lock "no tattoos" or a Heian court
|
||||
# lady drew a modern script tattoo.
|
||||
if field in ("gender", "age", "tattoos"):
|
||||
return True
|
||||
return FIELD_DEFINITIONS.get(field, {}).get("group") in _ESSENTIAL_GROUPS
|
||||
|
||||
|
||||
@@ -462,6 +462,14 @@ _MUSCLE_RE = re.compile(r"\bmuscul(?:ar|ed)\b", re.IGNORECASE)
|
||||
_CLEAN_SHAVEN_RE = re.compile(r"clean[ -]?shaven", re.IGNORECASE)
|
||||
_CLEAN_SHAVEN_SUPPRESS: dict[str, str] = {"facial_hair": "clean shaven"}
|
||||
|
||||
#: 2.2.0: a costume that names its own earrings or necklace must not also get a random
|
||||
#: one in Costume only mode (Volcana's gold hoops came back beside random silver hoops).
|
||||
_COSTUME_JEWELRY_RES: dict[str, re.Pattern] = {
|
||||
"earrings": re.compile(r"\bearrings?\b|\bhoops\b|\bear studs?\b", re.IGNORECASE),
|
||||
"necklace": re.compile(r"\bnecklaces?\b|\bchokers?\b|\bpendant\b|\blocket\b|\bdog tags\b",
|
||||
re.IGNORECASE),
|
||||
}
|
||||
|
||||
# Size-scale entries ("giant"/"tiny") pair with a hand-authored ``scale_prose``
|
||||
# phrase that REPLACES the human ``height`` value (applied in build_cosplayer_json).
|
||||
# ``height``'s gender pools are identical, so the engine's gender gate passes any
|
||||
@@ -877,6 +885,10 @@ def build_cosplayer_json(
|
||||
_apply_suppress(document, _CLEAN_SHAVEN_SUPPRESS, override=False)
|
||||
if not feral and _CLEAN_SHAVEN_RE.search(costume):
|
||||
_apply_suppress(document, _CLEAN_SHAVEN_SUPPRESS, override=False)
|
||||
if not feral:
|
||||
for field, pattern in _COSTUME_JEWELRY_RES.items():
|
||||
if pattern.search(costume):
|
||||
_apply_suppress(document, {field: "None"}, override=False)
|
||||
if not feral and _MUSCLE_RE.search(costume):
|
||||
_apply_suppress(document, {"fitness_level": "muscular"}, override=False)
|
||||
if not feral and (look_level == _FULL or (covers and not unmask)):
|
||||
|
||||
@@ -34,12 +34,10 @@ except ImportError: # pragma: no cover - exercised only outside ComfyUI
|
||||
_COMFY_AVAILABLE = False
|
||||
|
||||
try:
|
||||
from .identity_forge_turnaround import (
|
||||
_FRAMINGS, _REPLAY_SEED, _forge_class, _unwrap, replay_steering,
|
||||
)
|
||||
from .identity_forge_turnaround import _FRAMINGS, _forge_class, _unwrap, replay_base
|
||||
except ImportError: # pragma: no cover - standalone/test context
|
||||
from nodes.identity_forge_turnaround import (
|
||||
_FRAMINGS, _REPLAY_SEED, _forge_class, _unwrap, replay_steering,
|
||||
_FRAMINGS, _forge_class, _unwrap, replay_base,
|
||||
)
|
||||
|
||||
_LOG = logging.getLogger(__name__)
|
||||
@@ -90,14 +88,8 @@ def resolve_expression_sheet(
|
||||
) -> "tuple[list[str], list[str]]":
|
||||
"""Render one resolved character once per expression. Returns ``(prompts, labels)``."""
|
||||
forge = _forge_class()
|
||||
# Schema defaults for every input, then the document: the Turnaround's recipe, and
|
||||
# its long note on why defaults (not "Random" everywhere) are load-bearing.
|
||||
base: "dict[str, Any]" = {
|
||||
spec.id: getattr(spec, "default", None) for spec in forge.define_schema().inputs
|
||||
}
|
||||
base["seed"] = _REPLAY_SEED
|
||||
base["archetype_json"] = character_json or ""
|
||||
base.update(replay_steering(character_json))
|
||||
# The Turnaround's replay recipe (schema defaults, then the document).
|
||||
base = replay_base(character_json)
|
||||
framing = _FRAMINGS.get(framing_name, "")
|
||||
if framing:
|
||||
base["shot_type"] = framing
|
||||
|
||||
@@ -0,0 +1,275 @@
|
||||
"""IdentityForgeOutfitSheet node - one resolved character, a row of outfits.
|
||||
|
||||
The wardrobe-side sibling of :mod:`nodes.identity_forge_turnaround` and
|
||||
:mod:`nodes.identity_forge_expression_sheet`, built the same way (read the Turnaround's
|
||||
docstring first): it takes a **resolved** character (Identity Forge's ``prompt_json``),
|
||||
re-runs the engine over it once per view and emits the prompts as a **list**.
|
||||
|
||||
**Ownership line.** This node owns only the clothes. Each view pins one
|
||||
``outfit_style`` and *releases* every Clothing field from the document, so the engine
|
||||
dresses the same person again under its own rules (season, place, age, body). The
|
||||
other sheets pin fixed values instead; that cannot work here, because an outfit is a
|
||||
dozen fields that have to agree with each other, and only the engine can draw them.
|
||||
|
||||
Each view replays on its own seed, derived from the style (not the position), so a
|
||||
style dresses the person the same way in every sheet that contains it, and two views
|
||||
do not share one colour draw.
|
||||
|
||||
A style a live rule refuses (``lock_clash``) is handled by what refuses it. Styling
|
||||
that changes with the occasion (makeup, jewellery, hair styling, see
|
||||
:data:`_RESTYLED`) is released and redrawn for that view. Anything else (edgy
|
||||
alternative at 60+, resort wear in winter, a style the kept scene excludes) skips the
|
||||
style rather than voicing a contradiction, and logs it. A cosplayer wears their costume, so
|
||||
a cosplay or a body-covering character emits one view, as does one with no clothing.
|
||||
|
||||
Text-only, zero new dependencies.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
try:
|
||||
from comfy_api.latest import io # type: ignore[import-not-found]
|
||||
_COMFY_AVAILABLE: bool = True
|
||||
except ImportError: # pragma: no cover - exercised only outside ComfyUI
|
||||
_COMFY_AVAILABLE = False
|
||||
|
||||
try:
|
||||
from ..data.constraints import lock_clash
|
||||
from .identity_forge import FIELD_DEFINITIONS
|
||||
from .identity_forge_turnaround import (
|
||||
_FRAMINGS, _KEEP_POSE, _NEUTRAL_POSES, _forge_class, _unwrap, document_fields,
|
||||
character_seed, document_meta, parse_document, release_fields, replay_base,
|
||||
)
|
||||
except ImportError: # pragma: no cover - standalone/test context
|
||||
from data.constraints import lock_clash
|
||||
from nodes.identity_forge import FIELD_DEFINITIONS
|
||||
from nodes.identity_forge_turnaround import (
|
||||
_FRAMINGS, _KEEP_POSE, _NEUTRAL_POSES, _forge_class, _unwrap, document_fields,
|
||||
character_seed, document_meta, parse_document, release_fields, replay_base,
|
||||
)
|
||||
|
||||
_LOG = logging.getLogger(__name__)
|
||||
|
||||
#: Every Clothing field, derived so a field added later is released too.
|
||||
_CLOTHING: "frozenset[str]" = frozenset(
|
||||
name for name, field in FIELD_DEFINITIONS.items() if field.get("group") == "Clothing")
|
||||
|
||||
_STYLES: "list[str]" = list(FIELD_DEFINITIONS["outfit_style"]["female_options"])
|
||||
|
||||
#: The selectable sheets, in display order. Exact ``outfit_style`` pool values.
|
||||
_SHEETS: "dict[str, tuple[str, ...]]" = {
|
||||
"Range (6)": ("casual", "smart casual", "business formal", "evening formal",
|
||||
"athletic", "resort vacation"),
|
||||
"Everyday (4)": ("casual", "smart casual", "streetwear", "athletic"),
|
||||
"Work to evening (4)": ("business casual", "business formal", "cocktail semi-formal",
|
||||
"evening formal"),
|
||||
"Every style (15)": tuple(_STYLES),
|
||||
}
|
||||
|
||||
_KEEP_SCENE = "Keep the character's scene"
|
||||
|
||||
#: Backdrop label -> exact ``location`` pool value ("" keeps the scene). A plain
|
||||
#: backdrop is the reference-sheet default: no place for a style to clash with.
|
||||
_BACKDROPS: "dict[str, str]" = {
|
||||
"Grey studio backdrop": "seamless grey studio backdrop",
|
||||
"White studio backdrop": "solid white studio backdrop",
|
||||
"Black studio backdrop": "solid black studio backdrop",
|
||||
_KEEP_SCENE: "",
|
||||
}
|
||||
|
||||
#: Scene fields drawn against the place; released with it when a backdrop replaces it
|
||||
#: (studio light at a backdrop, not the park's afternoon sun; a backdrop has no season,
|
||||
#: by the engine's own location -> season rule).
|
||||
_SCENE: "frozenset[str]" = frozenset({"location", "lighting", "composition", "season"})
|
||||
|
||||
#: Styling a person changes with the occasion. The engine gates most of it on
|
||||
#: ``outfit_style`` (mismatched earrings with business dress, a pearl necklace with
|
||||
#: athletic wear, a scrunchie with evening dress); measured over 60 seeds, skipping
|
||||
#: on these instead left most backdrop sheets with one or two views. So a style that
|
||||
#: refuses one of them restyles it; a style refused by anything else (age, season,
|
||||
#: the kept place) is skipped.
|
||||
_RESTYLED: "frozenset[str]" = frozenset(
|
||||
name for name, field in FIELD_DEFINITIONS.items()
|
||||
if field.get("group") in ("Makeup", "Jewelry & Nails")
|
||||
) | {"hair_accessory", "hair_style"}
|
||||
|
||||
|
||||
def _single_view(meta: "dict[str, Any]") -> bool:
|
||||
"""A character whose outfit is not the engine's to redraw."""
|
||||
suppressed_groups = meta.get("suppress_groups") or ()
|
||||
suppressed_fields = meta.get("suppress_fields") or ()
|
||||
return bool(meta.get("cosplay_of") or meta.get("covers_body")
|
||||
or "Clothing" in suppressed_groups or "outfit_description" in suppressed_fields)
|
||||
|
||||
|
||||
def resolve_outfit_sheet(
|
||||
character_json: str, sheet_name: str, backdrop_name: str, framing_name: str,
|
||||
pose_name: str, outfit_seed: int = 0,
|
||||
) -> "tuple[list[str], list[str]]":
|
||||
"""Render one resolved character once per outfit style. Returns ``(prompts, labels)``."""
|
||||
forge = _forge_class()
|
||||
document = parse_document(character_json)
|
||||
meta = document_meta(document)
|
||||
base = replay_base(character_json)
|
||||
framing = _FRAMINGS.get(framing_name, "")
|
||||
if framing:
|
||||
base["shot_type"] = framing
|
||||
if pose_name != _KEEP_POSE:
|
||||
base["pose"] = pose_name
|
||||
|
||||
if not document or _single_view(meta):
|
||||
_LOG.warning("This character's outfit is a costume or a body form, not a "
|
||||
"wardrobe; emitting one view.")
|
||||
return [str(_unwrap(forge.execute(**base))[0])], ["1-as-resolved"]
|
||||
|
||||
released = set(_CLOTHING)
|
||||
backdrop = _BACKDROPS.get(backdrop_name, "")
|
||||
if backdrop:
|
||||
released |= _SCENE
|
||||
base["location"] = backdrop
|
||||
if framing:
|
||||
released |= {name for name, value in document_fields(document).items()
|
||||
if lock_clash("shot_type", framing, {name: value})}
|
||||
release_fields(document, released)
|
||||
base["archetype_json"] = json.dumps(document)
|
||||
# What the outfit must agree with: everything the replay keeps, plus the pins.
|
||||
context = document_fields(document)
|
||||
context.update({k: base[k] for k in ("location", "pose") if k in base
|
||||
and base[k] not in ("Random", None)})
|
||||
|
||||
names = _SHEETS.get(sheet_name, _SHEETS["Range (6)"])
|
||||
prompts: "list[str]" = []
|
||||
labels: "list[str]" = []
|
||||
for style in names:
|
||||
refused = {name for name, value in context.items()
|
||||
if lock_clash("outfit_style", style, {name: value})}
|
||||
if refused - _RESTYLED:
|
||||
_LOG.info("Outfit sheet: skipping '%s', which this character's %s refuses.",
|
||||
style, ", ".join(sorted(refused - _RESTYLED)))
|
||||
continue
|
||||
view = {**base, "outfit_style": style,
|
||||
"seed": character_seed(character_json, f"{outfit_seed}|{style}")}
|
||||
if refused:
|
||||
restyled = json.loads(json.dumps(document))
|
||||
release_fields(restyled, refused)
|
||||
view["archetype_json"] = json.dumps(restyled)
|
||||
prompts.append(str(_unwrap(forge.execute(**view))[0]))
|
||||
labels.append(f"{len(prompts)}-{style.replace(' ', '-')}")
|
||||
if not prompts:
|
||||
_LOG.warning("Every style in this sheet clashes with the character; "
|
||||
"emitting one view as resolved.")
|
||||
return [str(_unwrap(forge.execute(**replay_base(character_json)))[0])], \
|
||||
["1-as-resolved"]
|
||||
return prompts, labels
|
||||
|
||||
|
||||
if _COMFY_AVAILABLE:
|
||||
|
||||
class IdentityForgeOutfitSheet(io.ComfyNode): # type: ignore[misc, valid-type]
|
||||
"""Emit one resolved character in several outfits, as a list."""
|
||||
|
||||
@classmethod
|
||||
def define_schema(cls) -> "io.Schema":
|
||||
return io.Schema(
|
||||
node_id="IdentityForgeOutfitSheet",
|
||||
display_name="Identity Forge Outfit Sheet",
|
||||
category="conditioning/character",
|
||||
description=(
|
||||
"One character, several outfits, from a single queue: a wardrobe "
|
||||
"sheet. Wire Identity Forge's 'prompt_json' in; the 'prompt' "
|
||||
"output is a LIST, so everything downstream runs once per outfit. "
|
||||
"Only the clothes change - the person stays exactly as resolved."
|
||||
),
|
||||
inputs=[
|
||||
io.String.Input(
|
||||
"character_json",
|
||||
default="",
|
||||
force_input=True,
|
||||
tooltip="Connect Identity Forge's 'prompt_json' output. Every "
|
||||
"view is the same person; each one is dressed again "
|
||||
"in one outfit style. A cosplayer wears their costume, "
|
||||
"so a cosplay character emits one view.",
|
||||
),
|
||||
io.Combo.Input(
|
||||
"sheet",
|
||||
options=list(_SHEETS),
|
||||
default="Range (6)",
|
||||
tooltip="Which outfit styles to emit, and so how many images one "
|
||||
"queue makes. Range (6) = casual, smart casual, business "
|
||||
"formal, evening formal, athletic, resort vacation. A "
|
||||
"style that clashes with the character (edgy "
|
||||
"alternative at 60+, for example) is skipped.",
|
||||
),
|
||||
io.Combo.Input(
|
||||
"backdrop",
|
||||
options=list(_BACKDROPS),
|
||||
default="Grey studio backdrop",
|
||||
tooltip="Where each outfit is shown. A plain studio backdrop "
|
||||
"suits every style; 'Keep the character's scene' keeps "
|
||||
"the place, lighting and composition, and skips any "
|
||||
"style that place refuses (no evening gown on a hiking "
|
||||
"trail).",
|
||||
),
|
||||
io.Combo.Input(
|
||||
"framing",
|
||||
options=list(_FRAMINGS),
|
||||
default="Full body",
|
||||
tooltip="How much of the subject each view frames. 'Full body' "
|
||||
"shows the whole outfit, shoes included. 'Unspecified' "
|
||||
"keeps the character's own framing.",
|
||||
),
|
||||
io.Combo.Input(
|
||||
"pose",
|
||||
options=list(_NEUTRAL_POSES) + [_KEEP_POSE],
|
||||
default=_NEUTRAL_POSES[0],
|
||||
tooltip="Pins a standing stance so every outfit is shown the "
|
||||
"same way. Choose 'Keep the character's pose' to keep "
|
||||
"it (a seated pose hides much of an outfit).",
|
||||
),
|
||||
io.Int.Input(
|
||||
"outfit_seed",
|
||||
default=0,
|
||||
min=0,
|
||||
max=0xFFFFFFFFFFFFFFFF,
|
||||
control_after_generate=True,
|
||||
tooltip="Rolls a different outfit in every style for the same "
|
||||
"character. Outfits already differ from one character "
|
||||
"to the next; change this to re-dress the same person. "
|
||||
"Set the control to 'randomize' for new outfits every "
|
||||
"queue.",
|
||||
),
|
||||
],
|
||||
outputs=[
|
||||
io.String.Output(
|
||||
display_name="prompt",
|
||||
is_output_list=True,
|
||||
tooltip="One prompt per outfit, as a list. Wire into "
|
||||
"CLIPTextEncode.",
|
||||
),
|
||||
io.String.Output(
|
||||
display_name="view_label",
|
||||
is_output_list=True,
|
||||
tooltip="Matching list of sortable names ('1-casual', "
|
||||
"'2-smart-casual', ...). Wire into Save Image's "
|
||||
"filename_prefix.",
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
# No fingerprint_inputs: every seed is derived, nothing auto-advances (see
|
||||
# Turnaround), so the node is a pure function of its inputs.
|
||||
|
||||
@classmethod
|
||||
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
|
||||
prompts, labels = resolve_outfit_sheet(
|
||||
kwargs.get("character_json", ""),
|
||||
kwargs.get("sheet", "Range (6)"),
|
||||
kwargs.get("backdrop", "Grey studio backdrop"),
|
||||
kwargs.get("framing", "Full body"),
|
||||
kwargs.get("pose", _NEUTRAL_POSES[0]),
|
||||
int(kwargs.get("outfit_seed", 0) or 0),
|
||||
)
|
||||
return io.NodeOutput(prompts, labels)
|
||||
@@ -47,6 +47,7 @@ Text-only, zero new dependencies, no IMAGE anywhere.
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import zlib
|
||||
from typing import Any
|
||||
|
||||
try:
|
||||
@@ -230,6 +231,71 @@ def replay_steering(character_json: str) -> "dict[str, str]":
|
||||
}
|
||||
|
||||
|
||||
def replay_base(character_json: str) -> "dict[str, Any]":
|
||||
"""Main-node kwargs that replay ``character_json`` unchanged: every input on its
|
||||
schema default, the replay seed, the document, and its recorded steering. See
|
||||
:func:`resolve_turnaround` for why the defaults (not "Random") are load-bearing."""
|
||||
forge = _forge_class()
|
||||
base: "dict[str, Any]" = {
|
||||
spec.id: getattr(spec, "default", None) for spec in forge.define_schema().inputs
|
||||
}
|
||||
base["seed"] = _REPLAY_SEED
|
||||
base["archetype_json"] = character_json or ""
|
||||
base.update(replay_steering(character_json))
|
||||
return base
|
||||
|
||||
|
||||
def character_seed(character_json: str, salt: str = "") -> int:
|
||||
"""A replay seed for sheets that RELEASE fields (Outfit Sheet, Age Progression).
|
||||
|
||||
The fixed :data:`_REPLAY_SEED` is right for a replay that redraws nothing, but a
|
||||
released field redrawn from it lands on the same value for every character (2.3.0:
|
||||
40 characters' casual views shared four outfits). Hashing the document makes the
|
||||
redraw differ between characters and repeat for the same one.
|
||||
"""
|
||||
return zlib.crc32(f"{salt}|{character_json or ''}".encode("utf-8"))
|
||||
|
||||
|
||||
def parse_document(character_json: str) -> "dict[str, Any]":
|
||||
"""The resolved document as a dict, or ``{}`` for anything malformed."""
|
||||
try:
|
||||
document = json.loads(character_json or "{}")
|
||||
except (ValueError, TypeError):
|
||||
return {}
|
||||
return document if isinstance(document, dict) else {}
|
||||
|
||||
|
||||
def document_meta(document: "dict[str, Any]") -> "dict[str, Any]":
|
||||
meta = document.get("_meta")
|
||||
return meta if isinstance(meta, dict) else {}
|
||||
|
||||
|
||||
def document_fields(document: "dict[str, Any]") -> "dict[str, str]":
|
||||
"""Every concrete field value in the document, flattened out of its groups."""
|
||||
return {
|
||||
name: value
|
||||
for key, group in document.items() if key != "_meta" and isinstance(group, dict)
|
||||
for name, value in group.items()
|
||||
if name in FIELD_DEFINITIONS and isinstance(value, str)
|
||||
}
|
||||
|
||||
|
||||
def release_fields(document: "dict[str, Any]", names: "set[str]") -> None:
|
||||
"""Unlock ``names`` in place, so a replay draws them again under the engine's rules.
|
||||
|
||||
A field is locked twice over in a resolved document: by its value in a group, and,
|
||||
when it was deliberately absent, by ``_meta.omitted`` (re-injected as a "None"
|
||||
lock). Both have to go or the field stays pinned.
|
||||
"""
|
||||
for key, group in document.items():
|
||||
if key != "_meta" and isinstance(group, dict):
|
||||
for name in names:
|
||||
group.pop(name, None)
|
||||
meta = document_meta(document)
|
||||
if isinstance(meta.get("omitted"), list):
|
||||
meta["omitted"] = [n for n in meta["omitted"] if n not in names]
|
||||
|
||||
|
||||
#: Rotations that show the costume's back, where a roster entry's ``costume_back``
|
||||
#: replaces its front-facing costume text (2.0.0).
|
||||
_BACK_OF_COSTUME: "frozenset[str]" = frozenset({_BACK, _REAR_THREE_QUARTER})
|
||||
@@ -293,12 +359,7 @@ def resolve_turnaround(
|
||||
# engine re-rolled it, turning a woman into a man between the main node and the
|
||||
# turnaround. Defaults also mean a control added to the main node later is
|
||||
# deferred to correctly here without this node knowing it exists.
|
||||
base: "dict[str, Any]" = {
|
||||
spec.id: getattr(spec, "default", None) for spec in forge.define_schema().inputs
|
||||
}
|
||||
base["seed"] = _REPLAY_SEED
|
||||
base["archetype_json"] = character_json or ""
|
||||
base.update(replay_steering(character_json))
|
||||
base = replay_base(character_json)
|
||||
if pose_name != _KEEP_POSE:
|
||||
base["pose"] = pose_name
|
||||
# A neutral stance faces the way the camera says; a gaze ("looking over one
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-identity-forge"
|
||||
version = "2.1.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 and thumbnail previews. A Turnaround node builds a one-queue reference sheet: front, three-quarter, profile and back views of the same resolved character. 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."
|
||||
version = "2.3.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 are cached on disk so they also show offline. Sheet nodes build one-queue reference sets of the same resolved character: Turnaround (camera views), Expression Sheet, Outfit Sheet (one look per outfit style) and Age Progression (the character across ages). 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"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
@@ -47,6 +47,8 @@ from nodes.identity_forge_creature import IdentityForgeCreature # noqa: E402
|
||||
from nodes.identity_forge_modifier import IdentityForgeModifier # noqa: E402
|
||||
from nodes.identity_forge_turnaround import IdentityForgeTurnaround # noqa: E402
|
||||
from nodes.identity_forge_expression_sheet import IdentityForgeExpressionSheet # noqa: E402
|
||||
from nodes.identity_forge_outfit_sheet import IdentityForgeOutfitSheet # noqa: E402
|
||||
from nodes.identity_forge_age_progression import IdentityForgeAgeProgression # noqa: E402
|
||||
from nodes.identity_forge_vault_load import ( # noqa: E402
|
||||
IdentityForgeVaultLoad, _NO_CHARACTERS,
|
||||
)
|
||||
@@ -63,6 +65,8 @@ _NODE_CLASSES = {
|
||||
"IdentityForgeModifier": IdentityForgeModifier,
|
||||
"IdentityForgeTurnaround": IdentityForgeTurnaround,
|
||||
"IdentityForgeExpressionSheet": IdentityForgeExpressionSheet,
|
||||
"IdentityForgeOutfitSheet": IdentityForgeOutfitSheet,
|
||||
"IdentityForgeAgeProgression": IdentityForgeAgeProgression,
|
||||
"IdentityForgeVaultLoad": IdentityForgeVaultLoad,
|
||||
"IdentityForgeVaultSave": IdentityForgeVaultSave,
|
||||
}
|
||||
|
||||
@@ -165,9 +165,17 @@ def _gallery_shot(seed: int) -> str | None:
|
||||
#: not in the manifest hash.
|
||||
_GALLERY_GENDER: dict[str, dict[str, str]] = {
|
||||
"archetypes": {"Carhop": "Female", "Cheerleader": "Female",
|
||||
"Irish Step Dancer": "Female"},
|
||||
"Irish Step Dancer": "Female",
|
||||
# 2.3.0: the toga is the look people expect; the stola variant stays.
|
||||
"Ancient Roman Patrician": "Male"},
|
||||
"creatures": {"leprechaun": "Male"}, # 2.2.0: the folklore leprechaun is a bearded man
|
||||
}
|
||||
|
||||
#: Gallery-only Archetype lock level, same terms as _GALLERY_GENDER: a period look whose
|
||||
#: ethnicity is part of the look renders at "Full preset" so the sample shows it as
|
||||
#: intended (2.3.0: at "Essentials" the Aztec Noble sample drew a random ethnicity).
|
||||
_GALLERY_LOCK_LEVEL: dict[str, str] = {"Aztec Noble": "Full preset"}
|
||||
|
||||
#: Gallery-only pose pins, same terms as _GALLERY_GENDER: a sample whose defining
|
||||
#: feature only shows in one pose (Black Bolt's underarm wings spread only with the arms
|
||||
#: raised; at his sides they rendered as a cape).
|
||||
@@ -545,7 +553,8 @@ def resolve_prose(kind: str, name: str, reroll: int = 0) -> str:
|
||||
elif kind == "archetypes":
|
||||
_check_options(IdentityForgeArchetype, ARCHETYPE_WIDGETS)
|
||||
preset = IdentityForgeArchetype.execute(
|
||||
archetype=name, seed=seed, upstream="", **ARCHETYPE_WIDGETS
|
||||
archetype=name, seed=seed, upstream="",
|
||||
**{**ARCHETYPE_WIDGETS, "lock_level": _GALLERY_LOCK_LEVEL.get(name, "Essentials")},
|
||||
)
|
||||
elif kind == "creatures":
|
||||
_check_options(IdentityForgeCreature, CREATURE_WIDGETS)
|
||||
@@ -983,6 +992,10 @@ def main(argv: list[str] | None = None) -> int:
|
||||
if not pending:
|
||||
print("Nothing unpublished.")
|
||||
return 0
|
||||
if args.dry_run:
|
||||
for kind, names in sorted(pending.items()):
|
||||
print(f" {kind}: would publish {', '.join(names)}")
|
||||
return 0
|
||||
for kind, names in sorted(pending.items()):
|
||||
if not publish_kind(kind, names):
|
||||
return 1
|
||||
|
||||
+1031
-1028
File diff suppressed because it is too large
Load Diff
@@ -1502,6 +1502,7 @@
|
||||
"university chemistry laboratory",
|
||||
"veterinary clinic exam room",
|
||||
"city hall rotunda",
|
||||
"gilded palace throne room",
|
||||
"community theatre auditorium",
|
||||
"auto repair shop service bay",
|
||||
"print shop with running presses",
|
||||
@@ -2208,6 +2209,7 @@
|
||||
"Astronaut",
|
||||
"Astronomer",
|
||||
"Athlete",
|
||||
"Aztec Noble",
|
||||
"B-Boy / B-Girl",
|
||||
"Babushka",
|
||||
"Backyard Country Casual",
|
||||
@@ -2301,6 +2303,7 @@
|
||||
"Halfling Rogue",
|
||||
"Hanfu",
|
||||
"Hazmat Technician",
|
||||
"Heian Court",
|
||||
"Highland Scot",
|
||||
"Highwayman",
|
||||
"Hockey Goalie",
|
||||
@@ -2337,6 +2340,7 @@
|
||||
"Matador",
|
||||
"McBling Socialite",
|
||||
"Mechanic",
|
||||
"Medieval Monarch",
|
||||
"Medieval Peasant",
|
||||
"Metalhead",
|
||||
"Metrosexual",
|
||||
@@ -2355,6 +2359,7 @@
|
||||
"Oktoberfest",
|
||||
"Opera Singer",
|
||||
"Orchestra Conductor",
|
||||
"Ottoman Court",
|
||||
"Outback Bushman",
|
||||
"Paramedic",
|
||||
"Parisian Chic",
|
||||
@@ -2384,6 +2389,7 @@
|
||||
"Roaring Flapper",
|
||||
"Roaring Twenties Gent",
|
||||
"Rock Climber",
|
||||
"Rococo Courtier",
|
||||
"Rodeo Rider",
|
||||
"Roller Derby",
|
||||
"Roman Centurion",
|
||||
@@ -2510,6 +2516,7 @@
|
||||
"Abomination",
|
||||
"Acheron",
|
||||
"Ada Wong",
|
||||
"Adam Smasher",
|
||||
"Admiral Ackbar",
|
||||
"Aeon Flux",
|
||||
"Aerith Gainsborough",
|
||||
@@ -3485,6 +3492,7 @@
|
||||
"Kiss-Shot Acerola-Orion Heart-Under-Blade",
|
||||
"Kitana",
|
||||
"Kitty Pryde",
|
||||
"Kiwi",
|
||||
"Klingon",
|
||||
"Klytus",
|
||||
"Kokoro",
|
||||
@@ -3646,6 +3654,7 @@
|
||||
"Mai Sakurajima",
|
||||
"Mai Shiranui",
|
||||
"Maid Marian",
|
||||
"Maine",
|
||||
"Majin Buu",
|
||||
"Maka Albarn",
|
||||
"Maki Genryusai",
|
||||
@@ -4285,6 +4294,7 @@
|
||||
"Soma Yukihira",
|
||||
"Sombra",
|
||||
"Sona",
|
||||
"Song So Mi",
|
||||
"Songbird",
|
||||
"Sonic the Hedgehog",
|
||||
"Sonya Blade",
|
||||
@@ -4369,6 +4379,7 @@
|
||||
"Taki",
|
||||
"Tala",
|
||||
"Tali'Zorah",
|
||||
"Talia Yang",
|
||||
"Talia al Ghul",
|
||||
"Tamamo no Mae",
|
||||
"Tanjiro Kamado",
|
||||
@@ -4537,6 +4548,7 @@
|
||||
"Vivi Ornitier",
|
||||
"Vixen",
|
||||
"Vogue",
|
||||
"Volcana",
|
||||
"Voldo",
|
||||
"Von Lycaon",
|
||||
"Vulcan",
|
||||
@@ -7461,6 +7473,96 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"IdentityForgeOutfitSheet": [
|
||||
{
|
||||
"name": "sheet",
|
||||
"default": "Range (6)",
|
||||
"type": "combo",
|
||||
"options": [
|
||||
"Range (6)",
|
||||
"Everyday (4)",
|
||||
"Work to evening (4)",
|
||||
"Every style (15)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "backdrop",
|
||||
"default": "Grey studio backdrop",
|
||||
"type": "combo",
|
||||
"options": [
|
||||
"Grey studio backdrop",
|
||||
"White studio backdrop",
|
||||
"Black studio backdrop",
|
||||
"Keep the character's scene"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "framing",
|
||||
"default": "Full body",
|
||||
"type": "combo",
|
||||
"options": [
|
||||
"Full body",
|
||||
"Cowboy (mid-thigh up)",
|
||||
"Waist up",
|
||||
"Chest up",
|
||||
"Head and shoulders",
|
||||
"Unspecified"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "pose",
|
||||
"default": "standing with arms relaxed at the sides",
|
||||
"type": "combo",
|
||||
"options": [
|
||||
"standing with arms relaxed at the sides",
|
||||
"standing naturally",
|
||||
"standing tall with shoulders back",
|
||||
"standing with feet planted wide",
|
||||
"Keep the character's pose"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "outfit_seed",
|
||||
"default": 0,
|
||||
"type": "INT"
|
||||
},
|
||||
{
|
||||
"name": "control_after_generate",
|
||||
"type": "combo",
|
||||
"default": "randomize",
|
||||
"options": [
|
||||
"fixed",
|
||||
"increment",
|
||||
"decrement",
|
||||
"randomize"
|
||||
]
|
||||
}
|
||||
],
|
||||
"IdentityForgeAgeProgression": [
|
||||
{
|
||||
"name": "stages",
|
||||
"default": "Life stages (4)",
|
||||
"type": "combo",
|
||||
"options": [
|
||||
"Life stages (4)",
|
||||
"Decades (6)",
|
||||
"Young and old (2)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "framing",
|
||||
"default": "Head and shoulders",
|
||||
"type": "combo",
|
||||
"options": [
|
||||
"Full body",
|
||||
"Cowboy (mid-thigh up)",
|
||||
"Waist up",
|
||||
"Chest up",
|
||||
"Head and shoulders",
|
||||
"Unspecified"
|
||||
]
|
||||
}
|
||||
],
|
||||
"IdentityForgeVaultLoad": [
|
||||
{
|
||||
"name": "character",
|
||||
|
||||
@@ -48,7 +48,7 @@ function rosterOkHandler(url) {
|
||||
if (url.endsWith("identity_forge_roster.json")) {
|
||||
return { ok: true, json: async () => REAL_ROSTER };
|
||||
}
|
||||
if (url.includes("github.io")) {
|
||||
if (url.includes("/identity_forge/gallery/")) {
|
||||
return { ok: true, json: async () => ({ entries: [] }) };
|
||||
}
|
||||
return { ok: false, status: 404 };
|
||||
@@ -281,6 +281,30 @@ test("the gender filter keeps that gender plus entries that suit either", async
|
||||
}
|
||||
});
|
||||
|
||||
test("the franchise filter lists roster franchises by category and keeps only that franchise", async () => {
|
||||
resetDom();
|
||||
__testing.__resetForTests();
|
||||
const stub = installFetchStub(rosterOkHandler);
|
||||
try {
|
||||
const picker = await openPicker();
|
||||
const select = picker.franchiseSelect;
|
||||
assert.ok(select.querySelectorAll("optgroup").length > 1, "options are grouped by category");
|
||||
const franchise = REAL_ROSTER.find((e) => e.franchise).franchise;
|
||||
assert.ok([...select.options].some((o) => o.value === franchise));
|
||||
select.value = franchise;
|
||||
select.dispatchEvent(new window.Event("change"));
|
||||
assert.ok(picker.visible.length > 0);
|
||||
assert.ok(picker.visible.every((e) => e.franchise === franchise));
|
||||
picker.close();
|
||||
picker.open();
|
||||
await new Promise((r) => setTimeout(r, 0));
|
||||
assert.equal(picker.franchiseSelect.value, franchise, "the choice survives a reopen");
|
||||
picker.close();
|
||||
} finally {
|
||||
stub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test("while filtering, every tab shows its own match count so other kinds stay discoverable", async () => {
|
||||
resetDom();
|
||||
__testing.__resetForTests();
|
||||
@@ -491,7 +515,7 @@ test("thumbnails stay off (no gallery fetch) until the preview toggle is enabled
|
||||
picker.open();
|
||||
await flush();
|
||||
assert.ok(
|
||||
!stub.calls.some((u) => u.includes("github.io")),
|
||||
!stub.calls.some((u) => u.includes("/identity_forge/gallery/") || u.includes("github.io")),
|
||||
"no gallery manifest request must happen before the toggle is enabled",
|
||||
);
|
||||
|
||||
@@ -499,8 +523,42 @@ test("thumbnails stay off (no gallery fetch) until the preview toggle is enabled
|
||||
picker.previewCheckbox.dispatchEvent(new window.Event("change"));
|
||||
await flush();
|
||||
assert.ok(
|
||||
stub.calls.some((u) => u.includes("github.io") && u.includes("manifest.json")),
|
||||
"enabling the toggle must fetch the live gh-pages manifest for the visible kind(s)",
|
||||
stub.calls.some((u) => u.startsWith("/identity_forge/gallery/") && u.includes("manifest.json")),
|
||||
"enabling the toggle must fetch the manifest for the visible kind(s) through the server's cache",
|
||||
);
|
||||
// 2.3.0: --offline's CSP allows only ComfyUI's own origin, so nothing may go to GitHub.
|
||||
assert.ok(
|
||||
!stub.calls.some((u) => u.includes("github.io")),
|
||||
"the browser must never fetch the gallery from GitHub directly",
|
||||
);
|
||||
picker.close();
|
||||
} finally {
|
||||
stub.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test("preview images load from the server's cache route, path segments encoded", async () => {
|
||||
resetDom();
|
||||
__testing.__resetForTests();
|
||||
const stub = installFetchStub(rosterOkHandler);
|
||||
try {
|
||||
const node = makeFakeNode("IdentityForgeCosplayer");
|
||||
const picker = new __testing.IdentityForgePicker({
|
||||
kind: "cosplayer",
|
||||
targetWidgetName: "character",
|
||||
title: "test",
|
||||
node,
|
||||
});
|
||||
picker.open();
|
||||
await flush();
|
||||
const art = picker.grid.querySelector('[data-if-kind="cosplayer"] .if-picker-art');
|
||||
assert.ok(art, "a cosplayer card must be on screen");
|
||||
const name = art.getAttribute("data-if-name");
|
||||
picker.applyManifest("cosplayer", new Map([[name, "images/" + name + " #1.jpeg"]]));
|
||||
const src = art.querySelector("img").getAttribute("data-src");
|
||||
assert.equal(
|
||||
src,
|
||||
"/identity_forge/gallery/cosplay/images/" + encodeURIComponent(name + " #1.jpeg"),
|
||||
);
|
||||
picker.close();
|
||||
} finally {
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
"""Tests for the IdentityForgeAgeProgression node (2.3.0).
|
||||
|
||||
Contract: one resolved character at several adult ages; hair greys forward, never back;
|
||||
nothing an age refuses is voiced.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
from data.fields import FIELD_DEFINITIONS
|
||||
from nodes.identity_forge_age_progression import (
|
||||
_STAGES, IdentityForgeAgeProgression, _stage_hair, resolve_age_progression,
|
||||
)
|
||||
from nodes.identity_forge_cosplayer import IdentityForgeCosplayer
|
||||
from tests.test_outfit_sheet import _Conflicts, _forge
|
||||
|
||||
|
||||
class VocabularyTests(unittest.TestCase):
|
||||
def test_every_stage_is_an_adult_pool_age(self):
|
||||
for name, stages in _STAGES.items():
|
||||
self.assertEqual(list(stages), sorted(stages, key=int), name)
|
||||
for stage in stages:
|
||||
self.assertIn(stage, FIELD_DEFINITIONS["age"]["female_options"])
|
||||
self.assertIn(stage, FIELD_DEFINITIONS["age"]["male_options"])
|
||||
self.assertGreaterEqual(int(stage), 18)
|
||||
|
||||
|
||||
class HairTests(unittest.TestCase):
|
||||
def test_greys_forward(self):
|
||||
self.assertEqual(_stage_hair("jet black", 30, 50, ""), "jet black")
|
||||
self.assertEqual(_stage_hair("jet black", 30, 60, ""), "salt and pepper")
|
||||
self.assertEqual(_stage_hair("jet black", 30, 70, ""), "silver")
|
||||
self.assertEqual(_stage_hair("golden blonde", 30, 60, ""), "silver")
|
||||
# Younger than the character: the colour they have now.
|
||||
self.assertEqual(_stage_hair("jet black", 50, 20, ""), "jet black")
|
||||
|
||||
def test_never_back(self):
|
||||
# Grey at 45 stays grey at 50 even though most 50-year-olds are not.
|
||||
self.assertEqual(_stage_hair("silver", 45, 50, "dark brown"), "silver")
|
||||
self.assertEqual(_stage_hair("silver", 45, 40, "dark brown"), "dark brown")
|
||||
self.assertEqual(_stage_hair("salt and pepper", 70, 60, "dark brown"),
|
||||
"salt and pepper")
|
||||
self.assertEqual(_stage_hair("salt and pepper", 70, 20, "dark brown"), "dark brown")
|
||||
|
||||
def test_stage_colours_are_live_options(self):
|
||||
for colour in ("salt and pepper", "silver"):
|
||||
self.assertIn(colour, FIELD_DEFINITIONS["hair_color"]["female_options"])
|
||||
self.assertIn(colour, FIELD_DEFINITIONS["hair_color"]["male_options"])
|
||||
|
||||
|
||||
class ProgressionTests(unittest.TestCase):
|
||||
def test_same_person_at_each_age(self):
|
||||
document = _forge(23)
|
||||
prompts, labels = resolve_age_progression(document, "Decades (6)", "Unspecified")
|
||||
self.assertEqual(labels, [f"{i}-age-{a}" for i, a in
|
||||
enumerate(_STAGES["Decades (6)"], start=1)])
|
||||
for prompt, stage in zip(prompts, _STAGES["Decades (6)"]):
|
||||
self.assertIn(f"{stage}-year-old", prompt)
|
||||
# Only the age moves in the identity sentence.
|
||||
heads = {p.split(". ")[0].replace(f"{a}-year-old", "AGE")
|
||||
for p, a in zip(prompts, _STAGES["Decades (6)"])}
|
||||
self.assertEqual(len(heads), 1, heads)
|
||||
|
||||
def test_no_stage_voices_a_contradiction(self):
|
||||
handler = _Conflicts()
|
||||
root = logging.getLogger()
|
||||
old_level = root.level
|
||||
root.addHandler(handler)
|
||||
root.setLevel(logging.INFO)
|
||||
try:
|
||||
for seed in range(30):
|
||||
document = _forge(seed)
|
||||
handler.messages.clear()
|
||||
resolve_age_progression(document, "Decades (6)", "Head and shoulders")
|
||||
self.assertEqual(handler.messages, [], f"seed {seed}")
|
||||
finally:
|
||||
root.removeHandler(handler)
|
||||
root.setLevel(old_level)
|
||||
|
||||
def test_a_masked_character_emits_one_view(self):
|
||||
kwargs = {spec.id: getattr(spec, "default", None)
|
||||
for spec in IdentityForgeCosplayer.define_schema().inputs}
|
||||
kwargs.update(character="Grimace", seed=7, upstream="")
|
||||
document = _forge(7, IdentityForgeCosplayer.execute(**kwargs).args[0])
|
||||
self.assertTrue(json.loads(document)["_meta"].get("covers_face"))
|
||||
prompts, labels = resolve_age_progression(document, "Decades (6)", "Unspecified")
|
||||
self.assertEqual((len(prompts), labels), (1, ["1-as-resolved"]))
|
||||
|
||||
|
||||
class SchemaTests(unittest.TestCase):
|
||||
def test_outputs_are_lists(self):
|
||||
schema = IdentityForgeAgeProgression.define_schema()
|
||||
self.assertEqual(schema.node_id, "IdentityForgeAgeProgression")
|
||||
self.assertEqual(schema.category, "conditioning/character")
|
||||
self.assertTrue(all(output.is_output_list for output in schema.outputs))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -3,7 +3,7 @@
|
||||
Scans README.md and docs/*.md (excluding docs/worklog/, which is gitignored
|
||||
and so would make this test behave differently locally than on a fresh
|
||||
clone) for `[text](path)` links, and checks that every relative path
|
||||
resolves to a real file. External links (http(s)://, mailto:) and same-file
|
||||
resolves to a real file or folder. External links (http(s)://, mailto:) and same-file
|
||||
anchor links (`#section`) are skipped; an anchor fragment on a cross-file
|
||||
link (`architecture.md#some-heading`) is stripped before checking, since
|
||||
verifying the fragment itself actually exists in the target file is not
|
||||
@@ -39,7 +39,7 @@ class RelativeDocLinksTests(unittest.TestCase):
|
||||
broken = []
|
||||
for doc_path, path_part in _iter_relative_links():
|
||||
resolved = (doc_path.parent / path_part).resolve()
|
||||
if not resolved.is_file():
|
||||
if not resolved.exists(): # a folder link (example_workflows/) is valid too
|
||||
broken.append(f"{doc_path.relative_to(ROOT)} -> {path_part}")
|
||||
self.assertFalse(
|
||||
broken,
|
||||
|
||||
+15
-15
@@ -6067,24 +6067,24 @@ class RandomPoolTests(unittest.TestCase):
|
||||
# at 1.1.0 (Task 5 roster pass, 1977 -> 1994 cosplayers) and again at
|
||||
# 1.2.0 (1994 -> 1999), again at 1.3.0 (1999 -> 2023) and again at
|
||||
# 1.4.0 (2023 -> 2052), at 1.5.0 (2052 -> 2057) and at 1.5.1 (2057 -> 2073) and at 1.8.0 (new
|
||||
# cosplayers, one folded duplicate), at 1.9.0, at 1.11.0 and at 2.1.0 to the new
|
||||
# ground truth. It is expected to need refreshing every time the roster grows.
|
||||
# cosplayers, one folded duplicate), at 1.9.0, at 1.11.0, at 2.1.0 and at 2.2.0 to
|
||||
# the new ground truth. It is expected to need refreshing every time the roster grows.
|
||||
expected = {
|
||||
(_RANDOM_ANY, 0): 'Rick Flag',
|
||||
(_RANDOM_ANY, 1): 'Eowyn',
|
||||
(_RANDOM_ANY, 2): 'Borg Drone',
|
||||
(_RANDOM_ANY, 3): 'King',
|
||||
(_RANDOM_ANY, 4): 'Kilik',
|
||||
(_RANDOM_FEMALE, 0): 'Rin Tohsaka',
|
||||
(_RANDOM_ANY, 0): 'Rhino',
|
||||
(_RANDOM_ANY, 1): 'Enid Sinclair',
|
||||
(_RANDOM_ANY, 2): 'Booster Gold',
|
||||
(_RANDOM_ANY, 3): 'Kimberly Jackson',
|
||||
(_RANDOM_ANY, 4): 'Kikyo',
|
||||
(_RANDOM_FEMALE, 0): 'Rikku',
|
||||
(_RANDOM_FEMALE, 1): 'Fire',
|
||||
(_RANDOM_FEMALE, 2): 'Bloody Mary',
|
||||
(_RANDOM_FEMALE, 3): 'Lexa',
|
||||
(_RANDOM_FEMALE, 4): 'Lei Fang',
|
||||
(_RANDOM_MALE, 0): 'Rhino',
|
||||
(_RANDOM_MALE, 1): 'Duke',
|
||||
(_RANDOM_MALE, 2): 'Brainiac',
|
||||
(_RANDOM_MALE, 3): 'Joel Miller',
|
||||
(_RANDOM_MALE, 4): 'Jin Kazama',
|
||||
(_RANDOM_FEMALE, 3): 'Leone',
|
||||
(_RANDOM_FEMALE, 4): 'Leeloo',
|
||||
(_RANDOM_MALE, 0): 'Reverse-Flash',
|
||||
(_RANDOM_MALE, 1): 'Duff Killigan',
|
||||
(_RANDOM_MALE, 2): 'Bowser',
|
||||
(_RANDOM_MALE, 3): 'Jiraiya',
|
||||
(_RANDOM_MALE, 4): 'Jiminy Cricket',
|
||||
}
|
||||
for (character, seed), name in expected.items():
|
||||
doc = json.loads(build_cosplayer_json(character, seed))
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
"""Tests for the server-side gallery cache behind the picker's previews (2.3.0)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
import urllib.error
|
||||
from email.message import Message
|
||||
from pathlib import Path
|
||||
|
||||
from nodes import gallery_cache as gc
|
||||
|
||||
_MANIFEST = json.dumps({"entries": [
|
||||
{"name": "AKI", "image": "images/AKI.jpeg"},
|
||||
{"name": "2-1B Droid", "image": "images/2-1B Droid.jpeg"},
|
||||
{"name": "No image", "has_image": False},
|
||||
]}).encode("utf-8")
|
||||
|
||||
|
||||
class _Response:
|
||||
def __init__(self, body: bytes, content_type: str, etag: str = '"v1"') -> None:
|
||||
self._body = body
|
||||
self.headers = Message()
|
||||
self.headers["Content-Type"] = content_type
|
||||
self.headers["ETag"] = etag
|
||||
|
||||
def read(self, limit: int = -1) -> bytes:
|
||||
return self._body if limit < 0 else self._body[:limit]
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *_):
|
||||
return False
|
||||
|
||||
|
||||
class _Opener:
|
||||
"""Answers like GitHub Pages; ``offline`` makes every call fail."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.calls: "list[tuple[str, str | None]]" = []
|
||||
self.offline = False
|
||||
self.not_modified = False
|
||||
self.image_type = "image/jpeg"
|
||||
self.image_body = b"\xff\xd8jpeg"
|
||||
|
||||
def __call__(self, request):
|
||||
url = request.full_url
|
||||
self.calls.append((url, request.get_header("If-none-match")))
|
||||
if self.offline:
|
||||
raise urllib.error.URLError("no network")
|
||||
if self.not_modified and request.get_header("If-none-match"):
|
||||
raise urllib.error.HTTPError(url, 304, "Not Modified", Message(), None)
|
||||
if url.endswith("manifest.json"):
|
||||
return _Response(_MANIFEST, "application/json")
|
||||
return _Response(self.image_body, self.image_type)
|
||||
|
||||
|
||||
class GalleryCacheTests(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
self._dir = tempfile.TemporaryDirectory()
|
||||
self.root = Path(self._dir.name) / "cache"
|
||||
self.opener = _Opener()
|
||||
gc._LISTED.clear()
|
||||
|
||||
def tearDown(self) -> None:
|
||||
gc._LISTED.clear()
|
||||
self._dir.cleanup()
|
||||
|
||||
def _age(self, path: Path, seconds: float) -> None:
|
||||
then = time.time() - seconds
|
||||
os.utime(path, (then, then))
|
||||
|
||||
def test_fetches_once_then_serves_from_disk(self):
|
||||
path = gc.manifest_path("cosplay", self.root, self.opener)
|
||||
self.assertEqual(path.read_bytes(), _MANIFEST)
|
||||
self.assertEqual(self.opener.calls[0][0], gc.GALLERY_ROOT + "cosplay/manifest.json")
|
||||
gc.manifest_path("cosplay", self.root, self.opener)
|
||||
self.assertEqual(len(self.opener.calls), 1, "a fresh copy must not refetch")
|
||||
|
||||
def test_stale_copy_revalidates_with_its_etag(self):
|
||||
path = gc.manifest_path("cosplay", self.root, self.opener)
|
||||
self._age(path, gc.MANIFEST_MAX_AGE + 5)
|
||||
self.opener.not_modified = True
|
||||
gc.manifest_path("cosplay", self.root, self.opener)
|
||||
self.assertEqual(self.opener.calls[-1][1], '"v1"')
|
||||
self.assertLess(time.time() - path.stat().st_mtime, 60, "a 304 renews freshness")
|
||||
|
||||
def test_offline_serves_what_was_cached(self):
|
||||
image = gc.image_path("cosplay", "images/AKI.jpeg", self.root, self.opener)
|
||||
self._age(image, gc.IMAGE_MAX_AGE + 5)
|
||||
self._age(self.root / "cosplay" / "manifest.json", gc.MANIFEST_MAX_AGE + 5)
|
||||
self.opener.offline = True
|
||||
self.assertEqual(
|
||||
gc.image_path("cosplay", "images/AKI.jpeg", self.root, self.opener), image)
|
||||
|
||||
def test_offline_with_nothing_cached_is_an_error(self):
|
||||
self.opener.offline = True
|
||||
with self.assertRaises(gc.GalleryError):
|
||||
gc.manifest_path("cosplay", self.root, self.opener)
|
||||
|
||||
def test_only_listed_images_on_the_one_host(self):
|
||||
path = gc.image_path("cosplay", "images/2-1B Droid.jpeg", self.root, self.opener)
|
||||
self.assertEqual(path.name, "2-1B Droid.jpeg")
|
||||
self.assertEqual(self.opener.calls[-1][0],
|
||||
gc.GALLERY_ROOT + "cosplay/images/2-1B%20Droid.jpeg")
|
||||
for bad in ("images/Unknown.jpeg", "images/../../../secret.txt", "manifest.json"):
|
||||
with self.subTest(bad=bad), self.assertRaises(gc.GalleryError):
|
||||
gc.image_path("cosplay", bad, self.root, self.opener)
|
||||
with self.assertRaises(gc.GalleryError):
|
||||
gc.manifest_path("../etc", self.root, self.opener)
|
||||
|
||||
def test_rejected_responses_are_not_cached(self):
|
||||
self.opener.image_type = "text/html"
|
||||
with self.assertRaises(gc.GalleryError):
|
||||
gc.image_path("cosplay", "images/AKI.jpeg", self.root, self.opener)
|
||||
self.assertFalse((self.root / "cosplay" / "images" / "AKI.jpeg").exists())
|
||||
self.opener.image_type = "image/jpeg"
|
||||
self.opener.image_body = b"x" * (gc.MAX_IMAGE_BYTES + 1)
|
||||
with self.assertRaises(gc.GalleryError):
|
||||
gc.image_path("cosplay", "images/AKI.jpeg", self.root, self.opener)
|
||||
|
||||
def test_size_and_clear(self):
|
||||
self.assertEqual(gc.cache_bytes(self.root), 0)
|
||||
gc.image_path("cosplay", "images/AKI.jpeg", self.root, self.opener)
|
||||
self.assertGreater(gc.cache_bytes(self.root), len(_MANIFEST))
|
||||
gc.clear(self.root)
|
||||
self.assertEqual(gc.cache_bytes(self.root), 0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,156 @@
|
||||
"""Tests for the IdentityForgeOutfitSheet node (2.3.0).
|
||||
|
||||
Contract: one resolved character, several outfits, and nothing but the clothes (and the
|
||||
styling that goes with them) moving between them.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
from data.fields import FIELD_DEFINITIONS
|
||||
from nodes.identity_forge import IdentityForge
|
||||
from nodes.identity_forge_cosplayer import IdentityForgeCosplayer
|
||||
from nodes.identity_forge_outfit_sheet import (
|
||||
_BACKDROPS, _CLOTHING, _RESTYLED, _SHEETS, IdentityForgeOutfitSheet,
|
||||
resolve_outfit_sheet,
|
||||
)
|
||||
|
||||
_POSE = "standing naturally"
|
||||
|
||||
|
||||
def _forge(seed: int, archetype_json: str = "") -> str:
|
||||
kwargs: dict = {spec.id: "Random" for spec in IdentityForge.define_schema().inputs}
|
||||
kwargs.update(
|
||||
seed=seed, archetype_json=archetype_json, set_all_fields="Off", gender="Any",
|
||||
wardrobe="Match gender", size_scale="Auto", hair_color_scope="Natural only",
|
||||
accessory_density="Balanced", location_setting="Any indoor/outdoor",
|
||||
)
|
||||
return IdentityForge.execute(**kwargs).args[1]
|
||||
|
||||
|
||||
class _Conflicts(logging.Handler):
|
||||
"""Collects the engine's lock-vs-lock reports: a lock it had to keep against a rule."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__(logging.INFO)
|
||||
self.messages: "list[str]" = []
|
||||
|
||||
def emit(self, record: logging.LogRecord) -> None:
|
||||
if "keeping lock" in record.getMessage():
|
||||
self.messages.append(record.getMessage())
|
||||
|
||||
|
||||
class VocabularyTests(unittest.TestCase):
|
||||
def test_every_sheet_style_is_a_live_option(self):
|
||||
for sheet, styles in _SHEETS.items():
|
||||
self.assertEqual(len(styles), len(set(styles)), sheet)
|
||||
for style in styles:
|
||||
self.assertIn(style, FIELD_DEFINITIONS["outfit_style"]["female_options"])
|
||||
self.assertIn(style, FIELD_DEFINITIONS["outfit_style"]["male_options"])
|
||||
|
||||
def test_every_backdrop_is_a_live_location(self):
|
||||
for label, location in _BACKDROPS.items():
|
||||
if location:
|
||||
self.assertIn(location, FIELD_DEFINITIONS["location"]["female_options"], label)
|
||||
self.assertIn(location, FIELD_DEFINITIONS["location"]["male_options"], label)
|
||||
|
||||
def test_restyling_never_touches_the_person(self):
|
||||
groups = {FIELD_DEFINITIONS[name]["group"] for name in _RESTYLED}
|
||||
self.assertNotIn("Face", groups)
|
||||
self.assertNotIn("Body", groups)
|
||||
self.assertNotIn("Demographics", groups)
|
||||
self.assertFalse({"hair_color", "hair_length", "hair_texture"} & _RESTYLED)
|
||||
self.assertIn("outfit_description", _CLOTHING)
|
||||
|
||||
|
||||
class SheetTests(unittest.TestCase):
|
||||
def test_same_person_each_view_in_its_style(self):
|
||||
document = _forge(11)
|
||||
prompts, labels = resolve_outfit_sheet(
|
||||
document, "Range (6)", "Grey studio backdrop", "Full body", _POSE)
|
||||
self.assertEqual(len(prompts), 6)
|
||||
self.assertEqual(labels[2], "3-business-formal")
|
||||
self.assertEqual(len(set(prompts)), 6, "every view must differ")
|
||||
heads = {prompt.split(". ")[0] for prompt in prompts}
|
||||
self.assertEqual(len(heads), 1, heads)
|
||||
for prompt in prompts:
|
||||
self.assertIn("seamless grey studio backdrop", prompt)
|
||||
|
||||
def test_deterministic_and_stable_across_sheets(self):
|
||||
document = _forge(4)
|
||||
first = resolve_outfit_sheet(document, "Range (6)", "Grey studio backdrop",
|
||||
"Full body", _POSE)
|
||||
again = resolve_outfit_sheet(document, "Range (6)", "Grey studio backdrop",
|
||||
"Full body", _POSE)
|
||||
self.assertEqual(first, again)
|
||||
everyday, _ = resolve_outfit_sheet(document, "Everyday (4)", "Grey studio backdrop",
|
||||
"Full body", _POSE)
|
||||
# The seed follows the style, not the position: casual dresses the same way.
|
||||
self.assertEqual(first[0][0], everyday[0])
|
||||
|
||||
def test_outfits_differ_between_characters_and_by_outfit_seed(self):
|
||||
# 2.3.0: a fixed per-style seed gave 40 characters four casual outfits.
|
||||
def outfit(prompt: str) -> str:
|
||||
return prompt.split(" wears ", 2)[-1].split(". ")[0]
|
||||
|
||||
casual = {outfit(resolve_outfit_sheet(_forge(seed), "Everyday (4)",
|
||||
"Grey studio backdrop", "Full body",
|
||||
_POSE)[0][0])
|
||||
for seed in range(12)}
|
||||
self.assertGreaterEqual(len(casual), 10, casual)
|
||||
document = _forge(4)
|
||||
rolls = {tuple(outfit(p) for p in resolve_outfit_sheet(
|
||||
document, "Everyday (4)", "Grey studio backdrop", "Full body", _POSE,
|
||||
outfit_seed=n)[0])
|
||||
for n in range(4)}
|
||||
self.assertEqual(len(rolls), 4, "each outfit_seed must re-dress the person")
|
||||
|
||||
def test_no_view_voices_a_contradiction(self):
|
||||
# Every lock this node adds must agree with what it keeps: the engine reports
|
||||
# a lock it had to keep against a rule, and no view may produce one.
|
||||
handler = _Conflicts()
|
||||
root = logging.getLogger()
|
||||
old_level = root.level
|
||||
root.addHandler(handler)
|
||||
root.setLevel(logging.INFO)
|
||||
try:
|
||||
for seed in range(25):
|
||||
document = _forge(seed)
|
||||
handler.messages.clear()
|
||||
for backdrop in ("Grey studio backdrop", "Keep the character's scene"):
|
||||
resolve_outfit_sheet(document, "Every style (15)", backdrop,
|
||||
"Full body", _POSE)
|
||||
self.assertEqual(handler.messages, [], f"seed {seed}")
|
||||
finally:
|
||||
root.removeHandler(handler)
|
||||
root.setLevel(old_level)
|
||||
|
||||
def test_a_cosplayer_wears_their_costume(self):
|
||||
kwargs = {spec.id: getattr(spec, "default", None)
|
||||
for spec in IdentityForgeCosplayer.define_schema().inputs}
|
||||
kwargs.update(character="Grimace", seed=7, upstream="")
|
||||
document = _forge(7, IdentityForgeCosplayer.execute(**kwargs).args[0])
|
||||
prompts, labels = resolve_outfit_sheet(
|
||||
document, "Range (6)", "Grey studio backdrop", "Full body", _POSE)
|
||||
self.assertEqual(labels, ["1-as-resolved"])
|
||||
self.assertEqual(len(prompts), 1)
|
||||
|
||||
def test_malformed_input_degrades_to_one_view(self):
|
||||
prompts, labels = resolve_outfit_sheet(
|
||||
"not json", "Range (6)", "Grey studio backdrop", "Full body", _POSE)
|
||||
self.assertEqual((len(prompts), labels), (1, ["1-as-resolved"]))
|
||||
self.assertTrue(json.dumps(prompts))
|
||||
|
||||
|
||||
class SchemaTests(unittest.TestCase):
|
||||
def test_outputs_are_lists(self):
|
||||
schema = IdentityForgeOutfitSheet.define_schema()
|
||||
self.assertEqual(schema.node_id, "IdentityForgeOutfitSheet")
|
||||
self.assertEqual(schema.category, "conditioning/character")
|
||||
self.assertTrue(all(output.is_output_list for output in schema.outputs))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -112,6 +112,22 @@ class RehashTests(unittest.TestCase):
|
||||
render_gallery.save_manifest = original_save
|
||||
|
||||
|
||||
class PublishPendingDryRunTests(unittest.TestCase):
|
||||
def test_dry_run_publishes_nothing(self) -> None:
|
||||
# 2.3.0: --publish-pending ignored --dry-run and pushed to gh-pages.
|
||||
original_survey, original_publish = render_gallery.survey, render_gallery.publish_kind
|
||||
render_gallery.survey = lambda kinds: {k: {"unpublished": ["X"]} for k in kinds}
|
||||
render_gallery.publish_kind = lambda *a: self.fail("dry run must not publish")
|
||||
try:
|
||||
buffer = io.StringIO()
|
||||
with redirect_stdout(buffer):
|
||||
code = render_gallery.main(["--publish-pending", "--dry-run"])
|
||||
self.assertEqual(code, 0)
|
||||
self.assertIn("would publish X", buffer.getvalue())
|
||||
finally:
|
||||
render_gallery.survey, render_gallery.publish_kind = original_survey, original_publish
|
||||
|
||||
|
||||
class EntryHashTests(unittest.TestCase):
|
||||
def test_hash_is_stable_across_calls(self) -> None:
|
||||
first = render_gallery.entry_hash("cosplay", "2B")
|
||||
@@ -204,6 +220,14 @@ class GalleryShotPoolTests(unittest.TestCase):
|
||||
self.assertIn(name, COSPLAYERS)
|
||||
self.assertIn(pose, poses, name)
|
||||
|
||||
def test_lock_level_pins_name_real_archetypes_and_levels(self) -> None:
|
||||
from data.templates import ARCHETYPES
|
||||
from nodes.identity_forge_archetype import IdentityForgeArchetype
|
||||
spec = {i.id: i for i in IdentityForgeArchetype.define_schema().inputs}
|
||||
for name, level in render_gallery._GALLERY_LOCK_LEVEL.items():
|
||||
self.assertIn(name, ARCHETYPES)
|
||||
self.assertIn(level, spec["lock_level"].options, name)
|
||||
|
||||
def test_shot_pins_name_real_entries_and_gallery_shots(self) -> None:
|
||||
from data.templates import ARCHETYPES
|
||||
for kind, pins in render_gallery._GALLERY_SHOT.items():
|
||||
|
||||
Reference in New Issue
Block a user