No length cap on the binds-to-image definition form

This commit is contained in:
Z User 2026-10-30 20:35:58 +00:00
parent c2559f0572
commit 962c667418
4 changed files with 24 additions and 19 deletions

View File

@ -177,10 +177,10 @@ and sampler latent or the video can come out square.
20 year old woman with blonde hair, blue eyes and a medium build" — age, hair, 20 year old woman with blonde hair, blue eyes and a medium build" — age, hair,
eyes, build; never clothing, never a nude/bare state); a character WITH a eyes, build; never clothing, never a nude/bare state); a character WITH a
reference image gets "<Subject 1> binds to <Image 1> : what the image actually reference image gets "<Subject 1> binds to <Image 1> : what the image actually
shows" (the writing LLM is multimodal — look at it); and a user refmod shows" (the writing LLM is multimodal — look at it, no length cap); and a user
(`sam:&identity: ...; voice: ...&` in the story's characters block) is carried refmod (`sam:&identity: ...; voice: ...&` in the story's characters block) is
through VERBATIM as "<Subject 1> identity: ...; voice: ..." — never rewritten, carried through VERBATIM as "<Subject 1> identity: ...; voice: ..." — never
never trimmed, exempt from the length and clothing rules. Weave the head-to-toe rewritten, never trimmed, exempt from every defs limit. Weave the head-to-toe
look into the action as the scene exposes it — hair, build, and face as they look into the action as the scene exposes it — hair, build, and face as they
move, each garment where the action touches it, footwear where steps land — move, each garment where the action touches it, footwear where steps land —
nothing is shared between scenes or from a prefix. Name every body part the nothing is shared between scenes or from a prefix. Name every body part the

View File

