3 Commits
Author SHA1 Message Date
EnragedAntelope 4f4dcc5245 SceneWeaver 0.8.2
- nodes: drop the NaN fingerprint_inputs from both node classes so ComfyUI's input cache stops re-running every downstream node
- tests: registration test pins no fingerprint_inputs override; new test that a cached SCENE_ENTITY payload is reused unchanged
- engine: _rescope_slot revive is a required mutable set; generate_scene docstring matches _occupied_slots
- data/scifi.py: "spine-ringed shell" -> "spine-fringed shell", "concentric-ring rosettes" -> "concentric-banded rosettes", "coiling itself into a defensive ring" -> "looping itself into a defensive circle" (ring motif under its ceiling at 1000 seeds)
- ci.yml: sample_distribution runs 1000 seeds per pack
- pyproject: 0.8.2; ruff lint rules pinned to the set CI's ruff applies
- docs: architecture.md 0.8.2 section, AGENTS.md current state, registry release checks doc
2026-11-24 20:47:53 -05:00
EnragedAntelope f2ebabf6d1 SceneWeaver 0.8.1
- A locked value a drawn field contradicts re-draws that field instead of only warning (engine/scene.py _redraw_triggers)
- Fantasy: dormant undead on the seabed and dead flying ships in the sky, a courtyard or a quay get an act
- Fantasy: a wrecked airship in the sky plunges with a torn gasbag; torn gasbag form gains the falls stance
- Fantasy: rigging, not a gasbag, on wrecked sky galleons and cloud skiffs; no huge subjects in the forge; merfolk no longer brace against a gust underwater
- Thrown objects say their direction; renamed acts: "snapping at a spear hurled straight at it", "snatching a dagger thrown at them out of the air", "lying wrecked in a tangle of torn rigging", horror "lurching away from a torch thrust toward them"
- coherence_audit.py and coherence_sweep.py take --pack; CI sweeps fantasy and horror on both paths
- Version 0.8.1; AGENTS.md state
2026-10-17 12:12:05 -04:00
EnragedAntelope b63937b429 Round XXXI: audits take --pack; locks re-draw what contradicts them
- coherence_audit.py and coherence_sweep.py take --pack; the sweep runs pack classes and shape_classes for fantasy and horror
- Fantasy and horror fixes the sweeps found: dormant undead and dead flying ships with no act, gasbag act on gasbag-less ships, forge trait overwrite, merfolk gust act
- Thrown-object acts state their direction; TRAP_PHRASES rejects the undirected form; four acts renamed
- engine/scene.py: _redraw_triggers re-draws an unlocked field that makes a rule forbid a locked value
- Torn gasbag form gains the falls stance; the plunge act needs it
- CI: fantasy and horror coherence sweeps on both paths
- Regression rows for each fix; README, AGENTS.md, docs/architecture.md updated
2026-10-17 09:47:38 -04:00
18 changed files with 483 additions and 79 deletions
+13 -3
View File
@@ -55,15 +55,25 @@ jobs:
# Bias is measured, not assumed: a distribution defect has no
# single-scene symptom. Fails if one kind or the scale extremes break
# their documented ceiling; the baseline is in docs/architecture.md.
run: python scripts/sample_distribution.py --seeds 500
run: python scripts/sample_distribution.py --seeds 1000
- name: Measure the fantasy distribution
run: python scripts/sample_distribution.py --pack fantasy --seeds 500
run: python scripts/sample_distribution.py --pack fantasy --seeds 1000
- name: Measure the horror distribution
run: python scripts/sample_distribution.py --pack horror --seeds 500
run: python scripts/sample_distribution.py --pack horror --seeds 1000
- name: Audit the reported concern classes
# The user's own graph: a Scene Entity wired into the Scene Weaver. Every class a
# reported image fell into must stay absent; the flags are frozen in scripts/concern_flags.py.
run: python scripts/concern_audit.py --seeds 600 --gate
- name: Sweep the fantasy pack for coherence
# The pack tests sweep 400-500 seeds; these sweep thousands, which is what
# finds a rare draw. Ceilings live in scripts/coherence_sweep.py.
run: |
python scripts/coherence_sweep.py --pack fantasy --gate
python scripts/coherence_sweep.py --pack fantasy --gate --path unwired
- name: Sweep the horror pack for coherence
run: |
python scripts/coherence_sweep.py --pack horror --gate
python scripts/coherence_sweep.py --pack horror --gate --path unwired
frontend:
name: Frontend tests
+37 -11
View File
@@ -8,9 +8,9 @@ genre is a data module and two registration lines.
## Current state
_Last verified: 2026-10-13_
_Last verified: 2026-11-24_
- **Status:** v0.8.0 on `main`, released on GitHub and published to the ComfyUI
- **Status:** `main` is v0.8.2, released on GitHub and published to the ComfyUI
Registry by `publish.yml`; all three genres on one coherence engine. 0.6.0
added user_options keys that follow the scope chain, a working recreate, the
speedup and gates, a content round in all three packs, and two render-test
@@ -18,7 +18,15 @@ _Last verified: 2026-10-13_
content (post-collapse horror places, grown sci-fi places and void-order rites,
fantasy brass beasts and weather). 0.8.0 is the variety release (Round XXX):
a hidden variant draw per type, owned-act weighting, the Placement and Place
state widgets, foreground context framings and the variety floors. The repo is public at `EnragedAntelope/comfyui-sceneweaver`;
state widgets, foreground context framings and the variety floors. 0.8.1 is
Round XXXI: the audits take `--pack`, the fixes they found in fantasy and
horror, and a locked value re-drawing the field that contradicts it. 0.8.2
drops the nodes' `NaN` cache fingerprint, which re-ran every downstream node
on each queue ("0.8.2: the input cache is ComfyUI's" in
`docs/architecture.md`), and rewords three sci-fi values that pushed the
`ring` motif over its ceiling. Registry: 0.8.1 was still Flagged on 2026-11-24 on
the recreate code's known false positive, review request open (see
`docs/registry-release-checks.md`). The repo is public at `EnragedAntelope/comfyui-sceneweaver`;
the full pre-release history stays local (a git bundle outside the repo, and
the `coherence-round-*` branches).
- **Works:** both node classes per genre register through the V3
@@ -30,8 +38,12 @@ _Last verified: 2026-10-13_
order and validates both example workflows. Every gate under "Build and test"
is green. The mechanisms and every round's decisions and measurements are in
`docs/architecture.md` ("Round XV" to "Round XXVIII" are the render-test rounds;
"Round XXIX" is the subgenre content round; "Round XXX" is the variety round).
- **In progress:** nothing is open. 0.8.0 went through three render batches
"Round XXIX" is the subgenre content round; "Round XXX" is the variety round;
"Round XXXI" gives the audits `--pack` and fixes what they found). Scene
output is a pure function of the inputs, so ComfyUI's input cache is correct
for both nodes; no `fingerprint_inputs` override.
- **In progress:** nothing unmerged. Every merge to `main` beyond docs carries a
version bump, which publishes. 0.8.0 went through three render batches
(Round XXX), two of them reviewed by the maintainer, who keeps
render-testing;
each reported image becomes a fix plus a regression row. Head cropping on tall
@@ -40,19 +52,24 @@ _Last verified: 2026-10-13_
exorcist and a mortician (the last two would only reskin the village priest).
- **Known gaps:**
- A situation can disagree with the pose a model draws (a fire drake breathing
fire instead of "snapping at a spear") with no text contradiction behind it.
It is a model-fidelity limit; there is no wording fix.
fire instead of snapping at a spear) with no text contradiction behind it.
It is a model-fidelity limit. The one wording fix is direction: an object
thrown by someone off-frame says it comes "at it" (`TRAP_PHRASES`).
- Small alien creatures still name limbs, a natural weapon, senses and a mouth
by design, so a render can show odd protrusions. Watch small creatures.
- `scripts/reach_audit.py --gate` samples, so a low seed count lists rare
place-and-kind combinations as never drawn; use 30000 seeds. CI does not run it.
- Only `scripts/reach_audit.py` and `scripts/sample_distribution.py` take
`--pack`. `concern_audit.py`, `coherence_sweep.py` and `coherence_audit.py`
measure sci-fi only, and the frozen `concern_flags*` are sci-fi's.
- `concern_audit.py` is sci-fi only, by design: it replays the frozen
`concern_flags*` of reported sci-fi batches, and fantasy and horror have
none. Every other script takes `--pack`. CI runs `coherence_sweep.py`
for fantasy and horror on both paths, and the sci-fi classes run as
unit tests; it does not run `reach_audit.py`.
- Renaming or removing a dropdown value makes a saved workflow that locked it
report "value not in list" (0.7.0 renamed the sci-fi situation "writhing in a
tight coil" to "thrashing violently in place"; 0.8.0 rewrote the acts aimed
at "the viewer" and renamed many acts for verb spread). Seeds do not
at "the viewer" and renamed many acts for verb spread; Round XXXI renames
four acts, listed there; 0.8.2 rewords three sci-fi values, listed in
its section). Seeds do not
reproduce 0.7.0 prompts: the variant and the new scene fields are drawn. Release notes live in commit messages, never in
the README (maintainer's rule).
- Cross-genre trait conflicts fail open: a wired foreign entity carries no
@@ -88,6 +105,11 @@ _Last verified: 2026-10-13_
all three packs, and one section per render-test round. `docs/genre-roadmap.md`
- the genre content brainstorm and the decisions behind it.
## Registry releases
Before publishing or investigating Manager visibility, read
[Registry release checks](docs/registry-release-checks.md).
## Layout
| Path | What lives there |
@@ -125,6 +147,10 @@ python scripts/coherence_audit.py --seeds 2000
python scripts/concern_audit.py --seeds 600 --gate
python scripts/coherence_sweep.py --gate
python scripts/coherence_sweep.py --gate --path unwired
python scripts/coherence_sweep.py --pack fantasy --gate
python scripts/coherence_sweep.py --pack fantasy --gate --path unwired
python scripts/coherence_sweep.py --pack horror --gate
python scripts/coherence_sweep.py --pack horror --gate --path unwired
npm ci && npm run test:frontend
python -m ruff check .
```
+2 -1
View File
@@ -125,7 +125,8 @@ Every dropdown offers `Random`, then its values, then `None`:
* **a value** - **lock it.** Set `Creature type: cephalopod` and every scene is a
cephalopod, with everything else still rolling around it. Lock the creature
type and the hull colour and the environment; leave the rest wild. A locked
field is never cut and never overruled.
field is never cut and never overruled: a rolled field that contradicts it is
rolled again.
* **`None`** - omit it. Switch a slot's `kind` to `None` and that entity leaves
the scene entirely, which is how you get a pure-landscape shot.
+38 -12
View File
@@ -2307,7 +2307,7 @@ POOL_GROUPS: dict[str, dict[str, tuple[str, ...]]] = {
# --- dragon ---
_S_DRAGON_EV_WAR = (
"rearing up to strike", "lashing out with a snapping bite", "coiling to strike",
"lashing its tail in fury", "raking the air with a clawed swipe", "snapping at a hurled spear",
"lashing its tail in fury", "raking the air with a clawed swipe", "snapping at a spear hurled straight at it",
)
_S_DRAGON_EV_BREATH = (
"spewing a torrent of flame", "unleashing a gout of roaring fire",
@@ -2483,8 +2483,9 @@ _S_FEY_CALM = ("sprinkling a trail of sparkling dust",)
# --- hybrid folk ---
_S_HYBRID_EV_WAR = (
"brandishing their weapon high", "charging with their weapon lowered", "lunging forward with a battle cry",
"raising an arm against a gust of grit",
)
#: A gust needs air: merfolk raised an arm against one on the seabed.
_S_HYBRID_EV_WAR_AIR = ("raising an arm against a gust of grit",)
_S_HYBRID_EV = ("recoiling in alarm", "ducking back into cover", "spinning to face a sudden threat")
_S_HYBRID_ACT = (
"turning sharply at a sudden sound", "standing guard with folded arms", "calling out a warning",
@@ -2497,7 +2498,7 @@ _S_HYBRID_CALM = (
)
_S_FAUN_CALM = ("playing a haunting tune on a set of panpipes",)
_S_HYBRID_IDLE = ("resting with their eyes closed", "sitting on a mossy stone lost in thought")
_S_HYBRID_EV2 = ("vaulting over a fallen log", "snatching a thrown dagger from the air")
_S_HYBRID_EV2 = ("vaulting over a fallen log", "snatching a dagger thrown at them out of the air")
_S_HYBRID_EV2_WAR = ("springing from a crouch to strike", "shouting a war cry")
_S_HYBRID_ACT2 = ("braiding flowers into their hair", "carving a small wooden totem",
"tracing the stars with an outstretched finger")
@@ -2623,6 +2624,8 @@ _S_RESTLESS_ACT_WALLS = ("drifting through a stone wall",)
_S_UNDEAD_DORMANT = ("resting beneath a layer of dust",)
_S_BONES_DORMANT = ("lying in a heap of bones",)
_S_UNDEAD_DORMANT_WALLS = ("lying still in an open sarcophagus", "standing motionless in an alcove")
#: A dormant undead on an open seabed had no act: dust needs air and the other two a wall.
_S_UNDEAD_DORMANT_DEEP = ("half-buried in drifting silt", "draped in swaying strands of weed")
# --- construct ---
_S_CONSTRUCT_EV_WAR = (
@@ -2786,7 +2789,13 @@ _S_AIRSHIP_EV_WAR = (
"bristling with crossbowmen along its rails", "burning as it drifts across the sky",
"breaking apart high in the air under a heavy blow",
)
_S_AIRSHIP_DORMANT = ("lying wrecked across the ground with its gasbag torn",)
#: Rigging, not a gasbag: a sky galleon and a cloud skiff have none. On a floor, so a
#: paved quay or courtyard holds the wreck too.
_S_AIRSHIP_DORMANT = ("lying wrecked in a tangle of torn rigging",)
#: A dead flying ship in a sky place had no act at all. An intact one drifts; a wreck falls.
_S_AIRSHIP_DORMANT_SKY = ("drifting crewless on the wind",)
#: Only a body that can fall does this, so a torn gasbag reaches the sky by it alone.
_S_AIRSHIP_FALL_SKY = ("plunging out of the sky trailing torn rigging",)
_S_CART_ACT_GROUND = ("rumbling along a rutted road behind a team of horses", "drawing up at a crossroads behind a team of horses")
_S_CART_EV_GROUND = ("bouncing over rough ground behind a straining team of horses", "stuck axle-deep in mud")
_S_CART_EV_GROUND_WAR = ("charging headlong across a battlefield behind armoured horses",)
@@ -3446,6 +3455,7 @@ _BUCKETS = (
(_S_FEY_EV_AIR, "event", "n", _AIR, _FLOAT, ""),
(_S_FEY_CALM, "activity", "p", _A, _A, ""),
(_S_HYBRID_EV_WAR, "event", "c", _A, _A, ""),
(_S_HYBRID_EV_WAR_AIR, "event", "c", _AIR, _A, ""),
(_S_HYBRID_EV, "event", "n", _A, _A, ""),
(_S_HYBRID_ACT, "activity", "n", _A, _A, ""),
(_S_HYBRID_CALM, "activity", "p", _A, _A, ""),
@@ -3518,6 +3528,7 @@ _BUCKETS = (
(_S_RESTLESS_ACT_WALLS, "activity", "n", _WALLS, _FLOAT, ""),
(_S_UNDEAD_DORMANT, "idle", "n", _A, _A, "d"),
(_S_UNDEAD_DORMANT_WALLS, "idle", "n", _WALLS, _A, "d"),
(_S_UNDEAD_DORMANT_DEEP, "idle", "n", _DEEP, _A, "d"),
(_S_CONSTRUCT_EV_WAR, "event", "c", _A, _A, ""),
(_S_CONSTRUCT_EV, "event", "n", _A, _A, ""),
(_S_CONSTRUCT_ACT, "activity", "n", _A, _A, ""),
@@ -3577,7 +3588,9 @@ _BUCKETS = (
(_S_AIRSHIP_EV_ANY, "event", "n", _SKY, _FLY, ""),
(_S_AIRSHIP_ACT_ANY, "activity", "n", _SKY, _FLY, ""),
(_S_AIRSHIP_EV_WAR, "event", "c", _SKY, _FLY, ""),
(_S_AIRSHIP_DORMANT, "idle", "n", _GROUND, _A, "d"),
(_S_AIRSHIP_DORMANT, "idle", "n", frozenset({"floor"}), _A, "d"),
(_S_AIRSHIP_DORMANT_SKY, "idle", "n", _SKY, _A, "d"),
(_S_AIRSHIP_FALL_SKY, "idle", "n", _SKY, frozenset({"falls"}), "d"),
(_S_CART_ACT_GROUND, "activity", "n", _GROUND, _ROLL, ""),
(_S_CART_EV_GROUND, "event", "n", _GROUND, _ROLL, ""),
(_S_CART_EV_GROUND_WAR, "event", "c", _GROUND, _ROLL, ""),
@@ -3753,7 +3766,7 @@ _S_SMALL_CORE = (
+ _S_SMALL_ACT_WALLS + _S_SMALL_EV2 + _S_SMALL_ACT2
)
_S_HYBRID_CORE = (
_S_HYBRID_EV_WAR + _S_HYBRID_EV + _S_HYBRID_ACT + _S_HYBRID_CALM + _S_HYBRID_IDLE + _S_HYBRID_EV2
_S_HYBRID_EV_WAR + _S_HYBRID_EV_WAR_AIR + _S_HYBRID_EV + _S_HYBRID_ACT + _S_HYBRID_CALM + _S_HYBRID_IDLE + _S_HYBRID_EV2
+ _S_HYBRID_EV2_WAR + _S_HYBRID_ACT2
)
_S_FOLK_CORE = (
@@ -3763,7 +3776,8 @@ _S_FOLK_CORE = (
)
_S_UNDEAD_CORE = (
_S_UNDEAD_EV_WAR + _S_UNDEAD_EV_WAR_WALLS + _S_UNDEAD_EV + _S_UNDEAD_ACT + _S_UNDEAD_CANDLE_WALLS + _S_UNDEAD_EV_GROUND + _S_UNDEAD_EV_WALLS
+ _S_UNDEAD_ACT_WALLS + _S_UNDEAD_DORMANT + _S_UNDEAD_DORMANT_WALLS + _S_UNDEAD_ACT2
+ _S_UNDEAD_ACT_WALLS + _S_UNDEAD_DORMANT + _S_UNDEAD_DORMANT_WALLS + _S_UNDEAD_DORMANT_DEEP
+ _S_UNDEAD_ACT2
)
_S_CONSTRUCT_CORE = (
_S_CONSTRUCT_EV_WAR + _S_CONSTRUCT_EV + _S_CONSTRUCT_ACT + _S_CONSTRUCT_IDLE + _S_CONSTRUCT_EV2
@@ -3890,7 +3904,9 @@ SITUATION_POOLS: dict[str, tuple[str, ...]] = {
),
"flying ship": (
_S_AIRSHIP_EV_SKY + _S_AIRSHIP_ACT_SKY + _S_AIRSHIP_EV_ANY + _S_AIRSHIP_ACT_ANY + _S_AIRSHIP_EV_WAR
+ _S_VESSEL_IDLE + _S_AIRSHIP_DORMANT + _S_VESSEL_DORMANT_LIFE + _S_VESSEL_DORMANT_GROUND
+ _S_VESSEL_IDLE + _S_AIRSHIP_DORMANT + _S_AIRSHIP_DORMANT_SKY + _S_AIRSHIP_FALL_SKY
+ _S_VESSEL_DORMANT_LIFE
+ _S_VESSEL_DORMANT_GROUND
),
"land vehicle": (
_S_VESSEL_CORE + _S_CART_ACT_GROUND + _S_CART_EV_GROUND + _S_CART_EV_GROUND_WAR
@@ -4527,8 +4543,8 @@ _FORM_KEY_STANCES: dict[str, frozenset[str]] = {
_FORM_STANCE_OVERRIDES: dict[str, frozenset[str]] = {
"bat-winged lion body": _WALK_FLY,
"winged lion body with a human face": _WALK_FLY,
# A wreck lies where it came down (#757).
"torn gasbag sagging over a broken hull": frozenset({"rests"}),
# A wreck lies where it came down (#757), or is still coming down.
"torn gasbag sagging over a broken hull": frozenset({"rests", "falls"}),
}
@@ -4767,7 +4783,9 @@ VALUE_TRAITS: dict[str, dict[str, tuple[str, ...]]] = {
**{v: ("interior-place",) for v in _ENV_INTERIOR},
"volcanic ashlands": ("hot-place",), "magma cavern": ("hot-place",),
"blazing elemental plane": ("hot-place",),
"blacksmith's forge": ("hot-place",),
# A later key replaces an earlier one in a literal: the forge lost ``interior-place``
# here and admitted huge golems and fire elementals.
"blacksmith's forge": ("interior-place", "hot-place"),
"snowbound mountain peak": ("cold-place",), "glacier valley": ("cold-place",),
"frozen lake shore": ("cold-place",), "frozen realm of the frost giants": ("cold-place",),
"high mountain pass": ("cold-place",),
@@ -4900,6 +4918,8 @@ _NEGLECT_ACTS = (
"resting beneath a layer of dust", "streaked with lichen and weather",
"crumbling at one edge", "wreathed in creeping ivy",
"sprouting a young tree from one cracked flank",
# Not "plunging out of the sky": a fall is an event, and a newly launched ship can fall.
"lying wrecked in a tangle of torn rigging",
)
_add_traits("condition", {v: ("pristine-state",) for v in _PRISTINE_CONDITIONS})
_add_traits(SITUATION_FIELD, {v: ("neglect-act",) for v in _NEGLECT_ACTS})
@@ -5871,14 +5891,20 @@ for _field, _pools in (("surface_detail", SURFACE_DETAIL_POOLS), ("markings", MA
v: ("worn-material",) for pool in _pools.values() for v in pool if any(w in v for w in _WORN_WORDS)
})
# #757 a wreck's gasbag has come down with it.
_add_traits("form", {"torn gasbag sagging over a broken hull": ("inactive", "worn-material")})
_add_traits("form", {"torn gasbag sagging over a broken hull": ("inactive", "worn-material", "wreck-state")})
_add_traits("form", {v: ("intact-gasbag",) for v in (
"gasbag above a wooden hull", "twin gasbags above a long hull", "long gasbag above a slung gondola hull",
)})
_add_traits("condition", {"wrecked": ("wreck-state",)})
_add_traits(SITUATION_FIELD, {v: ("wreck-state",) for v in (
"lying beached on its side", "lying toppled and smashed on its side", "rotting in the shallows",
"plunging out of the sky trailing torn rigging",
)})
#: Only an intact ship drifts: a wreck or a torn gasbag falls instead. Its own trait,
#: so the wreck wins (a pair's first trait is the trigger, the second is re-drawn).
_add_traits(SITUATION_FIELD, {"drifting crewless on the wind": ("crewless-drift",)})
TRAIT_CONFLICTS = TRAIT_CONFLICTS + (("wreck-state", "crewless-drift"),)
TRAIT_REASONS["wreck-state|crewless-drift"] = "a wrecked ship cannot stay aloft"
# #746 a siege tower is pushed, and a cart pulled.
_add_traits("subkind", {"siege tower": ("pushed-vehicle",)})
_add_traits("subkind", {v: ("drawn-vehicle",) for v in (
+1 -1
View File
@@ -1629,7 +1629,7 @@ _S_SURVIVOR_SWARM = (
# --- the afflicted ---
_S_AFFLICTED_EV = (
"collapsing to their knees", "staggering toward a fleeing woman with one arm outstretched",
"lurching away from a raised torch", "flinching from a sudden light",
"lurching away from a torch thrust toward them","flinching from a sudden light",
"screaming as flies swarm around them", "tearing at their collar as if suffocating",
)
_S_AFFLICTED_EV_GORE = ("coughing up black blood", "clawing at weeping boils until they bleed")
+6 -6
View File
@@ -1163,7 +1163,7 @@ _VARIANT_MATERIAL: dict[str, tuple[str, ...]] = {
"upright hunter": ("quill-backed hide", "mottled ambush hide", "venom-slick scales"),
"stone feeder": ("ore-flecked mineral hide", "gem-studded hide", "salt-crusted mineral hide"),
"mimic body": ("petal-patterned film", "clear glassy resin", "eye-spotted scale"),
"radial form": ("spine-ringed shell", "nettle-celled lace", "glassy calcified lace"),
"radial form": ("spine-fringed shell", "nettle-celled lace", "glassy calcified lace"),
"filter swarm": ("swollen cloudy flesh", "silt-dulled membrane", "nettle-celled membrane"),
"symbiotic body": ("fungus-laced flesh", "crystal-grown resin", "parasite-veined flesh"),
"brooding colony": ("split brittle carapace", "spore-pitted silicate", "resin-glazed carapace"),
@@ -1697,7 +1697,7 @@ MARKINGS_POOLS: dict[str, tuple[str, ...]] = {
"moulted banding", "spotted dappling", "countershaded gradient",
# "eyespot" (a camouflage marking, like a moth wing's false eye) reads
# as a literal extra eye on the creature -- render-trap-word class.
"warning chevron patterning", "concentric-ring rosettes", "ripple striping",
"warning chevron patterning", "concentric-banded rosettes", "ripple striping",
"mottled camouflage blotching", "iridescent scale sheen",
"veined tracery", "brindled patterning", "rosette clustering",
"chevron-scaled flanks",
@@ -1706,7 +1706,7 @@ MARKINGS_POOLS: dict[str, tuple[str, ...]] = {
# A rooted growth has no scales or flanks to mark.
"sessile growth": (
"veined tracery", "mottled camouflage blotching", "spotted dappling",
"iridescent banding", "concentric-ring rosettes",
"iridescent banding", "concentric-banded rosettes",
),
"spacefarer": (
"colony sigil emblems", "rank chevrons", "shoulder hazard striping",
@@ -4294,7 +4294,7 @@ _OWN_SEGMENTED = (
_OWN_VERMIFORM = (
"bursting up through the ground in a spray of rock",
"coiling itself into a defensive ring",
"looping itself into a defensive circle",
"swallowing loose stones as it moves",
)
@@ -10840,7 +10840,7 @@ SITUATION_TIERS.update({
"moulting out of a split old shell": "activity",
"stringing silk lines between two rocks": "activity",
"bursting up through the ground in a spray of rock": "event",
"coiling itself into a defensive ring": "idle",
"looping itself into a defensive circle": "idle",
"swallowing loose stones as it moves": "activity",
"preening its wing membranes": "idle",
"mantling its wings over a fresh kill": "event",
@@ -11173,7 +11173,7 @@ VALUE_NEEDS["situation"].update({
"moulting out of a split old shell": frozenset(),
"stringing silk lines between two rocks": frozenset(),
"bursting up through the ground in a spray of rock": frozenset({"ground"}),
"coiling itself into a defensive ring": frozenset(),
"looping itself into a defensive circle": frozenset(),
"swallowing loose stones as it moves": frozenset(),
"preening its wing membranes": frozenset(),
"mantling its wings over a fresh kill": frozenset(),
+85
View File
@@ -2972,3 +2972,88 @@ over the treetops.
"net-tangled" draws a net, "spar" and "bow" draw a sailing ship, and "a
weapon" next to a carried spear draws two weapons. Say the damage or the
owner, not the object.
## Round XXXI: the audits take `--pack`
`coherence_audit.py` and `coherence_sweep.py` measured sci-fi only. The audit
reads pack declarations throughout, so `--pack` was enough there. The sweep's
classes are sci-fi word lists and kind names, so under `--pack fantasy|horror`
it runs two other sets: the pack's own classes from `tests/test_<pack>_pack.py`
(ceiling 0) and `shape_classes`, the sweep classes that read only a pack's
bands, affordances and traits. `concern_audit.py` stays sci-fi only: it
replays frozen flags from reported sci-fi batches, and the other packs have
none to replay.
The test files sweep 400 to 500 seeds. At 3000 to 4000 seeds the same classes
found what those runs never drew:
| Found | Cause | Fix |
| --- | --- | --- |
| A dormant revenant on the seabed with no act (`no-situation`, `dead-but-live`, 0.2%) | Undead dormant acts needed air (dust) or a wall | Two seabed dormant acts, shared with the artifacts |
| An abandoned airship, sky galleon or skiff with no act in the sky, a courtyard or a quay | Its dormant acts needed `ground` | A dead ship in the sky drifts if intact and falls if wrecked; the wreck act needs `floor` |
| "with its gasbag torn" on a sky galleon and a cloud skiff | The act was in the shared flying-ship pool | "lying wrecked in a tangle of torn rigging" |
| A huge golem in the blacksmith's forge (`huge-indoors`) | A later literal key `"blacksmith's forge": ("hot-place",)` replaced its `interior-place` | Both traits on the one key |
| Merfolk "raising an arm against a gust of grit" on the seabed (`weather-in-wrong-medium`) | The act needed nothing | It needs `air` |
The maintainer also reported a spear drawn leaving a sea serpent's mouth for
"snapping at a hurled spear". An object thrown by someone off-frame now says
its direction, and `TRAP_PHRASES` rejects the undirected form ("hurled",
"thrown", "flung", "raised" or "levelled" before a spear, dagger, torch and
the like). Renamed values, which a saved workflow that locked them will report
as "value not in list":
| Pack | Old | New |
| --- | --- | --- |
| fantasy | snapping at a hurled spear | snapping at a spear hurled straight at it |
| fantasy | snatching a thrown dagger from the air | snatching a dagger thrown at them out of the air |
| fantasy | lying wrecked across the ground with its gasbag torn | lying wrecked in a tangle of torn rigging |
| horror | lurching away from a raised torch | lurching away from a torch thrust toward them |
The shape ceilings are what 3000 seeds measured on both paths after the fixes;
`PACK_CEILINGS` in the script says what each remaining hit looked like. Each
fix has a regression row in `tests/test_concern_regressions.py`, and every row
failed on the old data first. CI now runs the fantasy and horror sweeps on both
paths (about 10 to 25 seconds each locally).
### A drawn field gives way to a lock
When a rule forbade a locked value, `_apply_constraints` kept the lock, warned,
and changed nothing else. An airship locked "wrecked" in the sea of clouds
kept its drawn intact gasbag, which forbids a wreck act, so it had no act in
150 of 150 seeds. `_redraw_triggers` now re-draws each unlocked field whose
value fired the rule, away from every value that fires it, and warns only when
no such field can move. A trigger with nothing else to draw keeps its value,
so a lock never empties another field. The torn-gasbag form also gained the
`falls` stance, and "plunging out of the sky trailing torn rigging" requires
it, as sci-fi's falling wrecks do; without that the torn form could not be in
the sky at all and there was nothing to re-draw to.
Measured against the previous engine on 400 seeds per pack: 0 of 1200 scenes
without locks changed. Of 1200 scenes with two or three fields locked from an
earlier draw, 66 changed, all of them scenes that had a conflict warning
before. Scenes with any conflict warning went from 78 to 16, and none failed
to settle.
## 0.8.2: the input cache is ComfyUI's
Both node classes used to return `NaN` from `fingerprint_inputs`, citing
ComfyUI #11905 (a randomised seed served a cached result). That could never
produce a new scene: a changed seed is a changed input and already misses the
cache, and an unchanged one re-runs to the same text, because a scene is a pure
function of its inputs (the same seed hashed identically under three
`PYTHONHASHSEED` values). What the `NaN` did do is enter the cache signature of
every node downstream. On a live ComfyUI, Scene Weaver at a fixed seed into
Concatenate Text into Preview as Text cached nothing on an identical second
queue; the same two nodes without Scene Weaver upstream were both cached. In a
real graph that re-ran the encoder and the sampler on every queue. The override
is gone and `tests/test_registration.py` pins its absence.
The same release clears the sci-fi `ring` motif, which sat at 15.90% over
1000 seeds (ceiling 15%) on 0.8.1: CI sampled 500 seeds, where it passed, while
`AGENTS.md` lists the 1000-seed run. Three values used the word for decoration
rather than for a ring subject and are reworded in place, so every other scene
is byte-identical: "spine-ringed shell" is "spine-fringed shell",
"concentric-ring rosettes" is "concentric-banded rosettes", and "coiling itself
into a defensive ring" is "looping itself into a defensive circle". The motif
measures 14.70%. CI now samples 1000 seeds per pack, as `AGENTS.md` does. A
workflow that locked one of the three old values reports "value not in list".
+47
View File
@@ -0,0 +1,47 @@
# Registry release checks
## After publishing
- Check the publish workflow, then inspect the exact published version in
`https://api.comfy.org/nodes/comfyui-sceneweaver/versions?include_status_reason=true`.
A green workflow alone does not prove Manager can offer the release.
- Confirm the version is Active. Pending is not a completed review;
`NodeVersionStatusFlagged` needs investigation. Inspect `status_reason`
rather than inferring a cause from the status alone.
- For a repeated finding, compare its file, issue type, and matched code with
previously cleared releases. When authorized, request maintainer review,
updating the existing review request when appropriate.
- Verify Manager offers the expected Registry version. A nightly Git install
uses commit-based update checks instead of a numbered Registry installation.
## Known scanner false positive
The October 22, 2026 investigation found SceneWeaver 0.8.1 flagged on
`link.origin.connect(link.originSlot, fresh, slot)` in `js/sceneweaver.js`.
This restores LiteGraph graph links during node recreation; it does not open
a network connection.
The finding was identical to one cleared on 0.8.0, whose public reason recorded
`policy-v0.6: reviewed-safe`. Do not rename legitimate APIs, remove features,
or disable scanning merely to silence this signature. Fix actual unsafe
behavior if found; otherwise seek review. Previous clearance does not
guarantee the next release avoids a flag.
Review request: https://github.com/Comfy-Org/registry-backend/issues/296
## Manager metadata is a separate path
Manager's stars and Last Update come from its GitHub statistics database, not
the Registry publish timestamp. The scanner discovers repositories through
`custom-node-list.json`; catalog-backed Registry rows retain the GitHub
reference used to look up those statistics.
Catalog registration: https://github.com/Comfy-Org/ComfyUI-Manager/pull/3403
The investigation also found Registry-only rows missing the UI's
`update-state` field. An existing fix addresses that general defect:
https://github.com/Comfy-Org/ComfyUI-Manager/pull/3261
Check those upstream records for current outcomes. Catalog merge and database
refresh do not clear Registry security flags, and missing metadata alone does
not prove a release or Git update failed.
+83 -12
View File
@@ -1162,7 +1162,7 @@ def _rescope_slot(
scene_filter: str,
slot: int,
changed: "frozenset[str] | set[str]",
revive: "set[str] | frozenset[str]" = frozenset(),
revive: "set[str]",
) -> None:
"""Re-draw the fields a changed control scopes, in declaration order.
@@ -1178,7 +1178,9 @@ def _rescope_slot(
A field that is ``None`` is also left alone, because a field with an empty
pool is legitimately silent -- except for a path in ``revive``, which a rule
nulled and which the new control value may make drawable again.
nulled and which the new control value may make drawable again. A revived
path is removed from ``revive`` in place, which is why it is a required,
mutable set: a frozenset default raised on the first re-draw.
"""
changed = set(changed)
controls = _control_fields(pack)
@@ -1274,6 +1276,65 @@ def _required_targets(
return required
def _redraw_triggers(
rng: random.Random,
pack: GenrePack,
state: dict[str, str | None],
address_of: Mapping[str, FieldDef],
locked_paths: "set[str]",
scene_filter: str,
slots: int,
target: str,
banned: "Mapping[str, set[str]]",
sticky_bans: "Mapping[str, frozenset[str]]",
nulled: "set[str]",
) -> bool:
"""Re-draw each unlocked field whose value makes a rule forbid locked ``target``.
The trigger is drawn away from every value that fires the rule. A trigger
with nothing else to draw keeps its value, so a lock never empties another
field; the caller then reports the conflict. True when anything moved.
"""
current = state.get(target)
moved = False
for rule, trigger, bound_target, triggers in _bound_rules(pack, slots):
if bound_target != target or trigger in locked_paths:
continue
if state.get(trigger) not in triggers:
continue
if rule.type == RULE_EXCLUDE:
if current not in rule.excludes_values:
continue
elif current in (set(rule.requires_values) if rule.requires_values else {rule.requires_value}):
continue
definition = address_of.get(trigger)
if definition is None:
continue
forbidden = set(triggers) | banned.get(trigger, set())
is_control = definition.base in _control_fields(pack) and definition.slot is not None
if is_control:
forbidden |= _control_values_ruled_out_by_state(
pack, definition.base, state, locked_paths, definition.slot
)
sticky = set(sticky_bans.get(trigger, ()))
if trigger == ENVIRONMENT_FIELD:
sticky |= _environments_ruled_out_by_state(pack, state, slots)
scope = _scope_for(pack, state, trigger)
replacement = _draw(rng, pack, definition, scope, scene_filter, forbidden | sticky)
if replacement is None and sticky:
replacement = _draw(rng, pack, definition, scope, scene_filter, forbidden)
if replacement is None:
continue
state[trigger] = replacement
moved = True
if is_control:
_rescope_slot(
rng, pack, state, address_of, locked_paths,
scene_filter, definition.slot, {definition.base}, nulled,
)
return moved
def _apply_constraints(
rng: random.Random,
pack: GenrePack,
@@ -1330,8 +1391,18 @@ def _apply_constraints(
elif current not in forbidden:
continue
if target in locked_paths:
# The user named this value. It wins, and the rule's reason
# is reported -- to _meta.warnings, never to prompt_text.
# The user named this value, so it wins. The unlocked field
# whose value fired the rule is re-drawn instead: a ship
# locked "wrecked" in the sky gets a torn gasbag, not an
# intact one that leaves no act it may do.
if _redraw_triggers(
rng, pack, state, address_of, locked_paths, scene_filter,
slots, target, banned, sticky_bans, nulled,
):
changed = True
continue
# Nothing else could move. The rule's reason is reported --
# to _meta.warnings, never to prompt_text.
for reason in reasons.get(target, ()):
message = f"{target}: kept the locked value {current!r} ({reason})"
if message not in warnings:
@@ -1650,14 +1721,14 @@ def generate_scene(
``wired_entities`` maps a 1-based slot to a ``SCENE_ENTITY`` payload.
``entity_count`` is how many slots the scene occupies, and it is the
**authority** on that: slots past it are left out even if their kind widget
holds a value, and slots within it are filled even if their kind widget
still says "None". Anything else makes the control a lie -- a user who sets
it to 3 and gets one entity because two hidden widgets defaulted to "None"
has been told something untrue by the node face. A wired slot is occupied
whatever the count says, because connecting a node is the more explicit
statement; the count is raised to match and reported in ``_meta``.
``entity_count`` is how many slots the scene occupies: slots past it are
emptied, and a slot within it is whatever its own kind widget says -- the
kind widgets default to "Random", so the count is what the user gets, and a
slot deliberately set to "None" stays empty. Two things outrank the count,
as ``_occupied_slots`` records: a wired slot, because connecting a node is
the more explicit statement, and a slot whose kind widget holds a literal,
because naming a subject is a lock. Either raises the count, and the widened
count is what the budget divides the scene's detail between.
It defaults to ``DEFAULT_ENTITY_COUNT`` rather than to ``None`` so that a
bare call behaves like a freshly-dropped node: one subject. Pass ``None``
+3 -8
View File
@@ -71,14 +71,9 @@ def build_entity_node(pack: GenrePack) -> type:
],
)
@classmethod
def fingerprint_inputs(cls, **kwargs: Any) -> float:
# Force a fresh roll on every queue. ComfyUI can serve a stale cached
# result when control_after_generate auto-advances the seed (ComfyUI
# #11905); a never-equal value makes this node's cache signature always
# differ, so it re-executes and reads the new seed. Pure cache control --
# no RNG here, so a fixed seed still reproduces exactly.
return float("nan")
# No fingerprint_inputs: the output is a pure function of the inputs, so
# ComfyUI's own input cache is correct. A NaN fingerprint (0.8.1 and
# earlier) re-ran every downstream node, sampler included, on each queue.
@classmethod
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
+1 -4
View File
@@ -115,10 +115,7 @@ def build_scene_node(pack: GenrePack) -> type:
],
)
@classmethod
def fingerprint_inputs(cls, **kwargs: Any) -> float:
# See the identical note on the Scene Entity node: ComfyUI #11905.
return float("nan")
# No fingerprint_inputs; see the note on the Scene Entity node.
@classmethod
def execute(cls, **kwargs: Any) -> "io.NodeOutput":
+6 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "comfyui-sceneweaver"
version = "0.8.0"
version = "0.8.2"
description = "One click, one whole coherent scene: the place, what is standing in it, and what it is doing - written as prose a text encoder can follow, where every detail agrees with every other one. A multi-genre scene engine: sci-fi (alien creatures, spacefarers, mechs, starships, stations, wrecks, worlds) fantasy (dragons, mythic beasts, giants, goblins, centaurs, elves, undead, golems, castles, airships) and horror (ghouls, vampires, banshees, cryptids, eldritch horrors, cultists, cursed objects, haunted houses, with a gore filter that starts on No gore), each drawn across a full morphology, with entities that wire across genres. Every field independently lockable."
license = { text = "MIT" }
readme = "README.md"
@@ -24,6 +24,11 @@ Icon = "https://raw.githubusercontent.com/EnragedAntelope/comfyui-sceneweaver/ma
[tool.ruff]
line-length = 100
[tool.ruff.lint]
# The rule set CI's pinned ruff applies by default, stated so a newer local ruff
# (0.17 widened its defaults to import sorting and naming) agrees with CI.
select = ["E4", "E7", "E9", "F"]
[tool.ruff.lint.per-file-ignores]
# The test modules prepend the repo root onto sys.path so they can be run
# standalone (``python tests/...``); those imports necessarily follow the shim,
+6 -4
View File
@@ -2,6 +2,7 @@
python scripts/coherence_audit.py # 1000 seeds
python scripts/coherence_audit.py --seeds 2000
python scripts/coherence_audit.py --pack fantasy # or horror
**Why this exists.** ``tests/test_coherence.py`` sweeps and asserts invariants;
this is the maintainer's instrument that *names* a defect instead of failing a
@@ -28,7 +29,7 @@ coil of gas" came from?
* buckets of the reference corpus, and it should sit near zero for the built and
* inert archetypes. A report, not a gate.
Zero dependencies and no ComfyUI; imports ``data.scifi`` directly (never the
Zero dependencies and no ComfyUI; imports ``data.<pack>`` directly (never the
entrypoint) so ``user_options.json`` can never reach a committed number.
"""
from __future__ import annotations
@@ -43,12 +44,12 @@ if str(_ROOT) not in sys.path:
sys.path.insert(0, str(_ROOT))
from data.genre import KIND_FIELD, archetype_name_for, scope_keys # noqa: E402
from data.scifi import SCIFI_PACK # noqa: E402
from engine.budget import count_tokens # noqa: E402
from engine.grammar import head_noun # noqa: E402
from engine.prose import render_entity # noqa: E402
from engine.resolution import ResolvedEntity # noqa: E402
from engine.scene import generate_scene # noqa: E402
from sample_distribution import PACK_SLUGS, load_pack # noqa: E402
def _normalized_head(value: str) -> str:
@@ -138,9 +139,10 @@ def _component_clauses(pack, record) -> int:
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument("--seeds", type=int, default=1000, help="seeds to sweep")
parser.add_argument("--pack", choices=PACK_SLUGS, default="scifi")
args = parser.parse_args(argv)
pack = SCIFI_PACK
pack = load_pack(args.pack)
by_kind_routes: dict[str, Counter] = defaultdict(Counter)
fallthrough_subkinds: dict[str, Counter] = defaultdict(Counter)
archetype_shape: dict[str, dict[str, list[int] | int]] = defaultdict(
@@ -185,7 +187,7 @@ def main(argv: list[str] | None = None) -> int:
if _component_clauses(pack, record) >= 4:
stats["heavy"] += 1
print(f"seeds {args.seeds} -- {entities} entities")
print(f"{args.pack}: seeds {args.seeds} -- {entities} entities")
print()
print("form resolution, per kind (share through a group/raw key):")
for kind in pack.kinds:
+94 -9
View File
@@ -4,6 +4,7 @@
python scripts/coherence_sweep.py --path unwired
python scripts/coherence_sweep.py --gate # exit 1 over a ceiling
python scripts/coherence_sweep.py --examples 3 # print real prompts
python scripts/coherence_sweep.py --pack fantasy # or horror
**Why this exists, and why it is not another concern_flags file.**
@@ -31,7 +32,15 @@ ceilings in ``CEILINGS`` are what the round left them at, so a change that puts
one back up is visible. Raise a ceiling only with a measured reason written next
to it.
An instrument, not a test: ``tests/`` owns the gates. Imports ``data.scifi``
**Fantasy and horror.** The sci-fi classes below are sci-fi word lists and kind
names, so ``--pack fantasy|horror`` runs two other sets instead: the pack's own
classes from ``tests/test_<pack>_pack.py`` (gated at zero there, over a few
hundred seeds; a ceiling of 0 here, over thousands), and ``shape_classes``,
which read only the pack's own declarations (bands, affordances, traits). At
4000 seeds the first set found dead subjects with no act and a forge holding a
huge golem that the 500-seed test sweep had never drawn.
An instrument, not a test: ``tests/`` owns the gates. Imports ``data.<pack>``
directly, never the entrypoint, so ``user_options.json`` can never reach a number.
"""
from __future__ import annotations
@@ -54,6 +63,7 @@ from data.genre import ( # noqa: E402
)
from data.scifi import SCIFI_PACK as PACK # noqa: E402
from engine.scene import generate_entity, generate_scene # noqa: E402
from sample_distribution import PACK_SLUGS, load_pack # noqa: E402
def _words(*terms: str) -> "re.Pattern[str]":
@@ -299,8 +309,80 @@ def classes(text: str, document: dict) -> "list[str]":
return out
def sweep(seeds: int, path: str, examples: int):
def shape_classes(pack, text: str, document: dict) -> "list[str]":
"""The classes above that need no sci-fi word: each reads ``pack``'s own bands,
affordances and traits, over every entity."""
out: set[str] = set()
place = document.get(ENVIRONMENT_FIELD) or ""
affords = affordances_of(pack, place)
context = (document.get(CONTEXT_FIELD) or "").lower()
low = text.lower()
pristine = {v for v, t in (pack.value_traits.get("condition") or {}).items() if "pristine-state" in t}
for entity in document["entities"]:
situation = (entity.get(SITUATION_FIELD) or "").lower()
substance = " ".join((entity.get(f) or "") for f in SUBSTANCE_FIELDS).lower()
if HOT.search(substance) and COLD.search(substance):
out.add("thermal-conflict")
if entity.get("condition") in pristine and BREAKING_GERUND.search(situation):
out.add("pristine-but-destroyed")
if "submerged" in affords and FIRE.search(situation):
out.add("fire-in-wrong-medium")
if "submerged" in affords and WEATHER.search(situation + " " + context):
out.add("weather-in-wrong-medium")
if place in (pack.environment_bands.get("interior") or ()) and context and DISTANCE.search(low):
out.add("interior-distance-context")
context_sentence = next((s for s in low.split(". ") if context and context in s), "")
if STANCE_VERB.search(context_sentence.replace(context, "")):
out.add("context-stance-verb")
return sorted(out)
#: Fantasy and horror. A class not listed is a test file's class, zero-gated there,
#: so any hit here is a rare draw the test sweep never reached. Shape ceilings were
#: measured at 3000 seeds on both paths when added (2026-10-17), after fixing merfolk
#: bracing against "a gust of grit" on the seabed (weather 0.13% -> 0).
PACK_CEILINGS: dict[str, dict[str, float]] = {
"fantasy": {
# 0.67 / 0.57: wide on purpose. A gleaming golem "splitting along a fresh crack",
# a pristine crown "bursting into a halo of cold blue flame", and plain misses
# ("crumbling a stone block in its grip", "breaking the surface").
"pristine-but-destroyed": 1.0,
# 0.07 / 0.17: a frost-grown crystal golem or a frost giant with a hot word.
"thermal-conflict": 0.3,
"fire-in-wrong-medium": 0.0,
"weather-in-wrong-medium": 0.0,
"interior-distance-context": 0.0,
"context-stance-verb": 0.0,
},
"horror": {
"pristine-but-destroyed": 0.0,
"thermal-conflict": 0.0,
"fire-in-wrong-medium": 0.0,
"weather-in-wrong-medium": 0.0,
# 0.90 / 0.83: the chapel and the ballroom afford ``vast``, so "In the distance"
# is the pack's own choice there.
"interior-distance-context": 1.0,
"context-stance-verb": 0.0,
},
}
def _classifier(slug: str):
"""``(pack, classify, ceilings)`` for one pack."""
if slug == "scifi":
return PACK, classes, CEILINGS
pack = load_pack(slug)
module = __import__(f"tests.test_{slug}_pack", fromlist=["_classes"])
def classify(text: str, document: dict) -> "list[str]":
return sorted(set(module._classes(text, document)) | set(shape_classes(pack, text, document)))
return pack, classify, PACK_CEILINGS[slug]
def sweep(seeds: int, path: str, examples: int, slug: str = "scifi"):
"""``(counts, scenes with any class, examples)`` over ``seeds`` scenes."""
pack, classify, _ceilings = _classifier(slug)
rng = random.Random(777)
tally: Counter = Counter()
shown: dict[str, list[str]] = defaultdict(list)
@@ -309,12 +391,12 @@ def sweep(seeds: int, path: str, examples: int):
entity_seed, scene_seed = rng.randrange(2**48), rng.randrange(2**48)
wired = {}
if path == "wired":
_text, payload = generate_entity(entity_seed, PACK)
_text, payload = generate_entity(entity_seed, pack)
wired = {1: payload}
text, document = generate_scene(
scene_seed, PACK, wired_entities=wired, entity_count=1
scene_seed, pack, wired_entities=wired, entity_count=1
)
found = classes(text, document)
found = classify(text, document)
tally.update(found)
flagged += bool(found)
for name in found:
@@ -329,18 +411,21 @@ def main(argv: "list[str] | None" = None) -> int:
parser.add_argument("--path", choices=("wired", "unwired"), default="wired")
parser.add_argument("--examples", type=int, default=0)
parser.add_argument("--gate", action="store_true")
parser.add_argument("--pack", choices=PACK_SLUGS, default="scifi")
args = parser.parse_args(argv)
logging.getLogger("sceneweaver").setLevel(logging.ERROR)
tally, flagged, shown = sweep(args.seeds, args.path, args.examples)
ceilings = _classifier(args.pack)[2]
tally, flagged, shown = sweep(args.seeds, args.path, args.examples, args.pack)
share = 100.0 * flagged / args.seeds
print(f"coherence_sweep -- {args.path} path, {args.seeds} scenes, "
print(f"coherence_sweep -- {args.pack}, {args.path} path, {args.seeds} scenes, "
f"{share:.1f}% carry at least one class")
over: list[str] = []
for name in sorted(CEILINGS):
# A class with no ceiling is a test file's zero-gated class: any hit is over.
for name in sorted(set(ceilings) | set(tally)):
count = tally.get(name, 0)
pct = 100.0 * count / args.seeds
ceiling = CEILINGS[name]
ceiling = ceilings.get(name, 0.0)
mark = ""
if pct > ceiling:
mark = f" <-- over ceiling {ceiling:.1f}%"
+35
View File
@@ -1441,6 +1441,41 @@ CONCERNS = CONCERNS + (
widgets={"entity1_subkind": "faun"}, pack=FANTASY_PACK),
Concern("a centaur turns into a horse", lambda r, d, t: bool(re.search(r"small (?:[\w-]+ )*centaur|war harness|pony|horse tail", t)),
widgets={"entity1_subkind": "centaur"}, pack=FANTASY_PACK),
# --- coherence_sweep --pack fantasy at 4000 seeds: what the 500-seed test sweep missed ---
*(
Concern(f"a dormant undead has no act in {place}", lambda r, d, t: not r.get("situation"),
widgets={"environment": place, "entity1_kind": "undead", "entity1_condition": "dormant"},
pack=FANTASY_PACK)
for place in ("abyssal sea trench", "sunken temple ruins")
),
*(
Concern(f"an abandoned {subkind} has no act in {place}", lambda r, d, t: not r.get("situation"),
widgets={"environment": place, "entity1_kind": "vessel", "entity1_subkind": subkind,
"entity1_condition": "abandoned"}, pack=FANTASY_PACK)
for subkind in ("airship", "sky galleon", "cloud skiff")
for place in ("sea of clouds", "castle courtyard", "harbour town quay")
),
Concern("a wrecked airship has no act in the sky", lambda r, d, t: not r.get("situation"),
widgets={"environment": "stormy sky above a mountain range", "entity1_subkind": "airship",
"entity1_form": "torn gasbag sagging over a broken hull"}, pack=FANTASY_PACK),
# A lock a drawn field contradicts: the drawn field moves, the lock stays.
Concern("a locked-wrecked airship has no act in the sky", lambda r, d, t: not r.get("situation"),
widgets={"environment": "sea of clouds", "entity1_subkind": "airship",
"entity1_condition": "wrecked"}, pack=FANTASY_PACK),
Concern("a torn gasbag drifts on the wind",
lambda r, d, t: said(r, "situation") == "drifting crewless on the wind",
widgets={"environment": "windswept moorland", "entity1_subkind": "airship",
"entity1_form": "torn gasbag sagging over a broken hull"}, pack=FANTASY_PACK),
Concern("a sky galleon or a cloud skiff has a gasbag",
lambda r, d, t: "gasbag" in said(r, "situation") and said(r, "subkind") != "airship",
widgets={"environment": "windswept moorland", "entity1_kind": "vessel"}, pack=FANTASY_PACK),
Concern("a sea folk braces against a gust underwater",
lambda r, d, t: "gust" in said(r, "situation"),
widgets={"environment": "kelp forest depths", "entity1_kind": "hybrid folk",
"entity1_subkind": "merfolk"}, pack=FANTASY_PACK),
Concern("a huge subject fits in a forge",
lambda r, d, t: said(r, "scale") in ("huge", "colossal", "titanic"),
widgets={"environment": "blacksmith's forge"}, pack=FANTASY_PACK),
)
+8 -6
View File
@@ -100,14 +100,16 @@ class NodeIdentityTests(unittest.TestCase):
self.assertEqual([o.display_name for o in entity_outputs], ["entity_text", "entity"])
self.assertEqual(entity_outputs[1].io_type, "SCENE_ENTITY")
def test_both_force_a_fresh_roll_every_queue(self) -> None:
"""ComfyUI #11905: with ``control_after_generate`` advancing the seed, a
cached result can be served for the new seed. ``vars(cls)`` rather than
``hasattr`` -- the base class declares the hook either way."""
def test_neither_overrides_the_input_cache(self) -> None:
"""The output is a pure function of the inputs (a changed seed is a
changed input), so ComfyUI's input cache is correct. A never-equal
fingerprint cannot produce a new scene -- an unchanged seed re-runs to the
same text -- but it enters every downstream node's cache signature, so a
re-queue re-ran the sampler. Measured on a live ComfyUI before removing it.
``vars(cls)`` rather than ``hasattr`` -- the base class declares the hook."""
for name, node in self.nodes.items():
with self.subTest(node=name):
self.assertIn("fingerprint_inputs", vars(node))
self.assertNotEqual(node.fingerprint_inputs(), node.fingerprint_inputs())
self.assertNotIn("fingerprint_inputs", vars(node))
def test_neither_node_is_a_shell_any_more(self) -> None:
"""Replaces the placeholder assertions Todos 17 and 18 retired. The
+13
View File
@@ -343,6 +343,19 @@ class WiredEntityTests(unittest.TestCase):
with self.assertRaises(ValueError):
NODE.execute(seed=8, entity_1_in="not a payload")
def test_a_cached_payload_is_reused_unchanged(self) -> None:
"""ComfyUI caches the Entity node and hands the same payload object to
every later run, so the scene must neither mutate it nor read it
differently the second time."""
for seed in range(25):
with self.subTest(seed=seed):
_, payload = ENTITY_NODE.execute(seed=seed).args
before = json.dumps(payload, sort_keys=True)
first = _run(seed=seed, entity_count="2", **{entity_socket_key(2): payload})
self.assertEqual(json.dumps(payload, sort_keys=True), before)
second = _run(seed=seed, entity_count="2", **{entity_socket_key(2): payload})
self.assertEqual(first, second)
if __name__ == "__main__": # pragma: no cover
unittest.main()
+5 -1
View File
@@ -258,7 +258,11 @@ SUBSTANCE_COLOUR_HOMES: dict[str, tuple[str, ...]] = {
#: in sci-fi and horror; fantasy's torch is a real one, so it is not listed.
TRAP_PHRASES = re.compile(
r"\b(fork of|heart in its|iris of|iris valve|rolling body|winding key|bone charms?|bottle|"
r"handheld torch|with a torch)\b"
r"handheld torch|with a torch|"
# An object aimed by someone off-frame, with no direction: "snapping at a hurled spear"
# drew the spear leaving the subject's mouth. Say it comes "at it" / "toward them".
r"(?:hurled|thrown|flung|raised|levelled) (?:spears?|daggers?|knives|knife|axes?|stones?|rocks?|"
r"torch(?:es)?|javelins?|lances?))\b"
)