studio-lumiere-cli 0.1.7 → 0.1.8

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.
@@ -1,16 +1,58 @@
1
- import { ETHNICITY_REGIONS, getRandomBackgroundValue, getRandomBackgroundTreatment, getRandomBlazerValue } from './constants.js';
2
- export const buildLLMPrompt = (template, detail, secondaryDetail, tertiaryDetail, quaternaryDetail, quinaryDetail, ethnicity, skinTone, hairColor, background, backgroundType, vibe, photographyStyle, imageCount, occasion, styleHint, isBypassMode = false) => {
1
+ import { ETHNICITY_REGIONS, getRandomBackgroundValue, getRandomBackgroundTreatment, getRandomBlazerValue, JEWELRY_MACRO_QUALITY_PROMPT, JEWELRY_MACRO_QUALITY_PROMPT_2 } from './constants.js';
2
+ export const buildLLMPrompt = (template, detail, secondaryDetail, tertiaryDetail, quaternaryDetail, quinaryDetail, ethnicity, skinTone, hairColor, background, backgroundType, vibe, photographyStyle, imageCount, occasion, backgroundReference, styleHint, uploadMode = 'stacking', editorialMuseCloseUp, editorialMuseUltraCloseUp, flatlayCloseUp, flatlayUltraCloseUp, jewelerInsight, campaignStyle, guidelineReferences, hasMuseReferences = false) => {
3
3
  const needsBothHands = template.id === 'hand_model' && imageCount >= 3;
4
4
  const isEditorialMuse = template.id === 'half_body_muse';
5
- const quantityConstraint = imageCount > 1
6
- ? `The model is wearing ALL the provided pieces together. Do NOT add any other jewelry.${needsBothHands ? ' IMPORTANT: Show BOTH hands with the pieces distributed naturally and elegantly across both hands — do NOT cram all pieces onto a single hand.' : ''}`
7
- : 'The model is wearing ONLY the single piece of jewelry shown in the reference. Do NOT add matching earrings, necklaces, or other rings.';
5
+ const useEditorialCloseUp = isEditorialMuse && !!editorialMuseCloseUp;
6
+ const useEditorialUltraCloseUp = isEditorialMuse && !!editorialMuseUltraCloseUp;
7
+ const useFlatlayCloseUp = template.id === 'flatlay_creative' && !!flatlayCloseUp;
8
+ const useFlatlayUltraCloseUp = template.id === 'flatlay_creative' && !!flatlayUltraCloseUp;
9
+ let quantityConstraint = '';
10
+ if (uploadMode === 'multi_angle') {
11
+ if (template.hasModel) {
12
+ quantityConstraint = 'The attached image(s) show the EXACT SAME single piece of jewelry (from different angles/perspectives). The model is wearing ONLY this single piece. Render EXACTLY ONE physical instance of that piece. Do NOT duplicate, pair, stack, mirror, or show multiple copies. Do NOT show multiple angles of the piece within the same image. Synthesize the views into a single coherent piece and choose ONE viewpoint for the output.';
13
+ }
14
+ else {
15
+ quantityConstraint = 'The attached image(s) show the EXACT SAME single piece of jewelry (from different angles/perspectives). Render EXACTLY ONE physical instance of that piece. Do NOT duplicate, pair, stack, mirror, or show multiple copies. Do NOT show multiple angles of the piece within the same image. Synthesize the views into a single coherent piece and choose ONE viewpoint for the output.';
16
+ }
17
+ }
18
+ else if (uploadMode === 'multi_item_single') {
19
+ if (template.hasModel) {
20
+ quantityConstraint = `The attached image shows MULTIPLE distinct jewelry pieces in a single photo. The model is wearing ALL visible pieces together. Each distinct piece must appear EXACTLY ONCE. Do NOT duplicate, mirror, or multiply any piece. Do NOT add any other jewelry.${needsBothHands ? ' IMPORTANT: Show BOTH hands with the pieces distributed naturally and elegantly across both hands -- do NOT cram all pieces onto a single hand.' : ''}`;
21
+ }
22
+ else {
23
+ quantityConstraint = 'The attached image shows MULTIPLE distinct jewelry pieces in a single photo. Include ALL visible pieces together in the final image. Each distinct piece must appear EXACTLY ONCE. Do NOT duplicate, mirror, or multiply them. Do NOT add any other pieces.';
24
+ }
25
+ }
26
+ else if (imageCount > 1) {
27
+ if (template.hasModel) {
28
+ quantityConstraint = `The model is wearing ALL the provided pieces together. Each distinct piece must appear EXACTLY ONCE. Do NOT duplicate, mirror, or multiply any piece. Do NOT add any other jewelry.${needsBothHands ? ' IMPORTANT: Show BOTH hands with the pieces distributed naturally and elegantly across both hands � do NOT cram all pieces onto a single hand.' : ''}`;
29
+ }
30
+ else {
31
+ quantityConstraint = 'The attached image(s) show the EXACT SAME single piece of jewelry (potentially from different angles/perspectives). Render ONLY this single piece in the scene. Synthesize the view(s) to accurately recreate its details. Do NOT generate multiple pieces of jewelry.';
32
+ }
33
+ }
34
+ else {
35
+ if (template.hasModel) {
36
+ quantityConstraint = 'The model is wearing ONLY the single piece of jewelry shown in the reference. Do NOT add matching earrings, necklaces, or other rings.';
37
+ }
38
+ else {
39
+ quantityConstraint = 'The scene includes ONLY the single piece of jewelry shown in the reference. Do NOT add matching earrings, necklaces, or other rings.';
40
+ }
41
+ }
8
42
  // Dynamic Base Concept
9
43
  let ethnicityLabel = (ethnicity && ethnicity.id !== 'none') ? ethnicity.name : "professional female";
10
44
  const extraModelNotes = [];
11
45
  const framingNotes = [];
12
46
  if (isEditorialMuse) {
13
- framingNotes.push('Framing: waist-up portrait with face, head, and shoulders visible. Hands may appear but must not be the primary subject. Do NOT crop to hands only.');
47
+ if (useEditorialUltraCloseUp) {
48
+ framingNotes.push('Framing: extreme close-up crop with jewelry dominating the frame and filling most of the image. Push the camera much closer. It is acceptable to crop out most of the face, head, and torso to prioritize the jewelry. Background and decor may be minimal or out of frame.');
49
+ }
50
+ else if (useEditorialCloseUp) {
51
+ framingNotes.push('Framing: tight close-up with jewelry prominent and larger in frame. It is acceptable to crop out parts of the face, head, and torso to prioritize the jewelry. Background and decor may be minimal or out of frame.');
52
+ }
53
+ else {
54
+ framingNotes.push('Framing: waist-up portrait with face, head, and shoulders visible. Hands may appear but must not be the primary subject. Do NOT crop to hands only.');
55
+ }
14
56
  extraModelNotes.push('High-fashion beauty, not girl-next-door; unconventional, memorable, magazine-cover presence.');
15
57
  }
16
58
  if (isEditorialMuse && ethnicity?.id === 'african') {
@@ -25,12 +67,24 @@ export const buildLLMPrompt = (template, detail, secondaryDetail, tertiaryDetail
25
67
  ethnicityLabel = `${randomRegion} (${ethnicity.name})`;
26
68
  }
27
69
  let basePrompt = template.basePrompt;
70
+ if (useEditorialUltraCloseUp) {
71
+ basePrompt = 'An extreme close-up editorial photograph of a [ETHNICITY] female model wearing the specific jewelry piece(s) shown. Jewelry should dominate the frame and fill most of the image. It is acceptable to crop out most of the face, head, and torso to prioritize the jewelry. High-fashion editorial mood, beauty-grade skin refinement with smooth even tone, reduced pores, minimal blemishes, still realistic (no plastic skin), cinematic lighting, shot on film.';
72
+ }
73
+ else if (useEditorialCloseUp) {
74
+ basePrompt = 'A tight close-up editorial photograph of a [ETHNICITY] female model wearing the specific jewelry piece(s) shown. Jewelry should be visually dominant. It is acceptable to crop the face, head, or torso to prioritize the jewelry. High-fashion editorial mood, beauty-grade skin refinement with smooth even tone, reduced pores, minimal blemishes, still realistic (no plastic skin), cinematic lighting, shot on film.';
75
+ }
28
76
  basePrompt = basePrompt.replace(/\[ETHNICITY\]/g, ethnicityLabel);
29
77
  const hairColorLabel = (hairColor && hairColor.id !== 'none') ? hairColor.name.toLowerCase() : "natural colored";
30
78
  basePrompt = basePrompt.replace(/\[HAIR_COLOR\]/g, hairColorLabel);
31
79
  const sceneDetails = [];
32
80
  const modelDetails = [];
33
81
  if (!template.hasModel) {
82
+ if (useFlatlayUltraCloseUp) {
83
+ sceneDetails.push('Framing: extreme close-up crop with the jewelry dominating the frame and filling most of the image; push the camera much closer; minimize negative space and background; allow props/material edges to be cropped; emphasize jewelry scale and detail.');
84
+ }
85
+ else if (useFlatlayCloseUp) {
86
+ sceneDetails.push('Framing: tight close-up crop with jewelry filling more of the frame; minimize background and allow props/material edges to be partially cropped; emphasize jewelry scale.');
87
+ }
34
88
  if (detail && template.customizationLabel) {
35
89
  const detailValue = detail.value.replace(/\[HAIR_COLOR\]/g, hairColorLabel);
36
90
  sceneDetails.push(`${template.customizationLabel}: ${detailValue}`);
@@ -53,9 +107,7 @@ export const buildLLMPrompt = (template, detail, secondaryDetail, tertiaryDetail
53
107
  modelDetails.push(`Model Ethnicity: ${ethnicityLabel}`);
54
108
  }
55
109
  if (detail) {
56
- // Replace [HAIR_COLOR] in the detail value (e.g. Hairstyle Context)
57
110
  let detailValue = detail.value.replace(/\[HAIR_COLOR\]/g, hairColorLabel);
58
- // Dynamic override for Blazer outfits to add variety
59
111
  if (detail.id === 'outfit_blazer') {
60
112
  detailValue = getRandomBlazerValue();
61
113
  }
@@ -122,83 +174,162 @@ export const buildLLMPrompt = (template, detail, secondaryDetail, tertiaryDetail
122
174
  'Ilford HP5 (if black and white)'
123
175
  ];
124
176
  const randomFilm = FILM_STOCKS[Math.floor(Math.random() * FILM_STOCKS.length)];
125
- let instruction = `A highly detailed, photorealistic photograph featuring the specific jewelry shown in the attached reference images.
177
+ let instruction = 'A highly detailed, photorealistic photograph featuring the specific jewelry shown in the attached reference image(s).';
178
+ instruction += `
179
+ ${JEWELRY_MACRO_QUALITY_PROMPT}
180
+ `;
181
+ instruction += `
126
182
 
127
- ══════════════════════════════════
183
+ ----------------------------------
128
184
  📸 PHOTOGRAPHY SPECIFICATION
129
- ══════════════════════════════════
130
- Base Concept: ${basePrompt}
131
- Camera: ${randomCamera}
132
- Film Stock: ${randomFilm}
133
- Target: Authentic, high-end editorial photography. Cinematic, naturalistic, slightly imperfect.
185
+ ----------------------------------
186
+ - Base Concept: ${basePrompt}
187
+ - Camera: ${randomCamera}
188
+ - Film Stock: ${randomFilm}
189
+ - Target: Authentic, high-end editorial photography. Cinematic, refined, naturalistic.
134
190
 
135
- ══════════════════════════════════
191
+ ----------------------------------
136
192
  💎 SUBJECT & JEWELRY (HIGHEST PRIORITY)
137
- ══════════════════════════════════
138
- ${quantityConstraint}
193
+ ----------------------------------
139
194
  - ${quantityConstraint}
140
- - The jewelry matches the reference images EXACTLY in all details: metal type, stone cuts, chain style, settings, etc.
195
+ - The jewelry matches the reference images EXACTLY in all details: metal type, stone cuts, chain style, settings, colors, etc.
196
+ - The jewelry MUST be razor-sharp and micro-detailed (tack-sharp edges, crisp facets, ultra-clear metal and stone texture).
197
+ - If the reference image is blurry or low quality, reconstruct the jewelry at higher fidelity; do NOT inherit blur.
198
+ - Absolutely NO blur, soft focus, motion blur, or depth-of-field blur on the jewelry itself (background can be soft).
141
199
  - No additional jewelry pieces or embellishments.
142
200
  - No sparkles, glitter, or magical glow effects.
143
201
  `;
144
- // OCCASION CONTEXT - Give this prominence if selected
202
+ if (jewelerInsight) {
203
+ instruction += `
204
+ ----------------------------------
205
+ 🔍 JEWELER INSIGHT
206
+ ----------------------------------
207
+ Pay special attention to the brand specific details, if any are provided.
208
+
209
+ ${jewelerInsight}
210
+ `;
211
+ }
212
+ if (campaignStyle) {
213
+ instruction += `
214
+ ----------------------------------
215
+ 💫 CAMPAIGN MODE (PREMIUM)
216
+ ----------------------------------
217
+ - Campaign Direction: ${campaignStyle.name}
218
+ - ${campaignStyle.prompt}
219
+ - Goal: billboard-level impact. Bold, cinematic, unforgettable.
220
+ - Do NOT override user selections (background, vibe, styling). Amplify them.
221
+ `;
222
+ }
223
+ const occasionCultural = occasion?.promptDetails?.culturalElements?.length
224
+ ? occasion.promptDetails.culturalElements[Math.floor(Math.random() * occasion.promptDetails.culturalElements.length)]
225
+ : null;
226
+ const occasionDecor = occasion?.promptDetails?.decor?.length
227
+ ? occasion.promptDetails.decor[Math.floor(Math.random() * occasion.promptDetails.decor.length)]
228
+ : null;
145
229
  if (occasion?.promptDetails) {
146
230
  instruction += `
147
- ══════════════════════════════════
231
+ ----------------------------------
148
232
  🎭 OCCASION CONTEXT: ${occasion.name.toUpperCase()}
149
- ══════════════════════════════════
233
+ ----------------------------------
150
234
  - ${occasion.description}
151
-
152
- - 🌟 CULTURAL & THEMATIC ELEMENTS: ${occasion.promptDetails.culturalElements}
153
- ${occasion.promptDetails.decor ? `- 🏛️ OCCASION DECOR: ${occasion.promptDetails.decor}` : ''}
235
+ - 🌟 CULTURAL & THEMATIC ELEMENTS: ${occasionCultural}
236
+ ${occasionDecor ? `- OCCASION DECOR: ${occasionDecor}` : ''}
154
237
  `;
155
238
  }
156
- // MODEL CUSTOMIZATIONS
157
239
  if (modelDetails.length > 0) {
158
240
  instruction += `
159
- ══════════════════════════════════
241
+ ----------------------------------
160
242
  👤 MODEL SPECIFICATIONS
161
- ══════════════════════════════════
243
+ ----------------------------------
162
244
  ${modelDetails.map(detailLine => `- ${detailLine}`).join('\n')}
163
245
  - The model should look like a natural, real human.
164
246
  `;
165
247
  }
166
- // SETTING & BACKGROUND (if not overridden by occasion)
167
- const hasSettingContext = !!(background || backgroundType || vibe || photographyStyle);
248
+ if (guidelineReferences && guidelineReferences.length > 0) {
249
+ const guidelineLines = guidelineReferences.map((ref, index) => `- Guideline Reference #${index + 1} = "${ref.name}"`).join('\n');
250
+ instruction += `
251
+ ----------------------------------
252
+ 📌 GUIDELINE REFERENCES
253
+ ----------------------------------
254
+ - These appear immediately AFTER the ${imageCount} jewelry reference image(s), and BEFORE any background reference image.
255
+ ${guidelineLines}
256
+ - When a guideline includes [[ref:Name]], use the matching Guideline Reference image above.
257
+ - Use these ONLY when referenced in the user's guidelines.
258
+ - Treat them as style/lighting/pose/composition cues; do NOT alter jewelry design from the reference.
259
+ `;
260
+ }
261
+ const isSolidBg = !!(background && background.value && background.value.includes('[SOLID_BG]'));
262
+ const hasSettingContext = !!(background || backgroundType || vibe || photographyStyle || backgroundReference);
168
263
  const shouldRenderSettingBlock = hasSettingContext || sceneDetails.length > 0;
169
264
  if (shouldRenderSettingBlock) {
265
+ const allowCampaignAccent = !(background && background.value && background.value.includes('[USER_BRAND_COLOR]'));
170
266
  instruction += `
171
- ══════════════════════════════════
267
+ ----------------------------------
172
268
  🎬 SETTING & ENVIRONMENT
173
- ══════════════════════════════════
269
+ ----------------------------------
174
270
  `;
175
- if (sceneDetails.length > 0) {
176
- instruction += `${sceneDetails.map(detailLine => `- ${detailLine}`).join('\n')}\n`;
271
+ if (isSolidBg) {
272
+ // Extract just the color specification
273
+ const colorValue = background.value.replace('[USER_BRAND_COLOR]', '').replace('[SOLID_BG]', '').trim();
274
+ instruction += `- BACKGROUND: A single, perfectly uniform, PURE SOLID COLOR filling the entire background � ${colorValue}.
275
+ - The background MUST be completely flat and uniform: absolutely NO gradients, NO textures, NO patterns, NO shadows on the background, NO objects, NO surfaces, NO environmental elements.
276
+ - Think of it as a perfectly even studio backdrop paper of exactly this color.
277
+ - The ONLY non-background elements in the image are the subject (jewelry and model if applicable).
278
+ `;
279
+ // Still include non-background scene details (e.g. surface for flatlay)
280
+ if (sceneDetails.length > 0) {
281
+ instruction += `${sceneDetails.map(detailLine => `- ${detailLine}`).join('\n')}\n`;
282
+ }
283
+ // Skip: backgroundReference, backgroundType, backgroundTreatment
284
+ // Keep photography style and vibe as they affect lighting/mood, not background content
285
+ if (photographyStyle) {
286
+ instruction += `- Overall Photography Style: ${photographyStyle.value}\n`;
287
+ }
177
288
  }
178
- // BACKGROUND TYPE (only add if no specific occasion context that would dictate the setting)
179
- if (backgroundType) {
180
- if (!occasion) {
181
- const bgValue = getRandomBackgroundValue(backgroundType.id, backgroundType.value);
289
+ else {
290
+ if (sceneDetails.length > 0) {
291
+ instruction += `${sceneDetails.map(detailLine => `- ${detailLine}`).join('\n')}\n`;
292
+ }
293
+ if (backgroundReference) {
294
+ const referenceLabel = backgroundReference.name ? ` ("${backgroundReference.name}")` : '';
295
+ const orderingNote = hasMuseReferences
296
+ ? 'The background reference image is provided after the jewelry and guideline reference images, and BEFORE the final 3 Muse reference images.'
297
+ : 'The background reference image is provided after the jewelry and guideline reference images.';
298
+ instruction += `- Background Image Reference${referenceLabel}: Use the provided background image as the exact background. Preserve its colors, textures, and lighting. Place the jewelry composition on top of that background. ${orderingNote}\n`;
299
+ }
300
+ if (backgroundType && !occasion && !backgroundReference) {
301
+ const bgValue = getRandomBackgroundValue(backgroundType.id, backgroundType.value, !!campaignStyle, allowCampaignAccent);
182
302
  instruction += `- Setting Type: ${bgValue}\n`;
183
303
  }
184
- }
185
- if (background && background.value) {
186
- if (template.id === 'flatlay_creative') {
187
- instruction += `- Secondary accent color/texture element to complement the main surface: ${background.value}\n`;
304
+ if (background && background.value) {
305
+ const isUserBrandColor = background.value.includes('[USER_BRAND_COLOR]');
306
+ const colorValue = isUserBrandColor ? background.value.replace('[USER_BRAND_COLOR] ', '') : background.value;
307
+ if (template.id === 'flatlay_creative') {
308
+ instruction += isUserBrandColor
309
+ ? `- MANDATORY Accent Color: ${colorValue}. The dominant accent tone in the scene MUST match this exact color.\n`
310
+ : `- Secondary accent color/texture element to complement the main material: ${colorValue}\n`;
311
+ }
312
+ else {
313
+ instruction += isUserBrandColor
314
+ ? `- MANDATORY Background/Accent Color: ${colorValue}. The background and environment tones MUST prominently feature this exact color.\n`
315
+ : `- Color Palette & Texture: ${colorValue}\n`;
316
+ }
188
317
  }
189
- else {
190
- instruction += `- Color Palette & Texture: ${background.value}\n`;
318
+ if (vibe) {
319
+ let vibeValue = vibe.value;
320
+ if (!template.hasModel) {
321
+ vibeValue = vibeValue.replace(/,?\s*shot on [^,]+ lens/gi, '').replace(/\s{2,}/g, ' ').trim();
322
+ }
323
+ if (vibeValue) {
324
+ instruction += `- Mood & Vibes: ${vibeValue}\n`;
325
+ }
326
+ }
327
+ if (photographyStyle) {
328
+ instruction += `- Overall Photography Style: ${photographyStyle.value}\n`;
329
+ }
330
+ if (hasSettingContext && !backgroundReference) {
331
+ instruction += `\n- Background Treatment: ${getRandomBackgroundTreatment()}\n`;
191
332
  }
192
- }
193
- if (vibe) {
194
- instruction += `- Mood & Vibes: ${vibe.value}\n`;
195
- }
196
- if (photographyStyle) {
197
- instruction += `- Overall Photography Style: ${photographyStyle.value}\n`;
198
- }
199
- if (hasSettingContext) {
200
- instruction += `\n- Background Treatment: ${getRandomBackgroundTreatment()}
201
- `;
202
333
  }
203
334
  }
204
335
  const LIGHTING_MODES = [
@@ -208,77 +339,108 @@ ${modelDetails.map(detailLine => `- ${detailLine}`).join('\n')}
208
339
  'Gentle overhead diffused studio lighting for authentic material representation',
209
340
  'Dramatic chiaroscuro lighting with deep, natural shadows'
210
341
  ];
211
- const randomLighting = LIGHTING_MODES[Math.floor(Math.random() * LIGHTING_MODES.length)];
212
- // TECHNICAL REQUIREMENTS
342
+ let randomLighting = LIGHTING_MODES[Math.floor(Math.random() * LIGHTING_MODES.length)];
343
+ if (photographyStyle?.id === 'sculptural_light') {
344
+ randomLighting = 'Single hard key light from a high angle, crisp shadow edge, controlled specular highlights, studio-grade product lighting';
345
+ }
213
346
  instruction += `
214
- ══════════════════════════════════
347
+ ----------------------------------
215
348
  ⚙️ TECHNICAL REQUIREMENTS
216
- ══════════════════════════════════
349
+ ----------------------------------
217
350
  - ${randomLighting}
218
- - Sharp focus on jewelry with shallow depth of field
219
- - Natural skin texture with subtle variation; avoid over-smoothing or plastic skin
351
+ - Ultra-sharp focus on jewelry; depth-of-field blur applies ONLY to the background
220
352
  - Lighting should feel natural with gentle falloff and imperfect shadow edges
221
353
  - Optional subtle lens character (light vignetting, mild edge softness) when appropriate
222
354
  - Authentic photographic quality (film grain acceptable)
223
355
  - Professional color grading
224
356
  - 2K resolution output quality
225
357
  `;
226
- // STYLE & POSE DIRECTION (for diversity in batch generation)
358
+ if (template.hasModel) {
359
+ instruction += `- Beauty-retouched skin finish: smooth even tone, reduced pores, minimal blemishes, still realistic (no plastic skin)`;
360
+ }
227
361
  if (styleHint) {
228
362
  instruction += `
229
- ══════════════════════════════════
363
+
364
+ ----------------------------------
230
365
  🎭 STYLE & POSE DIRECTION
231
- ══════════════════════════════════
366
+ ----------------------------------
232
367
  - ${styleHint}
233
- - IMPORTANT: Follow this specific direction to ensure variety across generated images.
234
368
  `;
235
369
  }
236
370
  instruction += `
237
- ══════════════════════════════════
371
+ ----------------------------------
238
372
  🚫 STRICT PROHIBITIONS
239
- ══════════════════════════════════
373
+ ----------------------------------
240
374
  - DO NOT add: fake sparkles, glitter particles, magical glows, lens flares, additional jewelry not in reference.
241
375
  - DO NOT change: the jewelry design, metal type, stone cuts, or any jewelry characteristics.
242
376
  - DO NOT add: scratches, chips, patina, damage, or wear to the jewelry.
243
377
  - DO NOT use: artificial effects, over-processing, unrealistic elements.
244
378
  - DO NOT generate nudity, semi-nudity or scandalous imagery. The model should be elegantly styled and tastefully posed.
245
379
  `;
246
- if (!isBypassMode) {
247
- instruction += `
248
- - OUTPUT: A structured JSON-like prompt with distinct sections. Do not use a single block of text. Use the following format:
249
-
250
- {
251
- "Subject": "Detailed description of the jewelry and model...",
252
- "Environment": "Setting, background, and atmosphere...",
253
- "Lighting": "Lighting details...",
254
- "Photography": "Camera and technical specs..."
255
- }
256
-
257
- - Ensure the content of each section is rich, dense, and highly descriptive.
258
- `;
380
+ if (uploadMode === 'multi_angle') {
381
+ instruction += `- CRITICAL: Do NOT duplicate the jewelry or show multiple instances (no pairs, stacks, or mirrored copies).`;
259
382
  }
383
+ instruction += `
384
+ ${JEWELRY_MACRO_QUALITY_PROMPT_2}
385
+ `;
260
386
  return instruction;
261
387
  };
262
- export const buildSystemInstruction = (template, ethnicity) => {
388
+ export const buildSystemInstruction = (template, ethnicity, imageCount = 1, uploadMode = 'stacking', userGuidelines, hasBackgroundReference = false, hasGuidelineReferences = false, hasMuseReferences = false) => {
263
389
  const isFloating = template.id === 'floating_minimal';
264
390
  const isFlatlay = template.id === 'flatlay_creative';
391
+ const isSolidColorStudio = template.id === 'solid_color_studio';
265
392
  const isHandModel = template.id === 'hand_model';
266
393
  const isMuseumExhibit = template.id === 'museum_exhibit';
267
394
  const isRomance = template.id === 'romance_proposal';
268
395
  const isRomanticMood = template.id === 'romantic_mood';
269
396
  let llmSystemInstruction = '';
397
+ let fidelityRule = '';
398
+ if (uploadMode === 'multi_angle') {
399
+ fidelityRule = template.hasModel
400
+ ? `1. **JEWELRY FIDELITY (TOP PRIORITY)**: The attached image(s) show the EXACT SAME single piece of jewelry (from different angles).
401
+ - The model must wear ONLY this single piece.
402
+ - Render EXACTLY ONE physical instance of the piece (no duplicates, pairs, stacks, mirrors).
403
+ - Do NOT show multiple angles of the piece within the same image.
404
+ - Synthesize the views into a single coherent piece and choose ONE viewpoint for the output.
405
+ - Do NOT invent new pieces or modify the design.`
406
+ : `1. **JEWELRY FIDELITY (TOP PRIORITY)**: The attached image(s) show the EXACT SAME single piece of jewelry (from different angles).
407
+ - Render EXACTLY ONE physical instance of the piece (no duplicates, pairs, stacks, mirrors).
408
+ - Do NOT show multiple angles of the piece within the same image.
409
+ - Synthesize the views into a single coherent piece and choose ONE viewpoint for the output.
410
+ - Do NOT invent new pieces or modify the design.
411
+ - The jewelry must match the reference images EXACTLY in all details: shape, metal type, stone cuts, chain style, settings, colors, etc. Do NOT change any aspect of the jewelry's appearance.`;
412
+ }
413
+ else if (uploadMode === 'multi_item_single') {
414
+ fidelityRule = `1. **JEWELRY FIDELITY (TOP PRIORITY)**: The attached image shows MULTIPLE distinct jewelry pieces in a single photo.
415
+ - The final image must contain ALL visible pieces together.
416
+ - Each distinct piece must appear EXACTLY ONCE. Do NOT duplicate, mirror, or multiply any piece.
417
+ - Do NOT invent new pieces.
418
+ - Do NOT modify the design of the existing jewelry.
419
+ - THIS IS THE MOST IMPORTANT RULE: The jewelry must match the reference image EXACTLY in all details: shape, metal type, stone cuts, chain style, settings, colors, etc. Do NOT change any aspect of the jewelry's appearance.`;
420
+ }
421
+ else if (imageCount > 1) {
422
+ fidelityRule = `1. **JEWELRY FIDELITY (TOP PRIORITY)**: The final image must contain ALL the jewelry pieces visible in the reference images, styled together.
423
+ - Each distinct piece must appear EXACTLY ONCE. Do NOT duplicate, mirror, or multiply any piece.
424
+ - Do NOT invent new pieces.
425
+ - Do NOT modify the design of the existing jewelry.
426
+ - THIS IS THE MOST IMPORTANT RULE: The jewelry must match the reference images EXACTLY in all details: shape, metal type, stone cuts, chain style, settings, colors, etc. Do NOT change any aspect of the jewelry's appearance.`;
427
+ }
428
+ else {
429
+ fidelityRule = `1. **JEWELRY FIDELITY (TOP PRIORITY)**: The final image must contain ONLY the jewelry piece visible in the reference image.
430
+ - Do NOT invent new pieces (e.g. do not add a necklace if only a ring is provided).
431
+ - Do NOT modify the design of the existing jewelry.
432
+ THIS IS THE MOST IMPORTANT RULE: The jewelry must match the reference image EXACTLY in all details: shape, metal type, stone cuts, chain style, settings, colors, etc. Do NOT change any aspect of the jewelry's appearance.`;
433
+ }
270
434
  if (isRomanticMood) {
271
435
  llmSystemInstruction = `You are a world-renowned still-life photographer and prop stylist for luxury jewelry and lifestyle brands.
272
436
  Generate a DREAMY, INTIMATE STILL-LIFE PHOTOGRAPH of jewelry in a romantic setting.
273
437
 
274
438
  CRITICAL GUIDELINES:
275
- 1. **JEWELRY FIDELITY (TOP PRIORITY)**: The final image must contain ONLY the jewelry pieces visible in the reference images.
276
- - Do NOT invent new pieces.
277
- - Do NOT modify the design of the existing jewelry.
439
+ ${fidelityRule}
278
440
  2. **PROP DISCIPLINE (CRITICAL)**: Use ONLY the specific prop/scene described in the user's customization choice. Do NOT add other props.
279
441
  - If the user chose "candles", the scene is ONLY candles and the jewelry. Do NOT add roses, letters, or other objects.
280
442
  - If the user chose "rose petals", the scene is ONLY rose petals and the jewelry. Do NOT add candles, letters, or other objects.
281
- - Keep the scene focused and minimal one prop theme, not a cluttered collection of romantic clichés.
443
+ - Keep the scene focused and minimal one prop theme, not a cluttered collection of romantic clich�s.
282
444
  3. **Subject**: NO human model, NO body parts, NO mannequins, NO hands.
283
445
  4. **NO FAKE EFFECTS**: Strictly FORBID "sparkles", "glitter particles", "magical glow". Use natural light and genuine material textures.`;
284
446
  }
@@ -288,9 +450,7 @@ export const buildSystemInstruction = (template, ethnicity) => {
288
450
  Generate an INTIMATE, EMOTIONALLY POWERFUL photograph based on the reference jewelry images.
289
451
 
290
452
  CRITICAL GUIDELINES:
291
- 1. **JEWELRY FIDELITY (TOP PRIORITY)**: The final image must contain ONLY the jewelry pieces visible in the reference images.
292
- - Do NOT invent new pieces (e.g. do not add a necklace if only a ring is provided).
293
- - Do NOT modify the design of the existing jewelry.
453
+ ${fidelityRule}
294
454
  2. **Subject**: Focus on the emotional authenticity of the moment. The jewelry (especially rings) should be prominently visible but feel naturally integrated.
295
455
  - Hands, fingers, and body language are critical storytelling elements.
296
456
  - Ethnicity context: ${ethnicityPrompt}
@@ -301,9 +461,7 @@ export const buildSystemInstruction = (template, ethnicity) => {
301
461
  Generate a MUSEUM-QUALITY photograph of jewelry displayed as a priceless exhibit.
302
462
 
303
463
  CRITICAL GUIDELINES:
304
- 1. **JEWELRY FIDELITY (TOP PRIORITY)**: The final image must contain ONLY the jewelry pieces visible in the reference images.
305
- - Do NOT invent new pieces.
306
- - Do NOT modify the design of the existing jewelry.
464
+ ${fidelityRule}
307
465
  2. **Subject**: The jewelry should be displayed as a priceless artifact worthy of the world's greatest museums.
308
466
  - NO human model, NO body parts, NO mannequins.
309
467
  3. **NO FAKE EFFECTS**: Strictly FORBID "sparkles", "glitter particles", "magical glow". Professional museum lighting only.`;
@@ -313,23 +471,27 @@ export const buildSystemInstruction = (template, ethnicity) => {
313
471
  Generate a HYPER-REALISTIC product photograph based on the reference images.
314
472
 
315
473
  CRITICAL GUIDELINES:
316
- 1. **JEWELRY FIDELITY (TOP PRIORITY)**: The final image must contain ONLY the jewelry pieces visible in the reference images.
317
- - Do NOT invent new pieces (e.g. do not add earrings if only a necklace is provided).
318
- - Do NOT modify the design of the existing jewelry.
474
+ ${fidelityRule}
319
475
  2. **Subject**: The jewelry should appear to be SUSPENDED in mid-air, floating, with NO human model, NO body parts, and NO mannequins. Focus on dramatic lighting, shadows, and a clean, minimalist composition.
320
476
  3. **NO FAKE EFFECTS**: Strictly FORBID "sparkles", "glitter particles", "magical glow". Natural light reflection only.`;
321
477
  }
478
+ else if (isSolidColorStudio) {
479
+ llmSystemInstruction = `You are a world-renowned product photographer and creative director for luxury jewelry campaigns.
480
+ Generate a HYPER-REALISTIC product photograph based on the reference images.
481
+
482
+ CRITICAL GUIDELINES:
483
+ ${fidelityRule}
484
+ 2. **Subject**: The jewelry is the ONLY subject. NO human model, NO body parts, NO mannequins, NO props, NO surfaces or platforms.
485
+ 3. **Background**: Must be a perfectly uniform solid color exactly as specified by the user prompt. NO gradients, NO textures, NO environmental elements.
486
+ 4. **NO FAKE EFFECTS**: Strictly FORBID "sparkles", "glitter particles", "magical glow". Natural light reflection only.`;
487
+ }
322
488
  else if (isFlatlay) {
323
489
  llmSystemInstruction = `You are a world-renowned product photographer and creative director for luxury jewelry campaigns.
324
490
  Generate a HYPER-REALISTIC product photograph based on the reference images.
325
491
 
326
492
  CRITICAL GUIDELINES:
327
- 1. **JEWELRY FIDELITY (TOP PRIORITY)**: The final image must contain ONLY the jewelry pieces visible in the reference images.
328
- - Do NOT invent new pieces (e.g. do not add earrings if only a necklace is provided).
329
- - Do NOT modify the design of the existing jewelry.
493
+ ${fidelityRule}
330
494
  2. **Subject**: The jewelry should be displayed as a creative still-life composition, with NO human model, NO body parts, and NO mannequins.
331
- - The jewelry may be laid flat on a surface, OR elevated on geometric pedestals, cubes, stone risers, plinths, or sculptural props.
332
- - Lighting should always look natural and photographic — soft studio light, window light, or gentle directional light. Shadows should feel organic, not artificial.
333
495
  3. **NO FAKE EFFECTS**: Strictly FORBID "sparkles", "glitter particles", "magical glow", neon lighting, overly stylized color gels. Natural light reflection only.`;
334
496
  }
335
497
  else if (isHandModel) {
@@ -337,9 +499,7 @@ export const buildSystemInstruction = (template, ethnicity) => {
337
499
  Generate a HYPER-REALISTIC hand model photograph based on the reference images.
338
500
 
339
501
  CRITICAL GUIDELINES:
340
- 1. **JEWELRY FIDELITY (TOP PRIORITY)**: The final image must contain ONLY the jewelry pieces visible in the reference images.
341
- - Do NOT invent new pieces (e.g. do not add earrings if only a ring is provided).
342
- - Do NOT modify the design of the existing jewelry.
502
+ ${fidelityRule}
343
503
  2. **FRAMING (CRITICAL)**: The image focuses on the hand, wrist, and forearm area.
344
504
  - NO face, head, or shoulders visible.
345
505
  - The forearm may be bare OR elegantly sleeved (luxurious fabrics like silk, cashmere, lace, velvet).
@@ -352,15 +512,19 @@ export const buildSystemInstruction = (template, ethnicity) => {
352
512
  else {
353
513
  const ethnicityPrompt = (ethnicity && ethnicity.id !== 'none') ? ethnicity.value : "Professional female model";
354
514
  llmSystemInstruction = `You are a world-renowned fashion photographer and creative director for Vogue Arabia and High Jewelry campaigns.
355
- Generate an AUTHENTIC, CINEMATIC photograph based on the reference images. Skin texture should look natural and realistic (not overly smoothed).
515
+ Generate an AUTHENTIC, CINEMATIC photograph based on the reference images. Beauty retouching is desired: smooth even complexion, reduced pores, minimal blemishes; keep a realistic finish and avoid plastic skin.
356
516
 
357
517
  CRITICAL GUIDELINES:
358
- 1. **JEWELRY FIDELITY (TOP PRIORITY)**: The final image must contain ONLY the jewelry pieces visible in the reference images.
359
- - Do NOT invent new pieces (e.g. do not add earrings if only a necklace is provided).
360
- - Do NOT modify the design of the existing jewelry.
361
- - If one ring is provided, the model wears ONE ring.
518
+ ${fidelityRule}
362
519
  2. **Subject**: ALWAYS a ${ethnicityPrompt} (age 20-30).
363
520
  3. **NO FAKE EFFECTS**: Strictly FORBID "sparkles", "glitter particles", "magical glow". Natural light reflection only.`;
521
+ }
522
+ if (userGuidelines && userGuidelines.trim()) {
523
+ llmSystemInstruction += `
524
+
525
+ USER-SPECIFIC GUIDELINES (MUST RESPECT IF ANY ARE PROVIDED):
526
+ ${userGuidelines.trim()}
527
+ `;
364
528
  }
365
529
  llmSystemInstruction += `
366
530
  IMPORTANT:
@@ -368,6 +532,18 @@ IMPORTANT:
368
532
  2. Follow and prioritize the "MODEL SPECIFICATIONS" directives from the user prompt.
369
533
  3. If an "Overall Photography Style" directive is provided, treat it as a required style constraint.
370
534
  4. Only override these style directives if they conflict with jewelry fidelity or explicit prohibitions above.`;
535
+ if (hasGuidelineReferences || hasBackgroundReference || hasMuseReferences) {
536
+ llmSystemInstruction += `
537
+ 5. Image reference ordering (important):
538
+ - Jewelry reference images come first.
539
+ - Guideline reference images (if any) come next.
540
+ - Background reference image (if any) comes after guideline references.
541
+ - If Muse images are provided, they are the final 3 images.`;
542
+ }
543
+ if (hasBackgroundReference) {
544
+ llmSystemInstruction += `
545
+ 6. The background reference image must be used as the exact background.`;
546
+ }
371
547
  return llmSystemInstruction;
372
548
  };
373
549
  //# sourceMappingURL=promptBuilder.js.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