@koda-sl/baker-cli 0.281.8-dev.1f1c09c80 → 0.281.10-dev.7a0f94402
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/cli.js +47 -4
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33326,11 +33326,29 @@ function svgIsLiveText(svg) {
|
|
|
33326
33326
|
return /<text[\s>]/i.test(svg);
|
|
33327
33327
|
}
|
|
33328
33328
|
async function markIsReal(markPath, root = ".") {
|
|
33329
|
-
const brandLogos =
|
|
33330
|
-
|
|
33331
|
-
if (brandFiles) return await markDirectoryIsReal(brandLogos);
|
|
33329
|
+
const brandLogos = await findBrandLogosDir(markPath, root);
|
|
33330
|
+
if (brandLogos) return await markDirectoryIsReal(brandLogos);
|
|
33332
33331
|
return await markDirectoryIsReal(path22.dirname(markPath));
|
|
33333
33332
|
}
|
|
33333
|
+
async function findBrandLogosDir(markPath, root) {
|
|
33334
|
+
const candidates = [];
|
|
33335
|
+
let dir = path22.resolve(path22.dirname(markPath));
|
|
33336
|
+
for (; ; ) {
|
|
33337
|
+
candidates.push(path22.join(dir, BRAND_DIR, "logos"));
|
|
33338
|
+
const parent = path22.dirname(dir);
|
|
33339
|
+
if (parent === dir) break;
|
|
33340
|
+
dir = parent;
|
|
33341
|
+
}
|
|
33342
|
+
candidates.push(path22.join(root, BRAND_DIR, "logos"));
|
|
33343
|
+
for (const candidate of candidates) {
|
|
33344
|
+
if (await readdir8(candidate).then(
|
|
33345
|
+
() => true,
|
|
33346
|
+
() => false
|
|
33347
|
+
))
|
|
33348
|
+
return candidate;
|
|
33349
|
+
}
|
|
33350
|
+
return null;
|
|
33351
|
+
}
|
|
33334
33352
|
async function markDirectoryIsReal(dir) {
|
|
33335
33353
|
const files = await readdir8(dir).catch(() => null);
|
|
33336
33354
|
if (!files) return false;
|
|
@@ -33377,6 +33395,12 @@ registerSchema({
|
|
|
33377
33395
|
required: false,
|
|
33378
33396
|
description: "Cast this avatar as the ad's recurring person \u2014 the same flag, the same word and the same meaning as on `baker studio generate` and `baker studio animate`. Every beat they appear in is grounded on their identity sheet and their subject description is copied verbatim, so it is one face throughout and the same face as the rest of the company's work. Overrides `cast.avatar` in the spec. `baker avatars list` shows who there is."
|
|
33379
33397
|
},
|
|
33398
|
+
"video-model": {
|
|
33399
|
+
type: "string",
|
|
33400
|
+
required: false,
|
|
33401
|
+
description: "Curated video model id for the shots. Only for comparing models on one brief.",
|
|
33402
|
+
enum: [...VIDEO_GENERATE_MODELS]
|
|
33403
|
+
},
|
|
33380
33404
|
slug: {
|
|
33381
33405
|
type: "string",
|
|
33382
33406
|
required: false,
|
|
@@ -33397,6 +33421,11 @@ var scaffoldAdCommand = defineCommand105({
|
|
|
33397
33421
|
args: {
|
|
33398
33422
|
spec: { type: "string", required: true, description: "Path to the ad spec JSON" },
|
|
33399
33423
|
avatar: { type: "string", required: false, description: "Cast this avatar as the ad's recurring person \u2014 the same flag, the same word and the same meaning as on `baker studio generate` and `baker studio animate`. Every beat they appear in is grounded on their identity sheet and their subject description is copied verbatim, so it is one face throughout and the same face as the rest of the company's work. Overrides `cast.avatar` in the spec. `baker avatars list` shows who there is." },
|
|
33424
|
+
"video-model": {
|
|
33425
|
+
type: "string",
|
|
33426
|
+
required: false,
|
|
33427
|
+
description: "Which curated video model renders the shots. Defaults to the one the lane picks; pass this only to compare models on the same brief, because mixing models across a campaign changes how the same face reads. `baker canvas catalog` lists what each one takes."
|
|
33428
|
+
},
|
|
33400
33429
|
slug: {
|
|
33401
33430
|
type: "string",
|
|
33402
33431
|
required: false,
|
|
@@ -33475,6 +33504,20 @@ var scaffoldAdCommand = defineCommand105({
|
|
|
33475
33504
|
process.exit(1);
|
|
33476
33505
|
return;
|
|
33477
33506
|
}
|
|
33507
|
+
const requestedModel = args["video-model"]?.trim();
|
|
33508
|
+
if (requestedModel && !VIDEO_GENERATE_MODELS.includes(requestedModel)) {
|
|
33509
|
+
writeJson({
|
|
33510
|
+
ok: false,
|
|
33511
|
+
error: {
|
|
33512
|
+
code: "VALIDATION_ERROR",
|
|
33513
|
+
message: `\`${requestedModel}\` is not one of the curated video models.`,
|
|
33514
|
+
fix: `Pick one of: ${VIDEO_GENERATE_MODELS.join(", ")}. Leave --video-model off to use the default.`
|
|
33515
|
+
}
|
|
33516
|
+
});
|
|
33517
|
+
process.exit(1);
|
|
33518
|
+
return;
|
|
33519
|
+
}
|
|
33520
|
+
const chosenVideoModel = requestedModel ?? DEFAULT_VIDEO_GENERATE_MODEL;
|
|
33478
33521
|
const handle = flagAvatar || spec.data.cast?.avatar?.trim();
|
|
33479
33522
|
let avatar = null;
|
|
33480
33523
|
let avatarError = null;
|
|
@@ -33609,7 +33652,7 @@ var scaffoldAdCommand = defineCommand105({
|
|
|
33609
33652
|
// The sheet on the SAME model as the frames it feeds. A sheet from another
|
|
33610
33653
|
// generator hands every frame a look its own model then reinterprets.
|
|
33611
33654
|
sheetModel: AD_IMAGE_MODEL,
|
|
33612
|
-
videoModel:
|
|
33655
|
+
videoModel: chosenVideoModel,
|
|
33613
33656
|
overlayCompositionPath: path24.relative(outDir, compositionDest),
|
|
33614
33657
|
captionsCompositionPath: path24.relative(outDir, captionsDest),
|
|
33615
33658
|
blueprintPath: path24.relative(outDir, blueprintPath),
|