@nodaro/prompts 1.7.0 → 1.7.2
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 +52 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -1
- package/dist/index.d.ts +104 -1
- package/dist/index.js +51 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/gemini-omni-inputs.test.ts +68 -0
- package/src/__tests__/seedance-2-inputs.test.ts +48 -0
- package/src/__tests__/veo-i2v-inputs.test.ts +58 -0
- package/src/gemini-omni-inputs.ts +73 -0
- package/src/index.ts +2 -0
- package/src/prompt-wizard-categories.ts +3 -2
- package/src/provider-prompt-doctrine.ts +1 -1
- package/src/resolve-prompt.ts +12 -1
- package/src/seedance-2-inputs.ts +10 -3
- package/src/veo-i2v-inputs.ts +68 -0
- package/src/video-reference-resolver.ts +12 -0
package/dist/index.cjs
CHANGED
|
@@ -10017,6 +10017,9 @@ function renderLens(l) {
|
|
|
10017
10017
|
if (l.aperture) bits.push(`f/${l.aperture}`);
|
|
10018
10018
|
return bits.length > 0 ? `Lens: ${bits.join(", ")}.` : "";
|
|
10019
10019
|
}
|
|
10020
|
+
function identityRefsSentence(firstOrdinal, lastOrdinal) {
|
|
10021
|
+
return firstOrdinal === lastOrdinal ? `${REF_BINDING.ordinal(firstOrdinal)} is an identity reference for this shot's subjects \u2014 match its subject's exact appearance; it is not a frame.` : `${REF_BINDING.ordinal(firstOrdinal)} through ${REF_BINDING.ordinal(lastOrdinal)} are identity references for this shot's subjects \u2014 match each subject's exact appearance; they are not frames.`;
|
|
10022
|
+
}
|
|
10020
10023
|
var REF_BINDING = {
|
|
10021
10024
|
image: (label, n) => `the ${label} from @image_${n}`,
|
|
10022
10025
|
video: (label, n) => `the ${label} from @video_${n}`,
|
|
@@ -10595,11 +10598,12 @@ function promptBindsFirstFrame(prompt) {
|
|
|
10595
10598
|
return /@image_\d+\s+as\s+the\s+(first|opening)\s*(\(first\))?\s*frame/i.test(prompt);
|
|
10596
10599
|
}
|
|
10597
10600
|
function resolveSeedance2Inputs(args) {
|
|
10601
|
+
const limits = args.limits ?? shared.SEEDANCE_2_REF_LIMITS;
|
|
10598
10602
|
const firstFrameUrl = clean(args.firstFrameUrl);
|
|
10599
10603
|
const lastFrameUrl = clean(args.lastFrameUrl);
|
|
10600
10604
|
const refImages = cleanList(args.refImageUrls);
|
|
10601
|
-
const refVideos = cleanList(args.refVideoUrls).slice(0,
|
|
10602
|
-
const refAudios = cleanList(args.refAudioUrls).slice(0,
|
|
10605
|
+
const refVideos = cleanList(args.refVideoUrls).slice(0, limits.videos);
|
|
10606
|
+
const refAudios = cleanList(args.refAudioUrls).slice(0, limits.audio);
|
|
10603
10607
|
const hasAnyReference = refImages.length > 0 || refVideos.length > 0 || refAudios.length > 0;
|
|
10604
10608
|
const canUseStrictMode = !hasAnyReference && (Boolean(firstFrameUrl) || !lastFrameUrl);
|
|
10605
10609
|
if (canUseStrictMode) {
|
|
@@ -10609,7 +10613,7 @@ function resolveSeedance2Inputs(args) {
|
|
|
10609
10613
|
return { mode: "first-frame", firstFrameUrl, lastFrameUrl: void 0, referenceImageUrls: [], referenceVideoUrls: [], referenceAudioUrls: [], promptSuffix: "", droppedRefImages: 0 };
|
|
10610
10614
|
}
|
|
10611
10615
|
const frameCount = (firstFrameUrl ? 1 : 0) + (lastFrameUrl ? 1 : 0);
|
|
10612
|
-
const userImageSlots = Math.max(0,
|
|
10616
|
+
const userImageSlots = Math.max(0, limits.images - frameCount);
|
|
10613
10617
|
const keptUserImages = refImages.slice(0, userImageSlots);
|
|
10614
10618
|
const droppedRefImages = refImages.length - keptUserImages.length;
|
|
10615
10619
|
const referenceImageUrls = [...keptUserImages];
|
|
@@ -10643,6 +10647,43 @@ function resolveSeedance2Inputs(args) {
|
|
|
10643
10647
|
droppedRefImages
|
|
10644
10648
|
};
|
|
10645
10649
|
}
|
|
10650
|
+
var GEMINI_OMNI_INPUT_SLOTS = shared.VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-video"]?.images ?? 7;
|
|
10651
|
+
function resolveGeminiOmniI2vInputs(args) {
|
|
10652
|
+
const refs = (args.refImageUrls ?? []).filter((u) => typeof u === "string" && u.length > 0);
|
|
10653
|
+
const slots = GEMINI_OMNI_INPUT_SLOTS - (args.videoConnected ? 2 : 0);
|
|
10654
|
+
const refSlots = Math.max(0, slots - 1);
|
|
10655
|
+
const kept = refs.slice(0, refSlots);
|
|
10656
|
+
const droppedRefImages = refs.length - kept.length;
|
|
10657
|
+
const imageUrls = [args.firstFrameUrl, ...kept];
|
|
10658
|
+
if (kept.length === 0) return { imageUrls, promptSuffix: "", droppedRefImages };
|
|
10659
|
+
const frameSentence = promptBindsFirstFrame(args.prompt) ? "" : REF_BINDING.frame(1, "opening");
|
|
10660
|
+
const promptSuffix = [frameSentence, identityRefsSentence(2, kept.length + 1)].filter(Boolean).join(" ");
|
|
10661
|
+
return { imageUrls, promptSuffix, droppedRefImages };
|
|
10662
|
+
}
|
|
10663
|
+
|
|
10664
|
+
// src/veo-i2v-inputs.ts
|
|
10665
|
+
var VEO_INGREDIENT_SLOTS = 3;
|
|
10666
|
+
function resolveVeoI2vInputs(args) {
|
|
10667
|
+
const refs = (args.refImageUrls ?? []).filter((u) => typeof u === "string" && u.length > 0);
|
|
10668
|
+
if (refs.length === 0) {
|
|
10669
|
+
return {
|
|
10670
|
+
imageUrls: args.endFrameUrl ? [args.firstFrameUrl, args.endFrameUrl] : [args.firstFrameUrl],
|
|
10671
|
+
promptSuffix: "",
|
|
10672
|
+
droppedRefImages: 0,
|
|
10673
|
+
droppedEndFrame: false
|
|
10674
|
+
};
|
|
10675
|
+
}
|
|
10676
|
+
const kept = refs.slice(0, VEO_INGREDIENT_SLOTS - 1);
|
|
10677
|
+
const droppedRefImages = refs.length - kept.length;
|
|
10678
|
+
const frameSentence = promptBindsFirstFrame(args.prompt) ? "" : REF_BINDING.frame(1, "opening");
|
|
10679
|
+
return {
|
|
10680
|
+
imageUrls: [args.firstFrameUrl, ...kept],
|
|
10681
|
+
generationType: "REFERENCE_2_VIDEO",
|
|
10682
|
+
promptSuffix: [frameSentence, identityRefsSentence(2, kept.length + 1)].filter(Boolean).join(" "),
|
|
10683
|
+
droppedRefImages,
|
|
10684
|
+
droppedEndFrame: Boolean(args.endFrameUrl)
|
|
10685
|
+
};
|
|
10686
|
+
}
|
|
10646
10687
|
function toOptions(arr, categoryField) {
|
|
10647
10688
|
return arr.map((e) => {
|
|
10648
10689
|
const opt = {
|
|
@@ -26224,7 +26265,7 @@ precise subject \u2192 action details \u2192 scene/environment \u2192 lighting &
|
|
|
26224
26265
|
**Generation differences (seedance-2-5 vs the 2.0 SKUs)**
|
|
26225
26266
|
- A single 2.5 shot runs to 30s, where every 2.0 SKU stops at 15s. Plan a complete 4-6 shot beat inside ONE generation instead of splitting it into two clips and stitching \u2014 no seam to hide, and continuity holds because it never leaves the model.
|
|
26226
26267
|
- 2.5 also takes far more reference material (30 images / 10 videos / 10 audio vs 9/3/3). Treat that as room for COVERAGE \u2014 more distinct characters, locations and props in one shot \u2014 not as licence to pile refs onto one identity. The "ONE headshot + ONE full-body, 4-5 assets total" rule above still produces the best likeness on 2.5.
|
|
26227
|
-
- 2.5 renders at 480p/720p
|
|
26268
|
+
- 2.5 renders at 480p/720p/1080p (1080p since 2026-08-17): there is no 4K tier, so route a job that needs 4K to seedance-2 (which has it) or upscale afterwards.
|
|
26228
26269
|
- With a start frame, 2.5 always derives the output aspect from that frame \u2014 an explicit aspect ratio is rejected outright, so compose the frame at the ratio you want.
|
|
26229
26270
|
|
|
26230
26271
|
**References (when reference media is attached)**
|
|
@@ -26643,6 +26684,7 @@ var PROVIDER_CAPABILITIES = {
|
|
|
26643
26684
|
"gpt-image": "Creative concepts, illustration, variable quality tiers",
|
|
26644
26685
|
"gpt-image-2": "Latest GPT Image \u2014 sharp text, photorealism, 1K/2K/4K resolution",
|
|
26645
26686
|
"grok": "General purpose, good text understanding",
|
|
26687
|
+
"grok-2": "Grok Imagine 2 \u2014 expressive, high-contrast, stylized output",
|
|
26646
26688
|
"imagen4": "Google's latest, strong photorealism and text rendering",
|
|
26647
26689
|
"imagen4-fast": "Faster Imagen 4 variant",
|
|
26648
26690
|
"imagen4-ultra": "Highest quality Imagen 4",
|
|
@@ -26719,7 +26761,7 @@ var PROVIDER_CAPABILITIES = {
|
|
|
26719
26761
|
"seedance-2": "Seedance 2.0 \u2014 multimodal refs (9 images / 3 videos / 3 audio), native multi-track audio, multi-shot storytelling, 4-15s",
|
|
26720
26762
|
"seedance-2-fast": "Seedance 2.0 Fast \u2014 same multimodal + audio capabilities, cheaper and quicker",
|
|
26721
26763
|
"seedance-2-mini": "Seedance 2.0 Mini \u2014 same multimodal + audio capabilities, budget tier, 480p/720p, 4-15s",
|
|
26722
|
-
"seedance-2-5": "Seedance 2.5 \u2014 up to 30s in ONE shot (no stitching), wider multimodal refs (30 images / 10 videos / 10 audio), native audio, 480p/720p",
|
|
26764
|
+
"seedance-2-5": "Seedance 2.5 \u2014 up to 30s in ONE shot (no stitching), wider multimodal refs (30 images / 10 videos / 10 audio), native audio, 480p/720p/1080p",
|
|
26723
26765
|
"minimax-h3": "MiniMax Hailuo 3 \u2014 premium multimodal refs (9 images / 3 videos / 3 audio), always-on audio, 2K or 768P, 4-15s per-second pricing",
|
|
26724
26766
|
"wan": "Versatile, good for animations and transformations",
|
|
26725
26767
|
"wan-turbo": "Faster Wan generation",
|
|
@@ -26747,7 +26789,7 @@ var PROVIDER_CAPABILITIES = {
|
|
|
26747
26789
|
"seedance-2": "Seedance 2.0 \u2014 start/end frame + multimodal refs, native audio, 4-15s",
|
|
26748
26790
|
"seedance-2-fast": "Seedance 2.0 Fast \u2014 same capabilities, cheaper and quicker",
|
|
26749
26791
|
"seedance-2-mini": "Seedance 2.0 Mini \u2014 same capabilities, budget tier, 480p/720p",
|
|
26750
|
-
"seedance-2-5": "Seedance 2.5 \u2014 start/end frame + wide multimodal refs, native audio, up to 30s, 480p/720p",
|
|
26792
|
+
"seedance-2-5": "Seedance 2.5 \u2014 start/end frame + wide multimodal refs, native audio, up to 30s, 480p/720p/1080p",
|
|
26751
26793
|
"minimax-h3": "MiniMax Hailuo 3 \u2014 first/last frame + multimodal refs, always-on audio, 2K or 768P, 4-15s",
|
|
26752
26794
|
"hailuo-2.3-pro": "Premium Hailuo animation",
|
|
26753
26795
|
"hailuo-2.3": "Standard Hailuo animation",
|
|
@@ -26860,7 +26902,7 @@ var NODE_PROMPT_CANDIDATE_FIELDS = {
|
|
|
26860
26902
|
function computeNodePrompt(nodeType, data, { override, wired, refMap, appendWired }) {
|
|
26861
26903
|
let typed;
|
|
26862
26904
|
if (nodeType === "text-to-speech") {
|
|
26863
|
-
typed = data.textSource === "direct" ? [data.directText] : [];
|
|
26905
|
+
typed = data.textSource === "direct" || !present(wired) ? [data.directText] : [];
|
|
26864
26906
|
} else {
|
|
26865
26907
|
const fields = NODE_PROMPT_CANDIDATE_FIELDS[nodeType] ?? ["prompt"];
|
|
26866
26908
|
typed = fields.map((f) => data[f]);
|
|
@@ -32449,6 +32491,7 @@ exports.getWardrobeEntry = getWardrobeEntry;
|
|
|
32449
32491
|
exports.getWardrobePromptHint = getWardrobePromptHint;
|
|
32450
32492
|
exports.groupFactoryPresets = groupFactoryPresets;
|
|
32451
32493
|
exports.hasUpstreamCharacter = hasUpstreamCharacter;
|
|
32494
|
+
exports.identityRefsSentence = identityRefsSentence;
|
|
32452
32495
|
exports.isAnalyzablePicker = isAnalyzablePicker;
|
|
32453
32496
|
exports.isInstrumentalVocal = isInstrumentalVocal;
|
|
32454
32497
|
exports.isVantageFraming = isVantageFraming;
|
|
@@ -32462,11 +32505,13 @@ exports.referenceRulesBlock = referenceRulesBlock;
|
|
|
32462
32505
|
exports.renderStructuredFields = renderStructuredFields;
|
|
32463
32506
|
exports.resolveBrandInput = resolveBrandInput;
|
|
32464
32507
|
exports.resolveCharacterMentions = resolveCharacterMentions;
|
|
32508
|
+
exports.resolveGeminiOmniI2vInputs = resolveGeminiOmniI2vInputs;
|
|
32465
32509
|
exports.resolveLocationMentions = resolveLocationMentions;
|
|
32466
32510
|
exports.resolvePrompt = resolvePrompt;
|
|
32467
32511
|
exports.resolveReferenceTokens = resolveReferenceTokens;
|
|
32468
32512
|
exports.resolveSeedance2Inputs = resolveSeedance2Inputs;
|
|
32469
32513
|
exports.resolveTemplate = resolveTemplate;
|
|
32514
|
+
exports.resolveVeoI2vInputs = resolveVeoI2vInputs;
|
|
32470
32515
|
exports.resolveVideoReferenceCore = resolveVideoReferenceCore;
|
|
32471
32516
|
exports.summarizePickerCatalogs = summarizePickerCatalogs;
|
|
32472
32517
|
exports.toIdentityLockMode = toIdentityLockMode;
|