@nodaro/prompts 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +627 -177
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +726 -33
- package/dist/index.d.ts +726 -33
- package/dist/index.js +598 -179
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/entity-convergence-image.test.ts.snap +19 -0
- package/src/__tests__/animal-getters-parity.test.ts +82 -0
- package/src/__tests__/assemble-image-input-cap.test.ts +236 -0
- package/src/__tests__/assemble-image-input.test.ts +100 -19
- package/src/__tests__/assemble-video-input-cap.test.ts +442 -0
- package/src/__tests__/assemble-video-input.test.ts +167 -33
- package/src/__tests__/direction-hint-token-safety.test.ts +21 -0
- package/src/__tests__/entity-convergence-image.test.ts +374 -0
- package/src/__tests__/location-convergence-image.test.ts +29 -1
- package/src/__tests__/location-default-role-image.test.ts +166 -0
- package/src/__tests__/mention-splice-spacing.test.ts +257 -0
- package/src/__tests__/prompt-style-section.test.ts +345 -0
- package/src/__tests__/read-node-subject.test.ts +140 -0
- package/src/__tests__/style-section-boundary.test.ts +179 -0
- package/src/__tests__/subject-fold.test.ts +251 -0
- package/src/__tests__/subject-registry.test.ts +312 -0
- package/src/assemble-image-input.ts +169 -41
- package/src/assemble-video-input.ts +200 -25
- package/src/direction-registry.ts +116 -28
- package/src/hint-shedding.ts +87 -0
- package/src/index.ts +3 -0
- package/src/parameter-prompt-hint.ts +8 -7
- package/src/picker-catalogs.ts +14 -7
- package/src/prompt-builder.ts +628 -88
- package/src/prompt-hint-join.ts +9 -0
- package/src/prompt-style-section.ts +256 -0
- package/src/read-node-direction.ts +60 -1
- package/src/subject-registry.ts +464 -0
- package/src/video-reference-resolver.ts +5 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ANIMAL_SUBCATEGORY_LABELS, ANIMAL_SUBCATEGORY_ORDER, VEHICLE_SUBCATEGORY_LABELS, VEHICLE_SUBCATEGORY_ORDER, WEAPON_SUBCATEGORY_LABELS, WEAPON_SUBCATEGORY_ORDER, FURNITURE_SUBCATEGORY_LABELS, FURNITURE_SUBCATEGORY_ORDER, VIDEO_REF_LIMITS_BY_PROVIDER, SOCIAL_POST_NODE_TYPES, FURNITURE, WEAPONS, VEHICLES, ANIMALS, PASSTHROUGH_TYPES, registerCatalogSidecars, resetCatalogSidecars, pickIds, getFurniture, getWeapon, getVehicle,
|
|
1
|
+
import { ANIMAL_SUBCATEGORY_LABELS, ANIMAL_SUBCATEGORY_ORDER, VEHICLE_SUBCATEGORY_LABELS, VEHICLE_SUBCATEGORY_ORDER, WEAPON_SUBCATEGORY_LABELS, WEAPON_SUBCATEGORY_ORDER, FURNITURE_SUBCATEGORY_LABELS, FURNITURE_SUBCATEGORY_ORDER, VIDEO_REF_LIMITS_BY_PROVIDER, SOCIAL_POST_NODE_TYPES, FURNITURE, WEAPONS, VEHICLES, ANIMALS, PASSTHROUGH_TYPES, registerCatalogSidecars, resetCatalogSidecars, pickIds, getAnimalPromptHint, getFurniture, getWeapon, getVehicle, DEFAULT_USAGE_MODE, usageModeDirective, DEFAULT_LOCATION_USAGE_MODE, imageReferenceLimit, knownImageSlugsFromRefs, findImageMentionTokens, knownEntitySlugsFromRefs, findEntityMentionTokens, findCharacterMentionTokens, findLocationMentionTokens, NATIVE_NEGATIVE_PROMPT_MODELS, getMaxNegativePromptChars, getMaxImagePromptChars, MODELS_WITH_REFERENCE_IMAGE_SUPPORT, getAnimalTerm, roleToPhrase, resolveDefaultRole, SEEDANCE_2_REF_LIMITS, NON_EN_LOCALE_IDS, readPromptAffixes, setRegisteredPersonPackFields, PLACEHOLDER_CHARACTER_NAME, REFERENCE_ROLE_PRESETS, imageMentionSlugForRef, entityMentionSlugForRef, defaultRoleForSource, locationReferencePhotoKindLabel, resolveNodeRefs, normalizeRoleSlug } from '@nodaro/shared';
|
|
2
2
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __export = (target, all) => {
|
|
@@ -9239,7 +9239,7 @@ function objectOptions(arr, phrase) {
|
|
|
9239
9239
|
label: e.label,
|
|
9240
9240
|
description: e.description,
|
|
9241
9241
|
category: e.subcategory,
|
|
9242
|
-
promptHint: phrase(e
|
|
9242
|
+
promptHint: phrase(e),
|
|
9243
9243
|
// Object entities have no `promptHint` field of their own (it is
|
|
9244
9244
|
// synthesized above), so the term cannot come from `resolveTerm`'s
|
|
9245
9245
|
// empty-hint rule: an authored `term` wins, and otherwise the label IS the
|
|
@@ -9571,7 +9571,7 @@ var SINGLE_CATALOGS = [
|
|
|
9571
9571
|
defaultValue: "dog-golden-retriever",
|
|
9572
9572
|
categoryOrder: ANIMAL_SUBCATEGORY_ORDER,
|
|
9573
9573
|
categoryLabels: ANIMAL_SUBCATEGORY_LABELS,
|
|
9574
|
-
options: objectOptions(ANIMALS, (
|
|
9574
|
+
options: objectOptions(ANIMALS, (e) => getAnimalPromptHint(e.id))
|
|
9575
9575
|
},
|
|
9576
9576
|
{
|
|
9577
9577
|
nodeType: "vehicle",
|
|
@@ -9582,7 +9582,7 @@ var SINGLE_CATALOGS = [
|
|
|
9582
9582
|
defaultValue: "sedan",
|
|
9583
9583
|
categoryOrder: VEHICLE_SUBCATEGORY_ORDER,
|
|
9584
9584
|
categoryLabels: VEHICLE_SUBCATEGORY_LABELS,
|
|
9585
|
-
options: objectOptions(VEHICLES, (
|
|
9585
|
+
options: objectOptions(VEHICLES, (e) => `featuring a ${e.label.toLowerCase()}, ${e.description}`)
|
|
9586
9586
|
},
|
|
9587
9587
|
{
|
|
9588
9588
|
nodeType: "weapon",
|
|
@@ -9593,7 +9593,7 @@ var SINGLE_CATALOGS = [
|
|
|
9593
9593
|
defaultValue: "katana",
|
|
9594
9594
|
categoryOrder: WEAPON_SUBCATEGORY_ORDER,
|
|
9595
9595
|
categoryLabels: WEAPON_SUBCATEGORY_LABELS,
|
|
9596
|
-
options: objectOptions(WEAPONS, (
|
|
9596
|
+
options: objectOptions(WEAPONS, (e) => `with a ${e.label.toLowerCase()}, ${e.description}`)
|
|
9597
9597
|
},
|
|
9598
9598
|
{
|
|
9599
9599
|
nodeType: "furniture",
|
|
@@ -9604,7 +9604,7 @@ var SINGLE_CATALOGS = [
|
|
|
9604
9604
|
defaultValue: "sofa",
|
|
9605
9605
|
categoryOrder: FURNITURE_SUBCATEGORY_ORDER,
|
|
9606
9606
|
categoryLabels: FURNITURE_SUBCATEGORY_LABELS,
|
|
9607
|
-
options: objectOptions(FURNITURE, (
|
|
9607
|
+
options: objectOptions(FURNITURE, (e) => `including a ${e.label.toLowerCase()}, ${e.description}`)
|
|
9608
9608
|
},
|
|
9609
9609
|
{
|
|
9610
9610
|
nodeType: "held-prop",
|
|
@@ -9972,13 +9972,16 @@ function resolveBaseHint(type, data, mode = "full") {
|
|
|
9972
9972
|
return withCustomText(data, byMode(mode, getLoopSubjectPromptHint, getLoopSubjectTerm)(asStr(data.loopSubject)));
|
|
9973
9973
|
case "material":
|
|
9974
9974
|
return withCustomText(data, buildMaterialHints(data.material, mode));
|
|
9975
|
-
|
|
9976
|
-
|
|
9975
|
+
// Animal is the one Object-entity catalog whose phrasing has a single
|
|
9976
|
+
// owner: `@nodaro/shared`'s `getAnimalPromptHint` / `getAnimalTerm`, which
|
|
9977
|
+
// the picker-catalog funnel calls too. Both getters already return "" on a
|
|
9978
|
+
// miss, so the entry lookup and the `animal ? … : ""` guard are the
|
|
9979
|
+
// getters' job now, not this switch's.
|
|
9980
|
+
case "animal":
|
|
9977
9981
|
return withCustomText(
|
|
9978
9982
|
data,
|
|
9979
|
-
|
|
9983
|
+
byMode(mode, getAnimalPromptHint, getAnimalTerm)(asStr(data.animal))
|
|
9980
9984
|
);
|
|
9981
|
-
}
|
|
9982
9985
|
case "vehicle": {
|
|
9983
9986
|
const vehicle = getVehicle(asStr(data.vehicle));
|
|
9984
9987
|
return withCustomText(
|
|
@@ -10212,6 +10215,218 @@ function applyTemplate(template, vars) {
|
|
|
10212
10215
|
template
|
|
10213
10216
|
);
|
|
10214
10217
|
}
|
|
10218
|
+
|
|
10219
|
+
// src/prompt-hint-join.ts
|
|
10220
|
+
var PROMPT_HINT_SEPARATOR = ". ";
|
|
10221
|
+
function joinPromptHints(userPrompt, hints) {
|
|
10222
|
+
if (hints.length === 0) return userPrompt;
|
|
10223
|
+
return [userPrompt.trim(), ...hints].filter((p) => p.length > 0).join(PROMPT_HINT_SEPARATOR);
|
|
10224
|
+
}
|
|
10225
|
+
|
|
10226
|
+
// src/direction-registry.ts
|
|
10227
|
+
var perId = (full, compact) => (ids, mode) => {
|
|
10228
|
+
const out = [];
|
|
10229
|
+
for (const id of ids) {
|
|
10230
|
+
const frag = mode === "compact" ? compact(id) : full(id);
|
|
10231
|
+
if (frag.length > 0) out.push(frag);
|
|
10232
|
+
}
|
|
10233
|
+
return out;
|
|
10234
|
+
};
|
|
10235
|
+
var viaListBuilder = (build) => (ids, mode) => build(ids.length === 1 ? ids[0] : [...ids], mode).filter((s) => s.length > 0);
|
|
10236
|
+
var viaStringBuilder = (build) => (ids, mode) => {
|
|
10237
|
+
const s = build(ids.length === 1 ? ids[0] : [...ids], mode);
|
|
10238
|
+
return s.length > 0 ? [s] : [];
|
|
10239
|
+
};
|
|
10240
|
+
var viaMood = (ids, mode) => buildMoodHints({ mood: ids.length === 1 ? ids[0] : [...ids] }, mode).filter(
|
|
10241
|
+
(s) => s.length > 0
|
|
10242
|
+
);
|
|
10243
|
+
var framing = perId(getFramingPromptHint, getFramingTerm);
|
|
10244
|
+
var lighting = perId(getLightingPromptHint, getLightingTerm);
|
|
10245
|
+
var exposure = perId(getExposurePromptHint, getExposureTerm);
|
|
10246
|
+
var temporal = perId(getTemporalPromptHint, getTemporalTerm);
|
|
10247
|
+
var DIRECTION_FIELDS = [
|
|
10248
|
+
{ key: "cameraMotion", surface: "video", family: "motion", maxPicks: 1, render: perId(getCameraMotionPromptHint, getCameraMotionTerm) },
|
|
10249
|
+
// Composition (the Framing catalog, one row per category).
|
|
10250
|
+
{ key: "shotSize", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
10251
|
+
{ key: "angle", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
10252
|
+
{ key: "coverage", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
10253
|
+
{ key: "composition", surface: "both", family: "look", maxPicks: 2, render: framing },
|
|
10254
|
+
{ key: "vantage", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
10255
|
+
{ key: "pose", surface: "both", family: "look", maxPicks: 1, render: perId(getPosePromptHint, getPoseTerm) },
|
|
10256
|
+
{ key: "compositionEffect", surface: "both", family: "look", maxPicks: 1, render: perId(getCompositionEffectPromptHint, getCompositionEffectTerm) },
|
|
10257
|
+
// Camera.
|
|
10258
|
+
{ key: "cameraFormat", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(getCameraFormatPromptHint, getCameraFormatTerm) },
|
|
10259
|
+
{ key: "lens", surface: "both", family: "look", maxPicks: 1, render: perId(getLensPromptHint, getLensTerm) },
|
|
10260
|
+
// Exposure (stills only — a video's exposure rides its own temporal levers).
|
|
10261
|
+
{ key: "aperture", surface: "image", family: "look", maxPicks: 1, render: exposure },
|
|
10262
|
+
{ key: "shutterSpeed", surface: "image", family: "look", maxPicks: 1, render: exposure },
|
|
10263
|
+
{ key: "isoValue", surface: "image", family: "look", maxPicks: 1, render: exposure },
|
|
10264
|
+
// Light (the Lighting catalog, one row per category).
|
|
10265
|
+
{ key: "timeOfDay", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
10266
|
+
{ key: "lightingStyle", surface: "both", family: "look", maxPicks: 2, render: lighting },
|
|
10267
|
+
{ key: "lightingDirection", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
10268
|
+
{ key: "lightingRatio", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
10269
|
+
{ key: "colorTemperature", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
10270
|
+
{ key: "colorLook", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(getColorLookPromptHint, getColorLookTerm) },
|
|
10271
|
+
{ key: "atmosphere", surface: "both", family: "look", maxPicks: 2, render: viaListBuilder(buildAtmosphereHints) },
|
|
10272
|
+
{ key: "postProcess", surface: "image", family: "look", maxPicks: 2, render: viaListBuilder(buildPostProcessHints) },
|
|
10273
|
+
// Style.
|
|
10274
|
+
{ key: "style", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(getStylePromptHint, getStyleTerm) },
|
|
10275
|
+
{ key: "mood", surface: "both", family: "look", maxPicks: 2, render: viaMood },
|
|
10276
|
+
{ key: "aesthetic", surface: "both", family: "look", maxPicks: 2, render: viaStringBuilder(buildAestheticHints) },
|
|
10277
|
+
{ key: "photoGenre", surface: "image", family: "look", maxPicks: 1, render: perId(getPhotoGenrePromptHint, getPhotoGenreTerm) },
|
|
10278
|
+
{ key: "photographer", surface: "image", family: "look", maxPicks: 2, render: viaStringBuilder(buildPhotographerHints) },
|
|
10279
|
+
{ key: "renderQuality", surface: "image", family: "look", maxPicks: 1, render: perId(getRenderQualityPromptHint, getRenderQualityTerm) },
|
|
10280
|
+
// Scene.
|
|
10281
|
+
{ key: "setting", surface: "both", family: "look", maxPicks: 1, render: perId(getSettingPromptHint, getSettingTerm) },
|
|
10282
|
+
{ key: "era", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(getEraPromptHint, getEraTerm) },
|
|
10283
|
+
{ key: "backdrop", surface: "both", family: "look", maxPicks: 1, render: perId(getBackdropPromptHint, getBackdropTerm) },
|
|
10284
|
+
// Motion & time.
|
|
10285
|
+
{ key: "actionFx", surface: "video", family: "motion", maxPicks: 2, render: viaListBuilder(buildActionFxHints) },
|
|
10286
|
+
{ key: "temporalSpeed", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
10287
|
+
{ key: "temporalFreeze", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
10288
|
+
{ key: "temporalDirection", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
10289
|
+
{ key: "temporalShutter", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
10290
|
+
{ key: "transition", surface: "video", family: "motion", maxPicks: 2, render: perId(getTransitionPromptHint, getTransitionTerm) },
|
|
10291
|
+
{ key: "loopSubject", surface: "video", family: "motion", maxPicks: 1, render: perId(getLoopSubjectPromptHint, getLoopSubjectTerm) },
|
|
10292
|
+
// ── LEGACY BLOCK — see the table doc above. Placed LAST, in today's exact
|
|
10293
|
+
// `composePromptText` order, so every pre-registry caller is byte-identical.
|
|
10294
|
+
{ key: "framingId", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
10295
|
+
{ key: "framingAngleId", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
10296
|
+
{ key: "lightingId", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
10297
|
+
{ key: "lensId", surface: "both", family: "look", maxPicks: 1, render: perId(getLensPromptHint, getLensTerm) },
|
|
10298
|
+
{ key: "cameraFormatId", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(getCameraFormatPromptHint, getCameraFormatTerm) }
|
|
10299
|
+
];
|
|
10300
|
+
var DIRECTION_SPECS = DIRECTION_FIELDS;
|
|
10301
|
+
var DIRECTION_KEYS = DIRECTION_FIELDS.map((f) => f.key);
|
|
10302
|
+
var FILM_STYLE_KEYS = DIRECTION_SPECS.filter(
|
|
10303
|
+
(f) => f.styleGroup === "film"
|
|
10304
|
+
).map((f) => f.key);
|
|
10305
|
+
var IMAGE_HINT_MODE_DEFAULT = "full";
|
|
10306
|
+
var VIDEO_HINT_MODE_DEFAULT = { look: "full", motion: "compact" };
|
|
10307
|
+
function modeForFamily(mode, family) {
|
|
10308
|
+
return typeof mode === "string" ? mode : family === "motion" ? mode.motion : mode.look;
|
|
10309
|
+
}
|
|
10310
|
+
var DIRECTION_ARRAY_CEILING = 8;
|
|
10311
|
+
var DIRECTION_ID_MAX_CHARS = 100;
|
|
10312
|
+
function normalizeDirectionIds(value, maxPicks) {
|
|
10313
|
+
const ids = [];
|
|
10314
|
+
if (typeof value === "string") {
|
|
10315
|
+
if (value) ids.push(value);
|
|
10316
|
+
} else if (Array.isArray(value)) {
|
|
10317
|
+
for (const v of value) {
|
|
10318
|
+
if (ids.length >= maxPicks) break;
|
|
10319
|
+
if (typeof v === "string" && v && !ids.includes(v)) ids.push(v);
|
|
10320
|
+
}
|
|
10321
|
+
}
|
|
10322
|
+
return ids.slice(0, maxPicks);
|
|
10323
|
+
}
|
|
10324
|
+
function directionFieldsForSurface(surface) {
|
|
10325
|
+
return DIRECTION_SPECS.filter((f) => f.surface === "both" || f.surface === surface);
|
|
10326
|
+
}
|
|
10327
|
+
function renderDirectionHintClauses(direction, opts) {
|
|
10328
|
+
if (!direction) return [];
|
|
10329
|
+
const mode = opts.mode ?? "full";
|
|
10330
|
+
const out = [];
|
|
10331
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10332
|
+
for (const spec of DIRECTION_SPECS) {
|
|
10333
|
+
if (spec.surface !== "both" && spec.surface !== opts.surface) continue;
|
|
10334
|
+
const ids = normalizeDirectionIds(
|
|
10335
|
+
direction[spec.key],
|
|
10336
|
+
spec.maxPicks
|
|
10337
|
+
);
|
|
10338
|
+
if (ids.length === 0) continue;
|
|
10339
|
+
for (const hint of spec.render(ids, modeForFamily(mode, spec.family))) {
|
|
10340
|
+
if (hint.length > 0 && !seen.has(hint)) {
|
|
10341
|
+
seen.add(hint);
|
|
10342
|
+
out.push({
|
|
10343
|
+
key: spec.key,
|
|
10344
|
+
family: spec.family,
|
|
10345
|
+
...spec.styleGroup !== void 0 ? { styleGroup: spec.styleGroup } : {},
|
|
10346
|
+
text: hint
|
|
10347
|
+
});
|
|
10348
|
+
}
|
|
10349
|
+
}
|
|
10350
|
+
}
|
|
10351
|
+
return out;
|
|
10352
|
+
}
|
|
10353
|
+
function renderDirectionHints(direction, opts) {
|
|
10354
|
+
return renderDirectionHintClauses(direction, opts).map((c) => c.text);
|
|
10355
|
+
}
|
|
10356
|
+
|
|
10357
|
+
// src/prompt-style-section.ts
|
|
10358
|
+
var STYLE_SECTION_HEADER = "[style]:";
|
|
10359
|
+
var STYLE_SECTION_GAP = "\n\n";
|
|
10360
|
+
var STYLE_SECTION_OPENING = `${STYLE_SECTION_GAP}${STYLE_SECTION_HEADER}
|
|
10361
|
+
`;
|
|
10362
|
+
function splitStyleSection(prompt) {
|
|
10363
|
+
const at = prompt.lastIndexOf(STYLE_SECTION_OPENING);
|
|
10364
|
+
if (at >= 0) {
|
|
10365
|
+
return { body: prompt.slice(0, at), section: prompt.slice(at + STYLE_SECTION_GAP.length) };
|
|
10366
|
+
}
|
|
10367
|
+
return prompt.startsWith(`${STYLE_SECTION_HEADER}
|
|
10368
|
+
`) ? { body: "", section: prompt } : { body: prompt, section: "" };
|
|
10369
|
+
}
|
|
10370
|
+
function insertBeforeStyleSection(prompt, lines) {
|
|
10371
|
+
if (lines.length === 0) return prompt;
|
|
10372
|
+
const block = lines.join("\n");
|
|
10373
|
+
const { body, section } = splitStyleSection(prompt);
|
|
10374
|
+
if (section.length === 0) return `${prompt}
|
|
10375
|
+
${block}`;
|
|
10376
|
+
return `${body.length > 0 ? `${body}
|
|
10377
|
+
${block}` : block}${STYLE_SECTION_GAP}${section}`;
|
|
10378
|
+
}
|
|
10379
|
+
function endsInsideStyleSection(prompt) {
|
|
10380
|
+
const at = prompt.lastIndexOf(STYLE_SECTION_GAP);
|
|
10381
|
+
const lastBlock = at >= 0 ? prompt.slice(at + STYLE_SECTION_GAP.length) : prompt;
|
|
10382
|
+
return lastBlock.startsWith(`${STYLE_SECTION_HEADER}
|
|
10383
|
+
`);
|
|
10384
|
+
}
|
|
10385
|
+
function styleSlotFor(row) {
|
|
10386
|
+
if (row.family === "motion") return "body";
|
|
10387
|
+
return row.styleGroup === "film" ? "film" : "scene";
|
|
10388
|
+
}
|
|
10389
|
+
function asBodyClauses(texts) {
|
|
10390
|
+
return texts.map((text) => ({ text, slot: "body" }));
|
|
10391
|
+
}
|
|
10392
|
+
function partitionStyleClauses(direction, opts) {
|
|
10393
|
+
return renderDirectionHintClauses(direction, opts).map((clause) => ({
|
|
10394
|
+
text: clause.text,
|
|
10395
|
+
slot: styleSlotFor(clause)
|
|
10396
|
+
}));
|
|
10397
|
+
}
|
|
10398
|
+
function styleSectionFromClauses(clauses) {
|
|
10399
|
+
const line = (slot) => clauses.filter((c) => c.slot === slot).map((c) => c.text).join(PROMPT_HINT_SEPARATOR);
|
|
10400
|
+
const lines = [line("film"), line("scene")].filter((l) => l.length > 0);
|
|
10401
|
+
return lines.length === 0 ? "" : `${STYLE_SECTION_HEADER}
|
|
10402
|
+
${lines.join("\n")}`;
|
|
10403
|
+
}
|
|
10404
|
+
function renderStyleSection(direction, opts) {
|
|
10405
|
+
return styleSectionFromClauses(partitionStyleClauses(direction, opts));
|
|
10406
|
+
}
|
|
10407
|
+
function composeSectionedPrompt(userPrompt, clauses, structuredFragment) {
|
|
10408
|
+
const bodyHints = [
|
|
10409
|
+
...clauses.filter((c) => c.slot === "body").map((c) => c.text),
|
|
10410
|
+
structuredFragment
|
|
10411
|
+
].filter((p) => p.length > 0);
|
|
10412
|
+
const section = styleSectionFromClauses(clauses);
|
|
10413
|
+
if (section.length === 0) {
|
|
10414
|
+
return bodyHints.length === 0 ? userPrompt : joinPromptHints(userPrompt ?? "", bodyHints);
|
|
10415
|
+
}
|
|
10416
|
+
const body = bodyHints.length > 0 ? joinPromptHints(userPrompt ?? "", bodyHints) : (userPrompt ?? "").trim();
|
|
10417
|
+
return body.length > 0 ? `${body}${STYLE_SECTION_GAP}${section}` : section;
|
|
10418
|
+
}
|
|
10419
|
+
function sectionedClauseCosts(userPrompt, clauses, structuredFragment) {
|
|
10420
|
+
const lengthAt = (kept) => composeSectionedPrompt(userPrompt, clauses.slice(0, kept), structuredFragment)?.length ?? 0;
|
|
10421
|
+
const costs = [];
|
|
10422
|
+
let below = lengthAt(0);
|
|
10423
|
+
for (let i = 0; i < clauses.length; i++) {
|
|
10424
|
+
const at = lengthAt(i + 1);
|
|
10425
|
+
costs.push(at - below);
|
|
10426
|
+
below = at;
|
|
10427
|
+
}
|
|
10428
|
+
return costs;
|
|
10429
|
+
}
|
|
10215
10430
|
function composeIdentityDescPart(subject, canonicalDesc, elementInjection) {
|
|
10216
10431
|
const parts = [];
|
|
10217
10432
|
const c = canonicalDesc?.trim();
|
|
@@ -10282,6 +10497,11 @@ ${resolvedPrompt}`;
|
|
|
10282
10497
|
}
|
|
10283
10498
|
return { prompt: resolvedPrompt, additionalUrls, mentionedCharacterSlugs };
|
|
10284
10499
|
}
|
|
10500
|
+
function spliceMentionPhrase(prompt, offset, tokenLength, phrase) {
|
|
10501
|
+
const before = prompt.slice(0, offset).replace(/(?<=\S)[^\S\r\n]{2,}$/, " ");
|
|
10502
|
+
const after = prompt.slice(offset + tokenLength).replace(/^[^\S\r\n]{2,}/, " ");
|
|
10503
|
+
return before + phrase + after;
|
|
10504
|
+
}
|
|
10285
10505
|
function resolveCharacterMentionsHybrid(prompt, tokens, refs, existingUrls) {
|
|
10286
10506
|
const bySlug = /* @__PURE__ */ new Map();
|
|
10287
10507
|
const byVariant = /* @__PURE__ */ new Map();
|
|
@@ -10320,7 +10540,7 @@ function resolveCharacterMentionsHybrid(prompt, tokens, refs, existingUrls) {
|
|
|
10320
10540
|
let resolvedPrompt = prompt;
|
|
10321
10541
|
for (const m of [...matched].sort((a, b) => b.offset - a.offset)) {
|
|
10322
10542
|
const phrase = roleToPhrase(m.role, bindingFor(m.url));
|
|
10323
|
-
resolvedPrompt = resolvedPrompt
|
|
10543
|
+
resolvedPrompt = spliceMentionPhrase(resolvedPrompt, m.offset, m.token.length, phrase);
|
|
10324
10544
|
}
|
|
10325
10545
|
const lockLines = [];
|
|
10326
10546
|
const elementDirectives = [];
|
|
@@ -10351,16 +10571,21 @@ function locationModeDirective(mode) {
|
|
|
10351
10571
|
}
|
|
10352
10572
|
}
|
|
10353
10573
|
function locationModeToRole(mode) {
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10574
|
+
return roleBearingLocationMode(mode) ?? defaultRoleForSource("wired-location");
|
|
10575
|
+
}
|
|
10576
|
+
function roleBearingLocationMode(mode) {
|
|
10577
|
+
const m = mode?.trim();
|
|
10578
|
+
if (!m) return null;
|
|
10579
|
+
return REFERENCE_ROLE_PRESETS["wired-location"].includes(m) ? m : null;
|
|
10580
|
+
}
|
|
10581
|
+
function resolveLocationRole(tokenRole, tokenUsageMode, ref) {
|
|
10582
|
+
const explicitRole = tokenRole?.trim();
|
|
10583
|
+
if (explicitRole) return normalizeRoleSlug(explicitRole);
|
|
10584
|
+
const modeRole = roleBearingLocationMode(tokenUsageMode);
|
|
10585
|
+
if (modeRole) return modeRole;
|
|
10586
|
+
const nodeRole = ref.defaultRole?.trim();
|
|
10587
|
+
if (nodeRole) return normalizeRoleSlug(nodeRole);
|
|
10588
|
+
return locationModeToRole(ref.defaultUsageMode ?? DEFAULT_LOCATION_USAGE_MODE);
|
|
10364
10589
|
}
|
|
10365
10590
|
function resolveLocationMentions(prompt, tokens, refs) {
|
|
10366
10591
|
const bySlug = /* @__PURE__ */ new Map();
|
|
@@ -10442,8 +10667,7 @@ function resolveLocationMentionsHybrid(prompt, tokens, refs, existingUrls) {
|
|
|
10442
10667
|
mentionedLocationSlugs.add(t.locationSlug);
|
|
10443
10668
|
refByUrl.set(match.url, match);
|
|
10444
10669
|
if (t.lock !== void 0) lockOverrideByUrl.set(match.url, t.lock);
|
|
10445
|
-
const
|
|
10446
|
-
const role = t.role ? normalizeRoleSlug(t.role) : locationModeToRole(mode);
|
|
10670
|
+
const role = resolveLocationRole(t.role, t.usageMode, match);
|
|
10447
10671
|
matched.push({ token: t.token, offset: t.offset, url: match.url, role });
|
|
10448
10672
|
}
|
|
10449
10673
|
const slotByUrl = /* @__PURE__ */ new Map();
|
|
@@ -10457,7 +10681,7 @@ function resolveLocationMentionsHybrid(prompt, tokens, refs, existingUrls) {
|
|
|
10457
10681
|
let resolvedPrompt = prompt;
|
|
10458
10682
|
for (const m of [...matched].sort((a, b) => b.offset - a.offset)) {
|
|
10459
10683
|
const phrase = roleToPhrase(m.role, bindingFor(m.url));
|
|
10460
|
-
resolvedPrompt = resolvedPrompt
|
|
10684
|
+
resolvedPrompt = spliceMentionPhrase(resolvedPrompt, m.offset, m.token.length, phrase);
|
|
10461
10685
|
}
|
|
10462
10686
|
const lockLines = [];
|
|
10463
10687
|
const elementDirectives = [];
|
|
@@ -10506,7 +10730,7 @@ function resolveImageMentionsHybrid(prompt, tokens, refs, existingUrls) {
|
|
|
10506
10730
|
let resolvedPrompt = prompt;
|
|
10507
10731
|
for (const m of [...matched].sort((a, b) => b.offset - a.offset)) {
|
|
10508
10732
|
const phrase = roleToPhrase(m.role, bindingFor(m.url));
|
|
10509
|
-
resolvedPrompt = resolvedPrompt
|
|
10733
|
+
resolvedPrompt = spliceMentionPhrase(resolvedPrompt, m.offset, m.token.length, phrase);
|
|
10510
10734
|
}
|
|
10511
10735
|
const lockLines = [];
|
|
10512
10736
|
const elementDirectives = [];
|
|
@@ -10524,6 +10748,60 @@ function resolveImageMentionsHybrid(prompt, tokens, refs, existingUrls) {
|
|
|
10524
10748
|
}
|
|
10525
10749
|
return { prompt: resolvedPrompt, additionalUrls, lockLines, elementDirectives };
|
|
10526
10750
|
}
|
|
10751
|
+
function resolveEntityMentionsHybrid(prompt, tokens, refs, existingUrls) {
|
|
10752
|
+
const bySlug = /* @__PURE__ */ new Map();
|
|
10753
|
+
for (const source of ["wired-creature", "wired-object"]) {
|
|
10754
|
+
for (const r of refs) {
|
|
10755
|
+
if (r.source !== source) continue;
|
|
10756
|
+
const slug = entityMentionSlugForRef(r);
|
|
10757
|
+
if (!slug) continue;
|
|
10758
|
+
if (!bySlug.has(slug)) bySlug.set(slug, r);
|
|
10759
|
+
}
|
|
10760
|
+
}
|
|
10761
|
+
const additionalUrls = [];
|
|
10762
|
+
const mentionedUrls = /* @__PURE__ */ new Set();
|
|
10763
|
+
const refByUrl = /* @__PURE__ */ new Map();
|
|
10764
|
+
const lockOverrideByUrl = /* @__PURE__ */ new Map();
|
|
10765
|
+
const matched = [];
|
|
10766
|
+
for (const t of tokens) {
|
|
10767
|
+
const match = bySlug.get(t.entitySlug);
|
|
10768
|
+
if (!match || !match.url) continue;
|
|
10769
|
+
additionalUrls.push(match.url);
|
|
10770
|
+
mentionedUrls.add(match.url);
|
|
10771
|
+
refByUrl.set(match.url, match);
|
|
10772
|
+
if (t.lock !== void 0) lockOverrideByUrl.set(match.url, t.lock);
|
|
10773
|
+
const role = (t.role ?? "").trim() || resolveDefaultRole(match.defaultRole, match.defaultUsageMode, match.source);
|
|
10774
|
+
matched.push({ token: t.token, offset: t.offset, url: match.url, role });
|
|
10775
|
+
}
|
|
10776
|
+
const slotByUrl = /* @__PURE__ */ new Map();
|
|
10777
|
+
for (const u of [...existingUrls, ...additionalUrls]) {
|
|
10778
|
+
if (!slotByUrl.has(u)) slotByUrl.set(u, slotByUrl.size + 1);
|
|
10779
|
+
}
|
|
10780
|
+
const bindingFor = (url2) => {
|
|
10781
|
+
const slot = slotByUrl.get(url2);
|
|
10782
|
+
return slot ? `reference image ${slotToLetter(slot)}` : "the reference image";
|
|
10783
|
+
};
|
|
10784
|
+
let resolvedPrompt = prompt;
|
|
10785
|
+
for (const m of [...matched].sort((a, b) => b.offset - a.offset)) {
|
|
10786
|
+
const phrase = roleToPhrase(m.role, bindingFor(m.url));
|
|
10787
|
+
resolvedPrompt = spliceMentionPhrase(resolvedPrompt, m.offset, m.token.length, phrase);
|
|
10788
|
+
}
|
|
10789
|
+
const lockLines = [];
|
|
10790
|
+
const elementDirectives = [];
|
|
10791
|
+
const seenUrls = /* @__PURE__ */ new Set();
|
|
10792
|
+
for (const m of matched) {
|
|
10793
|
+
if (seenUrls.has(m.url)) continue;
|
|
10794
|
+
seenUrls.add(m.url);
|
|
10795
|
+
const ref = refByUrl.get(m.url);
|
|
10796
|
+
if (!ref) continue;
|
|
10797
|
+
const binding = bindingFor(m.url);
|
|
10798
|
+
const lock = buildIdentityLockLine(withForcedIdentityLock(ref, lockOverrideByUrl.get(m.url)), binding);
|
|
10799
|
+
if (lock) lockLines.push(lock);
|
|
10800
|
+
const inject = ref.elementInjection?.trim();
|
|
10801
|
+
if (inject) elementDirectives.push(inject);
|
|
10802
|
+
}
|
|
10803
|
+
return { prompt: resolvedPrompt, additionalUrls, mentionedUrls, lockLines, elementDirectives };
|
|
10804
|
+
}
|
|
10527
10805
|
function buildCanonicalFallback(refs, mentionedSlugs, startIndex) {
|
|
10528
10806
|
const directiveLines = [];
|
|
10529
10807
|
const urls = [];
|
|
@@ -10682,7 +10960,7 @@ function renderLocationCanonicalHybrid(nonCharacterRefs, finalIndexByUrl, covere
|
|
|
10682
10960
|
if (!slot) continue;
|
|
10683
10961
|
seenUrls.add(r.url);
|
|
10684
10962
|
const binding = `reference image ${slotToLetter(slot)}`;
|
|
10685
|
-
phrases.push(roleToPhrase(
|
|
10963
|
+
phrases.push(roleToPhrase(resolveLocationRole(null, null, r), binding));
|
|
10686
10964
|
const lock = buildIdentityLockLine(r, binding);
|
|
10687
10965
|
if (lock) lockLines.push(lock);
|
|
10688
10966
|
const inject = r.elementInjection?.trim();
|
|
@@ -10838,9 +11116,29 @@ function reconcileBodySegments(body, bodySegments) {
|
|
|
10838
11116
|
}
|
|
10839
11117
|
return [{ text: body, origin: "user" }];
|
|
10840
11118
|
}
|
|
11119
|
+
function controlSuffixes(body, styleLine, avoidLine) {
|
|
11120
|
+
const separator = (text) => endsInsideStyleSection(text) ? STYLE_SECTION_GAP : "\n";
|
|
11121
|
+
const styleSuffix = styleLine ? `${separator(body)}${styleLine}` : "";
|
|
11122
|
+
const avoidSuffix = avoidLine ? `${separator(body + styleSuffix)}${avoidLine}` : "";
|
|
11123
|
+
return { styleSuffix, avoidSuffix };
|
|
11124
|
+
}
|
|
10841
11125
|
function buildImagePrompt(config2) {
|
|
10842
11126
|
return buildImagePromptInternal(config2);
|
|
10843
11127
|
}
|
|
11128
|
+
function buildImagePromptWithOverflow(config2) {
|
|
11129
|
+
const marks = newAssemblyMarks();
|
|
11130
|
+
const result = buildImagePromptInternal(config2, marks);
|
|
11131
|
+
return { ...result, overflowChars: marks.overflowChars };
|
|
11132
|
+
}
|
|
11133
|
+
function newAssemblyMarks() {
|
|
11134
|
+
return {
|
|
11135
|
+
directivesPrefix: "",
|
|
11136
|
+
bodyBeforeSuffixes: "",
|
|
11137
|
+
styleSuffix: "",
|
|
11138
|
+
avoidSuffix: "",
|
|
11139
|
+
overflowChars: 0
|
|
11140
|
+
};
|
|
11141
|
+
}
|
|
10844
11142
|
function buildImagePromptInternal(config2, marks) {
|
|
10845
11143
|
let {
|
|
10846
11144
|
provider,
|
|
@@ -10862,6 +11160,7 @@ function buildImagePromptInternal(config2, marks) {
|
|
|
10862
11160
|
const suppressedCanonicalLocationIds = config2.suppressedCanonicalLocationIds ?? [];
|
|
10863
11161
|
const isHybrid = config2.referenceFormat === "hybrid";
|
|
10864
11162
|
let hybridBodyConverged = false;
|
|
11163
|
+
const mentionedEntityUrls = /* @__PURE__ */ new Set();
|
|
10865
11164
|
if (config2.skipCharacterMentions) {
|
|
10866
11165
|
config2 = {
|
|
10867
11166
|
...config2,
|
|
@@ -10908,7 +11207,9 @@ function buildImagePromptInternal(config2, marks) {
|
|
|
10908
11207
|
);
|
|
10909
11208
|
const knownImageSlugs = knownImageSlugsFromRefs(connectedReferences);
|
|
10910
11209
|
const hasImageMentionTokens = isHybrid && knownImageSlugs.length > 0 && findImageMentionTokens(config2.prompt, knownImageSlugs).length > 0;
|
|
10911
|
-
|
|
11210
|
+
const knownEntitySlugs = knownEntitySlugsFromRefs(connectedReferences);
|
|
11211
|
+
const hasEntityMentionTokens = isHybrid && knownEntitySlugs.length > 0 && findEntityMentionTokens(config2.prompt, knownEntitySlugs).length > 0;
|
|
11212
|
+
if (knownCharacterSlugs.length > 0 || hasExtraRefs || knownLocationSlugs.length > 0 || hasImageMentionTokens || hasEntityMentionTokens) {
|
|
10912
11213
|
const mentionTokens = knownCharacterSlugs.length > 0 ? findCharacterMentionTokens(config2.prompt, knownCharacterSlugs) : [];
|
|
10913
11214
|
let hybridLockLines = [];
|
|
10914
11215
|
let hybridElementDirectives = [];
|
|
@@ -10980,6 +11281,25 @@ function buildImagePromptInternal(config2, marks) {
|
|
|
10980
11281
|
if (hi.additionalUrls.length > 0) hybridBodyConverged = true;
|
|
10981
11282
|
}
|
|
10982
11283
|
}
|
|
11284
|
+
let hybridEntityLockLines = [];
|
|
11285
|
+
let hybridEntityElementDirectives = [];
|
|
11286
|
+
if (hasEntityMentionTokens) {
|
|
11287
|
+
const entityTokens = findEntityMentionTokens(resolved.prompt, knownEntitySlugs);
|
|
11288
|
+
if (entityTokens.length > 0) {
|
|
11289
|
+
const he = resolveEntityMentionsHybrid(
|
|
11290
|
+
resolved.prompt,
|
|
11291
|
+
entityTokens,
|
|
11292
|
+
connectedReferences,
|
|
11293
|
+
[...referenceImageUrls || [], ...resolved.additionalUrls]
|
|
11294
|
+
);
|
|
11295
|
+
resolved.prompt = he.prompt;
|
|
11296
|
+
resolved.additionalUrls = [...resolved.additionalUrls, ...he.additionalUrls];
|
|
11297
|
+
hybridEntityLockLines = he.lockLines;
|
|
11298
|
+
hybridEntityElementDirectives = he.elementDirectives;
|
|
11299
|
+
for (const u of he.mentionedUrls) mentionedEntityUrls.add(u);
|
|
11300
|
+
if (he.additionalUrls.length > 0) hybridBodyConverged = true;
|
|
11301
|
+
}
|
|
11302
|
+
}
|
|
10983
11303
|
const prefixDedupedLength = [
|
|
10984
11304
|
...referenceImageUrls || [],
|
|
10985
11305
|
...resolved.additionalUrls
|
|
@@ -11061,6 +11381,7 @@ ${promptForNext}`;
|
|
|
11061
11381
|
...hybridLockLines,
|
|
11062
11382
|
...hybridLocationLockLines,
|
|
11063
11383
|
...hybridImageLockLines,
|
|
11384
|
+
...hybridEntityLockLines,
|
|
11064
11385
|
...canonical.lockLines,
|
|
11065
11386
|
...extrasRendered.lockLines
|
|
11066
11387
|
])];
|
|
@@ -11068,6 +11389,7 @@ ${promptForNext}`;
|
|
|
11068
11389
|
...hybridElementDirectives,
|
|
11069
11390
|
...hybridLocationElementDirectives,
|
|
11070
11391
|
...hybridImageElementDirectives,
|
|
11392
|
+
...hybridEntityElementDirectives,
|
|
11071
11393
|
...canonical.phrases,
|
|
11072
11394
|
...canonical.elementDirectives,
|
|
11073
11395
|
...extrasRendered.bodyLines,
|
|
@@ -11076,9 +11398,7 @@ ${promptForNext}`;
|
|
|
11076
11398
|
const lockBlock = allLockLines.length > 0 ? `${allLockLines.join("\n")}
|
|
11077
11399
|
|
|
11078
11400
|
` : "";
|
|
11079
|
-
|
|
11080
|
-
${trailingLines.join("\n")}` : "";
|
|
11081
|
-
promptForNext = `${lockBlock}${promptForNext}${trailingBlock}`;
|
|
11401
|
+
promptForNext = `${lockBlock}${insertBeforeStyleSection(promptForNext, trailingLines)}`;
|
|
11082
11402
|
}
|
|
11083
11403
|
config2 = {
|
|
11084
11404
|
...config2,
|
|
@@ -11114,7 +11434,8 @@ ${trailingLines.join("\n")}` : "";
|
|
|
11114
11434
|
if (coveredUrl) tokenCoveredUrls.add(coveredUrl);
|
|
11115
11435
|
}
|
|
11116
11436
|
const locCanon = renderLocationCanonicalHybrid(nonCharacterRefs, finalIndexByUrl, tokenCoveredUrls);
|
|
11117
|
-
const
|
|
11437
|
+
const objCoveredUrls = mentionedEntityUrls.size > 0 ? /* @__PURE__ */ new Set([...tokenCoveredUrls, ...mentionedEntityUrls]) : tokenCoveredUrls;
|
|
11438
|
+
const objCanon = renderObjectCreatureCanonicalHybrid(nonCharacterRefs, finalIndexByUrl, objCoveredUrls);
|
|
11118
11439
|
const canonLockLines = [...locCanon.lockLines, ...objCanon.lockLines];
|
|
11119
11440
|
const canonLockBlock = canonLockLines.length > 0 ? `${canonLockLines.join("\n")}
|
|
11120
11441
|
|
|
@@ -11125,9 +11446,7 @@ ${trailingLines.join("\n")}` : "";
|
|
|
11125
11446
|
...locCanon.elementDirectives,
|
|
11126
11447
|
...objCanon.elementDirectives
|
|
11127
11448
|
];
|
|
11128
|
-
const
|
|
11129
|
-
${canonTrailingLines.join("\n")}` : "";
|
|
11130
|
-
const composedScene = `${canonLockBlock}${scene}${canonTrailingBlock}`;
|
|
11449
|
+
const composedScene = `${canonLockBlock}${insertBeforeStyleSection(scene, canonTrailingLines)}`;
|
|
11131
11450
|
prompt2 = config2.referenceLockSnippet ? `${config2.referenceLockSnippet}
|
|
11132
11451
|
${composedScene}` : composedScene;
|
|
11133
11452
|
if (marks) marks.directivesPrefix = "";
|
|
@@ -11153,31 +11472,33 @@ ${directives}`;
|
|
|
11153
11472
|
}
|
|
11154
11473
|
}
|
|
11155
11474
|
const styleText2 = style?.trim();
|
|
11156
|
-
const
|
|
11157
|
-
Style: ${getStylePromptHint(styleText2) || styleText2}` : "";
|
|
11475
|
+
const styleLine2 = styleText2 ? `Style: ${getStylePromptHint(styleText2) || styleText2}` : "";
|
|
11158
11476
|
const negPrompt2 = negativePrompt?.trim();
|
|
11159
11477
|
let nativeNegativePrompt2;
|
|
11160
|
-
let
|
|
11478
|
+
let avoidLine2 = "";
|
|
11161
11479
|
if (negPrompt2) {
|
|
11162
11480
|
if (NATIVE_NEGATIVE_PROMPT_MODELS.has(provider)) {
|
|
11163
11481
|
nativeNegativePrompt2 = negPrompt2.slice(0, getMaxNegativePromptChars(provider));
|
|
11164
11482
|
} else {
|
|
11165
|
-
|
|
11166
|
-
Avoid: ${negPrompt2}`;
|
|
11483
|
+
avoidLine2 = `Avoid: ${negPrompt2}`;
|
|
11167
11484
|
}
|
|
11168
11485
|
}
|
|
11169
|
-
if (marks) {
|
|
11170
|
-
marks.styleSuffix = styleSuffix2;
|
|
11171
|
-
marks.avoidSuffix = avoidSuffix2;
|
|
11172
|
-
}
|
|
11173
11486
|
const maxLen2 = getMaxImagePromptChars(provider);
|
|
11174
|
-
const
|
|
11487
|
+
const preCut2 = controlSuffixes(prompt2, styleLine2, avoidLine2);
|
|
11488
|
+
const reserved2 = preCut2.styleSuffix.length + preCut2.avoidSuffix.length;
|
|
11175
11489
|
if (prompt2.length + reserved2 > maxLen2) {
|
|
11490
|
+
if (marks) marks.overflowChars += prompt2.length + reserved2 - maxLen2;
|
|
11176
11491
|
prompt2 = prompt2.slice(0, Math.max(0, maxLen2 - reserved2 - 3)) + "...";
|
|
11177
11492
|
}
|
|
11493
|
+
const { styleSuffix: styleSuffix2, avoidSuffix: avoidSuffix2 } = controlSuffixes(prompt2, styleLine2, avoidLine2);
|
|
11494
|
+
if (marks) {
|
|
11495
|
+
marks.styleSuffix = styleSuffix2;
|
|
11496
|
+
marks.avoidSuffix = avoidSuffix2;
|
|
11497
|
+
}
|
|
11178
11498
|
if (marks) marks.bodyBeforeSuffixes = prompt2.slice(marks.directivesPrefix.length);
|
|
11179
11499
|
prompt2 = prompt2 + styleSuffix2 + avoidSuffix2;
|
|
11180
11500
|
if (prompt2.length > maxLen2) {
|
|
11501
|
+
if (marks) marks.overflowChars += prompt2.length - maxLen2;
|
|
11181
11502
|
prompt2 = prompt2.slice(0, maxLen2 - 3) + "...";
|
|
11182
11503
|
}
|
|
11183
11504
|
if (!isHybrid) {
|
|
@@ -11225,37 +11546,41 @@ Avoid: ${negPrompt2}`;
|
|
|
11225
11546
|
let prompt = config2.prompt;
|
|
11226
11547
|
if (charDescs.length > 0) {
|
|
11227
11548
|
const wrapperTemplate = resolveTemplate("generate-image-wrapper", userTemplates, flowTemplates);
|
|
11228
|
-
|
|
11229
|
-
|
|
11549
|
+
const { body, section } = splitStyleSection(prompt);
|
|
11550
|
+
const wrapped = applyTemplate(wrapperTemplate, {
|
|
11551
|
+
userPrompt: body,
|
|
11230
11552
|
assetDescriptions: charDescs.join(" ")
|
|
11231
11553
|
});
|
|
11554
|
+
prompt = section.length > 0 ? `${wrapped}${STYLE_SECTION_GAP}${section}` : wrapped;
|
|
11232
11555
|
}
|
|
11233
11556
|
const styleText = style?.trim();
|
|
11234
|
-
const
|
|
11235
|
-
Style: ${getStylePromptHint(styleText) || styleText}` : "";
|
|
11557
|
+
const styleLine = styleText ? `Style: ${getStylePromptHint(styleText) || styleText}` : "";
|
|
11236
11558
|
const negPrompt = negativePrompt?.trim();
|
|
11237
11559
|
let nativeNegativePrompt;
|
|
11238
|
-
let
|
|
11560
|
+
let avoidLine = "";
|
|
11239
11561
|
if (negPrompt) {
|
|
11240
11562
|
if (NATIVE_NEGATIVE_PROMPT_MODELS.has(provider)) {
|
|
11241
11563
|
nativeNegativePrompt = negPrompt.slice(0, getMaxNegativePromptChars(provider));
|
|
11242
11564
|
} else {
|
|
11243
|
-
|
|
11244
|
-
Avoid: ${negPrompt}`;
|
|
11565
|
+
avoidLine = `Avoid: ${negPrompt}`;
|
|
11245
11566
|
}
|
|
11246
11567
|
}
|
|
11247
|
-
if (marks) {
|
|
11248
|
-
marks.styleSuffix = styleSuffix;
|
|
11249
|
-
marks.avoidSuffix = avoidSuffix;
|
|
11250
|
-
}
|
|
11251
11568
|
const maxLen = getMaxImagePromptChars(provider);
|
|
11252
|
-
const
|
|
11569
|
+
const preCut = controlSuffixes(prompt, styleLine, avoidLine);
|
|
11570
|
+
const reserved = preCut.styleSuffix.length + preCut.avoidSuffix.length;
|
|
11253
11571
|
if (prompt.length + reserved > maxLen) {
|
|
11572
|
+
if (marks) marks.overflowChars += prompt.length + reserved - maxLen;
|
|
11254
11573
|
prompt = prompt.slice(0, Math.max(0, maxLen - reserved - 3)) + "...";
|
|
11255
11574
|
}
|
|
11575
|
+
const { styleSuffix, avoidSuffix } = controlSuffixes(prompt, styleLine, avoidLine);
|
|
11576
|
+
if (marks) {
|
|
11577
|
+
marks.styleSuffix = styleSuffix;
|
|
11578
|
+
marks.avoidSuffix = avoidSuffix;
|
|
11579
|
+
}
|
|
11256
11580
|
if (marks) marks.bodyBeforeSuffixes = prompt;
|
|
11257
11581
|
prompt = prompt + styleSuffix + avoidSuffix;
|
|
11258
11582
|
if (prompt.length > maxLen) {
|
|
11583
|
+
if (marks) marks.overflowChars += prompt.length - maxLen;
|
|
11259
11584
|
prompt = prompt.slice(0, maxLen - 3) + "...";
|
|
11260
11585
|
}
|
|
11261
11586
|
const allRefs = referenceImageUrls.length > 0 ? referenceImageUrls : ancestorRefs;
|
|
@@ -11265,12 +11590,7 @@ Avoid: ${negPrompt}`;
|
|
|
11265
11590
|
return { prompt, nativeNegativePrompt, referenceImageUrls: refsToSend };
|
|
11266
11591
|
}
|
|
11267
11592
|
function buildImagePromptSegments(config2, bodySegments) {
|
|
11268
|
-
const marks =
|
|
11269
|
-
directivesPrefix: "",
|
|
11270
|
-
bodyBeforeSuffixes: "",
|
|
11271
|
-
styleSuffix: "",
|
|
11272
|
-
avoidSuffix: ""
|
|
11273
|
-
};
|
|
11593
|
+
const marks = newAssemblyMarks();
|
|
11274
11594
|
const result = buildImagePromptInternal(config2, marks);
|
|
11275
11595
|
let segments = [
|
|
11276
11596
|
...marks.directivesPrefix ? [{ text: marks.directivesPrefix, origin: "mention" }] : [],
|
|
@@ -11460,19 +11780,35 @@ function hybridRolePhrase(label, letter) {
|
|
|
11460
11780
|
return `the ${label} from reference image ${letter}`;
|
|
11461
11781
|
}
|
|
11462
11782
|
function expandImageRefTokensHybrid(prompt, refs, finalIndexByUrl) {
|
|
11463
|
-
|
|
11464
|
-
|
|
11783
|
+
const splices = [];
|
|
11784
|
+
for (const m of prompt.matchAll(IMAGE_TOKEN_PATTERN)) {
|
|
11785
|
+
const n = parseInt(m[1], 10);
|
|
11465
11786
|
const ref = refs[n - 1];
|
|
11466
11787
|
const finalIdx = ref?.url ? finalIndexByUrl.get(ref.url) : void 0;
|
|
11467
|
-
if (!finalIdx)
|
|
11468
|
-
|
|
11469
|
-
|
|
11788
|
+
if (!finalIdx) continue;
|
|
11789
|
+
splices.push({
|
|
11790
|
+
offset: m.index ?? 0,
|
|
11791
|
+
length: m[0].length,
|
|
11792
|
+
phrase: hybridRolePhrase((m[2] ?? "").trim(), slotToLetter(finalIdx))
|
|
11793
|
+
});
|
|
11794
|
+
}
|
|
11795
|
+
let resolved = prompt;
|
|
11796
|
+
for (let i = splices.length - 1; i >= 0; i--) {
|
|
11797
|
+
const s = splices[i];
|
|
11798
|
+
resolved = spliceMentionPhrase(resolved, s.offset, s.length, s.phrase);
|
|
11799
|
+
}
|
|
11800
|
+
return resolved;
|
|
11470
11801
|
}
|
|
11471
11802
|
function capitalizeLineInitial(line) {
|
|
11472
11803
|
return line.replace(/[a-zA-Z]/, (c) => c.toUpperCase());
|
|
11473
11804
|
}
|
|
11474
11805
|
function buildHybridScene(prompt, refs, finalIndexByUrl) {
|
|
11475
|
-
|
|
11806
|
+
const lines = prompt.split("\n");
|
|
11807
|
+
const sectionAt = lines.indexOf(STYLE_SECTION_HEADER);
|
|
11808
|
+
return lines.map((line, i) => {
|
|
11809
|
+
const expanded = expandImageRefTokensHybrid(line, refs, finalIndexByUrl);
|
|
11810
|
+
return sectionAt >= 0 && i >= sectionAt ? expanded : capitalizeLineInitial(expanded);
|
|
11811
|
+
}).join("\n");
|
|
11476
11812
|
}
|
|
11477
11813
|
function buildIdentityDirectives(prompt, refs, meta3 = [], suppressedCanonicalLocationIds) {
|
|
11478
11814
|
return collectIdentities(prompt, refs, meta3).map((id) => buildIdentityDirective(id, suppressedCanonicalLocationIds)).filter((s) => s.length > 0).join("\n");
|
|
@@ -11690,9 +12026,16 @@ function renderLens(l) {
|
|
|
11690
12026
|
if (l.aperture) bits.push(`f/${l.aperture}`);
|
|
11691
12027
|
return bits.length > 0 ? `Lens: ${bits.join(", ")}.` : "";
|
|
11692
12028
|
}
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
12029
|
+
var viaFragmentBuilder = (build) => (subject, mode) => {
|
|
12030
|
+
const clause = build(subject, mode).filter((s) => s.length > 0).join(", ");
|
|
12031
|
+
return clause.length > 0 ? [clause] : [];
|
|
12032
|
+
};
|
|
12033
|
+
var viaListBuilder2 = (build) => (ids, mode) => build(ids.length === 1 ? ids[0] : [...ids], mode).filter((s) => s.length > 0);
|
|
12034
|
+
var viaStringBuilder2 = (build) => (ids, mode) => {
|
|
12035
|
+
const s = build(ids.length === 1 ? ids[0] : [...ids], mode);
|
|
12036
|
+
return s.length > 0 ? [s] : [];
|
|
12037
|
+
};
|
|
12038
|
+
var perId2 = (full, compact) => (ids, mode) => {
|
|
11696
12039
|
const out = [];
|
|
11697
12040
|
for (const id of ids) {
|
|
11698
12041
|
const frag = mode === "compact" ? compact(id) : full(id);
|
|
@@ -11700,80 +12043,45 @@ var perId = (full, compact) => (ids, mode) => {
|
|
|
11700
12043
|
}
|
|
11701
12044
|
return out;
|
|
11702
12045
|
};
|
|
11703
|
-
var
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
}
|
|
11708
|
-
|
|
11709
|
-
(s) => s.length > 0
|
|
11710
|
-
);
|
|
11711
|
-
var framing = perId(getFramingPromptHint, getFramingTerm);
|
|
11712
|
-
var lighting = perId(getLightingPromptHint, getLightingTerm);
|
|
11713
|
-
var exposure = perId(getExposurePromptHint, getExposureTerm);
|
|
11714
|
-
var temporal = perId(getTemporalPromptHint, getTemporalTerm);
|
|
11715
|
-
var DIRECTION_FIELDS = [
|
|
11716
|
-
{ key: "cameraMotion", surface: "video", family: "motion", maxPicks: 1, render: perId(getCameraMotionPromptHint, getCameraMotionTerm) },
|
|
11717
|
-
// Composition (the Framing catalog, one row per category).
|
|
11718
|
-
{ key: "shotSize", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
11719
|
-
{ key: "angle", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
11720
|
-
{ key: "coverage", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
11721
|
-
{ key: "composition", surface: "both", family: "look", maxPicks: 2, render: framing },
|
|
11722
|
-
{ key: "vantage", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
11723
|
-
{ key: "pose", surface: "both", family: "look", maxPicks: 1, render: perId(getPosePromptHint, getPoseTerm) },
|
|
11724
|
-
{ key: "compositionEffect", surface: "both", family: "look", maxPicks: 1, render: perId(getCompositionEffectPromptHint, getCompositionEffectTerm) },
|
|
11725
|
-
// Camera.
|
|
11726
|
-
{ key: "cameraFormat", surface: "both", family: "look", maxPicks: 1, render: perId(getCameraFormatPromptHint, getCameraFormatTerm) },
|
|
11727
|
-
{ key: "lens", surface: "both", family: "look", maxPicks: 1, render: perId(getLensPromptHint, getLensTerm) },
|
|
11728
|
-
// Exposure (stills only — a video's exposure rides its own temporal levers).
|
|
11729
|
-
{ key: "aperture", surface: "image", family: "look", maxPicks: 1, render: exposure },
|
|
11730
|
-
{ key: "shutterSpeed", surface: "image", family: "look", maxPicks: 1, render: exposure },
|
|
11731
|
-
{ key: "isoValue", surface: "image", family: "look", maxPicks: 1, render: exposure },
|
|
11732
|
-
// Light (the Lighting catalog, one row per category).
|
|
11733
|
-
{ key: "timeOfDay", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
11734
|
-
{ key: "lightingStyle", surface: "both", family: "look", maxPicks: 2, render: lighting },
|
|
11735
|
-
{ key: "lightingDirection", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
11736
|
-
{ key: "lightingRatio", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
11737
|
-
{ key: "colorTemperature", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
11738
|
-
{ key: "colorLook", surface: "both", family: "look", maxPicks: 1, render: perId(getColorLookPromptHint, getColorLookTerm) },
|
|
11739
|
-
{ key: "atmosphere", surface: "both", family: "look", maxPicks: 2, render: viaListBuilder(buildAtmosphereHints) },
|
|
11740
|
-
{ key: "postProcess", surface: "image", family: "look", maxPicks: 2, render: viaListBuilder(buildPostProcessHints) },
|
|
11741
|
-
// Style.
|
|
11742
|
-
{ key: "style", surface: "both", family: "look", maxPicks: 1, render: perId(getStylePromptHint, getStyleTerm) },
|
|
11743
|
-
{ key: "mood", surface: "both", family: "look", maxPicks: 2, render: viaMood },
|
|
11744
|
-
{ key: "aesthetic", surface: "both", family: "look", maxPicks: 2, render: viaStringBuilder(buildAestheticHints) },
|
|
11745
|
-
{ key: "photoGenre", surface: "image", family: "look", maxPicks: 1, render: perId(getPhotoGenrePromptHint, getPhotoGenreTerm) },
|
|
11746
|
-
{ key: "photographer", surface: "image", family: "look", maxPicks: 2, render: viaStringBuilder(buildPhotographerHints) },
|
|
11747
|
-
{ key: "renderQuality", surface: "image", family: "look", maxPicks: 1, render: perId(getRenderQualityPromptHint, getRenderQualityTerm) },
|
|
11748
|
-
// Scene.
|
|
11749
|
-
{ key: "setting", surface: "both", family: "look", maxPicks: 1, render: perId(getSettingPromptHint, getSettingTerm) },
|
|
11750
|
-
{ key: "era", surface: "both", family: "look", maxPicks: 1, render: perId(getEraPromptHint, getEraTerm) },
|
|
11751
|
-
{ key: "backdrop", surface: "both", family: "look", maxPicks: 1, render: perId(getBackdropPromptHint, getBackdropTerm) },
|
|
11752
|
-
// Motion & time.
|
|
11753
|
-
{ key: "actionFx", surface: "video", family: "motion", maxPicks: 2, render: viaListBuilder(buildActionFxHints) },
|
|
11754
|
-
{ key: "temporalSpeed", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
11755
|
-
{ key: "temporalFreeze", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
11756
|
-
{ key: "temporalDirection", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
11757
|
-
{ key: "temporalShutter", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
11758
|
-
{ key: "transition", surface: "video", family: "motion", maxPicks: 2, render: perId(getTransitionPromptHint, getTransitionTerm) },
|
|
11759
|
-
{ key: "loopSubject", surface: "video", family: "motion", maxPicks: 1, render: perId(getLoopSubjectPromptHint, getLoopSubjectTerm) },
|
|
11760
|
-
// ── LEGACY BLOCK — see the table doc above. Placed LAST, in today's exact
|
|
11761
|
-
// `composePromptText` order, so every pre-registry caller is byte-identical.
|
|
11762
|
-
{ key: "framingId", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
11763
|
-
{ key: "framingAngleId", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
11764
|
-
{ key: "lightingId", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
11765
|
-
{ key: "lensId", surface: "both", family: "look", maxPicks: 1, render: perId(getLensPromptHint, getLensTerm) },
|
|
11766
|
-
{ key: "cameraFormatId", surface: "both", family: "look", maxPicks: 1, render: perId(getCameraFormatPromptHint, getCameraFormatTerm) }
|
|
12046
|
+
var SUBJECT_FIELDS = [
|
|
12047
|
+
{ key: "person", kind: "group", surface: "both", render: viaFragmentBuilder(buildPersonHints) },
|
|
12048
|
+
{ key: "styling", kind: "group", surface: "both", render: viaFragmentBuilder(buildStylingHints) },
|
|
12049
|
+
{ key: "heldProp", kind: "ids", surface: "both", maxPicks: 2, render: viaListBuilder2(buildHeldPropHints) },
|
|
12050
|
+
{ key: "material", kind: "ids", surface: "both", maxPicks: 2, render: viaStringBuilder2(buildMaterialHints) },
|
|
12051
|
+
{ key: "animal", kind: "ids", surface: "both", maxPicks: 1, render: perId2(getAnimalPromptHint, getAnimalTerm) }
|
|
11767
12052
|
];
|
|
11768
|
-
var
|
|
11769
|
-
var
|
|
11770
|
-
var
|
|
11771
|
-
|
|
11772
|
-
|
|
12053
|
+
var SUBJECT_FOLD_KEYS = SUBJECT_FIELDS.map((f) => f.key);
|
|
12054
|
+
var IDS_ROWS = SUBJECT_FIELDS.filter((f) => f.kind === "ids");
|
|
12055
|
+
var SUBJECT_CUSTOM_AGE_KEY = "customAge";
|
|
12056
|
+
var CUSTOM_AGE_MIN = 0;
|
|
12057
|
+
var CUSTOM_AGE_MAX = 120;
|
|
12058
|
+
var SUBJECT_KEYS = [
|
|
12059
|
+
...PERSON_DIMENSION_ORDER.map((d) => PERSON_FIELD_BY_DIMENSION[d]),
|
|
12060
|
+
SUBJECT_CUSTOM_AGE_KEY,
|
|
12061
|
+
...STYLING_DIMENSION_ORDER.map((d) => STYLING_FIELD_BY_DIMENSION[d]),
|
|
12062
|
+
...IDS_ROWS.map((f) => f.key)
|
|
12063
|
+
];
|
|
12064
|
+
function getRegisteredSubjectKeys() {
|
|
12065
|
+
const fieldByDimension = getRegisteredPersonFieldByDimension();
|
|
12066
|
+
const personFields = [];
|
|
12067
|
+
for (const dimension of getRegisteredPersonDimensionOrder()) {
|
|
12068
|
+
const field = fieldByDimension[dimension];
|
|
12069
|
+
if (field) personFields.push(field);
|
|
12070
|
+
}
|
|
12071
|
+
return [
|
|
12072
|
+
...personFields,
|
|
12073
|
+
SUBJECT_CUSTOM_AGE_KEY,
|
|
12074
|
+
...STYLING_DIMENSION_ORDER.map((d) => STYLING_FIELD_BY_DIMENSION[d]),
|
|
12075
|
+
...IDS_ROWS.map((f) => f.key)
|
|
12076
|
+
];
|
|
11773
12077
|
}
|
|
11774
|
-
var
|
|
11775
|
-
var
|
|
11776
|
-
|
|
12078
|
+
var SUBJECT_IMAGE_HINT_MODE_DEFAULT = "full";
|
|
12079
|
+
var SUBJECT_VIDEO_HINT_MODE_DEFAULT = "compact";
|
|
12080
|
+
var SUBJECT_ARRAY_CEILING = DIRECTION_ARRAY_CEILING;
|
|
12081
|
+
var SUBJECT_ID_MAX_CHARS = DIRECTION_ID_MAX_CHARS;
|
|
12082
|
+
var MAX_SUBJECT_KEYS = 128;
|
|
12083
|
+
var SUBJECT_KEY_MAX_CHARS = 64;
|
|
12084
|
+
function normalizeIds(value, maxPicks) {
|
|
11777
12085
|
const ids = [];
|
|
11778
12086
|
if (typeof value === "string") {
|
|
11779
12087
|
if (value) ids.push(value);
|
|
@@ -11785,22 +12093,54 @@ function normalizeDirectionIds(value, maxPicks) {
|
|
|
11785
12093
|
}
|
|
11786
12094
|
return ids.slice(0, maxPicks);
|
|
11787
12095
|
}
|
|
11788
|
-
function
|
|
11789
|
-
|
|
12096
|
+
function limitByField() {
|
|
12097
|
+
const out = /* @__PURE__ */ new Map();
|
|
12098
|
+
const personFieldByDimension = getRegisteredPersonFieldByDimension();
|
|
12099
|
+
for (const dimension of getRegisteredPersonDimensionOrder()) {
|
|
12100
|
+
const field = personFieldByDimension[dimension];
|
|
12101
|
+
if (field) out.set(field, getPersonDimensionLimit(dimension));
|
|
12102
|
+
}
|
|
12103
|
+
for (const dimension of STYLING_DIMENSION_ORDER) {
|
|
12104
|
+
out.set(
|
|
12105
|
+
STYLING_FIELD_BY_DIMENSION[dimension],
|
|
12106
|
+
getStylingDimensionLimit(dimension)
|
|
12107
|
+
);
|
|
12108
|
+
}
|
|
12109
|
+
for (const row of IDS_ROWS) out.set(row.key, row.maxPicks);
|
|
12110
|
+
return out;
|
|
11790
12111
|
}
|
|
11791
|
-
function
|
|
11792
|
-
if (!
|
|
12112
|
+
function normalizeSubjectFields(subject) {
|
|
12113
|
+
if (!subject || typeof subject !== "object" || Array.isArray(subject)) return void 0;
|
|
12114
|
+
const src = subject;
|
|
12115
|
+
const limits = limitByField();
|
|
12116
|
+
const out = {};
|
|
12117
|
+
const rawAge = src[SUBJECT_CUSTOM_AGE_KEY];
|
|
12118
|
+
if (typeof rawAge === "number" && Number.isFinite(rawAge)) {
|
|
12119
|
+
out[SUBJECT_CUSTOM_AGE_KEY] = Math.max(
|
|
12120
|
+
CUSTOM_AGE_MIN,
|
|
12121
|
+
Math.min(CUSTOM_AGE_MAX, Math.round(rawAge))
|
|
12122
|
+
);
|
|
12123
|
+
}
|
|
12124
|
+
for (const [field, limit] of limits) {
|
|
12125
|
+
const ids = normalizeIds(src[field], limit);
|
|
12126
|
+
if (ids.length === 0) continue;
|
|
12127
|
+
out[field] = ids.length === 1 ? ids[0] : ids;
|
|
12128
|
+
}
|
|
12129
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
12130
|
+
}
|
|
12131
|
+
function subjectFieldsForSurface(surface) {
|
|
12132
|
+
return SUBJECT_FIELDS.filter((f) => f.surface === "both" || f.surface === surface);
|
|
12133
|
+
}
|
|
12134
|
+
function renderSubjectHints(subject, opts) {
|
|
12135
|
+
const bag = normalizeSubjectFields(subject);
|
|
12136
|
+
if (!bag) return [];
|
|
11793
12137
|
const mode = opts.mode ?? "full";
|
|
11794
12138
|
const out = [];
|
|
11795
12139
|
const seen = /* @__PURE__ */ new Set();
|
|
11796
|
-
for (const spec of
|
|
12140
|
+
for (const spec of SUBJECT_FIELDS) {
|
|
11797
12141
|
if (spec.surface !== "both" && spec.surface !== opts.surface) continue;
|
|
11798
|
-
const
|
|
11799
|
-
|
|
11800
|
-
spec.maxPicks
|
|
11801
|
-
);
|
|
11802
|
-
if (ids.length === 0) continue;
|
|
11803
|
-
for (const hint of spec.render(ids, modeForFamily(mode, spec.family))) {
|
|
12142
|
+
const hints = spec.kind === "group" ? spec.render(bag, mode) : spec.render(normalizeIds(bag[spec.key], spec.maxPicks), mode);
|
|
12143
|
+
for (const hint of hints) {
|
|
11804
12144
|
if (hint.length > 0 && !seen.has(hint)) {
|
|
11805
12145
|
seen.add(hint);
|
|
11806
12146
|
out.push(hint);
|
|
@@ -11810,11 +12150,15 @@ function renderDirectionHints(direction, opts) {
|
|
|
11810
12150
|
return out;
|
|
11811
12151
|
}
|
|
11812
12152
|
|
|
11813
|
-
// src/
|
|
11814
|
-
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
12153
|
+
// src/hint-shedding.ts
|
|
12154
|
+
function keepableDirectionHints(hintClauses, kept, deficit, clauseCosts) {
|
|
12155
|
+
let remaining = deficit;
|
|
12156
|
+
let next = kept;
|
|
12157
|
+
while (next > 0 && remaining > 0) {
|
|
12158
|
+
next -= 1;
|
|
12159
|
+
remaining -= clauseCosts?.[next] ?? hintClauses[next].length + PROMPT_HINT_SEPARATOR.length;
|
|
12160
|
+
}
|
|
12161
|
+
return next;
|
|
11818
12162
|
}
|
|
11819
12163
|
|
|
11820
12164
|
// src/ref-binding.ts
|
|
@@ -12166,9 +12510,7 @@ function resolveVideoReferenceCore(args) {
|
|
|
12166
12510
|
const lockBlock = lockLines.length > 0 ? `${lockLines.join("\n")}
|
|
12167
12511
|
|
|
12168
12512
|
` : "";
|
|
12169
|
-
|
|
12170
|
-
${trailingLines.join("\n")}` : "";
|
|
12171
|
-
finalPrompt = `${lockBlock}${finalPrompt}${trailingBlock}`;
|
|
12513
|
+
finalPrompt = `${lockBlock}${insertBeforeStyleSection(finalPrompt, trailingLines)}`;
|
|
12172
12514
|
} else {
|
|
12173
12515
|
const allFallbackLines = [...fallbackDirectiveLines, ...extraDirectiveLines];
|
|
12174
12516
|
if (allFallbackLines.length > 0) {
|
|
@@ -12402,17 +12744,34 @@ function assembleSunoInput(input) {
|
|
|
12402
12744
|
}
|
|
12403
12745
|
|
|
12404
12746
|
// src/assemble-image-input.ts
|
|
12405
|
-
function
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
12747
|
+
function renderImageHintPieces(subject, direction, structured) {
|
|
12748
|
+
return {
|
|
12749
|
+
hintClauses: [
|
|
12750
|
+
...asBodyClauses(
|
|
12751
|
+
renderSubjectHints(subject, {
|
|
12752
|
+
surface: "image",
|
|
12753
|
+
mode: SUBJECT_IMAGE_HINT_MODE_DEFAULT
|
|
12754
|
+
})
|
|
12755
|
+
),
|
|
12756
|
+
...partitionStyleClauses(direction, {
|
|
12757
|
+
surface: "image",
|
|
12758
|
+
mode: IMAGE_HINT_MODE_DEFAULT
|
|
12759
|
+
})
|
|
12760
|
+
].filter((c) => c.text.length > 0),
|
|
12761
|
+
structuredFragment: structured ? renderStructuredFields(structured) : ""
|
|
12762
|
+
};
|
|
12763
|
+
}
|
|
12764
|
+
function composePromptText(userPrompt, pieces, keptHintClauses) {
|
|
12765
|
+
return composeSectionedPrompt(
|
|
12766
|
+
userPrompt,
|
|
12767
|
+
pieces.hintClauses.slice(0, keptHintClauses),
|
|
12768
|
+
pieces.structuredFragment
|
|
12769
|
+
);
|
|
12411
12770
|
}
|
|
12412
12771
|
function assembleImageInput(input) {
|
|
12413
|
-
const
|
|
12414
|
-
const
|
|
12415
|
-
prompt,
|
|
12772
|
+
const pieces = renderImageHintPieces(input.subject, input.direction, input.structured);
|
|
12773
|
+
const assembleWith = (keptHintClauses) => buildImagePromptWithOverflow({
|
|
12774
|
+
prompt: composePromptText(input.userPrompt, pieces, keptHintClauses),
|
|
12416
12775
|
provider: input.provider,
|
|
12417
12776
|
...input.connectedReferences !== void 0 ? { connectedReferences: input.connectedReferences } : {},
|
|
12418
12777
|
// Manual uploads / direct refs ride the builder's reference-URL channel so
|
|
@@ -12435,6 +12794,21 @@ function assembleImageInput(input) {
|
|
|
12435
12794
|
...input.sourceNodeIdById !== void 0 ? { sourceNodeIdById: input.sourceNodeIdById } : {},
|
|
12436
12795
|
...input.skipCharacterMentions !== void 0 ? { skipCharacterMentions: input.skipCharacterMentions } : {}
|
|
12437
12796
|
});
|
|
12797
|
+
let kept = pieces.hintClauses.length;
|
|
12798
|
+
let fitted = assembleWith(kept);
|
|
12799
|
+
if (fitted.overflowChars > 0) {
|
|
12800
|
+
const costs = sectionedClauseCosts(
|
|
12801
|
+
input.userPrompt,
|
|
12802
|
+
pieces.hintClauses,
|
|
12803
|
+
pieces.structuredFragment
|
|
12804
|
+
);
|
|
12805
|
+
const texts = pieces.hintClauses.map((c) => c.text);
|
|
12806
|
+
while (fitted.overflowChars > 0 && kept > 0) {
|
|
12807
|
+
kept = keepableDirectionHints(texts, kept, fitted.overflowChars, costs);
|
|
12808
|
+
fitted = assembleWith(kept);
|
|
12809
|
+
}
|
|
12810
|
+
}
|
|
12811
|
+
const { overflowChars, ...result } = fitted;
|
|
12438
12812
|
if (input.throwOnEmpty && !result.prompt.trim()) {
|
|
12439
12813
|
throw new Error(
|
|
12440
12814
|
"No prompt \u2014 type one, bind a character, or pick a cinematography direction"
|
|
@@ -12445,15 +12819,35 @@ function assembleImageInput(input) {
|
|
|
12445
12819
|
|
|
12446
12820
|
// src/assemble-video-input.ts
|
|
12447
12821
|
function composeVideoPromptText(userPrompt, direction, structured, opts) {
|
|
12448
|
-
const
|
|
12449
|
-
...
|
|
12822
|
+
const hintClauses = [
|
|
12823
|
+
...asBodyClauses(
|
|
12824
|
+
renderSubjectHints(opts?.subject, {
|
|
12825
|
+
surface: "video",
|
|
12826
|
+
mode: opts?.subjectHintMode ?? SUBJECT_VIDEO_HINT_MODE_DEFAULT
|
|
12827
|
+
})
|
|
12828
|
+
),
|
|
12829
|
+
...partitionStyleClauses(direction, {
|
|
12450
12830
|
surface: "video",
|
|
12451
12831
|
mode: opts?.hintMode ?? VIDEO_HINT_MODE_DEFAULT
|
|
12452
|
-
})
|
|
12453
|
-
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12832
|
+
})
|
|
12833
|
+
].filter((c) => c.text.length > 0);
|
|
12834
|
+
const structuredFragment = structured ? renderStructuredFields(structured) : "";
|
|
12835
|
+
const composeWith = (kept2) => composeSectionedPrompt(userPrompt, hintClauses.slice(0, kept2), structuredFragment);
|
|
12836
|
+
const cap = opts?.cap;
|
|
12837
|
+
if (cap === void 0) return composeWith(hintClauses.length);
|
|
12838
|
+
const frame = opts?.frame ?? ((body2) => body2);
|
|
12839
|
+
let kept = hintClauses.length;
|
|
12840
|
+
let body = composeWith(kept);
|
|
12841
|
+
let framedLength = frame(body)?.length ?? 0;
|
|
12842
|
+
if (framedLength <= cap) return body;
|
|
12843
|
+
const costs = sectionedClauseCosts(userPrompt, hintClauses, structuredFragment);
|
|
12844
|
+
const texts = hintClauses.map((c) => c.text);
|
|
12845
|
+
while (framedLength > cap && kept > 0) {
|
|
12846
|
+
kept = keepableDirectionHints(texts, kept, framedLength - cap, costs);
|
|
12847
|
+
body = composeWith(kept);
|
|
12848
|
+
framedLength = frame(body)?.length ?? 0;
|
|
12849
|
+
}
|
|
12850
|
+
return body;
|
|
12457
12851
|
}
|
|
12458
12852
|
|
|
12459
12853
|
// src/read-node-direction.ts
|
|
@@ -12478,6 +12872,31 @@ function readDirectionFields(value) {
|
|
|
12478
12872
|
}
|
|
12479
12873
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
12480
12874
|
}
|
|
12875
|
+
function readSubjectFields(value) {
|
|
12876
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
|
|
12877
|
+
const src = value;
|
|
12878
|
+
const out = {};
|
|
12879
|
+
for (const key of getRegisteredSubjectKeys()) {
|
|
12880
|
+
const v = src[key];
|
|
12881
|
+
if (key === SUBJECT_CUSTOM_AGE_KEY) {
|
|
12882
|
+
if (typeof v === "number" && Number.isFinite(v)) out[key] = v;
|
|
12883
|
+
continue;
|
|
12884
|
+
}
|
|
12885
|
+
if (typeof v === "string") {
|
|
12886
|
+
if (v.length > 0 && v.length <= SUBJECT_ID_MAX_CHARS) out[key] = v;
|
|
12887
|
+
} else if (Array.isArray(v)) {
|
|
12888
|
+
const kept = [];
|
|
12889
|
+
for (const x of v) {
|
|
12890
|
+
if (kept.length >= SUBJECT_ARRAY_CEILING) break;
|
|
12891
|
+
if (typeof x === "string" && x.length > 0 && x.length <= SUBJECT_ID_MAX_CHARS) {
|
|
12892
|
+
kept.push(x);
|
|
12893
|
+
}
|
|
12894
|
+
}
|
|
12895
|
+
if (kept.length > 0) out[key] = kept;
|
|
12896
|
+
}
|
|
12897
|
+
}
|
|
12898
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
12899
|
+
}
|
|
12481
12900
|
var GENDERS = ["man", "woman", "child", "non-binary"];
|
|
12482
12901
|
var MAX_STRUCTURED_VALUE_CHARS = 200;
|
|
12483
12902
|
var PERSON_FIELDS2 = {
|
|
@@ -33742,6 +34161,6 @@ function buildSurroundFillPrompt(direction, userPrompt) {
|
|
|
33742
34161
|
return `${scene}This is a partial frame: the ${carried} portion contains real, finished pixels and the ${painted} portion is flat gray that MUST be painted in. Paint ONLY the ${painted} gray region as a natural, seamless continuation of the ${carried} portion \u2014 same scene, same perspective, continuing the horizon, geometry, and content across the boundary with no break. Keep the ${carried} portion completely unchanged. CRITICAL: do NOT change the lighting, exposure, white balance, or time of day. Match the ${carried} portion's EXACT light, color temperature, and contrast across the whole frame \u2014 if it is flat overcast daylight, keep flat overcast daylight. No golden hour, no sunset, no warm relight, no cinematic regrade. The seam between the ${carried} and ${painted} portions must be invisible. No people, no text, no labels, no watermarks.`;
|
|
33743
34162
|
}
|
|
33744
34163
|
|
|
33745
|
-
export { ACTION_FX, ACTION_FX_CATEGORY_LABELS, ACTION_FX_CATEGORY_ORDER, ACTION_FX_IDS, AESTHETICS, AESTHETIC_CATEGORY_LABELS, AESTHETIC_CATEGORY_ORDER, AESTHETIC_IDS, ALL_PICKER_WIRING, ANALYZABLE_PICKER_TYPES, ANGLE_LABELS, ASPECT_RATIO_LABELS, ATMOSPHERES, ATMOSPHERE_IDS, AUDIO_WIZARD_CATEGORIES, BACKDROPS, BACKDROP_CATEGORY_LABELS, BACKDROP_CATEGORY_ORDER, BACKDROP_IDS, BRAND_PRESETS, BRAND_PRESET_IDS, BRAND_PRESET_META, CAMERA_FORMATS, CAMERA_FORMAT_IDS, CAMERA_MOTIONS, CAMERA_MOTION_CATEGORY_LABELS, CAMERA_MOTION_CATEGORY_ORDER, CAMERA_MOTION_IDS, CHARACTER_FX, CHARACTER_FX_CATEGORY_LABELS, CHARACTER_FX_CATEGORY_ORDER, CHARACTER_FX_DURATIONS, CHARACTER_FX_IDS, CHARACTER_FX_INTENSITIES, CHARACTER_FX_POSITIONS, CINEMATIC_LOOK_TAIL, COLOR_LOOKS, COLOR_LOOK_CATEGORY_LABELS, COLOR_LOOK_CATEGORY_ORDER, COLOR_LOOK_IDS, COMPOSITION_EFFECTS, COMPOSITION_EFFECT_IDS, DEFAULT_IDENTITY_LOCK, DEFAULT_TEMPLATES, DIRECTION_ARRAY_CEILING, DIRECTION_FIELDS, DIRECTION_ID_MAX_CHARS, DIRECTION_KEYS, ERAS, ERA_CATEGORY_LABELS, ERA_CATEGORY_ORDER, ERA_IDS, EXPOSURE_CATEGORY_LABELS, EXPOSURE_CATEGORY_ORDER, EXPOSURE_FIELD_BY_CATEGORY, EXPOSURE_IDS, EXPOSURE_SETTINGS, FACTORY_PRESETS, FACTORY_SNIPPETS, FILM_STILL_PREFIX, FRAMINGS, FRAMING_CATEGORY_LABELS, FRAMING_CATEGORY_ORDER, FRAMING_FIELD_BY_CATEGORY, FRAMING_IDS, GAPS_SCHEMA, HELD_PROPS, HELD_PROP_CATEGORY_LABELS, HELD_PROP_CATEGORY_ORDER, HELD_PROP_IDS, IMAGE_HINT_MODE_DEFAULT, IMAGE_REFERENCE_PROMPT_DOCTRINE, IMAGE_WIZARD_CATEGORIES, INSTRUMENTATION_DEFAULT_DATA, INSTRUMENTS, INSTRUMENT_CATEGORY_LABELS, INSTRUMENT_CATEGORY_ORDER, LENSES, LENS_IDS, LIGHTINGS, LIGHTING_CATEGORY_LABELS, LIGHTING_CATEGORY_ORDER, LIGHTING_FIELD_BY_CATEGORY, LIGHTING_IDS, LLM_CHAT_WIZARD_CATEGORIES, LOOP_SUBJECTS, LOOP_SUBJECT_CATEGORY_LABELS, LOOP_SUBJECT_CATEGORY_ORDER, MATERIALS, MATERIAL_CATEGORY_LABELS, MATERIAL_CATEGORY_ORDER, MATERIAL_IDS, MAX_SELECTED_BY_DIMENSION, MAX_SELECTED_BY_FRAMING_CATEGORY, MAX_SELECTED_BY_STYLING_DIMENSION, MOODS, MOOD_CATEGORY_LABELS, MOOD_CATEGORY_ORDER, MOOD_IDS, MOVEMENT_LABELS, MULTI_PICKER_WIRING, MUSIC_EMOTIONS, MUSIC_ENERGIES, MUSIC_ERAS, MUSIC_GENRES, MUSIC_GENRE_CATEGORY_LABELS, MUSIC_GENRE_CATEGORY_ORDER, MUSIC_GENRE_DEFAULT_DATA, MUSIC_MOOD_DEFAULT_DATA, MUSIC_VIBES, MUSIC_WIZARD_CATEGORIES, NODE_PROMPT_CANDIDATE_FIELDS, NODE_PROMPT_FIELDS, OBJECT_ANGLE_PRESETS, OBJECT_ANGLE_PROMPTS, OBJECT_ASSET_PRESETS, OBJECT_ASSET_PROMPTS, OBJECT_MATERIAL_PRESETS, OBJECT_MATERIAL_PROMPTS, OBJECT_VARIATION_PRESETS, OBJECT_VARIATION_PROMPTS, PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, PERSON_DIMENSION_SECTIONS, PERSON_FIELD_BY_DIMENSION, PERSON_IDS, PHOTOGRAPHERS, PHOTOGRAPHER_CATEGORY_LABELS, PHOTOGRAPHER_CATEGORY_ORDER, PHOTOGRAPHER_IDS, PHOTO_GENRES, PHOTO_GENRE_CATEGORY_LABELS, PHOTO_GENRE_CATEGORY_ORDER, PHOTO_GENRE_IDS, PICKER_ANALYZER_FAMILIES, PICKER_ANALYZER_REGISTRY, PICKER_CATALOGS, PICKER_TYPES, POSES, POSE_CATEGORY_LABELS, POSE_CATEGORY_ORDER, POSE_IDS, POST_PROCESS_EFFECTS, POST_PROCESS_EFFECT_IDS, PRODUCTION_STYLES, PROMPT_AFFIX_CORE_FIELD_OVERRIDES, PROMPT_AFFIX_NODE_TYPES, PROMPT_HINT_SEPARATOR, PROVIDER_CAPABILITIES, PROVIDER_PROMPT_DOCTRINES, REFERENCE_IMAGE_ROLES, REFERENCE_RULES, REFERENCE_RULES_MULTI_PERSON, REF_BINDING, RENDER_QUALITIES, RENDER_QUALITY_IDS, SCENE_FRAME_RULE, SCENE_PROMPT_MAX_LENGTH, SETTINGS, SETTING_CATEGORY_LABELS, SETTING_IDS, SHOT_LABELS, SINGING_STYLES, SINGLE_PICKER_WIRING, SNIPPET_MEDIA_VALUES, STYLES, STYLE_IDS, STYLE_PRESETS, STYLINGS, STYLING_DIMENSION_LABELS, STYLING_DIMENSION_ORDER, STYLING_FIELD_BY_DIMENSION, STYLING_IDS, TEMPORALS, TEMPORAL_CATEGORY_LABELS, TEMPORAL_CATEGORY_ORDER, TEMPORAL_FIELD_BY_CATEGORY, TEMPORAL_IDS, TERM_MAX_CHARS, TEXT_WIZARD_CATEGORIES, TRANSITIONS, TRANSITION_CATEGORY_LABELS, TRANSITION_CATEGORY_ORDER, TRANSITION_DURATIONS, TRANSITION_IDS, TRANSITION_INTENSITIES, TRANSITION_POSITIONS, VIDEO_HINT_MODE_DEFAULT, VIDEO_WIZARD_CATEGORIES, VOCAL_PRESENCE, VOCAL_PRESENCE_INSTRUMENTAL_ID, VOICE_ACCENTS, VOICE_AGES, VOICE_ARCHETYPES, VOICE_CHARACTER_DEFAULT_DATA, VOICE_DELIVERY_DEFAULT_DATA, VOICE_EMOTIONS, VOICE_GENDERS, VOICE_LANGUAGES, VOICE_PACES, VOICE_TIMBRES, WARDROBE, WARDROBE_CATEGORY_LABELS, WARDROBE_DIMENSION_ORDER, WARDROBE_FIELD_BY_DIMENSION, appendField, appendMusicMeta, applyPickerJson, applyPromptAffixes, applyReferenceOrderToVideo, applyTemplate, assembleImageInput, assembleSunoInput, buildActionFxHints, buildActionFxTerms, buildAestheticHints, buildAestheticTerms, buildAgeHint, buildAtmosphereHints, buildAtmosphereTerms, buildCharacterPrompt, buildCreaturePrompt, buildExposureHints, buildExposureTerms, buildFaceTemplateInputs, buildFramingHints, buildFramingTerms, buildHeldPropHints, buildHeldPropTerms, buildIdentityDirectives, buildIdentityLockLine, buildImagePrompt, buildImagePromptSegments, buildInstrumentationHints, buildInstrumentationTerms, buildLightingHints, buildLightingTerms, buildLocationMotionPrompt, buildLocationPrompt, buildLocationRefinePrompt, buildMaterialHints, buildMaterialTerms, buildMoodHints, buildMoodTerms, buildMotionPrompt, buildMultiPickerAnalyzerSpec, buildMusicGenreHints, buildMusicGenreTerms, buildMusicMoodHints, buildMusicMoodTerms, buildObjectMotionPrompt, buildObjectPrompt, buildPersonHints, buildPersonTerms, buildPhotographerHints, buildPhotographerTerms, buildPickerAnalyzerSpec, buildPickerLegend, buildPickerZodSchema, buildPoseHints, buildPoseTerms, buildPostProcessHints, buildPostProcessTerms, buildReferenceBlocks, buildScenePrompt, buildStylingHints, buildStylingTerms, buildSurroundFillPrompt, buildTemporalHints, buildTemporalTerms, buildVoiceCharacterHints, buildVoiceCharacterTerms, buildVoiceDeliveryHints, buildVoiceDeliveryTerms, buildWardrobeHints, catalogPacksVersion, characterLockToRefLock, collectIdentityLockClause, composeCameraMotionHintFromConnections, composeCameraMotionTermFromConnections, composeCharacterFxHintFromConnections, composeNegative, composePickerCatalogs, composeSoundHintFromConnections, composeTransitionHintFromConnections, composeVideoPromptText, computeLlmChatFields, computeNodePrompt, computePackSidecarCoverage, deriveTerm, directionFieldsForSurface, expandImagePositionRefs, expandImageRefTokens, filmStillPrefix, getActionFx, getActionFxLabel, getActionFxPromptHint, getActionFxTerm, getAesthetic, getAestheticLabel, getAestheticPromptHint, getAestheticTerm, getAtmosphere, getAtmosphereLabel, getAtmospherePromptHint, getAtmosphereTerm, getBackdrop, getBackdropLabel, getBackdropPromptHint, getBackdropTerm, getCameraFormat, getCameraFormatLabel, getCameraFormatPromptHint, getCameraFormatTerm, getCameraMotion, getCameraMotionLabel, getCameraMotionPromptHint, getCameraMotionTerm, getCategoriesForNodeType, getCharacterFx, getCharacterFxLabel, getCharacterFxPromptHint, getCharacterFxTerm, getColorLook, getColorLookLabel, getColorLookPromptHint, getColorLookTerm, getCompositionEffect, getCompositionEffectLabel, getCompositionEffectPromptHint, getCompositionEffectTerm, getEffectiveSunoCustomMode, getEra, getEraLabel, getEraPromptHint, getEraTerm, getExposure, getExposureLabel, getExposurePromptHint, getExposureTerm, getFactoryPresets, getFactorySnippets, getFraming, getFramingCategoryLimit, getFramingLabel, getFramingPromptHint, getFramingTerm, getHeldProp, getHeldPropLabel, getHeldPropPromptHint, getHeldPropTerm, getIdentityLockClause, getInstrument, getInstrumentTerm, getLens, getLensLabel, getLensPromptHint, getLensTerm, getLighting, getLightingLabel, getLightingPromptHint, getLightingTerm, getLoopSubject, getLoopSubjectLabel, getLoopSubjectPromptHint, getLoopSubjectTerm, getMaterial, getMaterialLabel, getMaterialPromptHint, getMaterialTerm, getMood, getMoodLabel, getMoodPromptHint, getMoodTerm, getMusicEmotion, getMusicEmotionTerm, getMusicEnergy, getMusicEnergyTerm, getMusicEra, getMusicEraTerm, getMusicGenre, getMusicGenreLabel, getMusicGenreTerm, getMusicSubgenre, getMusicSubgenreTerm, getMusicVibe, getMusicVibeTerm, getParameterPromptHint, getPerson, getPersonDimensionLimit, getPersonLabel, getPersonPromptHint, getPersonTerm, getPhotoGenre, getPhotoGenreLabel, getPhotoGenrePromptHint, getPhotoGenreTerm, getPhotographer, getPhotographerLabel, getPhotographerPromptHint, getPhotographerTerm, getPickerAnalyzer, getPickerCatalog, getPickerWiring, getPose, getPoseLabel, getPosePromptHint, getPoseTerm, getPostProcessEffect, getPostProcessEffectLabel, getPostProcessEffectPromptHint, getPostProcessEffectTerm, getProductionStyle, getProductionStyleTerm, getPromptDoctrine, getPromptFields, getPromptTips, getRegisteredCatalogPacks, getRegisteredPeople, getRegisteredPersonDimensionLabels, getRegisteredPersonDimensionOrder, getRegisteredPersonFieldByDimension, getRegisteredPickerCatalogs, getRenderQuality, getRenderQualityLabel, getRenderQualityPromptHint, getRenderQualityTerm, getSetting, getSettingLabel, getSettingPromptHint, getSettingTerm, getSingingStyle, getSingingStyleTerm, getSnippetMedia, getStyle, getStyleLabel, getStylePreset, getStylePromptHint, getStyleTerm, getStyling, getStylingDimensionLimit, getStylingLabel, getStylingPromptHint, getStylingTerm, getTemporal, getTemporalLabel, getTemporalPromptHint, getTemporalTerm, getTransition, getTransitionLabel, getTransitionPromptHint, getTransitionTerm, getVocalPresence, getVocalPresenceTerm, getVoiceAccent, getVoiceAccentTerm, getVoiceAge, getVoiceAgeTerm, getVoiceArchetype, getVoiceArchetypeTerm, getVoiceEmotion, getVoiceEmotionTerm, getVoiceGender, getVoiceGenderTerm, getVoiceLanguage, getVoiceLanguageTerm, getVoicePace, getVoicePaceTerm, getVoiceTimbre, getVoiceTimbreTerm, getWardrobeEntriesByDimension, getWardrobeEntry, getWardrobePromptHint, groupFactoryPresets, hasUpstreamCharacter, identityRefsSentence, isAnalyzablePicker, isInstrumentalVocal, isSuspiciousDerivedTerm, isVantageFraming, isWizardSupported, joinPromptHints, joinPromptParts, listPickerCatalogs, migratePersonValue, modeForFamily, nodeHasInlinePrompt, nodeHasPromptField, nodeSupportsPromptAffixes, personPacksVersion, pickerFanoutTargets, projectAllCatalogs, projectPickerCatalog, promptAffixCoreField, promptBindsFirstFrame, promptFieldCarriesAffixes, promptPartSeparator, readDirectionFields, readStructuredFields, referenceRulesBlock, registerCatalogPack, registerPersonPack, renderDirectionHints, renderStructuredFields, resetCatalogPacks, resetPersonPacks, resolveBrandInput, resolveCharacterMentions, resolveGeminiOmniI2vInputs, resolveLocationMentions, resolvePrompt, resolveRefIdTokens, resolveReferenceTokens, resolveSeedance2Inputs, resolveTemplate, resolveTerm, resolveVeoI2vInputs, resolveVideoReferenceCore, summarizePickerCatalogs, toIdentityLockMode, truncateForField, truncateText, withForcedIdentityLock };
|
|
34164
|
+
export { ACTION_FX, ACTION_FX_CATEGORY_LABELS, ACTION_FX_CATEGORY_ORDER, ACTION_FX_IDS, AESTHETICS, AESTHETIC_CATEGORY_LABELS, AESTHETIC_CATEGORY_ORDER, AESTHETIC_IDS, ALL_PICKER_WIRING, ANALYZABLE_PICKER_TYPES, ANGLE_LABELS, ASPECT_RATIO_LABELS, ATMOSPHERES, ATMOSPHERE_IDS, AUDIO_WIZARD_CATEGORIES, BACKDROPS, BACKDROP_CATEGORY_LABELS, BACKDROP_CATEGORY_ORDER, BACKDROP_IDS, BRAND_PRESETS, BRAND_PRESET_IDS, BRAND_PRESET_META, CAMERA_FORMATS, CAMERA_FORMAT_IDS, CAMERA_MOTIONS, CAMERA_MOTION_CATEGORY_LABELS, CAMERA_MOTION_CATEGORY_ORDER, CAMERA_MOTION_IDS, CHARACTER_FX, CHARACTER_FX_CATEGORY_LABELS, CHARACTER_FX_CATEGORY_ORDER, CHARACTER_FX_DURATIONS, CHARACTER_FX_IDS, CHARACTER_FX_INTENSITIES, CHARACTER_FX_POSITIONS, CINEMATIC_LOOK_TAIL, COLOR_LOOKS, COLOR_LOOK_CATEGORY_LABELS, COLOR_LOOK_CATEGORY_ORDER, COLOR_LOOK_IDS, COMPOSITION_EFFECTS, COMPOSITION_EFFECT_IDS, DEFAULT_IDENTITY_LOCK, DEFAULT_TEMPLATES, DIRECTION_ARRAY_CEILING, DIRECTION_FIELDS, DIRECTION_ID_MAX_CHARS, DIRECTION_KEYS, ERAS, ERA_CATEGORY_LABELS, ERA_CATEGORY_ORDER, ERA_IDS, EXPOSURE_CATEGORY_LABELS, EXPOSURE_CATEGORY_ORDER, EXPOSURE_FIELD_BY_CATEGORY, EXPOSURE_IDS, EXPOSURE_SETTINGS, FACTORY_PRESETS, FACTORY_SNIPPETS, FILM_STILL_PREFIX, FILM_STYLE_KEYS, FRAMINGS, FRAMING_CATEGORY_LABELS, FRAMING_CATEGORY_ORDER, FRAMING_FIELD_BY_CATEGORY, FRAMING_IDS, GAPS_SCHEMA, HELD_PROPS, HELD_PROP_CATEGORY_LABELS, HELD_PROP_CATEGORY_ORDER, HELD_PROP_IDS, IMAGE_HINT_MODE_DEFAULT, IMAGE_REFERENCE_PROMPT_DOCTRINE, IMAGE_WIZARD_CATEGORIES, INSTRUMENTATION_DEFAULT_DATA, INSTRUMENTS, INSTRUMENT_CATEGORY_LABELS, INSTRUMENT_CATEGORY_ORDER, LENSES, LENS_IDS, LIGHTINGS, LIGHTING_CATEGORY_LABELS, LIGHTING_CATEGORY_ORDER, LIGHTING_FIELD_BY_CATEGORY, LIGHTING_IDS, LLM_CHAT_WIZARD_CATEGORIES, LOOP_SUBJECTS, LOOP_SUBJECT_CATEGORY_LABELS, LOOP_SUBJECT_CATEGORY_ORDER, MATERIALS, MATERIAL_CATEGORY_LABELS, MATERIAL_CATEGORY_ORDER, MATERIAL_IDS, MAX_SELECTED_BY_DIMENSION, MAX_SELECTED_BY_FRAMING_CATEGORY, MAX_SELECTED_BY_STYLING_DIMENSION, MAX_SUBJECT_KEYS, MOODS, MOOD_CATEGORY_LABELS, MOOD_CATEGORY_ORDER, MOOD_IDS, MOVEMENT_LABELS, MULTI_PICKER_WIRING, MUSIC_EMOTIONS, MUSIC_ENERGIES, MUSIC_ERAS, MUSIC_GENRES, MUSIC_GENRE_CATEGORY_LABELS, MUSIC_GENRE_CATEGORY_ORDER, MUSIC_GENRE_DEFAULT_DATA, MUSIC_MOOD_DEFAULT_DATA, MUSIC_VIBES, MUSIC_WIZARD_CATEGORIES, NODE_PROMPT_CANDIDATE_FIELDS, NODE_PROMPT_FIELDS, OBJECT_ANGLE_PRESETS, OBJECT_ANGLE_PROMPTS, OBJECT_ASSET_PRESETS, OBJECT_ASSET_PROMPTS, OBJECT_MATERIAL_PRESETS, OBJECT_MATERIAL_PROMPTS, OBJECT_VARIATION_PRESETS, OBJECT_VARIATION_PROMPTS, PEOPLE, PERSON_DIMENSION_LABELS, PERSON_DIMENSION_ORDER, PERSON_DIMENSION_SECTIONS, PERSON_FIELD_BY_DIMENSION, PERSON_IDS, PHOTOGRAPHERS, PHOTOGRAPHER_CATEGORY_LABELS, PHOTOGRAPHER_CATEGORY_ORDER, PHOTOGRAPHER_IDS, PHOTO_GENRES, PHOTO_GENRE_CATEGORY_LABELS, PHOTO_GENRE_CATEGORY_ORDER, PHOTO_GENRE_IDS, PICKER_ANALYZER_FAMILIES, PICKER_ANALYZER_REGISTRY, PICKER_CATALOGS, PICKER_TYPES, POSES, POSE_CATEGORY_LABELS, POSE_CATEGORY_ORDER, POSE_IDS, POST_PROCESS_EFFECTS, POST_PROCESS_EFFECT_IDS, PRODUCTION_STYLES, PROMPT_AFFIX_CORE_FIELD_OVERRIDES, PROMPT_AFFIX_NODE_TYPES, PROMPT_HINT_SEPARATOR, PROVIDER_CAPABILITIES, PROVIDER_PROMPT_DOCTRINES, REFERENCE_IMAGE_ROLES, REFERENCE_RULES, REFERENCE_RULES_MULTI_PERSON, REF_BINDING, RENDER_QUALITIES, RENDER_QUALITY_IDS, SCENE_FRAME_RULE, SCENE_PROMPT_MAX_LENGTH, SETTINGS, SETTING_CATEGORY_LABELS, SETTING_IDS, SHOT_LABELS, SINGING_STYLES, SINGLE_PICKER_WIRING, SNIPPET_MEDIA_VALUES, STYLES, STYLE_IDS, STYLE_PRESETS, STYLE_SECTION_GAP, STYLE_SECTION_HEADER, STYLINGS, STYLING_DIMENSION_LABELS, STYLING_DIMENSION_ORDER, STYLING_FIELD_BY_DIMENSION, STYLING_IDS, SUBJECT_ARRAY_CEILING, SUBJECT_CUSTOM_AGE_KEY, SUBJECT_FIELDS, SUBJECT_FOLD_KEYS, SUBJECT_ID_MAX_CHARS, SUBJECT_IMAGE_HINT_MODE_DEFAULT, SUBJECT_KEYS, SUBJECT_KEY_MAX_CHARS, SUBJECT_VIDEO_HINT_MODE_DEFAULT, TEMPORALS, TEMPORAL_CATEGORY_LABELS, TEMPORAL_CATEGORY_ORDER, TEMPORAL_FIELD_BY_CATEGORY, TEMPORAL_IDS, TERM_MAX_CHARS, TEXT_WIZARD_CATEGORIES, TRANSITIONS, TRANSITION_CATEGORY_LABELS, TRANSITION_CATEGORY_ORDER, TRANSITION_DURATIONS, TRANSITION_IDS, TRANSITION_INTENSITIES, TRANSITION_POSITIONS, VIDEO_HINT_MODE_DEFAULT, VIDEO_WIZARD_CATEGORIES, VOCAL_PRESENCE, VOCAL_PRESENCE_INSTRUMENTAL_ID, VOICE_ACCENTS, VOICE_AGES, VOICE_ARCHETYPES, VOICE_CHARACTER_DEFAULT_DATA, VOICE_DELIVERY_DEFAULT_DATA, VOICE_EMOTIONS, VOICE_GENDERS, VOICE_LANGUAGES, VOICE_PACES, VOICE_TIMBRES, WARDROBE, WARDROBE_CATEGORY_LABELS, WARDROBE_DIMENSION_ORDER, WARDROBE_FIELD_BY_DIMENSION, appendField, appendMusicMeta, applyPickerJson, applyPromptAffixes, applyReferenceOrderToVideo, applyTemplate, asBodyClauses, assembleImageInput, assembleSunoInput, buildActionFxHints, buildActionFxTerms, buildAestheticHints, buildAestheticTerms, buildAgeHint, buildAtmosphereHints, buildAtmosphereTerms, buildCharacterPrompt, buildCreaturePrompt, buildExposureHints, buildExposureTerms, buildFaceTemplateInputs, buildFramingHints, buildFramingTerms, buildHeldPropHints, buildHeldPropTerms, buildIdentityDirectives, buildIdentityLockLine, buildImagePrompt, buildImagePromptSegments, buildImagePromptWithOverflow, buildInstrumentationHints, buildInstrumentationTerms, buildLightingHints, buildLightingTerms, buildLocationMotionPrompt, buildLocationPrompt, buildLocationRefinePrompt, buildMaterialHints, buildMaterialTerms, buildMoodHints, buildMoodTerms, buildMotionPrompt, buildMultiPickerAnalyzerSpec, buildMusicGenreHints, buildMusicGenreTerms, buildMusicMoodHints, buildMusicMoodTerms, buildObjectMotionPrompt, buildObjectPrompt, buildPersonHints, buildPersonTerms, buildPhotographerHints, buildPhotographerTerms, buildPickerAnalyzerSpec, buildPickerLegend, buildPickerZodSchema, buildPoseHints, buildPoseTerms, buildPostProcessHints, buildPostProcessTerms, buildReferenceBlocks, buildScenePrompt, buildStylingHints, buildStylingTerms, buildSurroundFillPrompt, buildTemporalHints, buildTemporalTerms, buildVoiceCharacterHints, buildVoiceCharacterTerms, buildVoiceDeliveryHints, buildVoiceDeliveryTerms, buildWardrobeHints, catalogPacksVersion, characterLockToRefLock, collectIdentityLockClause, composeCameraMotionHintFromConnections, composeCameraMotionTermFromConnections, composeCharacterFxHintFromConnections, composeNegative, composePickerCatalogs, composeSectionedPrompt, composeSoundHintFromConnections, composeTransitionHintFromConnections, composeVideoPromptText, computeLlmChatFields, computeNodePrompt, computePackSidecarCoverage, deriveTerm, directionFieldsForSurface, endsInsideStyleSection, expandImagePositionRefs, expandImageRefTokens, filmStillPrefix, getActionFx, getActionFxLabel, getActionFxPromptHint, getActionFxTerm, getAesthetic, getAestheticLabel, getAestheticPromptHint, getAestheticTerm, getAtmosphere, getAtmosphereLabel, getAtmospherePromptHint, getAtmosphereTerm, getBackdrop, getBackdropLabel, getBackdropPromptHint, getBackdropTerm, getCameraFormat, getCameraFormatLabel, getCameraFormatPromptHint, getCameraFormatTerm, getCameraMotion, getCameraMotionLabel, getCameraMotionPromptHint, getCameraMotionTerm, getCategoriesForNodeType, getCharacterFx, getCharacterFxLabel, getCharacterFxPromptHint, getCharacterFxTerm, getColorLook, getColorLookLabel, getColorLookPromptHint, getColorLookTerm, getCompositionEffect, getCompositionEffectLabel, getCompositionEffectPromptHint, getCompositionEffectTerm, getEffectiveSunoCustomMode, getEra, getEraLabel, getEraPromptHint, getEraTerm, getExposure, getExposureLabel, getExposurePromptHint, getExposureTerm, getFactoryPresets, getFactorySnippets, getFraming, getFramingCategoryLimit, getFramingLabel, getFramingPromptHint, getFramingTerm, getHeldProp, getHeldPropLabel, getHeldPropPromptHint, getHeldPropTerm, getIdentityLockClause, getInstrument, getInstrumentTerm, getLens, getLensLabel, getLensPromptHint, getLensTerm, getLighting, getLightingLabel, getLightingPromptHint, getLightingTerm, getLoopSubject, getLoopSubjectLabel, getLoopSubjectPromptHint, getLoopSubjectTerm, getMaterial, getMaterialLabel, getMaterialPromptHint, getMaterialTerm, getMood, getMoodLabel, getMoodPromptHint, getMoodTerm, getMusicEmotion, getMusicEmotionTerm, getMusicEnergy, getMusicEnergyTerm, getMusicEra, getMusicEraTerm, getMusicGenre, getMusicGenreLabel, getMusicGenreTerm, getMusicSubgenre, getMusicSubgenreTerm, getMusicVibe, getMusicVibeTerm, getParameterPromptHint, getPerson, getPersonDimensionLimit, getPersonLabel, getPersonPromptHint, getPersonTerm, getPhotoGenre, getPhotoGenreLabel, getPhotoGenrePromptHint, getPhotoGenreTerm, getPhotographer, getPhotographerLabel, getPhotographerPromptHint, getPhotographerTerm, getPickerAnalyzer, getPickerCatalog, getPickerWiring, getPose, getPoseLabel, getPosePromptHint, getPoseTerm, getPostProcessEffect, getPostProcessEffectLabel, getPostProcessEffectPromptHint, getPostProcessEffectTerm, getProductionStyle, getProductionStyleTerm, getPromptDoctrine, getPromptFields, getPromptTips, getRegisteredCatalogPacks, getRegisteredPeople, getRegisteredPersonDimensionLabels, getRegisteredPersonDimensionOrder, getRegisteredPersonFieldByDimension, getRegisteredPickerCatalogs, getRegisteredSubjectKeys, getRenderQuality, getRenderQualityLabel, getRenderQualityPromptHint, getRenderQualityTerm, getSetting, getSettingLabel, getSettingPromptHint, getSettingTerm, getSingingStyle, getSingingStyleTerm, getSnippetMedia, getStyle, getStyleLabel, getStylePreset, getStylePromptHint, getStyleTerm, getStyling, getStylingDimensionLimit, getStylingLabel, getStylingPromptHint, getStylingTerm, getTemporal, getTemporalLabel, getTemporalPromptHint, getTemporalTerm, getTransition, getTransitionLabel, getTransitionPromptHint, getTransitionTerm, getVocalPresence, getVocalPresenceTerm, getVoiceAccent, getVoiceAccentTerm, getVoiceAge, getVoiceAgeTerm, getVoiceArchetype, getVoiceArchetypeTerm, getVoiceEmotion, getVoiceEmotionTerm, getVoiceGender, getVoiceGenderTerm, getVoiceLanguage, getVoiceLanguageTerm, getVoicePace, getVoicePaceTerm, getVoiceTimbre, getVoiceTimbreTerm, getWardrobeEntriesByDimension, getWardrobeEntry, getWardrobePromptHint, groupFactoryPresets, hasUpstreamCharacter, identityRefsSentence, insertBeforeStyleSection, isAnalyzablePicker, isInstrumentalVocal, isSuspiciousDerivedTerm, isVantageFraming, isWizardSupported, joinPromptHints, joinPromptParts, keepableDirectionHints, listPickerCatalogs, migratePersonValue, modeForFamily, nodeHasInlinePrompt, nodeHasPromptField, nodeSupportsPromptAffixes, normalizeSubjectFields, partitionStyleClauses, personPacksVersion, pickerFanoutTargets, projectAllCatalogs, projectPickerCatalog, promptAffixCoreField, promptBindsFirstFrame, promptFieldCarriesAffixes, promptPartSeparator, readDirectionFields, readStructuredFields, readSubjectFields, referenceRulesBlock, registerCatalogPack, registerPersonPack, renderDirectionHintClauses, renderDirectionHints, renderStructuredFields, renderStyleSection, renderSubjectHints, resetCatalogPacks, resetPersonPacks, resolveBrandInput, resolveCharacterMentions, resolveGeminiOmniI2vInputs, resolveLocationMentions, resolvePrompt, resolveRefIdTokens, resolveReferenceTokens, resolveSeedance2Inputs, resolveTemplate, resolveTerm, resolveVeoI2vInputs, resolveVideoReferenceCore, sectionedClauseCosts, splitStyleSection, styleSectionFromClauses, styleSlotFor, subjectFieldsForSurface, summarizePickerCatalogs, toIdentityLockMode, truncateForField, truncateText, withForcedIdentityLock };
|
|
33746
34165
|
//# sourceMappingURL=index.js.map
|
|
33747
34166
|
//# sourceMappingURL=index.js.map
|