@koda-sl/baker-cli 0.352.0-dev.09c54d90c → 0.352.0-dev.0d2112628
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/README.md +2 -2
- package/dist/cli.js +8 -18
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5487,7 +5487,7 @@ Turn a source/inspiration image into a **runnable, self-validated static-ad canv
|
|
|
5487
5487
|
2. **element selection** (`~google/gemini-flash-latest`) — picks the **main, identity-critical** elements (the brand logo, a showcased product, a trust badge) **plus any foreground/hero person or animal** — the emotional focal point — even a generic one, because a free-generated face/muzzle reads as AI and grows artifacts; the emotional hero always gets a real-reference slot. When the advertiser's logo appears in **more than one lockup** (a square/icon **mark** and a horizontal **wordmark**), each is emitted as its **own** element (e.g. `LOGO_MARK`, `LOGO_WORDMARK`) so you drop the right file in each slot instead of stretching one logo to cover both. The describe pass also records the ad's **typography** under a `fonts` block (each typeface's classification, a best-guess family, and its weight/case) so you know exactly what to drop at the brand-font slot. Background extras are dropped. Each element is stamped back onto its blueprint entry as a `reference_image` label so the JSON self-documents which slot grounds which subject.
|
|
5488
5488
|
3. **global layout** (`~google/gemini-flash-latest`) — produces a structured `layout` block in `prompt.json`: the column/row grid, each region's `x_pct`/`y_pct` bounds, panel splits, background/shape, and every text block's relative size/weight/case/alignment. This is what gives the generator a precise composition to rebuild.
|
|
5489
5489
|
|
|
5490
|
-
It then scaffolds a canvas that ingests `prompt.json`, wires **one `[TODO]` ingest slot per detected element** (plus an optional brand-font → type-specimen) into `image_generate`, and wires the original image in for composition only
|
|
5490
|
+
It then scaffolds a canvas that ingests `prompt.json`, wires **one `[TODO]` ingest slot per detected element** (plus an optional brand-font → type-specimen) into `image_generate`, and wires the original image in for composition only. Each **person/animal hero** is additionally fused into a generated **multi-view reference sheet** (`image_reference_sheet`, a turnaround built from the one dropped photo) that the render grounds on instead of the lone flat snapshot — the same identity lock the video scaffold uses, so the face/muzzle stays consistent and artifact-free from a single reference. Pass `--skip-actor-sheets` to ground straight on the dropped photo. The canvas is validated before it's written. stdout returns `{ ok, canvas_path, prompt_path, models, aspect_ratio, placements, output_formats, layout_regions, stats, checklist }` — the **checklist** lists every real asset to drop in (and which heroes get a sheet).
|
|
5491
5491
|
|
|
5492
5492
|
**Automatic placement fan-out.** By default the canvas doesn't stop at one ratio: the hero renders once at the platform's primary ratio, then an `image_aspect_adapt` node recomposes it into that platform's full placement set, and the canvas `output` points at the adapted images. The placement set is derived from `--platform` (`meta` → 4:5 + 9:16, `google` → 1:1 + 4:5 + 16:9, `linkedin` → 1:1, `tiktok` → 9:16, `youtube` → 16:9); override it with `--placements <preset>` or disable it with `--placements none` for a single base ad. The hero ratio passes through the adapt node **free**; each other ratio is a billed recomposition — and because adaptation re-generates, every ratio should be eyeballed for text and brand-color fidelity before publish (`ad-formats.md` in the scaffold skill covers this).
|
|
5493
5493
|
|
|
@@ -5516,7 +5516,7 @@ baker canvas run ./static-ad.canvas.json
|
|
|
5516
5516
|
| `--placements <preset\|none>` | derived from `--platform` | Override the fan-out set: `meta_feed`\|`meta_feed_stories`\|`meta_all`\|`linkedin`\|`google_demandgen`\|`tiktok`\|`youtube`, or `none` for a single base ad. |
|
|
5517
5517
|
| `--aspect <ratio>` | inferred from the image, else `9:16` | Force the hero's aspect ratio (clamped into the placement set so it stays a free pass-through). |
|
|
5518
5518
|
| `--skip-font` | off | Skip the brand-font → type-specimen slot. |
|
|
5519
|
-
| `--skip-actor-sheets` | off | Ground each animal
|
|
5519
|
+
| `--skip-actor-sheets` | off | Ground each person/animal on its lone dropped photo instead of a generated multi-view reference sheet. |
|
|
5520
5520
|
|
|
5521
5521
|
Scaffolding runs (and bills) the two vision passes; **running** the result generates a billed image. `baker canvas validate` does not check that the `[TODO]` paths exist — supply the real files before `run`.
|
|
5522
5522
|
|
package/dist/cli.js
CHANGED
|
@@ -41330,6 +41330,7 @@ import { z as z40 } from "zod";
|
|
|
41330
41330
|
var GEN_ASPECT_RATIOS = /* @__PURE__ */ new Set(["1:1", "4:5", "9:16", "16:9", "4:3", "3:4", "2:3", "3:2", "21:9"]);
|
|
41331
41331
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
41332
41332
|
var SHEET_SUBJECT_TYPE2 = {
|
|
41333
|
+
person: "person",
|
|
41333
41334
|
animal: "character"
|
|
41334
41335
|
};
|
|
41335
41336
|
var ACTOR_SHEET_MODEL2 = "google/gemini-3-pro-image-preview";
|
|
@@ -41339,8 +41340,7 @@ var ADAPT_IMAGE_SIZE = "2K";
|
|
|
41339
41340
|
var ADAPT_GUIDANCE = "Keep the headline, logo, CTA, and hero subject fully visible in every ratio. Reproduce every text string verbatim \u2014 no dropped, added, or altered characters \u2014 and preserve the exact brand-color treatment (e.g. a black\u2192red word pivot), never flattening it.";
|
|
41340
41341
|
var Blueprint = z40.object({
|
|
41341
41342
|
meta: z40.object({ estimated_aspect_ratio: z40.string().optional() }).loose().optional(),
|
|
41342
|
-
text_content: z40.array(z40.object({ text: z40.string().optional() }).loose()).optional()
|
|
41343
|
-
people: z40.array(z40.unknown()).optional()
|
|
41343
|
+
text_content: z40.array(z40.object({ text: z40.string().optional() }).loose()).optional()
|
|
41344
41344
|
}).loose();
|
|
41345
41345
|
var ElementLocator = z40.object({
|
|
41346
41346
|
collection: z40.enum(["subjects", "people", "brands_logos"]),
|
|
@@ -41396,7 +41396,6 @@ function roleForType2(type) {
|
|
|
41396
41396
|
case "product":
|
|
41397
41397
|
return "the showcased product; keep this exact product identity. Ignore any caption text printed on this reference.";
|
|
41398
41398
|
case "person":
|
|
41399
|
-
return "the emotional hero \u2014 the brand's cast person: a company Avatar's identity sheet, a multi-view turnaround of ONE person the brand may show. Keep this exact face, hair and build, and render them once in the pose, gaze, wardrobe and expression the blueprint specifies \u2014 never as a grid. Ignore the cell labels printed on the sheet.";
|
|
41400
41399
|
case "animal":
|
|
41401
41400
|
return "the emotional hero \u2014 the face/muzzle/eyes the viewer locks onto and exactly where AI artifacts (malformed mouths, teeth, foam, extra fingers) betray a fake. It MUST be grounded in this real reference, never invented from prose. Keep this identity AND the expression the blueprint specifies. Ignore any caption text printed on this reference.";
|
|
41402
41401
|
default:
|
|
@@ -41407,10 +41406,7 @@ function todoPath2(el, label) {
|
|
|
41407
41406
|
const desc = el.description ? ` \u2014 ${el.description}` : "";
|
|
41408
41407
|
const expr = el.expression ? `, with a ${el.expression} expression` : "";
|
|
41409
41408
|
const t = el.type.toLowerCase();
|
|
41410
|
-
|
|
41411
|
-
return `[TODO: drop the identity sheet of a company Avatar for ${label}${desc}${expr} \u2014 REQUIRED: this is the emotional hero and the render keeps this face, so use \`baker avatars list\` or cast one with \`baker avatars create\`, then put its sheetUrl here; never a found photo of a real person (web search, the source ad), who never agreed to appear in this ad]`;
|
|
41412
|
-
}
|
|
41413
|
-
const lock = t === "animal" ? " \u2014 REQUIRED: this is the emotional hero; ground it in a real reference (image-library / video-library / Pinterest), do not delete this slot and free-generate" : "";
|
|
41409
|
+
const lock = t === "person" || t === "animal" ? " \u2014 REQUIRED: this is the emotional hero; ground it in a real reference (image-library / video-library / Pinterest), do not delete this slot and free-generate" : "";
|
|
41414
41410
|
return `[TODO: drop a real image for ${label} (${el.type})${desc}${expr}${lock} \u2014 replace with a path relative to this canvas file, never an absolute path]`;
|
|
41415
41411
|
}
|
|
41416
41412
|
function sheetSubjectDescription(el) {
|
|
@@ -41450,9 +41446,6 @@ function textFidelityDirective(blueprint, hasFont) {
|
|
|
41450
41446
|
"Keep all type crisp, legible, and large enough to read cleanly; no garbled, warped, or duplicated characters, and no unreadable microtext."
|
|
41451
41447
|
].join("\n");
|
|
41452
41448
|
}
|
|
41453
|
-
function showsPerson(blueprint, elements) {
|
|
41454
|
-
return (blueprint.people?.length ?? 0) > 0 || elements.some((el) => el.type.toLowerCase() === "person");
|
|
41455
|
-
}
|
|
41456
41449
|
function scaffoldStaticAd(input, elementsInput, opts) {
|
|
41457
41450
|
const blueprint = Blueprint.parse(input);
|
|
41458
41451
|
const elements = MainElements.parse(elementsInput);
|
|
@@ -41518,18 +41511,15 @@ function scaffoldStaticAd(input, elementsInput, opts) {
|
|
|
41518
41511
|
params: { text: specimenText(blueprint), font_size: 72, line_height: 1.2, max_width: 1600 }
|
|
41519
41512
|
});
|
|
41520
41513
|
}
|
|
41521
|
-
const originalAsReference = !showsPerson(blueprint, elements);
|
|
41522
41514
|
const reference = [
|
|
41523
41515
|
...elementSlots.map((s) => s.ref),
|
|
41524
41516
|
...hasFont ? ["$ref:type_ref.image"] : [],
|
|
41525
|
-
|
|
41517
|
+
"$ref:original.asset"
|
|
41526
41518
|
];
|
|
41527
41519
|
const legend = [
|
|
41528
41520
|
...elementSlots.map((s) => `- ${s.label} \u2014 ${roleForType2(s.type)}`),
|
|
41529
41521
|
...hasFont ? ["- TYPE SPECIMEN \u2014 render every text string in this exact typeface; ignore its color and layout."] : [],
|
|
41530
|
-
|
|
41531
|
-
"- ORIGINAL \u2014 use ONLY for composition, layout, and proportions. IGNORE its text, its logo, its brand name, and its colors entirely \u2014 they belong to a different brand."
|
|
41532
|
-
] : []
|
|
41522
|
+
"- ORIGINAL \u2014 use ONLY for composition, layout, and proportions. IGNORE its text, its logo, its brand name, and its colors entirely \u2014 they belong to a different brand."
|
|
41533
41523
|
].join("\n");
|
|
41534
41524
|
const exclusionsLast = imageProfileFor(opts.genModel)?.constraintPlacement === "last";
|
|
41535
41525
|
const exclusionsBlock = "Exclusions: no invented badges, icons, or seals; render exactly the subjects the blueprint names and no others; no competitor branding; no watermark.";
|
|
@@ -41593,7 +41583,7 @@ function scaffoldStaticAd(input, elementsInput, opts) {
|
|
|
41593
41583
|
schema: "baker-canvas/1",
|
|
41594
41584
|
metadata: {
|
|
41595
41585
|
name: "static ad reproduction",
|
|
41596
|
-
description: "Scaffolded by `baker canvas scaffold-static-ad`. Edit `prompt.json` (the blueprint generated from the source image) into the ad you want, drop a real asset at each [TODO] ingest path (logo/product/subject/badge + brand font), then `baker canvas run`. The original is wired for composition only
|
|
41586
|
+
description: "Scaffolded by `baker canvas scaffold-static-ad`. Edit `prompt.json` (the blueprint generated from the source image) into the ad you want, drop a real asset at each [TODO] ingest path (logo/product/subject/badge + brand font), then `baker canvas run`. The original is wired for composition only."
|
|
41597
41587
|
},
|
|
41598
41588
|
nodes,
|
|
41599
41589
|
output: fanOut ? { node: "adapt", output: "images" } : { node: "gen", output: "images" }
|
|
@@ -42063,7 +42053,7 @@ var scaffoldStaticAdCommand = defineCommand114({
|
|
|
42063
42053
|
"skip-font": { type: "boolean", description: "Skip the brand-font \u2192 type-specimen slot" },
|
|
42064
42054
|
"skip-actor-sheets": {
|
|
42065
42055
|
type: "boolean",
|
|
42066
|
-
description: "Ground each animal
|
|
42056
|
+
description: "Ground each person/animal on its lone dropped photo instead of a generated multi-view sheet"
|
|
42067
42057
|
}
|
|
42068
42058
|
},
|
|
42069
42059
|
async run({ args: args5 }) {
|
|
@@ -42204,7 +42194,7 @@ var scaffoldStaticAdCommand = defineCommand114({
|
|
|
42204
42194
|
edit_prompt: `Edit ${path21.basename(blueprintPath)} \u2014 it is the blueprint generated from your image; rewrite it into the ad you want (palette, copy, claims, subjects). It feeds the generator directly.`,
|
|
42205
42195
|
assets_to_supply: report.elements,
|
|
42206
42196
|
font_slot: report.includes_font ? "Drop a brand font at the [TODO] brandfont path (the describe pass recorded the ad's typefaces under `fonts` in prompt.json \u2014 match those). The font is wired into the render as a TYPE SPECIMEN reference so generated text takes the brand letterforms. Delete the brandfont + type_ref nodes to skip it." : "skipped (--skip-font)",
|
|
42207
|
-
actor_sheets: report.actor_sheets.length > 0 ? `Each
|
|
42197
|
+
actor_sheets: report.actor_sheets.length > 0 ? `Each living hero (${report.actor_sheets.join(", ")}) is fused into a generated multi-view reference sheet (image_reference_sheet) that the render grounds on \u2014 so drop ONE clean photo at that hero's ingest and the sheet builds the consistent turnaround. Pass --skip-actor-sheets to ground on the lone photo instead.` : "none (no person/animal heroes detected, or --skip-actor-sheets)",
|
|
42208
42198
|
placements: report.placements === null ? `Single format (${report.aspect_ratio}). Pass --placements meta_feed_stories|meta_all|linkedin|\u2026 to auto-fan-out to a platform's set.` : `Auto-fans the approved hero out to ${report.placements} \u2192 ${report.output_formats.join(", ")}. The hero ratio (${report.aspect_ratio}) passes through free; each other ratio is a billed render, AI-recomposed (not cropped). Re-read the copy and confirm the brand-color treatment on EVERY ratio before publishing \u2014 adaptation re-generates and can silently mangle text or flatten a color device. Pass --placements none for a single base ad.`,
|
|
42209
42199
|
note: "Populate as you go: for each [TODO] ingest slot, source its real asset and wire it into the slot right away \u2014 one at a time, not all sourced first then reconciled at the end. For any LOGO slot, use the company's committed brand logo from `src/brand/logos/` (per BRAND.md's Logos map) \u2014 do NOT re-fetch it with `baker images logo <domain>` when a brand logo exists, because the Brandfetch CDN often serves an OUTDATED mark and that is how an old logo ships on a live ad. When every slot is filled, `baker canvas validate` then `baker canvas run`. Running generates a billed image \u2014 it is not free."
|
|
42210
42200
|
}
|