@mindstudio-ai/remy 0.1.198 → 0.1.199
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/headless.js
CHANGED
|
@@ -4232,7 +4232,15 @@ var SYSTEM_PROMPT = readAsset(
|
|
|
4232
4232
|
"subagents/designExpert/tools/images/enhance-image-prompt.md"
|
|
4233
4233
|
);
|
|
4234
4234
|
async function enhanceImagePrompt(params) {
|
|
4235
|
-
const {
|
|
4235
|
+
const {
|
|
4236
|
+
brief,
|
|
4237
|
+
width,
|
|
4238
|
+
height,
|
|
4239
|
+
transparentBackground,
|
|
4240
|
+
hasReferenceImage,
|
|
4241
|
+
onLog,
|
|
4242
|
+
model
|
|
4243
|
+
} = params;
|
|
4236
4244
|
const contextParts = [
|
|
4237
4245
|
`Dimensions: ${width}x${height}${width > height ? " (landscape)" : width < height ? " (portrait)" : " (square)"}`
|
|
4238
4246
|
];
|
|
@@ -4241,6 +4249,11 @@ async function enhanceImagePrompt(params) {
|
|
|
4241
4249
|
"Transparent background: yes \u2014 the background will be removed. Focus on the subject as an isolated element."
|
|
4242
4250
|
);
|
|
4243
4251
|
}
|
|
4252
|
+
if (hasReferenceImage) {
|
|
4253
|
+
contextParts.push(
|
|
4254
|
+
"Reference image: yes \u2014 a reference image is provided to the generation model alongside this prompt to guide style, subject, or composition. Complement it; don't re-describe what it already carries."
|
|
4255
|
+
);
|
|
4256
|
+
}
|
|
4244
4257
|
const context = `<context>
|
|
4245
4258
|
${contextParts.join("\n")}
|
|
4246
4259
|
</context>`;
|
|
@@ -4271,6 +4284,7 @@ async function generateImageAssets(opts) {
|
|
|
4271
4284
|
prompts,
|
|
4272
4285
|
sourceImages,
|
|
4273
4286
|
transparentBackground,
|
|
4287
|
+
enhancePrompts,
|
|
4274
4288
|
onLog,
|
|
4275
4289
|
imageGenerationModel: genModel,
|
|
4276
4290
|
imageAnalysisModel,
|
|
@@ -4289,19 +4303,20 @@ async function generateImageAssets(opts) {
|
|
|
4289
4303
|
config.source_image = firstImage;
|
|
4290
4304
|
config.source = firstImage;
|
|
4291
4305
|
}
|
|
4292
|
-
const
|
|
4293
|
-
const enhancedPrompts =
|
|
4306
|
+
const hasReference = !!sourceImages?.length;
|
|
4307
|
+
const enhancedPrompts = enhancePrompts ? await Promise.all(
|
|
4294
4308
|
prompts.map(
|
|
4295
4309
|
(brief) => enhanceImagePrompt({
|
|
4296
4310
|
brief,
|
|
4297
4311
|
width,
|
|
4298
4312
|
height,
|
|
4299
4313
|
transparentBackground,
|
|
4314
|
+
hasReferenceImage: hasReference,
|
|
4300
4315
|
onLog,
|
|
4301
4316
|
model: imagePromptEnhancerModel
|
|
4302
4317
|
})
|
|
4303
4318
|
)
|
|
4304
|
-
);
|
|
4319
|
+
) : prompts;
|
|
4305
4320
|
let imageUrls;
|
|
4306
4321
|
if (enhancedPrompts.length === 1) {
|
|
4307
4322
|
const step = JSON.stringify({
|
|
@@ -4371,7 +4386,7 @@ async function generateImageAssets(opts) {
|
|
|
4371
4386
|
if (url.startsWith("Error")) {
|
|
4372
4387
|
return {
|
|
4373
4388
|
prompt: prompts[i],
|
|
4374
|
-
|
|
4389
|
+
...enhancePrompts && { enhancedPrompt: enhancedPrompts[i] },
|
|
4375
4390
|
error: url
|
|
4376
4391
|
};
|
|
4377
4392
|
}
|
|
@@ -4384,7 +4399,7 @@ async function generateImageAssets(opts) {
|
|
|
4384
4399
|
return {
|
|
4385
4400
|
url,
|
|
4386
4401
|
prompt: prompts[i],
|
|
4387
|
-
|
|
4402
|
+
...enhancePrompts && { enhancedPrompt: enhancedPrompts[i] },
|
|
4388
4403
|
analysis,
|
|
4389
4404
|
width,
|
|
4390
4405
|
height
|
|
@@ -4409,6 +4424,10 @@ var definition6 = {
|
|
|
4409
4424
|
},
|
|
4410
4425
|
description: "One or more image briefs describing what you want. Focus on subject, mood, style, and intended use \u2014 the tool optimizes your brief into a model-ready prompt automatically. Multiple briefs run in parallel."
|
|
4411
4426
|
},
|
|
4427
|
+
referenceImage: {
|
|
4428
|
+
type: "string",
|
|
4429
|
+
description: "Optional URL of a single reference image to guide the generation \u2014 for style, subject, character consistency, or composition. Your prompt still describes the desired result; the reference conditions it. Applies to every prompt in the batch."
|
|
4430
|
+
},
|
|
4412
4431
|
width: {
|
|
4413
4432
|
type: "number",
|
|
4414
4433
|
description: "Image width in pixels. Default 2048. Range: 2048-4096."
|
|
@@ -4431,6 +4450,8 @@ async function execute6(input, onLog, context) {
|
|
|
4431
4450
|
width: input.width,
|
|
4432
4451
|
height: input.height,
|
|
4433
4452
|
transparentBackground: input.transparentBackground,
|
|
4453
|
+
sourceImages: input.referenceImage ? [input.referenceImage] : void 0,
|
|
4454
|
+
enhancePrompts: true,
|
|
4434
4455
|
onLog,
|
|
4435
4456
|
imageGenerationModel: resolveModel(
|
|
4436
4457
|
"imageGeneration",
|
|
@@ -4500,6 +4521,7 @@ async function execute7(input, onLog, context) {
|
|
|
4500
4521
|
width: input.width,
|
|
4501
4522
|
height: input.height,
|
|
4502
4523
|
transparentBackground: input.transparentBackground,
|
|
4524
|
+
enhancePrompts: false,
|
|
4503
4525
|
onLog,
|
|
4504
4526
|
imageGenerationModel: resolveModel(
|
|
4505
4527
|
"imageGeneration",
|
package/dist/index.js
CHANGED
|
@@ -4957,7 +4957,15 @@ var init_screenshot3 = __esm({
|
|
|
4957
4957
|
|
|
4958
4958
|
// src/subagents/designExpert/tools/images/enhancePrompt.ts
|
|
4959
4959
|
async function enhanceImagePrompt(params) {
|
|
4960
|
-
const {
|
|
4960
|
+
const {
|
|
4961
|
+
brief,
|
|
4962
|
+
width,
|
|
4963
|
+
height,
|
|
4964
|
+
transparentBackground,
|
|
4965
|
+
hasReferenceImage,
|
|
4966
|
+
onLog,
|
|
4967
|
+
model
|
|
4968
|
+
} = params;
|
|
4961
4969
|
const contextParts = [
|
|
4962
4970
|
`Dimensions: ${width}x${height}${width > height ? " (landscape)" : width < height ? " (portrait)" : " (square)"}`
|
|
4963
4971
|
];
|
|
@@ -4966,6 +4974,11 @@ async function enhanceImagePrompt(params) {
|
|
|
4966
4974
|
"Transparent background: yes \u2014 the background will be removed. Focus on the subject as an isolated element."
|
|
4967
4975
|
);
|
|
4968
4976
|
}
|
|
4977
|
+
if (hasReferenceImage) {
|
|
4978
|
+
contextParts.push(
|
|
4979
|
+
"Reference image: yes \u2014 a reference image is provided to the generation model alongside this prompt to guide style, subject, or composition. Complement it; don't re-describe what it already carries."
|
|
4980
|
+
);
|
|
4981
|
+
}
|
|
4969
4982
|
const context = `<context>
|
|
4970
4983
|
${contextParts.join("\n")}
|
|
4971
4984
|
</context>`;
|
|
@@ -5006,6 +5019,7 @@ async function generateImageAssets(opts) {
|
|
|
5006
5019
|
prompts,
|
|
5007
5020
|
sourceImages,
|
|
5008
5021
|
transparentBackground,
|
|
5022
|
+
enhancePrompts,
|
|
5009
5023
|
onLog,
|
|
5010
5024
|
imageGenerationModel: genModel,
|
|
5011
5025
|
imageAnalysisModel,
|
|
@@ -5024,19 +5038,20 @@ async function generateImageAssets(opts) {
|
|
|
5024
5038
|
config.source_image = firstImage;
|
|
5025
5039
|
config.source = firstImage;
|
|
5026
5040
|
}
|
|
5027
|
-
const
|
|
5028
|
-
const enhancedPrompts =
|
|
5041
|
+
const hasReference = !!sourceImages?.length;
|
|
5042
|
+
const enhancedPrompts = enhancePrompts ? await Promise.all(
|
|
5029
5043
|
prompts.map(
|
|
5030
5044
|
(brief) => enhanceImagePrompt({
|
|
5031
5045
|
brief,
|
|
5032
5046
|
width,
|
|
5033
5047
|
height,
|
|
5034
5048
|
transparentBackground,
|
|
5049
|
+
hasReferenceImage: hasReference,
|
|
5035
5050
|
onLog,
|
|
5036
5051
|
model: imagePromptEnhancerModel
|
|
5037
5052
|
})
|
|
5038
5053
|
)
|
|
5039
|
-
);
|
|
5054
|
+
) : prompts;
|
|
5040
5055
|
let imageUrls;
|
|
5041
5056
|
if (enhancedPrompts.length === 1) {
|
|
5042
5057
|
const step = JSON.stringify({
|
|
@@ -5106,7 +5121,7 @@ async function generateImageAssets(opts) {
|
|
|
5106
5121
|
if (url.startsWith("Error")) {
|
|
5107
5122
|
return {
|
|
5108
5123
|
prompt: prompts[i],
|
|
5109
|
-
|
|
5124
|
+
...enhancePrompts && { enhancedPrompt: enhancedPrompts[i] },
|
|
5110
5125
|
error: url
|
|
5111
5126
|
};
|
|
5112
5127
|
}
|
|
@@ -5119,7 +5134,7 @@ async function generateImageAssets(opts) {
|
|
|
5119
5134
|
return {
|
|
5120
5135
|
url,
|
|
5121
5136
|
prompt: prompts[i],
|
|
5122
|
-
|
|
5137
|
+
...enhancePrompts && { enhancedPrompt: enhancedPrompts[i] },
|
|
5123
5138
|
analysis,
|
|
5124
5139
|
width,
|
|
5125
5140
|
height
|
|
@@ -5151,6 +5166,8 @@ async function execute6(input, onLog, context) {
|
|
|
5151
5166
|
width: input.width,
|
|
5152
5167
|
height: input.height,
|
|
5153
5168
|
transparentBackground: input.transparentBackground,
|
|
5169
|
+
sourceImages: input.referenceImage ? [input.referenceImage] : void 0,
|
|
5170
|
+
enhancePrompts: true,
|
|
5154
5171
|
onLog,
|
|
5155
5172
|
imageGenerationModel: resolveModel(
|
|
5156
5173
|
"imageGeneration",
|
|
@@ -5189,6 +5206,10 @@ var init_generateImages = __esm({
|
|
|
5189
5206
|
},
|
|
5190
5207
|
description: "One or more image briefs describing what you want. Focus on subject, mood, style, and intended use \u2014 the tool optimizes your brief into a model-ready prompt automatically. Multiple briefs run in parallel."
|
|
5191
5208
|
},
|
|
5209
|
+
referenceImage: {
|
|
5210
|
+
type: "string",
|
|
5211
|
+
description: "Optional URL of a single reference image to guide the generation \u2014 for style, subject, character consistency, or composition. Your prompt still describes the desired result; the reference conditions it. Applies to every prompt in the batch."
|
|
5212
|
+
},
|
|
5192
5213
|
width: {
|
|
5193
5214
|
type: "number",
|
|
5194
5215
|
description: "Image width in pixels. Default 2048. Range: 2048-4096."
|
|
@@ -5221,6 +5242,7 @@ async function execute7(input, onLog, context) {
|
|
|
5221
5242
|
width: input.width,
|
|
5222
5243
|
height: input.height,
|
|
5223
5244
|
transparentBackground: input.transparentBackground,
|
|
5245
|
+
enhancePrompts: false,
|
|
5224
5246
|
onLog,
|
|
5225
5247
|
imageGenerationModel: resolveModel(
|
|
5226
5248
|
"imageGeneration",
|
|
@@ -41,6 +41,7 @@ You'll receive context about the generation parameters. Use them:
|
|
|
41
41
|
|
|
42
42
|
- **Dimensions**: If the image is wide (landscape), compose horizontally. If tall (portrait), compose vertically. If square, center the subject.
|
|
43
43
|
- **Transparent background**: The background will be removed after generation and the image will be trimmed to the subject bounds (no extra padding). Don't describe elaborate backgrounds — focus on the subject. Describe it as an isolated element.
|
|
44
|
+
- **Reference image**: When a reference image is provided, the generation model receives it alongside your prompt to guide style, subject, or composition. Write the prompt to *complement* the reference, not duplicate it: describe the scene, action, and anything new or changed, and lean on the reference for what it already establishes (a specific face, product, logo, or art style). Don't exhaustively re-describe those — over-specifying competes with the reference image and can distort it.
|
|
44
45
|
|
|
45
46
|
## Photography prompts
|
|
46
47
|
|