@slatesvideo/shared 0.3.0 → 0.4.1
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/operations/index.d.ts +4 -4
- package/dist/operations/index.js +4 -4
- package/dist/prompts/character-sheet.d.ts +24 -0
- package/dist/prompts/character-sheet.js +53 -0
- package/dist/prompts/environment-sheet.d.ts +9 -0
- package/dist/prompts/environment-sheet.js +27 -0
- package/dist/prompts/index.d.ts +6 -0
- package/dist/prompts/index.js +17 -0
- package/dist/prompts/model-facts.d.ts +17 -0
- package/dist/prompts/model-facts.js +64 -0
- package/dist/prompts/reference-rules.d.ts +34 -0
- package/dist/prompts/reference-rules.js +120 -0
- package/dist/prompts/style-library.d.ts +31 -0
- package/dist/prompts/style-library.js +84 -0
- package/dist/skills/content.js +6 -6
- package/package.json +59 -55
- package/skills/slates-character-turnaround.md +18 -16
- package/skills/slates-prompting-flux-2-max.md +6 -0
- package/skills/slates-prompting-kling-v3.md +7 -0
- package/skills/slates-prompting-nano-banana-2.md +12 -5
- package/skills/slates-prompting-seedance.md +11 -0
- package/skills/slates-prompting-veo-3.md +7 -0
|
@@ -74,7 +74,7 @@ export declare const createCharacter: Operation<{
|
|
|
74
74
|
projectId: string;
|
|
75
75
|
name: string;
|
|
76
76
|
description?: string;
|
|
77
|
-
style?:
|
|
77
|
+
style?: string;
|
|
78
78
|
}>;
|
|
79
79
|
export declare const setCharacterTurnaround: Operation<{
|
|
80
80
|
characterId: string;
|
|
@@ -91,7 +91,7 @@ export declare const createEnvironment: Operation<{
|
|
|
91
91
|
projectId: string;
|
|
92
92
|
name: string;
|
|
93
93
|
description?: string;
|
|
94
|
-
style?:
|
|
94
|
+
style?: string;
|
|
95
95
|
}>;
|
|
96
96
|
export declare const listStoryboards: Operation<{
|
|
97
97
|
projectId: string;
|
|
@@ -256,7 +256,7 @@ export declare const updateCharacter: Operation<{
|
|
|
256
256
|
characterId: string;
|
|
257
257
|
name?: string;
|
|
258
258
|
description?: string;
|
|
259
|
-
style?:
|
|
259
|
+
style?: string;
|
|
260
260
|
}>;
|
|
261
261
|
export declare const deleteCharacter: Operation<{
|
|
262
262
|
characterId: string;
|
|
@@ -265,7 +265,7 @@ export declare const updateEnvironment: Operation<{
|
|
|
265
265
|
environmentId: string;
|
|
266
266
|
name?: string;
|
|
267
267
|
description?: string;
|
|
268
|
-
style?:
|
|
268
|
+
style?: string;
|
|
269
269
|
gridAssetId?: string | null;
|
|
270
270
|
}>;
|
|
271
271
|
export declare const deleteEnvironment: Operation<{
|
package/dist/operations/index.js
CHANGED
|
@@ -316,7 +316,7 @@ export const createCharacter = {
|
|
|
316
316
|
projectId: z.string().uuid(),
|
|
317
317
|
name: z.string().min(1).max(120),
|
|
318
318
|
description: z.string().optional(),
|
|
319
|
-
style: z.
|
|
319
|
+
style: z.string().max(200).optional().describe("Art style. Omit to inherit the reference's style (the default). Canonical styles: photoreal, anime, painterly, 3d-render, comic. Or pass any free-text instruction, e.g. 'turn this into a real person'."),
|
|
320
320
|
}),
|
|
321
321
|
async run(input, ctx) {
|
|
322
322
|
return ok(await ctx.desktop().post('/agent/characters', input));
|
|
@@ -366,7 +366,7 @@ export const createEnvironment = {
|
|
|
366
366
|
projectId: z.string().uuid(),
|
|
367
367
|
name: z.string().min(1).max(120),
|
|
368
368
|
description: z.string().optional(),
|
|
369
|
-
style: z.
|
|
369
|
+
style: z.string().max(200).optional().describe("Art style. Omit to inherit the reference's style (the default). Canonical styles: photoreal, anime, painterly, 3d-render, comic. Or pass any free-text instruction, e.g. 'turn this into a real person'."),
|
|
370
370
|
}),
|
|
371
371
|
async run(input, ctx) {
|
|
372
372
|
return ok(await ctx.desktop().post('/agent/environments', input));
|
|
@@ -1627,7 +1627,7 @@ export const updateCharacter = {
|
|
|
1627
1627
|
characterId: z.string().uuid(),
|
|
1628
1628
|
name: z.string().min(1).max(120).optional(),
|
|
1629
1629
|
description: z.string().optional(),
|
|
1630
|
-
style: z.
|
|
1630
|
+
style: z.string().max(200).optional().describe("Art style. Omit to inherit the reference's style (the default). Canonical styles: photoreal, anime, painterly, 3d-render, comic. Or pass any free-text instruction, e.g. 'turn this into a real person'."),
|
|
1631
1631
|
}),
|
|
1632
1632
|
async run(input, ctx) {
|
|
1633
1633
|
return ok(await ctx.desktop().post('/agent/characters/update', {
|
|
@@ -1651,7 +1651,7 @@ export const updateEnvironment = {
|
|
|
1651
1651
|
environmentId: z.string().uuid(),
|
|
1652
1652
|
name: z.string().min(1).max(120).optional(),
|
|
1653
1653
|
description: z.string().optional(),
|
|
1654
|
-
style: z.
|
|
1654
|
+
style: z.string().max(200).optional().describe("Art style. Omit to inherit the reference's style (the default). Canonical styles: photoreal, anime, painterly, 3d-render, comic. Or pass any free-text instruction, e.g. 'turn this into a real person'."),
|
|
1655
1655
|
gridAssetId: z.string().uuid().nullable().optional(),
|
|
1656
1656
|
}),
|
|
1657
1657
|
async run(input, ctx) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Turnaround = the IDENTITY reference. 4 neutral full-body angles. */
|
|
2
|
+
export declare const CHARACTER_ANGLES_DESC = "front view, back view, left side profile, right side profile";
|
|
3
|
+
/**
|
|
4
|
+
* Expression-sheet close-ups = the FACE identity reference (high-res
|
|
5
|
+
* eyes/skin/teeth/bone). Attached alongside the turnaround; the scene-time
|
|
6
|
+
* reference label drives the rendered expression.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CHARACTER_EXPRESSIONS_DESC = "neutral expression on left, genuine smile showing teeth in center, serious frown on right";
|
|
9
|
+
export declare const BODY_POSE_LABELS: readonly ["front", "back", "profile-left", "profile-right"];
|
|
10
|
+
export declare const EXPRESSION_LABELS: readonly ["neutral", "smile", "serious"];
|
|
11
|
+
/**
|
|
12
|
+
* Body turnaround sheet — the identity reference.
|
|
13
|
+
* @param userStyle optional natural-language style transform (e.g. "make her a real person")
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildCharacterTurnaroundPrompt(userStyle?: string | null): string;
|
|
16
|
+
/**
|
|
17
|
+
* Expression sheet — the close-up face reference. Its three portraits carry
|
|
18
|
+
* high-res facial detail (eyes, skin, teeth, bone structure) plus the
|
|
19
|
+
* character's expression range. Attached ALONGSIDE the turnaround; the
|
|
20
|
+
* reference label drives identity-use + scene-driven expression so the multiple
|
|
21
|
+
* expressions don't average the generated face.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildExpressionSheetPrompt(userStyle?: string | null): string;
|
|
24
|
+
//# sourceMappingURL=character-sheet.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Canonical character-sheet prompt content. ONE mode: inherit the source's
|
|
2
|
+
// medium, render on a flat-lit plain background, optional natural-language
|
|
3
|
+
// style transform. (Replaces the old photorealistic / match-reference fork
|
|
4
|
+
// that baked studio lighting or a scene's lighting into the identity ref.)
|
|
5
|
+
//
|
|
6
|
+
// This is the SOURCE OF TRUTH that the desktop templates, the MCP skill
|
|
7
|
+
// markdown, and the lead-magnet are RECONCILED against. They do NOT import it
|
|
8
|
+
// yet (the skill-embed + desktop-import wiring is future work per
|
|
9
|
+
// plans/2026-06-25-slates-prompting-system-overhaul.md), so when you change a
|
|
10
|
+
// rule here, update those copies in the same pass until the wiring ships.
|
|
11
|
+
import { IDENTITY_LIGHTING_CLAUSE, INHERIT_SOURCE_STYLE, } from './reference-rules.js';
|
|
12
|
+
import { renderStyleInstruction } from './style-library.js';
|
|
13
|
+
/** Turnaround = the IDENTITY reference. 4 neutral full-body angles. */
|
|
14
|
+
export const CHARACTER_ANGLES_DESC = 'front view, back view, left side profile, right side profile';
|
|
15
|
+
/**
|
|
16
|
+
* Expression-sheet close-ups = the FACE identity reference (high-res
|
|
17
|
+
* eyes/skin/teeth/bone). Attached alongside the turnaround; the scene-time
|
|
18
|
+
* reference label drives the rendered expression.
|
|
19
|
+
*/
|
|
20
|
+
export const CHARACTER_EXPRESSIONS_DESC = 'neutral expression on left, genuine smile showing teeth in center, serious frown on right';
|
|
21
|
+
export const BODY_POSE_LABELS = ['front', 'back', 'profile-left', 'profile-right'];
|
|
22
|
+
export const EXPRESSION_LABELS = ['neutral', 'smile', 'serious'];
|
|
23
|
+
// The sheet's style directive: a user transform REPLACES the inherit-source
|
|
24
|
+
// instruction (so the model isn't told to both preserve the medium AND change
|
|
25
|
+
// it); otherwise inherit the source medium.
|
|
26
|
+
function styleDirective(userStyle) {
|
|
27
|
+
return renderStyleInstruction(userStyle).trim() || INHERIT_SOURCE_STYLE;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Body turnaround sheet — the identity reference.
|
|
31
|
+
* @param userStyle optional natural-language style transform (e.g. "make her a real person")
|
|
32
|
+
*/
|
|
33
|
+
export function buildCharacterTurnaroundPrompt(userStyle) {
|
|
34
|
+
return (`Character model reference sheet with 4 full body views of the same character: ${CHARACTER_ANGLES_DESC}. ` +
|
|
35
|
+
`Neutral pose, neutral expression, consistent character appearance across all views. ` +
|
|
36
|
+
`${styleDirective(userStyle)} ${IDENTITY_LIGHTING_CLAUSE} ` +
|
|
37
|
+
`For upright/bipedal characters arrange side-by-side; for quadruped/animal characters use a 2x2 grid. ` +
|
|
38
|
+
`No text, no labels, no captions.`);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Expression sheet — the close-up face reference. Its three portraits carry
|
|
42
|
+
* high-res facial detail (eyes, skin, teeth, bone structure) plus the
|
|
43
|
+
* character's expression range. Attached ALONGSIDE the turnaround; the
|
|
44
|
+
* reference label drives identity-use + scene-driven expression so the multiple
|
|
45
|
+
* expressions don't average the generated face.
|
|
46
|
+
*/
|
|
47
|
+
export function buildExpressionSheetPrompt(userStyle) {
|
|
48
|
+
return (`Character expression reference sheet with 3 head and shoulder portraits arranged side by side horizontally: ${CHARACTER_EXPRESSIONS_DESC}. ` +
|
|
49
|
+
`Consistent character appearance across all three. ` +
|
|
50
|
+
`${styleDirective(userStyle)} ${IDENTITY_LIGHTING_CLAUSE} Same framing for each. ` +
|
|
51
|
+
`No text, no labels, no captions.`);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=character-sheet.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single establishing image of an empty location — the optional
|
|
3
|
+
* exact-match environment reference. One frame, naturally lit.
|
|
4
|
+
* @param userStyle optional natural-language style transform
|
|
5
|
+
*/
|
|
6
|
+
export declare function buildEnvironmentEstablishingPrompt(userStyle?: string | null): string;
|
|
7
|
+
/** Guidance shown to users/agents: prefer describing the environment in text. */
|
|
8
|
+
export declare const ENVIRONMENT_DESCRIBE_FIRST = "Default to describing the environment in words and let the model build it to fit the shot. Generate an establishing plate only when a location must be locked exactly across shots.";
|
|
9
|
+
//# sourceMappingURL=environment-sheet.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Canonical environment-plate prompt content. ONE clean establishing image —
|
|
2
|
+
// NOT a 3x3 grid fed whole (that was Eric's "green-screen pasted in front of
|
|
3
|
+
// mountains" failure: a bordered collage used as a reference). Default
|
|
4
|
+
// workflow is to DESCRIBE the location in words; this plate is the optional
|
|
5
|
+
// exact-match lock, and when used it is a single naturally-lit frame.
|
|
6
|
+
import { ENVIRONMENT_NATURAL_LIGHT, INHERIT_SOURCE_STYLE, } from './reference-rules.js';
|
|
7
|
+
import { renderStyleInstruction } from './style-library.js';
|
|
8
|
+
// A user transform REPLACES the inherit-source instruction (no "preserve the
|
|
9
|
+
// medium AND change it" contradiction); otherwise inherit the source medium.
|
|
10
|
+
function styleDirective(userStyle) {
|
|
11
|
+
return renderStyleInstruction(userStyle).trim() || INHERIT_SOURCE_STYLE;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Single establishing image of an empty location — the optional
|
|
15
|
+
* exact-match environment reference. One frame, naturally lit.
|
|
16
|
+
* @param userStyle optional natural-language style transform
|
|
17
|
+
*/
|
|
18
|
+
export function buildEnvironmentEstablishingPrompt(userStyle) {
|
|
19
|
+
return (`A single clean establishing shot of this empty location: a wide, eye-level view that captures the space — its architecture or geography, materials, and depth. ` +
|
|
20
|
+
`The location is empty and unpopulated, ready for scene staging. ` +
|
|
21
|
+
`${styleDirective(userStyle)} Use ${ENVIRONMENT_NATURAL_LIGHT}. ` +
|
|
22
|
+
`If the reference image contains people or characters, generate the location as an empty space — ignore the figures. ` +
|
|
23
|
+
`No text, no labels, no captions.`);
|
|
24
|
+
}
|
|
25
|
+
/** Guidance shown to users/agents: prefer describing the environment in text. */
|
|
26
|
+
export const ENVIRONMENT_DESCRIBE_FIRST = 'Default to describing the environment in words and let the model build it to fit the shot. Generate an establishing plate only when a location must be locked exactly across shots.';
|
|
27
|
+
//# sourceMappingURL=environment-sheet.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @slatesvideo/shared/prompts — the canonical "WHAT" layer for Slates model
|
|
2
|
+
// prompting: reference best-practices, the style library, per-model facts, and
|
|
3
|
+
// the character/environment prompt builders. The desktop app, the MCP
|
|
4
|
+
// prompting skills, and the lead-magnet .skill all DERIVE from here.
|
|
5
|
+
//
|
|
6
|
+
// Propagation rule (the TARGET): research → second-brain; encode once → here;
|
|
7
|
+
// everything else derives. Reality today: nothing imports this module yet — the
|
|
8
|
+
// desktop templates and MCP skill markdown are RECONCILED against it by hand
|
|
9
|
+
// until the desktop-import + skill-embed wiring ships (see the SSOT map +
|
|
10
|
+
// plan). So a change here must be applied to those copies in the same pass for
|
|
11
|
+
// now. SSOT map: second-brain business/projects/slates/product/prompting-ssot.md
|
|
12
|
+
export * from './reference-rules.js';
|
|
13
|
+
export * from './style-library.js';
|
|
14
|
+
export * from './model-facts.js';
|
|
15
|
+
export * from './character-sheet.js';
|
|
16
|
+
export * from './environment-sheet.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ModelFact {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
kind: 'image' | 'video';
|
|
5
|
+
/** Max reference images (image models) — null if not applicable. */
|
|
6
|
+
maxRefImages: number | null;
|
|
7
|
+
/** Max ingredient images (video models) — null if not applicable. */
|
|
8
|
+
maxIngredients: number | null;
|
|
9
|
+
notes: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const MODEL_FACTS: ModelFact[];
|
|
12
|
+
export declare function getModelFact(id: string): ModelFact | undefined;
|
|
13
|
+
/** The official NB2 / general image prompt formula (subject-first). */
|
|
14
|
+
export declare const IMAGE_PROMPT_FORMULA = "[Subject] + [Action] + [Location/context] + [Composition] + [Style]";
|
|
15
|
+
/** The expanded cinematic/photoreal formula for NB2 start frames. */
|
|
16
|
+
export declare const CINEMATIC_IMAGE_FORMULA = "Film still from [DIRECTOR] [GENRE]. Shot on [CAMERA] with [LENS]. [SUBJECT and action]. [3-5 specific visual details]. [LIGHTING \u2014 direction + quality]. [COLOR PALETTE]. [FILM STOCK or sensor language]. [1-2 word emotional tone].";
|
|
17
|
+
//# sourceMappingURL=model-facts.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Per-model prompting facts — reference/ingredient limits and the prompt
|
|
2
|
+
// formula, as KNOWLEDGE (for skills + lead-magnet + desktop tooltips). The
|
|
3
|
+
// RUNTIME source of truth for limits is slate/src/shared/pricing.ts
|
|
4
|
+
// (MODEL_REGISTRY.maxRefImages / maxIngredientImages); these mirror it for
|
|
5
|
+
// documentation. Code-verified 2026-06-25.
|
|
6
|
+
export const MODEL_FACTS = [
|
|
7
|
+
{
|
|
8
|
+
id: 'nano-banana-2',
|
|
9
|
+
label: 'Nano Banana 2 (Gemini 3 Image)',
|
|
10
|
+
kind: 'image',
|
|
11
|
+
maxRefImages: 14, // 10 object-fidelity + 4 character-consistency; categories don't trade.
|
|
12
|
+
maxIngredients: null,
|
|
13
|
+
notes: 'Default image model. 14 refs hard cap (10 object + 4 character). Brief it like a creative director, not tag soup. No negativePrompt field — use positive reframing. Best image start-frame for legible text. Knowledge cutoff Jan 2025.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 'flux-2-max',
|
|
17
|
+
label: 'FLUX.2 Max',
|
|
18
|
+
kind: 'image',
|
|
19
|
+
maxRefImages: 4,
|
|
20
|
+
maxIngredients: null,
|
|
21
|
+
notes: 'Photoreal, less censored, up to ~4MP. Auto-routes to its edit endpoint when references are present. Lower ref cap than NB2.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'seedream-5-lite',
|
|
25
|
+
label: 'Seedream 5 Lite',
|
|
26
|
+
kind: 'image',
|
|
27
|
+
maxRefImages: 10,
|
|
28
|
+
maxIngredients: null,
|
|
29
|
+
notes: 'Cheapest image model (~flat price). Less censored. Routes to its edit endpoint with references.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'seedance-2',
|
|
33
|
+
label: 'Seedance 2.0',
|
|
34
|
+
kind: 'video',
|
|
35
|
+
maxRefImages: null,
|
|
36
|
+
maxIngredients: 9, // ingredient images per video gen
|
|
37
|
+
notes: 'Hero video model — physics, effects, scale. Up to 9 ingredient images. Strong I2V / own-footage restyle.',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'kling-v3',
|
|
41
|
+
label: 'Kling 3.0',
|
|
42
|
+
kind: 'video',
|
|
43
|
+
maxRefImages: null,
|
|
44
|
+
maxIngredients: 4,
|
|
45
|
+
notes: 'Budget-cinematic video — acting, dialogue, lip-sync. Strong start-frame adherence.',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'veo-3.1',
|
|
49
|
+
label: 'Veo 3.1',
|
|
50
|
+
kind: 'video',
|
|
51
|
+
maxRefImages: null,
|
|
52
|
+
maxIngredients: 3,
|
|
53
|
+
notes: 'Native audio. Default audio-on. Strong prompt adherence; treats the prompt as scene direction.',
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
const FACT_BY_ID = new Map(MODEL_FACTS.map((m) => [m.id, m]));
|
|
57
|
+
export function getModelFact(id) {
|
|
58
|
+
return FACT_BY_ID.get(id);
|
|
59
|
+
}
|
|
60
|
+
/** The official NB2 / general image prompt formula (subject-first). */
|
|
61
|
+
export const IMAGE_PROMPT_FORMULA = '[Subject] + [Action] + [Location/context] + [Composition] + [Style]';
|
|
62
|
+
/** The expanded cinematic/photoreal formula for NB2 start frames. */
|
|
63
|
+
export const CINEMATIC_IMAGE_FORMULA = 'Film still from [DIRECTOR] [GENRE]. Shot on [CAMERA] with [LENS]. [SUBJECT and action]. [3-5 specific visual details]. [LIGHTING — direction + quality]. [COLOR PALETTE]. [FILM STOCK or sensor language]. [1-2 word emotional tone].';
|
|
64
|
+
//# sourceMappingURL=model-facts.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type SourceGrade = 'Eric-test' | 'community' | 'code-verified' | 'creator-demo';
|
|
2
|
+
export interface ReferenceRule {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
rule: string;
|
|
6
|
+
why: string;
|
|
7
|
+
grade: SourceGrade;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The 10 verified reference rules. These are the WHY; the fragments below
|
|
11
|
+
* are the reusable text the templates compose.
|
|
12
|
+
*/
|
|
13
|
+
export declare const REFERENCE_RULES: ReferenceRule[];
|
|
14
|
+
/** Flat, even, shadowless identity lighting on a plain neutral background. */
|
|
15
|
+
export declare const IDENTITY_LIGHTING = "flat, even, shadowless lighting";
|
|
16
|
+
export declare const IDENTITY_BACKGROUND = "a plain neutral-grey background";
|
|
17
|
+
export declare const IDENTITY_LIGHTING_CLAUSE = "Render on a plain neutral-grey background with flat, even, shadowless lighting so the sheet captures the character's identity, not scene lighting.";
|
|
18
|
+
/** Inherit the source's artistic medium unless told otherwise. */
|
|
19
|
+
export declare const INHERIT_SOURCE_STYLE = "Preserve the artistic medium and visual style of the reference image (photograph, anime, illustration, 3D render, painterly, etc.).";
|
|
20
|
+
/** Environment plate guidance: one clean, naturally-lit establishing image. */
|
|
21
|
+
export declare const ENVIRONMENT_NATURAL_LIGHT = "natural, even ambient lighting that reads as the location's real light, not a studio setup";
|
|
22
|
+
/** One-line summary used as a header in skills + the lead magnet. */
|
|
23
|
+
export declare const REFERENCE_RULES_HEADLINE = "Identity = a few flat-lit neutral angles; one reference per role, labeled; 2-4 refs not 12; describe environments instead of feeding a grid.";
|
|
24
|
+
/**
|
|
25
|
+
* Canonical markdown block — the SOURCE OF TRUTH the skill markdown and the
|
|
26
|
+
* lead-magnet are reconciled AGAINST. NOTE: nothing imports this yet — the
|
|
27
|
+
* skills hand-author their own reference-rule prose and embed-skills.mjs ships
|
|
28
|
+
* the raw .md as-is, so a change here must be propagated to the per-model skill
|
|
29
|
+
* blocks + lead-magnet by hand until the skill-embed wiring lands (see
|
|
30
|
+
* plans/2026-06-25-slates-prompting-system-overhaul.md). The TARGET is to
|
|
31
|
+
* inject this text so it can't drift; today it's reconciled manually.
|
|
32
|
+
*/
|
|
33
|
+
export declare const REFERENCE_RULES_TEXT = "## Reference rules (how to use reference images)\n\nIdentity = a few flat-lit neutral angles; one reference per role, labeled; 2-4 refs not 12; describe environments instead of feeding a grid.\n\n1. **2-4 strong references beat both extremes.** Not 1 (warps toward itself), not 12 (averages worse). Start with 2-3 focused refs.\n2. **One reference per ROLE, labeled in the prompt.** Identity / style-grade / environment. The model does not infer roles from order \u2014 name each role in the prompt text. Same-role competitors drift.\n3. **Attach both sheets \u2014 label them, don't gate them.** Attach the full-body turnaround (body/proportion/outfit) AND the close-up expression sheet (high-res facial detail: eyes, skin, teeth, bone structure). Label both as identity references and tell the model to render the SCENE's expression (default neutral). An *unlabeled* expression sheet hurts (the model copies the varied expressions \u2192 midpoint face); *labeled*, the close-ups are a fidelity win. The trend is MORE references \u2014 role-labeling is what makes many refs work.\n4. **Flat-light identity refs.** Prep identity refs with flat, even, shadowless lighting on a plain neutral background. Studio-lit / scene-lit sheets bleed their lighting into every generation (the studio-lit sheet \u2192 \"green-screen-pasted in front of mountains\" failure). Reference prep beats prompting here.\n5. **Environment: describe it, don't feed a grid.** Default to describing the location in words. Reserve an environment reference for a mandatory exact-match, and then use ONE clean establishing image with natural, even ambient lighting that reads as the location's real light, not a studio setup \u2014 never a multi-panel grid fed whole.\n6. **Grids: explore, don't input.** Use grids to explore compositions cheaply, then pick a cell. Never feed a grid back in as a reference \u2014 cells share a split detail budget and generate jointly, so flaws propagate.\n7. **Reuse the same refs across all shots.** Lock a set and reuse it; swapping refs mid-sequence causes drift.\n8. **Legible in-shot text \u2192 bake it into an image start frame, never trust text-to-video.** Animate from the locked frame.\n9. **I2V / own-footage superpower.** Restyle your own clip keeping the performance; delayed-VFX on \"video one\"; marker-object insertion; video-as-ref for a series. Describe ONLY what changes.\n10. **Style transform by natural language.** Default keeps the source's art style; an optional plain-text instruction transforms it (\"anime \u2192 real person\"). No preset pickers.";
|
|
34
|
+
//# sourceMappingURL=reference-rules.d.ts.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Reference best-practices — the canonical "how to use reference images"
|
|
2
|
+
// knowledge for every Slates surface (desktop templates, MCP skills, the
|
|
3
|
+
// lead-magnet .skill). Authored ONCE here; consumers derive from it.
|
|
4
|
+
//
|
|
5
|
+
// Source grades: [Eric-test] = Eric's own hands-on result (doctrine-grade);
|
|
6
|
+
// [community] = multi-guide consensus; [code-verified] = verified against
|
|
7
|
+
// the slate codebase; [creator-demo] = single creator demonstration.
|
|
8
|
+
/**
|
|
9
|
+
* The 10 verified reference rules. These are the WHY; the fragments below
|
|
10
|
+
* are the reusable text the templates compose.
|
|
11
|
+
*/
|
|
12
|
+
export const REFERENCE_RULES = [
|
|
13
|
+
{
|
|
14
|
+
id: 'two-to-four-refs',
|
|
15
|
+
title: '2-4 strong references beat both extremes',
|
|
16
|
+
rule: 'Use 2-4 strong, focused references — not 1 (warps), not 12 (averages worse). Start with 2-3.',
|
|
17
|
+
why: 'One reference warps toward itself; a dozen averages everyone into mush. One tester cut drift ~60% going 6→2.',
|
|
18
|
+
grade: 'community',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: 'one-ref-per-role',
|
|
22
|
+
title: 'One reference per ROLE, labeled in the prompt',
|
|
23
|
+
rule: 'Use one reference per role — identity, style-grade, environment — and label each role explicitly in the prompt text. The model does not infer roles from order.',
|
|
24
|
+
why: 'Same-role competitors drift; two "identity" refs of different people blend into a third face.',
|
|
25
|
+
grade: 'community',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'identity-label-roles',
|
|
29
|
+
title: 'Attach both sheets — label them, don\'t gate them',
|
|
30
|
+
rule: 'Attach BOTH the full-body turnaround (body/proportion/outfit) AND the close-up expression sheet (high-res facial detail). Label them as identity references and tell the model to render the SCENE\'s expression (default neutral). The label — not gating — is what stops the multiple expressions from averaging the face.',
|
|
31
|
+
why: 'An UNLABELED expression sheet hurts: the model copies its varied expressions and the face drifts to a midpoint. Labeled ("use for identity; render the scene\'s expression"), the close-ups are a fidelity win — they carry far more facial signal (eyes, skin, teeth, bone structure) than the postage-stamp faces in a full-body turnaround. The trend is MORE references (video/audio/3D into Seedance-class models); role-labeling is what makes many refs work, so lean into attaching rich refs and labeling every role.',
|
|
32
|
+
grade: 'Eric-test',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'flat-light-identity',
|
|
36
|
+
title: 'Flat-light identity refs',
|
|
37
|
+
rule: 'Prep identity refs with flat, even, shadowless lighting on a plain neutral background. Studio-lit or scene-lit sheets bleed their lighting into every generation.',
|
|
38
|
+
why: "Eric's Norse-woman test: a studio-lit sheet produced a subject that looked green-screen-pasted in front of mountains. Reference prep beats prompting here.",
|
|
39
|
+
grade: 'Eric-test',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'describe-environment',
|
|
43
|
+
title: 'Environment: describe it, don\'t feed a grid',
|
|
44
|
+
rule: 'Default to describing the environment in words. Reserve an environment reference for a mandatory exact-match location, and when you do, use ONE clean establishing image — never a multi-panel grid fed whole.',
|
|
45
|
+
why: "Eric's test: character sheet + 3x3 mountain grid → pasted-in mess; the same character + a described background → believable scene with natural lighting the model invented to fit.",
|
|
46
|
+
grade: 'Eric-test',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'grids-explore-not-input',
|
|
50
|
+
title: 'Grids: generation/exploration = fine; INPUT reference = bad',
|
|
51
|
+
rule: 'Use grids to EXPLORE compositions (cheap multi-angle generation), then pick a cell. Do NOT feed a grid back in as a reference image — cells share a split detail budget and generate jointly, so flaws propagate.',
|
|
52
|
+
why: 'A picked cell re-generated with a "preserve the exact composition" prompt keeps its flaws faithfully (that is the budget path, kept on purpose). A loose prompt can fix anatomy but drifts off the picked composition.',
|
|
53
|
+
grade: 'code-verified',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'reuse-refs',
|
|
57
|
+
title: 'Reuse the same refs across all shots',
|
|
58
|
+
rule: 'Lock a reference set and reuse it across every shot in a sequence. Swapping refs mid-sequence causes drift.',
|
|
59
|
+
why: 'The model adapts environment refs to each prompt rather than copying them, so swapping compounds inconsistency shot to shot.',
|
|
60
|
+
grade: 'community',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'text-as-start-frame',
|
|
64
|
+
title: 'Legible in-shot text → image start-frame, never trust text-to-video',
|
|
65
|
+
rule: 'When a shot needs legible on-screen text, bake it into a still start frame (NB2) and animate from that. Do not expect a text-to-video model to render clean text.',
|
|
66
|
+
why: 'Video models smear text; an image model holds it, and the video inherits the locked frame.',
|
|
67
|
+
grade: 'community',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'i2v-own-footage',
|
|
71
|
+
title: 'I2V / own-footage superpower — describe only what changes',
|
|
72
|
+
rule: 'Restyle your own clip while keeping the performance; "video one" delayed-VFX; marker-object insertion; video-as-ref for a series. In all cases describe ONLY what changes, not the whole scene.',
|
|
73
|
+
why: 'The source clip already carries motion, timing, and performance; re-describing them fights the model. Narrate the delta.',
|
|
74
|
+
grade: 'creator-demo',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'style-transform-nl',
|
|
78
|
+
title: 'Style transform by natural language',
|
|
79
|
+
rule: 'Default: keep the source\'s artistic medium/style. To change it, add a plain-text instruction ("anime → real person") — no preset pickers.',
|
|
80
|
+
why: 'Paste/natural-language over preset menus is the product philosophy; the medium is inherited unless the user explicitly asks to transform it.',
|
|
81
|
+
grade: 'Eric-test',
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
// ── Reusable text fragments (the template-assembly building blocks) ──
|
|
85
|
+
// These are the exact strings the desktop prompt templates, MCP skills,
|
|
86
|
+
// and lead-magnet compose. Change a rule HERE and every consumer follows.
|
|
87
|
+
/** Flat, even, shadowless identity lighting on a plain neutral background. */
|
|
88
|
+
export const IDENTITY_LIGHTING = 'flat, even, shadowless lighting';
|
|
89
|
+
export const IDENTITY_BACKGROUND = 'a plain neutral-grey background';
|
|
90
|
+
export const IDENTITY_LIGHTING_CLAUSE = `Render on ${IDENTITY_BACKGROUND} with ${IDENTITY_LIGHTING} so the sheet captures the character's identity, not scene lighting.`;
|
|
91
|
+
/** Inherit the source's artistic medium unless told otherwise. */
|
|
92
|
+
export const INHERIT_SOURCE_STYLE = 'Preserve the artistic medium and visual style of the reference image (photograph, anime, illustration, 3D render, painterly, etc.).';
|
|
93
|
+
/** Environment plate guidance: one clean, naturally-lit establishing image. */
|
|
94
|
+
export const ENVIRONMENT_NATURAL_LIGHT = 'natural, even ambient lighting that reads as the location\'s real light, not a studio setup';
|
|
95
|
+
/** One-line summary used as a header in skills + the lead magnet. */
|
|
96
|
+
export const REFERENCE_RULES_HEADLINE = 'Identity = a few flat-lit neutral angles; one reference per role, labeled; 2-4 refs not 12; describe environments instead of feeding a grid.';
|
|
97
|
+
/**
|
|
98
|
+
* Canonical markdown block — the SOURCE OF TRUTH the skill markdown and the
|
|
99
|
+
* lead-magnet are reconciled AGAINST. NOTE: nothing imports this yet — the
|
|
100
|
+
* skills hand-author their own reference-rule prose and embed-skills.mjs ships
|
|
101
|
+
* the raw .md as-is, so a change here must be propagated to the per-model skill
|
|
102
|
+
* blocks + lead-magnet by hand until the skill-embed wiring lands (see
|
|
103
|
+
* plans/2026-06-25-slates-prompting-system-overhaul.md). The TARGET is to
|
|
104
|
+
* inject this text so it can't drift; today it's reconciled manually.
|
|
105
|
+
*/
|
|
106
|
+
export const REFERENCE_RULES_TEXT = `## Reference rules (how to use reference images)
|
|
107
|
+
|
|
108
|
+
${REFERENCE_RULES_HEADLINE}
|
|
109
|
+
|
|
110
|
+
1. **2-4 strong references beat both extremes.** Not 1 (warps toward itself), not 12 (averages worse). Start with 2-3 focused refs.
|
|
111
|
+
2. **One reference per ROLE, labeled in the prompt.** Identity / style-grade / environment. The model does not infer roles from order — name each role in the prompt text. Same-role competitors drift.
|
|
112
|
+
3. **Attach both sheets — label them, don't gate them.** Attach the full-body turnaround (body/proportion/outfit) AND the close-up expression sheet (high-res facial detail: eyes, skin, teeth, bone structure). Label both as identity references and tell the model to render the SCENE's expression (default neutral). An *unlabeled* expression sheet hurts (the model copies the varied expressions → midpoint face); *labeled*, the close-ups are a fidelity win. The trend is MORE references — role-labeling is what makes many refs work.
|
|
113
|
+
4. **Flat-light identity refs.** Prep identity refs with ${IDENTITY_LIGHTING} on a plain neutral background. Studio-lit / scene-lit sheets bleed their lighting into every generation (the studio-lit sheet → "green-screen-pasted in front of mountains" failure). Reference prep beats prompting here.
|
|
114
|
+
5. **Environment: describe it, don't feed a grid.** Default to describing the location in words. Reserve an environment reference for a mandatory exact-match, and then use ONE clean establishing image with ${ENVIRONMENT_NATURAL_LIGHT} — never a multi-panel grid fed whole.
|
|
115
|
+
6. **Grids: explore, don't input.** Use grids to explore compositions cheaply, then pick a cell. Never feed a grid back in as a reference — cells share a split detail budget and generate jointly, so flaws propagate.
|
|
116
|
+
7. **Reuse the same refs across all shots.** Lock a set and reuse it; swapping refs mid-sequence causes drift.
|
|
117
|
+
8. **Legible in-shot text → bake it into an image start frame, never trust text-to-video.** Animate from the locked frame.
|
|
118
|
+
9. **I2V / own-footage superpower.** Restyle your own clip keeping the performance; delayed-VFX on "video one"; marker-object insertion; video-as-ref for a series. Describe ONLY what changes.
|
|
119
|
+
10. **Style transform by natural language.** Default keeps the source's art style; an optional plain-text instruction transforms it ("anime → real person"). No preset pickers.`;
|
|
120
|
+
//# sourceMappingURL=reference-rules.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface StyleEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
/** What the model should produce when this style is requested. */
|
|
5
|
+
description: string;
|
|
6
|
+
/** The artistic medium this style implies. */
|
|
7
|
+
medium: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Optional named styles for when a user DOES want to name one. The default is
|
|
11
|
+
* always `inherit` — keep the reference's own medium. These are descriptions,
|
|
12
|
+
* not preset buttons; they exist so an agent can translate a user's plain
|
|
13
|
+
* request ("make it anime") into a clean instruction.
|
|
14
|
+
*/
|
|
15
|
+
export declare const STYLE_LIBRARY: StyleEntry[];
|
|
16
|
+
export declare const DEFAULT_STYLE_ID = "inherit";
|
|
17
|
+
export declare function getStyle(id: string | null | undefined): StyleEntry;
|
|
18
|
+
/**
|
|
19
|
+
* Render the optional style instruction that templates append verbatim.
|
|
20
|
+
* - No user style → empty string (inherit the source medium, the default).
|
|
21
|
+
* - A free-text instruction ("make her a real person") → appended as a clean
|
|
22
|
+
* transform clause.
|
|
23
|
+
* - A known style id → the library description.
|
|
24
|
+
*
|
|
25
|
+
* Tolerant of the legacy desktop values ('photorealistic' / 'match-reference'):
|
|
26
|
+
* 'match-reference' coalesces to inherit (empty); 'photorealistic' maps to the
|
|
27
|
+
* photoreal description. So old character/environment rows stay valid with no
|
|
28
|
+
* data migration.
|
|
29
|
+
*/
|
|
30
|
+
export declare function renderStyleInstruction(userStyle?: string | null): string;
|
|
31
|
+
//# sourceMappingURL=style-library.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Style library — the canonical "style name → description / medium" map and
|
|
2
|
+
// the single rule that governs how Slates handles style: inherit the source's
|
|
3
|
+
// artistic medium by default, transform only on an explicit natural-language
|
|
4
|
+
// instruction. No preset pickers (PRODUCT_PHILOSOPHY: paste/NL over menus).
|
|
5
|
+
import { INHERIT_SOURCE_STYLE } from './reference-rules.js';
|
|
6
|
+
/**
|
|
7
|
+
* Optional named styles for when a user DOES want to name one. The default is
|
|
8
|
+
* always `inherit` — keep the reference's own medium. These are descriptions,
|
|
9
|
+
* not preset buttons; they exist so an agent can translate a user's plain
|
|
10
|
+
* request ("make it anime") into a clean instruction.
|
|
11
|
+
*/
|
|
12
|
+
export const STYLE_LIBRARY = [
|
|
13
|
+
{
|
|
14
|
+
id: 'inherit',
|
|
15
|
+
label: 'Match Source',
|
|
16
|
+
description: INHERIT_SOURCE_STYLE,
|
|
17
|
+
medium: 'whatever the reference already is',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'photoreal',
|
|
21
|
+
label: 'Photoreal',
|
|
22
|
+
description: 'A real photograph of a real person/place. Natural skin texture and imperfection, motivated lighting, lens and film-stock language — never the word "photorealistic" as a token.',
|
|
23
|
+
medium: 'live-action photography',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'anime',
|
|
27
|
+
label: 'Anime',
|
|
28
|
+
description: 'Hand-drawn 2D anime/cel style: clean line art, flat-shaded color, expressive eyes.',
|
|
29
|
+
medium: '2D animation',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'painterly',
|
|
33
|
+
label: 'Painterly',
|
|
34
|
+
description: 'Visible brushwork, painted edges, concept-art rendering rather than photographic capture.',
|
|
35
|
+
medium: 'digital/traditional painting',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: '3d-render',
|
|
39
|
+
label: '3D Render',
|
|
40
|
+
description: 'Stylized 3D CGI render: sculpted forms, subsurface materials, soft GI lighting (Pixar/Unreal lineage).',
|
|
41
|
+
medium: '3D render',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'comic',
|
|
45
|
+
label: 'Comic',
|
|
46
|
+
description: 'Inked comic-book style: bold outlines, halftone or flat color, graphic shadows.',
|
|
47
|
+
medium: 'comic illustration',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
export const DEFAULT_STYLE_ID = 'inherit';
|
|
51
|
+
const STYLE_BY_ID = new Map(STYLE_LIBRARY.map((s) => [s.id, s]));
|
|
52
|
+
export function getStyle(id) {
|
|
53
|
+
return (id && STYLE_BY_ID.get(id)) || STYLE_BY_ID.get(DEFAULT_STYLE_ID);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Render the optional style instruction that templates append verbatim.
|
|
57
|
+
* - No user style → empty string (inherit the source medium, the default).
|
|
58
|
+
* - A free-text instruction ("make her a real person") → appended as a clean
|
|
59
|
+
* transform clause.
|
|
60
|
+
* - A known style id → the library description.
|
|
61
|
+
*
|
|
62
|
+
* Tolerant of the legacy desktop values ('photorealistic' / 'match-reference'):
|
|
63
|
+
* 'match-reference' coalesces to inherit (empty); 'photorealistic' maps to the
|
|
64
|
+
* photoreal description. So old character/environment rows stay valid with no
|
|
65
|
+
* data migration.
|
|
66
|
+
*/
|
|
67
|
+
export function renderStyleInstruction(userStyle) {
|
|
68
|
+
const raw = (userStyle ?? '').trim();
|
|
69
|
+
if (!raw)
|
|
70
|
+
return '';
|
|
71
|
+
const lower = raw.toLowerCase();
|
|
72
|
+
// Legacy / default values are no-ops — keep the source medium.
|
|
73
|
+
if (lower === 'match-reference' || lower === 'inherit' || lower === 'match source')
|
|
74
|
+
return '';
|
|
75
|
+
if (lower === 'photorealistic' || lower === 'photoreal') {
|
|
76
|
+
return ` Style: ${getStyle('photoreal').description}`;
|
|
77
|
+
}
|
|
78
|
+
const known = STYLE_BY_ID.get(lower);
|
|
79
|
+
if (known)
|
|
80
|
+
return ` Style: ${known.description}`;
|
|
81
|
+
// Free-text natural-language transform — append verbatim.
|
|
82
|
+
return ` Style change: ${raw}.`;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=style-library.js.map
|