@nodaro/prompts 1.17.1 → 1.18.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 +123 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +207 -1
- package/dist/index.d.ts +207 -1
- package/dist/index.js +109 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/node-prompt-fields.test.ts +3 -2
- package/src/__tests__/scene3d-reference-doctrine.test.ts +142 -0
- package/src/index.ts +1 -0
- package/src/node-prompt-fields.ts +1 -0
- package/src/prompt-wizard-categories.ts +6 -0
- package/src/scene3d-reference-doctrine.ts +312 -0
package/dist/index.cjs
CHANGED
|
@@ -29071,6 +29071,107 @@ var IMAGE_REFERENCE_PROMPT_DOCTRINE = {
|
|
|
29071
29071
|
- Person+face composition intermittently trips provider content filters ("Content policy violation"). Keep wording neutral (no glamor/body emphasis), and on a rejection rephrase the glue words or swap provider rather than retrying unchanged.`
|
|
29072
29072
|
};
|
|
29073
29073
|
|
|
29074
|
+
// src/scene3d-reference-doctrine.ts
|
|
29075
|
+
var SCENE3D_LAYOUT_SCOPING_MARKER = "LAYOUT reference only";
|
|
29076
|
+
var SCENE3D_LAYOUT_SCOPING_FOR = {
|
|
29077
|
+
/** Always: where the subjects are and what is in front of what. */
|
|
29078
|
+
layout: "its subject positions and blocking",
|
|
29079
|
+
occlusion: "its foreground occlusion",
|
|
29080
|
+
framing: "its framing",
|
|
29081
|
+
cameraAngle: "its camera angle",
|
|
29082
|
+
/** Clips only. */
|
|
29083
|
+
cameraMotion: "its camera motion",
|
|
29084
|
+
timing: "its timing",
|
|
29085
|
+
/** Clips with more than one shot. */
|
|
29086
|
+
cuts: (shots) => `its ${shots} shots and where they cut`
|
|
29087
|
+
};
|
|
29088
|
+
var SCENE3D_LAYOUT_SCOPING_IGNORE = "Ignore its untextured grey clay placeholder look, its flat placeholder colours, its materials, its lighting and its empty background; none of that is the target look";
|
|
29089
|
+
var SCENE3D_LAYOUT_SCOPING_LOOK_SOURCE = "Take the look from the prompt and from the other references";
|
|
29090
|
+
function buildScene3DLayoutScopingLine(spec) {
|
|
29091
|
+
const matches = [
|
|
29092
|
+
SCENE3D_LAYOUT_SCOPING_FOR.layout,
|
|
29093
|
+
SCENE3D_LAYOUT_SCOPING_FOR.occlusion,
|
|
29094
|
+
SCENE3D_LAYOUT_SCOPING_FOR.framing,
|
|
29095
|
+
SCENE3D_LAYOUT_SCOPING_FOR.cameraAngle
|
|
29096
|
+
];
|
|
29097
|
+
if (spec.carries === "clip") {
|
|
29098
|
+
if (spec.includesCameraMotion) matches.push(SCENE3D_LAYOUT_SCOPING_FOR.cameraMotion);
|
|
29099
|
+
if (typeof spec.shots === "number" && Number.isFinite(spec.shots) && spec.shots > 1) {
|
|
29100
|
+
matches.push(SCENE3D_LAYOUT_SCOPING_FOR.cuts(Math.floor(spec.shots)));
|
|
29101
|
+
}
|
|
29102
|
+
matches.push(SCENE3D_LAYOUT_SCOPING_FOR.timing);
|
|
29103
|
+
}
|
|
29104
|
+
return `${SCENE3D_LAYOUT_SCOPING_MARKER} \u2014 match ${joinWithAnd(matches)}. ${SCENE3D_LAYOUT_SCOPING_IGNORE}. ${SCENE3D_LAYOUT_SCOPING_LOOK_SOURCE}`;
|
|
29105
|
+
}
|
|
29106
|
+
function joinWithAnd(parts) {
|
|
29107
|
+
if (parts.length <= 1) return parts[0] ?? "";
|
|
29108
|
+
return `${parts.slice(0, -1).join(", ")} and ${parts[parts.length - 1]}`;
|
|
29109
|
+
}
|
|
29110
|
+
function renderScene3DLayoutScopingLine(binding, spec) {
|
|
29111
|
+
return `${binding.trim()}: ${buildScene3DLayoutScopingLine(spec)}.`;
|
|
29112
|
+
}
|
|
29113
|
+
function hasScene3DLayoutScopingLine(prompt, binding) {
|
|
29114
|
+
if (!prompt) return false;
|
|
29115
|
+
const b = binding.trim().replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
29116
|
+
return new RegExp(`${b}(?::| is an?)\\s+${SCENE3D_LAYOUT_SCOPING_MARKER}`).test(prompt);
|
|
29117
|
+
}
|
|
29118
|
+
var SCENE3D_LAYOUT_REFERENCE_SCOPING_LINE = buildScene3DLayoutScopingLine({
|
|
29119
|
+
carries: "clip",
|
|
29120
|
+
includesCameraMotion: true
|
|
29121
|
+
});
|
|
29122
|
+
var SCENE3D_LAYOUT_REFERENCE_SCOPING_FIXTURE = {
|
|
29123
|
+
clip: SCENE3D_LAYOUT_REFERENCE_SCOPING_LINE,
|
|
29124
|
+
clipRendered: renderScene3DLayoutScopingLine("@video_1", { carries: "clip", includesCameraMotion: true }),
|
|
29125
|
+
clipWithCuts: buildScene3DLayoutScopingLine({ carries: "clip", shots: 4, includesCameraMotion: true }),
|
|
29126
|
+
still: buildScene3DLayoutScopingLine({ carries: "still" }),
|
|
29127
|
+
stillRendered: renderScene3DLayoutScopingLine("@image_1", { carries: "still" })
|
|
29128
|
+
};
|
|
29129
|
+
function scene3DLayoutVideoCaptions(seats, prompt) {
|
|
29130
|
+
const clips = seats.filter((r) => r.carries === "clip" && !hasScene3DLayoutScopingLine(prompt, r.binding));
|
|
29131
|
+
if (clips.length === 0) return void 0;
|
|
29132
|
+
const captions = [];
|
|
29133
|
+
for (const clip of clips) {
|
|
29134
|
+
while (captions.length <= clip.index) captions.push("");
|
|
29135
|
+
captions[clip.index] = buildScene3DLayoutScopingLine(clip.spec);
|
|
29136
|
+
}
|
|
29137
|
+
return captions;
|
|
29138
|
+
}
|
|
29139
|
+
function appendScene3DStillScopingLines(prompt, seats) {
|
|
29140
|
+
const stills = seats.filter((r) => r.carries === "still" && !hasScene3DLayoutScopingLine(prompt, r.binding));
|
|
29141
|
+
if (stills.length === 0) return prompt;
|
|
29142
|
+
const lines = stills.map((still) => renderScene3DLayoutScopingLine(still.binding, still.spec));
|
|
29143
|
+
return prompt ? `${prompt}
|
|
29144
|
+
${lines.join("\n")}` : lines.join("\n");
|
|
29145
|
+
}
|
|
29146
|
+
var SCENE3D_FIGURE_REFERENCE_RULE = "Every figure that must look real needs its own character reference; a figure without one takes the clay look of the layout reference. Keep two reference slots free for a location or style plate.";
|
|
29147
|
+
var SCENE3D_FREE_PLATE_SLOTS = 2;
|
|
29148
|
+
var SCENE3D_UNREFERENCED_FIGURES_WARNING_CODE = "scene3d_unreferenced_figures";
|
|
29149
|
+
function buildScene3DUnreferencedFiguresWarning(check2) {
|
|
29150
|
+
const figures = check2.figureCount;
|
|
29151
|
+
if (figures === void 0 || !Number.isFinite(figures) || figures <= 0) return void 0;
|
|
29152
|
+
const refs = Math.max(0, Math.floor(check2.characterReferenceCount));
|
|
29153
|
+
const missing = Math.floor(figures) - refs;
|
|
29154
|
+
if (missing <= 0) return void 0;
|
|
29155
|
+
const figureWord = figures === 1 ? "figure" : "figures";
|
|
29156
|
+
const refWord = refs === 1 ? "character reference is" : "character references are";
|
|
29157
|
+
let message = `The layout reference shows ${figures} ${figureWord} but ${refs} ${refWord} attached. A figure without its own character reference takes the clay look of the layout reference. Attach one character reference per figure (${missing} more)`;
|
|
29158
|
+
const cap = check2.imageReferenceCap;
|
|
29159
|
+
if (typeof cap === "number" && Number.isFinite(cap) && cap > 0) {
|
|
29160
|
+
const seats = Math.max(0, Math.floor(check2.layoutReferenceImageSeats ?? 0));
|
|
29161
|
+
const spare = cap - seats - figures;
|
|
29162
|
+
message += spare >= SCENE3D_FREE_PLATE_SLOTS ? `; this model takes ${cap} image references, which leaves ${spare} for a location or style plate.` : `; this model takes ${cap} image references, so one per figure plus ${SCENE3D_FREE_PLATE_SLOTS} free slots for a location or style plate does not fit \u2014 reference the figures that matter most first.`;
|
|
29163
|
+
} else {
|
|
29164
|
+
message += ".";
|
|
29165
|
+
}
|
|
29166
|
+
return {
|
|
29167
|
+
code: SCENE3D_UNREFERENCED_FIGURES_WARNING_CODE,
|
|
29168
|
+
message,
|
|
29169
|
+
figureCount: figures,
|
|
29170
|
+
characterReferenceCount: refs,
|
|
29171
|
+
missing
|
|
29172
|
+
};
|
|
29173
|
+
}
|
|
29174
|
+
|
|
29074
29175
|
// src/prompt-wizard-categories.ts
|
|
29075
29176
|
var IMAGE_WIZARD_CATEGORIES = [
|
|
29076
29177
|
{ key: "subject", label: "Subject" },
|
|
@@ -29162,6 +29263,8 @@ var PROVIDER_CAPABILITIES = {
|
|
|
29162
29263
|
"nano-banana-2-lite": "Fast, low-cost 1K generation for drafts and iteration",
|
|
29163
29264
|
"gpt-image": "Creative concepts, illustration, variable quality tiers",
|
|
29164
29265
|
"gpt-image-2": "Latest GPT Image \u2014 sharp text, photorealism, 1K/2K/4K resolution",
|
|
29266
|
+
"gpt-image-2-5-flare": "Fast everyday GPT Image 2.5 \u2014 higher quality than GPT Image 2 at ~half the latency; default for iteration, social, high volume",
|
|
29267
|
+
"gpt-image-2-5-sunburst": "Precision GPT Image 2.5 \u2014 slower, tighter control and detail fidelity; brand-sensitive, packaging, diagrams, final creative",
|
|
29165
29268
|
"grok": "General purpose, good text understanding",
|
|
29166
29269
|
"grok-2": "Grok Imagine 2 \u2014 expressive, high-contrast, stylized output",
|
|
29167
29270
|
"imagen4": "Google's latest, strong photorealism and text rendering",
|
|
@@ -29187,6 +29290,8 @@ var PROVIDER_CAPABILITIES = {
|
|
|
29187
29290
|
"flux-pro-i2i": "Premium Flux transformation",
|
|
29188
29291
|
"gpt-image-i2i": "Creative reinterpretation of source images",
|
|
29189
29292
|
"gpt-image-2-i2i": "Latest GPT Image \u2014 pixel-level edits with original lighting/texture preservation, up to 4K",
|
|
29293
|
+
"gpt-image-2-5-flare-i2i": "Fast GPT Image 2.5 edits \u2014 up to 16 sources; use while iterating",
|
|
29294
|
+
"gpt-image-2-5-sunburst-i2i": "Precision GPT Image 2.5 edits \u2014 up to 16 sources, tightest control on demanding retouches; slower",
|
|
29190
29295
|
"ideogram-edit": "Instruction-based editing with text preservation",
|
|
29191
29296
|
"ideogram-remix": "Style remixing while preserving structure",
|
|
29192
29297
|
"ideogram-reframe": "Aspect ratio changes with AI fill",
|
|
@@ -29210,6 +29315,8 @@ var PROVIDER_CAPABILITIES = {
|
|
|
29210
29315
|
"flux-pro-i2i": "Premium Flux transformation",
|
|
29211
29316
|
"gpt-image-i2i": "Creative reinterpretation of source images",
|
|
29212
29317
|
"gpt-image-2-i2i": "Latest GPT Image \u2014 pixel-level edits with original lighting/texture preservation, up to 4K",
|
|
29318
|
+
"gpt-image-2-5-flare-i2i": "Fast GPT Image 2.5 edits \u2014 up to 16 sources; use while iterating",
|
|
29319
|
+
"gpt-image-2-5-sunburst-i2i": "Precision GPT Image 2.5 edits \u2014 up to 16 sources, tightest control on demanding retouches; slower",
|
|
29213
29320
|
"ideogram-edit": "Instruction-based editing with text preservation",
|
|
29214
29321
|
"ideogram-remix": "Style remixing while preserving structure",
|
|
29215
29322
|
"ideogram-reframe": "Aspect ratio changes with AI fill",
|
|
@@ -29481,6 +29588,7 @@ var NODE_PROMPT_FIELDS = {
|
|
|
29481
29588
|
// ── Composition / FX (compact, no media-result preview → no inline editor) ──
|
|
29482
29589
|
"image-critic": { prompt: "prompt", promptLabel: "Criteria", media: "image", inline: false },
|
|
29483
29590
|
"motion-graphics": { prompt: "motionPrompt", promptLabel: "Motion prompt", media: "video", inline: false },
|
|
29591
|
+
"pro-3d-render": { prompt: "scenePrompt", promptLabel: "Scene", media: "text", inline: false },
|
|
29484
29592
|
"generate-3d-scene": { prompt: "scenePrompt", promptLabel: "Scene", media: "text", inline: false },
|
|
29485
29593
|
"edit-3d-scene": { prompt: "editPrompt", promptLabel: "Edit instruction", media: "text", inline: false },
|
|
29486
29594
|
"3d-title": { prompt: "titlePrompt", promptLabel: "Title", media: "text", inline: false },
|
|
@@ -34931,6 +35039,15 @@ exports.REF_BINDING = REF_BINDING;
|
|
|
34931
35039
|
exports.RENDER_QUALITIES = RENDER_QUALITIES;
|
|
34932
35040
|
exports.RENDER_QUALITY_IDS = RENDER_QUALITY_IDS;
|
|
34933
35041
|
exports.RETIRED_ADULT_ONLY_HINT_STRINGS = RETIRED_ADULT_ONLY_HINT_STRINGS;
|
|
35042
|
+
exports.SCENE3D_FIGURE_REFERENCE_RULE = SCENE3D_FIGURE_REFERENCE_RULE;
|
|
35043
|
+
exports.SCENE3D_FREE_PLATE_SLOTS = SCENE3D_FREE_PLATE_SLOTS;
|
|
35044
|
+
exports.SCENE3D_LAYOUT_REFERENCE_SCOPING_FIXTURE = SCENE3D_LAYOUT_REFERENCE_SCOPING_FIXTURE;
|
|
35045
|
+
exports.SCENE3D_LAYOUT_REFERENCE_SCOPING_LINE = SCENE3D_LAYOUT_REFERENCE_SCOPING_LINE;
|
|
35046
|
+
exports.SCENE3D_LAYOUT_SCOPING_FOR = SCENE3D_LAYOUT_SCOPING_FOR;
|
|
35047
|
+
exports.SCENE3D_LAYOUT_SCOPING_IGNORE = SCENE3D_LAYOUT_SCOPING_IGNORE;
|
|
35048
|
+
exports.SCENE3D_LAYOUT_SCOPING_LOOK_SOURCE = SCENE3D_LAYOUT_SCOPING_LOOK_SOURCE;
|
|
35049
|
+
exports.SCENE3D_LAYOUT_SCOPING_MARKER = SCENE3D_LAYOUT_SCOPING_MARKER;
|
|
35050
|
+
exports.SCENE3D_UNREFERENCED_FIGURES_WARNING_CODE = SCENE3D_UNREFERENCED_FIGURES_WARNING_CODE;
|
|
34934
35051
|
exports.SCENE_FRAME_RULE = SCENE_FRAME_RULE;
|
|
34935
35052
|
exports.SCENE_PROMPT_MAX_LENGTH = SCENE_PROMPT_MAX_LENGTH;
|
|
34936
35053
|
exports.SETTINGS = SETTINGS;
|
|
@@ -34995,6 +35112,7 @@ exports.__resetCatalogIdGuardForTests = __resetCatalogIdGuardForTests;
|
|
|
34995
35112
|
exports.appendField = appendField;
|
|
34996
35113
|
exports.appendMusicMeta = appendMusicMeta;
|
|
34997
35114
|
exports.appendReferenceLines = appendReferenceLines;
|
|
35115
|
+
exports.appendScene3DStillScopingLines = appendScene3DStillScopingLines;
|
|
34998
35116
|
exports.applyMinorAgeFloorToPickerValues = applyMinorAgeFloorToPickerValues;
|
|
34999
35117
|
exports.applyPickerJson = applyPickerJson;
|
|
35000
35118
|
exports.applyPromptAffixes = applyPromptAffixes;
|
|
@@ -35056,6 +35174,8 @@ exports.buildPoseTerms = buildPoseTerms;
|
|
|
35056
35174
|
exports.buildPostProcessHints = buildPostProcessHints;
|
|
35057
35175
|
exports.buildPostProcessTerms = buildPostProcessTerms;
|
|
35058
35176
|
exports.buildReferenceBlocks = buildReferenceBlocks;
|
|
35177
|
+
exports.buildScene3DLayoutScopingLine = buildScene3DLayoutScopingLine;
|
|
35178
|
+
exports.buildScene3DUnreferencedFiguresWarning = buildScene3DUnreferencedFiguresWarning;
|
|
35059
35179
|
exports.buildScenePrompt = buildScenePrompt;
|
|
35060
35180
|
exports.buildStylingHints = buildStylingHints;
|
|
35061
35181
|
exports.buildStylingTerms = buildStylingTerms;
|
|
@@ -35288,6 +35408,7 @@ exports.getWardrobeEntry = getWardrobeEntry;
|
|
|
35288
35408
|
exports.getWardrobePromptHint = getWardrobePromptHint;
|
|
35289
35409
|
exports.groupFactoryPresets = groupFactoryPresets;
|
|
35290
35410
|
exports.hasCatalogPacksFor = hasCatalogPacksFor;
|
|
35411
|
+
exports.hasScene3DLayoutScopingLine = hasScene3DLayoutScopingLine;
|
|
35291
35412
|
exports.hasUpstreamCharacter = hasUpstreamCharacter;
|
|
35292
35413
|
exports.identityRefsSentence = identityRefsSentence;
|
|
35293
35414
|
exports.insertBeforeStyleSection = insertBeforeStyleSection;
|
|
@@ -35329,6 +35450,7 @@ exports.renderDescribedReferenceLines = renderDescribedReferenceLines;
|
|
|
35329
35450
|
exports.renderDirectionHintClauses = renderDirectionHintClauses;
|
|
35330
35451
|
exports.renderDirectionHints = renderDirectionHints;
|
|
35331
35452
|
exports.renderReferenceCaptionLines = renderReferenceCaptionLines;
|
|
35453
|
+
exports.renderScene3DLayoutScopingLine = renderScene3DLayoutScopingLine;
|
|
35332
35454
|
exports.renderStructuredFields = renderStructuredFields;
|
|
35333
35455
|
exports.renderStyleSection = renderStyleSection;
|
|
35334
35456
|
exports.renderSubjectHints = renderSubjectHints;
|
|
@@ -35346,6 +35468,7 @@ exports.resolveTemplate = resolveTemplate;
|
|
|
35346
35468
|
exports.resolveTerm = resolveTerm;
|
|
35347
35469
|
exports.resolveVeoI2vInputs = resolveVeoI2vInputs;
|
|
35348
35470
|
exports.resolveVideoReferenceCore = resolveVideoReferenceCore;
|
|
35471
|
+
exports.scene3DLayoutVideoCaptions = scene3DLayoutVideoCaptions;
|
|
35349
35472
|
exports.sectionedClauseCosts = sectionedClauseCosts;
|
|
35350
35473
|
exports.setComposedCatalogResolver = setComposedCatalogResolver;
|
|
35351
35474
|
exports.splitStyleSection = splitStyleSection;
|