@ -254,8 +254,8 @@ Shots are flat. A shot never contains a nested object.
marks and carry the text through VERBATIM: "<Subject 1> identity: <their marks and carry the text through VERBATIM: "<Subject 1> identity: <their
identity text>; voice: <their voice text>". Never rewrite, trim, reorder, or identity text>; voice: <their voice text>". Never rewrite, trim, reorder, or
"improve" a refmod line — it is the user's tested wording and overrides every "improve" a refmod line — it is the user's tested wording and overrides every
other rule about definitions, including the length cap and the other rule about definitions (only the no-image form has a length cap, and no
clothing/skin-state ban. form's limits ever apply to a refmod line).
Define <Subject 2> the same way when the story casts a second recurring person. Define <Subject 2> the same way when the story casts a second recurring person.
Never define a label twice; never define a label you do not use. Never define a label twice; never define a label you do not use.
2. "summary:" then "[reference generation]" — exactly this directive on every scene, 2. "summary:" then "[reference generation]" — exactly this directive on every scene,

View File

@ -368,7 +368,8 @@ The sound picture is its own element and lives in the overall_soundscape section
carry the text through VERBATIM: "<Subject 1> identity: <their identity text>; carry the text through VERBATIM: "<Subject 1> identity: <their identity text>;
voice: <their voice text>". Never rewrite, trim, reorder, or "improve" a voice: <their voice text>". Never rewrite, trim, reorder, or "improve" a
refmod line — it is the user's tested wording and overrides every other rule refmod line — it is the user's tested wording and overrides every other rule
about definitions, including the length cap and the clothing/skin-state ban. about definitions (only the no-image form has a length cap, and no form's
limits ever apply to a refmod line).
Define <Subject 2> the same way when the outline casts a second person. Never Define <Subject 2> the same way when the outline casts a second person. Never
define a label twice; never define a label you do not use. define a label twice; never define a label you do not use.
2. "summary:" then "[reference generation]" — exactly this directive on every scene 2. "summary:" then "[reference generation]" — exactly this directive on every scene

View File

@ -32,12 +32,14 @@ REF2VA_RETENTION_MARKERS = {"fully_preserved", "partially_preserved",
"attribute_transfer", "weak_reference"} "attribute_transfer", "weak_reference"}
# Rule 7 - a subject_definitions line comes in exactly one of three forms: # Rule 7 - a subject_definitions line comes in exactly one of three forms:
# 1. no reference image -> "<Subject N> is a <age> ... with <hair>, <eyes> and # 1. no reference image -> "<Subject N> is a <age> ... with <hair>, <eyes> and
# <build>" - physical traits only: never clothing, never a nude/bare skin state # <build>" - lean physical traits only (25-word cap): never clothing, never a
# nude/bare skin state
# 2. reference image -> "<Subject N> binds to <Image N> : <what the image # 2. reference image -> "<Subject N> binds to <Image N> : <what the image
# actually shows>" - compact and faithful; the writer is multimodal # actually shows>" - faithful to the image, NO length cap; the writer is
# multimodal
# 3. user refmod -> "<Subject N> identity: <verbatim>; voice: <verbatim>" # 3. user refmod -> "<Subject N> identity: <verbatim>; voice: <verbatim>"
# - the user's own tested wording, carried through untouched (exempt from the # - the user's own tested wording, carried through untouched (exempt from
# length cap and the clothing/skin-state bans) # every no-image trait limit: length, clothing, skin state)
# In every form the full look is still woven into the [Shot 1] body. # In every form the full look is still woven into the [Shot 1] body.
REF2VA_DEF_MAX_WORDS = 25 REF2VA_DEF_MAX_WORDS = 25
REF2VA_REFMOD_RE = re.compile(r"^identity\s*:", re.I) REF2VA_REFMOD_RE = re.compile(r"^identity\s*:", re.I)
@ -186,13 +188,6 @@ def check_ref2va_prompt(lines, dur, where, prev_handoff=None):
raise ValueError(f"{where}: {m.group(1)} binds line needs a description " raise ValueError(f"{where}: {m.group(1)} binds line needs a description "
f"after the colon - look at <Image N> and write what " f"after the colon - look at <Image N> and write what "
f"you see: {line[:60]!r}") f"you see: {line[:60]!r}")
words = len(desc.split())
if words > REF2VA_DEF_MAX_WORDS:
raise ValueError(f"{where}: {m.group(1)} binds description is {words} "
f"words - describe what you actually see in <Image N> "
f"compactly (age, hair, eyes, build, what they wear in "
f"the image); the look in motion is still woven into "
f"the [Shot 1] body: {line[:60]!r}")
else: else:
if not re.match(r"^is\b", anchor, re.I): if not re.match(r"^is\b", anchor, re.I):
raise ValueError(f"{where}: {m.group(1)} definition is none of the three " raise ValueError(f"{where}: {m.group(1)} definition is none of the three "
@ -762,7 +757,16 @@ def run_fragment_suite():
noimage["prompt"][1] = ("<Subject 1> is a woman in her thirties with dark brown " noimage["prompt"][1] = ("<Subject 1> is a woman in her thirties with dark brown "
"hair in a low bun, calm grey eyes and a slim build.") "hair in a low bun, calm grey eyes and a slim build.")
validate_fragment(noimage, index=1, total=1) validate_fragment(noimage, index=1, total=1)
print(" all ref2va PASS cases ok (binds, verbatim refmod, no-image traits)") long_binds = _ref2va_short()
long_binds["prompt"][1] = ("<Subject 1> binds to <Image 1> : a woman in her "
"thirties with dark brown hair pulled back in a low "
"bun, calm grey eyes, a slim build, wearing a pale "
"green scrub top and matching scrub trousers, white "
"sneakers, and a clipped ID badge on a lanyard at her "
"chest.")
validate_fragment(long_binds, index=1, total=1)
print(" all ref2va PASS cases ok (binds uncapped, verbatim refmod, no-image "
"traits)")
print("\nRef2VA edge cases that must FAIL:") print("\nRef2VA edge cases that must FAIL:")
no_ret = _ref2va_short() no_ret = _ref2va_short()