@koda-sl/baker-cli 0.214.0 → 0.216.0-dev.843330ec0
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 +65 -1
- package/canvas/hello-world-overlay.json +1 -1
- package/dist/{chunk-54GMUYWN.js → chunk-CMPAHYLB.js} +126 -7
- package/dist/chunk-CMPAHYLB.js.map +1 -0
- package/dist/cli.js +2621 -1870
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-54GMUYWN.js.map +0 -1
package/README.md
CHANGED
|
@@ -1824,7 +1824,7 @@ Research data is cached server-side (shared across all callers). No local cache
|
|
|
1824
1824
|
|
|
1825
1825
|
---
|
|
1826
1826
|
|
|
1827
|
-
### Assets (`baker images`, `baker videos`, `baker testimonials`)
|
|
1827
|
+
### Assets (`baker images`, `baker videos`, `baker avatars`, `baker testimonials`)
|
|
1828
1828
|
|
|
1829
1829
|
#### Image sourcing — verb-per-provider overview
|
|
1830
1830
|
|
|
@@ -2591,6 +2591,69 @@ baker testimonials tags
|
|
|
2591
2591
|
|
|
2592
2592
|
---
|
|
2593
2593
|
|
|
2594
|
+
### Avatars (`baker avatars`)
|
|
2595
|
+
|
|
2596
|
+
Reusable AI presenters a company casts into images and video. An avatar holds one settled identity: an **identity sheet** (`sheetUrl`, a generated multi-view turnaround) plus the **subject description** (`subjectDescription`) that person is described with. Every render grounds on the sheet via `--reference` and reuses the subject description verbatim — that pairing is what keeps the same face across a whole campaign.
|
|
2597
|
+
|
|
2598
|
+
`status` is `generating | ready | error | archived`; only `ready` can be cast. `create` returns immediately with `generating` because the identity sheet renders in the background (~30s). `likeness` is `synthetic` (invented from a description) or `licensed` (built from photographs of a real person, which requires `--likeness-confirmed`).
|
|
2599
|
+
|
|
2600
|
+
#### `baker avatars list`
|
|
2601
|
+
|
|
2602
|
+
List the company's avatars. Retired ones are hidden unless you ask for them. Rows are compact and deliberately omit `subjectDescription` — read it with `get`.
|
|
2603
|
+
|
|
2604
|
+
```bash
|
|
2605
|
+
baker avatars list
|
|
2606
|
+
baker avatars list --status ready --output md
|
|
2607
|
+
baker avatars list --status archived --limit 10
|
|
2608
|
+
```
|
|
2609
|
+
|
|
2610
|
+
#### `baker avatars get <handle>`
|
|
2611
|
+
|
|
2612
|
+
Read one avatar: status, `sheetUrl` for `--reference`, and the `subjectDescription` to reuse verbatim. `--full` adds the whole written profile (persona, speech, motion, wardrobe, setting, guardrails, voice, source photos, created date).
|
|
2613
|
+
|
|
2614
|
+
```bash
|
|
2615
|
+
baker avatars get marta
|
|
2616
|
+
baker avatars get marta --full --output md
|
|
2617
|
+
```
|
|
2618
|
+
|
|
2619
|
+
#### `baker avatars create`
|
|
2620
|
+
|
|
2621
|
+
Cast a new presenter. `--name` and `--subject` are required; `--subject` describes one person plainly (age, build, hair, skin, face) with no scene, lighting, camera, or wardrobe.
|
|
2622
|
+
|
|
2623
|
+
```bash
|
|
2624
|
+
baker avatars create --name "Marta" \
|
|
2625
|
+
--subject "woman in her early 40s, shoulder-length dark brown hair, light olive skin, warm open face" \
|
|
2626
|
+
--persona "friendly product expert" --wardrobe "plain knit sweater" \
|
|
2627
|
+
--guardrails "no competitor logos, no medical claims"
|
|
2628
|
+
|
|
2629
|
+
# From photographs of a real person — both flags required together
|
|
2630
|
+
baker avatars create --name "Marta" --subject "…" \
|
|
2631
|
+
--source-image "<imageId1>,<imageId2>" --likeness-confirmed
|
|
2632
|
+
```
|
|
2633
|
+
|
|
2634
|
+
Optional: `--handle`, `--speech`, `--motion`, `--setting`, `--voice-id`, `--voice-description`. Returns `{ avatarId, handle, likeness, status }`.
|
|
2635
|
+
|
|
2636
|
+
#### `baker avatars update <handle>`
|
|
2637
|
+
|
|
2638
|
+
Edit an avatar. Profile flags are merged over the stored profile, so `--persona` alone keeps the subject description intact; an empty value clears the field it names (except `--subject`, which can only be replaced). Changing `--subject` requires `--regenerate-sheet` in the same call — otherwise the sheet still shows the person described before.
|
|
2639
|
+
|
|
2640
|
+
```bash
|
|
2641
|
+
baker avatars update marta --wardrobe "charcoal blazer over a white tee"
|
|
2642
|
+
baker avatars update marta --subject "woman in her early 50s, silver bob, …" --regenerate-sheet
|
|
2643
|
+
baker avatars update marta --new-handle marta-founder --voice-id <voiceId>
|
|
2644
|
+
```
|
|
2645
|
+
|
|
2646
|
+
#### `baker avatars delete <handle>`
|
|
2647
|
+
|
|
2648
|
+
Remove an avatar. `--archive` retires it — it leaves the roster but past work and `@handle` mentions keep resolving. Without `--archive` it is deleted for good.
|
|
2649
|
+
|
|
2650
|
+
```bash
|
|
2651
|
+
baker avatars delete marta --archive --dry-run
|
|
2652
|
+
baker avatars delete marta --archive
|
|
2653
|
+
```
|
|
2654
|
+
|
|
2655
|
+
---
|
|
2656
|
+
|
|
2594
2657
|
### Winning Ads (`baker winning-ads`)
|
|
2595
2658
|
|
|
2596
2659
|
Search the **ad-dna** corpus of scored "winning" competitor ads for reference creatives to reproduce (e.g. with `baker canvas`), and manage the brands your library tracks (`follow` / `following` / `feed` / `unfollow`). Each result carries a presigned media URL (~1h TTL), the ad's DNA summary, and scores. The CLI authenticates with the normal `BAKER_API_KEY`; the Baker backend proxies the request to the ad-dna service with a server-held token — no extra credential in the sandbox.
|
|
@@ -5492,6 +5555,7 @@ This CLI is designed for AI agent consumption. Key patterns:
|
|
|
5492
5555
|
- **0.119.0**: `draft amend`/`draft show` land on both `baker ads google` and `baker ads linkedin` — a generic JSON-merge-patch to update any staged op in place plus a full-payload receipt, replacing remove+recreate as the correction path. Google gains `assets update` and `asset-groups create|update` (Performance Max asset groups are now their own entity — `ads create --format performanceMaxAssetGroup` never worked and is gone); `ads create --format video` moves from a bare YouTube id to `--video-assets` refs (**breaking flag change** — stage the video as an asset first); `--format demandGen` gains `--image-assets`/`--square-image-assets`/`--logo-image-assets` and flag-building for headlines/descriptions. LinkedIn's `draft list` now renders a readable Campaign group ▸ Campaign ▸ Creative tree by default (`--json` for raw), `creatives update` gains `--campaign` (re-parent while staged), and `campaigns update` passes create-only fields (`--group`/`--type`/`--locale`/`--associated-entity`) through when amending a `li_temp_*` staged create instead of always stripping them.
|
|
5493
5556
|
- **0.150.0**: `baker landing critique` gains an `agent-washing` rule in the `copy` family — an autonomy claim ("fully autonomous", "while you sleep", "no human intervention") with no signal anywhere on the page about who oversees the agent (approval, review, override, undo/rollback, audit log, escalation) scores a warn. Page-scope, so a hero may defer the trust story to a later section; generic privacy boilerplate does not clear it. `CRITIC_VERSION` bumps to `2`.
|
|
5494
5557
|
- **0.152.0**: `baker ads linkedin campaigns url-params <ad-set-id>` stages an ad set's URL tracking parameters (LinkedIn's `adTrackingParameters`) — `--param key=value` for fixed values (repeatable or `&`-joined), `--dynamic key=PLACEHOLDER` for values LinkedIn fills in per ad (`CAMPAIGN_NAME`, `CREATIVE_ID`, …), `--clear` to remove them. LinkedIn appends these to the landing URL of every ad in the ad set, including ads already running, so this replaces stamping the same UTM onto each ad's `--landing-url` — which missed later ads and double-appended keys the ad set already set. Account-level parameters remain UI-only (LinkedIn exposes no API for them).
|
|
5558
|
+
- **0.155.0**: new family `baker avatars list|get|create|update|delete` — company-scoped reusable AI presenters, typed from the shared `@baker/api` avatars contract. `get` returns the identity-sheet URL to pass to `baker studio generate --reference` plus the subject description to reuse verbatim, and every command's `hints` carry the next move (still building → re-check with `get`; changed `--subject` without `--regenerate-sheet` → the sheet is stale). `create` refuses `--source-image` without `--likeness-confirmed` and returns an `error.fix` telling the agent to ask the user for that permission; an unknown handle returns an `error.fix` pointing at `baker avatars list`. Profile flags on `update` merge over the stored profile instead of replacing it.
|
|
5495
5559
|
- **0.153.0**: `baker landing critique` accepts several slugs in one call (`baker landing critique a b c`). `data.landings[]` always carries one entry per slug; a single slug additionally keeps the old top-level `data.slug`/`counts`/`dimensions`/`findings` shape, so existing readers are unaffected. An invalid or missing slug anywhere in the batch still fails the whole call up front. The scaffold's Stop-hook critique gate now emits one batched command instead of one line per stale landing.
|
|
5496
5560
|
- **0.159.0**: `baker ads google ads update` takes the same content flags as `ads create` (`--format` + `--headlines`/`--descriptions`/image refs/…), and `--format app` becomes a flag-buildable format on both, with `--image-assets` wiring an App campaign ad's images (`AppAdInfo.images`) the same way Responsive Display does. Content flags without `--format` now fail instead of being silently dropped. An ad content update replaces **every field it sends** — a list has to include the entries you want to keep, while an optional asset list you omit is left untouched on the ad — and a partial payload (only the images, or Google's read-shaped `{"appAd":{…}}`) is rejected at stage time with the fields it's missing, instead of staging cleanly and blocking publish later. Content updates also record the staged image assets they consume as dependencies, so discarding an asset no longer leaves the ad pointing at nothing.
|
|
5497
5561
|
- **0.167.0**: `baker ads google conversions update` stops staging two conversion-action changes Google always rejects. `status: "HIDDEN"` leaves the write contract — Google denies it on every conversion action ("the field's value is on a deny-list for this field"), and offering it made it the obvious pick for retiring an action gently, so a whole cleanup published nothing; the refusal now names the two changes that do work (`--no-primary` to stop bidding toward it while it keeps measuring, `status: "REMOVED"` to stop it counting). `HIDDEN` is unchanged everywhere it is *read* — an action hidden long ago still reads back. And an update against a conversion action **Google owns** — Smart campaign calls/directions, the in-ad lead form's submit, YouTube subscriptions and follow-on views, Floodlight and Search Ads 360 imports, store visits, codeless webpage actions — is refused at stage time, renames included, since Google rejects every write against one and its own interface will not change them either. Both refusals name what to do instead and tell the agent to carry on with the rest of the job.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"id": "person_image",
|
|
10
10
|
"type": "image_generate",
|
|
11
11
|
"params": {
|
|
12
|
-
"model": "google/gemini-3.
|
|
12
|
+
"model": "google/gemini-3.1-flash-image-preview",
|
|
13
13
|
"prompt": "Portrait photo of a friendly person smiling, standing outdoors in a city park with soft golden-hour sunlight, 9:16 framing, natural colors.",
|
|
14
14
|
"aspect_ratio": "9:16",
|
|
15
15
|
"image_size": "1K"
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
shouldEscalate
|
|
17
17
|
} from "./chunk-DZUVUGEP.js";
|
|
18
18
|
|
|
19
|
-
//
|
|
19
|
+
// ../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/810146e81bae4e3a061fe487864f2fde80c4b03b886877dc0f1fffbc6480b67e/node_modules/safe-stable-stringify/index.js
|
|
20
20
|
var require_safe_stable_stringify = __commonJS({
|
|
21
|
-
"
|
|
21
|
+
"../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/810146e81bae4e3a061fe487864f2fde80c4b03b886877dc0f1fffbc6480b67e/node_modules/safe-stable-stringify/index.js"(exports, module) {
|
|
22
22
|
"use strict";
|
|
23
23
|
var { hasOwnProperty } = Object.prototype;
|
|
24
24
|
var stringify = configure2();
|
|
@@ -1092,7 +1092,7 @@ function resolveAdaptFormats(params) {
|
|
|
1092
1092
|
return params.formats ?? [];
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
|
-
//
|
|
1095
|
+
// ../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/810146e81bae4e3a061fe487864f2fde80c4b03b886877dc0f1fffbc6480b67e/node_modules/safe-stable-stringify/esm/wrapper.js
|
|
1096
1096
|
var import__ = __toESM(require_safe_stable_stringify(), 1);
|
|
1097
1097
|
var configure = import__.default.configure;
|
|
1098
1098
|
var wrapper_default = import__.default;
|
|
@@ -1192,6 +1192,9 @@ var KLING_DURATIONS = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
|
|
|
1192
1192
|
var GEMINI_OMNI_DURATIONS = [3, 4, 5, 6, 7, 8, 9, 10];
|
|
1193
1193
|
var GEMINI_OMNI_ASPECT_RATIOS = ["16:9", "9:16"];
|
|
1194
1194
|
var GEMINI_OMNI_IMAGE_MIMES = ["image/png", "image/jpeg", "image/webp"];
|
|
1195
|
+
var GROK_IMAGINE_DURATIONS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
1196
|
+
var WAN_27_DURATIONS = [2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
1197
|
+
var HAPPYHORSE_DURATIONS = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
|
|
1195
1198
|
var ELEVENLABS_OUTPUT_FORMATS = [
|
|
1196
1199
|
"mp3_22050_32",
|
|
1197
1200
|
"mp3_44100_32",
|
|
@@ -1224,13 +1227,20 @@ var VIDEO_GENERATE_MODELS = [
|
|
|
1224
1227
|
"google/gemini-omni-flash",
|
|
1225
1228
|
"google/veo-3.1",
|
|
1226
1229
|
"google/veo-3.1-fast",
|
|
1227
|
-
"
|
|
1230
|
+
"google/veo-3.1-lite",
|
|
1231
|
+
"kwaivgi/kling-v3.0-pro",
|
|
1232
|
+
"x-ai/grok-imagine-video",
|
|
1233
|
+
"alibaba/wan-2.7",
|
|
1234
|
+
"alibaba/happyhorse-1.1"
|
|
1228
1235
|
];
|
|
1229
1236
|
var DEFAULT_VIDEO_GENERATE_MODEL = "google/gemini-omni-flash";
|
|
1230
1237
|
var REFERENCE_TO_VIDEO_MODELS = [
|
|
1231
1238
|
"bytedance/seedance-2.0",
|
|
1232
1239
|
"bytedance/seedance-2.5",
|
|
1233
|
-
"google/gemini-omni-flash"
|
|
1240
|
+
"google/gemini-omni-flash",
|
|
1241
|
+
"x-ai/grok-imagine-video",
|
|
1242
|
+
"alibaba/wan-2.7",
|
|
1243
|
+
"alibaba/happyhorse-1.1"
|
|
1234
1244
|
];
|
|
1235
1245
|
function supportsReferenceToVideo(model) {
|
|
1236
1246
|
return REFERENCE_TO_VIDEO_MODELS.includes(model);
|
|
@@ -1681,6 +1691,89 @@ var MODEL_REGISTRY = {
|
|
|
1681
1691
|
cfg_scale: { kind: "number", min: 0, max: 1 }
|
|
1682
1692
|
}
|
|
1683
1693
|
},
|
|
1694
|
+
"x-ai/grok-imagine-video": {
|
|
1695
|
+
// The avatar workhorse. Measured best of the reference-capable models on
|
|
1696
|
+
// identity retention AND aspect-ratio obedience, at the lowest rate of any
|
|
1697
|
+
// video model we carry ($0.05/s at 480p). No audio at all — `generate_audio`
|
|
1698
|
+
// is absent from its OpenRouter listing, so a talking head goes to Wan 2.7.
|
|
1699
|
+
// NOTE: `x-ai/grok-imagine-video-1.5` is NOT a drop-in upgrade — it is
|
|
1700
|
+
// described as plain image-to-video and drops the reference conditioning
|
|
1701
|
+
// this entry exists for.
|
|
1702
|
+
label: "Grok Imagine Video",
|
|
1703
|
+
inputs: [],
|
|
1704
|
+
optional_inputs: [{ kind: "image", mimes: OPENROUTER_IMAGE_MIMES }],
|
|
1705
|
+
required: ["prompt"],
|
|
1706
|
+
params: {
|
|
1707
|
+
prompt: { kind: "string" },
|
|
1708
|
+
aspect_ratio: { kind: "string", enum: ["16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3"] },
|
|
1709
|
+
resolution: { kind: "string", enum: ["480p", "720p"] },
|
|
1710
|
+
duration: { kind: "number", enum: GROK_IMAGINE_DURATIONS }
|
|
1711
|
+
}
|
|
1712
|
+
},
|
|
1713
|
+
"alibaba/wan-2.7": {
|
|
1714
|
+
// Reference-to-video AND native audio — the only model we carry with both,
|
|
1715
|
+
// which makes it the landscape talking-head option.
|
|
1716
|
+
//
|
|
1717
|
+
// LANDSCAPE ONLY, measured. It advertises 9:16, 1:1, 4:3 and 3:4, and
|
|
1718
|
+
// delivers 16:9 regardless: asked for vertical via `aspect_ratio: "9:16"`
|
|
1719
|
+
// it returned 1280x720, and asked again via an explicit
|
|
1720
|
+
// `size: "720x1280"` from its own `supported_sizes` it returned 1280x720
|
|
1721
|
+
// again. The enum below is therefore what it DOES, not what it claims, so
|
|
1722
|
+
// nobody pays for a vertical clip that comes back landscape. For a vertical
|
|
1723
|
+
// avatar clip use `x-ai/grok-imagine-video` (silent) or animate a generated
|
|
1724
|
+
// still with `google/veo-3.1-lite` (native audio, honours 9:16).
|
|
1725
|
+
label: "Alibaba Wan 2.7",
|
|
1726
|
+
inputs: [],
|
|
1727
|
+
optional_inputs: [{ kind: "image", mimes: OPENROUTER_IMAGE_MIMES }],
|
|
1728
|
+
required: ["prompt"],
|
|
1729
|
+
params: {
|
|
1730
|
+
prompt: { kind: "string" },
|
|
1731
|
+
negative_prompt: { kind: "string" },
|
|
1732
|
+
aspect_ratio: { kind: "string", enum: ["16:9"] },
|
|
1733
|
+
resolution: { kind: "string", enum: ["720p", "1080p"] },
|
|
1734
|
+
duration: { kind: "number", enum: WAN_27_DURATIONS },
|
|
1735
|
+
seed: { kind: "number" },
|
|
1736
|
+
generate_audio: { kind: "boolean" }
|
|
1737
|
+
}
|
|
1738
|
+
},
|
|
1739
|
+
"alibaba/happyhorse-1.1": {
|
|
1740
|
+
// Third reference-capable option: strong identity, correct ratios, no audio.
|
|
1741
|
+
// First-frame only (no `last_frame`), so it cannot close a beat on a
|
|
1742
|
+
// specified end pose the way Wan and Veo can.
|
|
1743
|
+
label: "Alibaba HappyHorse 1.1",
|
|
1744
|
+
inputs: [],
|
|
1745
|
+
optional_inputs: [{ kind: "image", mimes: OPENROUTER_IMAGE_MIMES }],
|
|
1746
|
+
required: ["prompt"],
|
|
1747
|
+
params: {
|
|
1748
|
+
prompt: { kind: "string" },
|
|
1749
|
+
aspect_ratio: { kind: "string", enum: ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"] },
|
|
1750
|
+
resolution: { kind: "string", enum: ["720p", "1080p"] },
|
|
1751
|
+
duration: { kind: "number", enum: HAPPYHORSE_DURATIONS },
|
|
1752
|
+
seed: { kind: "number" }
|
|
1753
|
+
}
|
|
1754
|
+
},
|
|
1755
|
+
"google/veo-3.1-lite": {
|
|
1756
|
+
// The cheapest way to animate a still that carries a real face: same Veo
|
|
1757
|
+
// family and the same escape from ByteDance's filter, at $0.05/s with audio
|
|
1758
|
+
// at 720p against Veo 3.1's $0.40. That 8x is the difference between an
|
|
1759
|
+
// avatar clip you iterate on and one you think twice about.
|
|
1760
|
+
label: "Google Veo 3.1 Lite",
|
|
1761
|
+
inputs: [],
|
|
1762
|
+
optional_inputs: [{ kind: "image", mimes: OPENROUTER_IMAGE_MIMES }],
|
|
1763
|
+
required: ["prompt"],
|
|
1764
|
+
params: {
|
|
1765
|
+
prompt: { kind: "string" },
|
|
1766
|
+
negative_prompt: { kind: "string" },
|
|
1767
|
+
aspect_ratio: { kind: "string", enum: ["16:9", "9:16"] },
|
|
1768
|
+
resolution: { kind: "string", enum: ["720p", "1080p"] },
|
|
1769
|
+
duration: { kind: "number", enum: [4, 6, 8] },
|
|
1770
|
+
seed: { kind: "number" },
|
|
1771
|
+
generate_audio: { kind: "boolean" },
|
|
1772
|
+
person_generation: { kind: "string", enum: ["allow_all", "allow_adult"] },
|
|
1773
|
+
enhance_prompt: { kind: "boolean" },
|
|
1774
|
+
conditioning_scale: { kind: "number" }
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1684
1777
|
"google/veo-3.1-fast": {
|
|
1685
1778
|
// Cheap test/iteration model. Forwarded by the backend via
|
|
1686
1779
|
// `provider.options.google-vertex.parameters` (camelCased on the wire).
|
|
@@ -2055,6 +2148,7 @@ function validateValue(key, value, schema, model) {
|
|
|
2055
2148
|
|
|
2056
2149
|
// ../canvas-contract/src/videoCost.ts
|
|
2057
2150
|
var CREDITS_PER_USD = 100;
|
|
2151
|
+
var OPENING_FRAME_CREDITS = Math.ceil(0.03 * CREDITS_PER_USD);
|
|
2058
2152
|
var SEEDANCE_USD_PER_SECOND = {
|
|
2059
2153
|
"480p": 0.18,
|
|
2060
2154
|
"720p": 0.5,
|
|
@@ -2075,12 +2169,37 @@ function seedance25UsdPerSecond(resolution) {
|
|
|
2075
2169
|
return SEEDANCE_25_USD_PER_SECOND[resolution ?? DEFAULT_VIDEO_RESOLUTION] ?? SEEDANCE_25_FALLBACK_USD_PER_SECOND;
|
|
2076
2170
|
}
|
|
2077
2171
|
var FALLBACK_USD_PER_SECOND = 0.5;
|
|
2172
|
+
var MIN_BILLED_SECONDS = 5;
|
|
2173
|
+
var MODELS_WITH_BILLING_FLOOR = /* @__PURE__ */ new Set(["alibaba/wan-2.7", "alibaba/happyhorse-1.1"]);
|
|
2174
|
+
function billedSeconds(model, duration) {
|
|
2175
|
+
return MODELS_WITH_BILLING_FLOOR.has(model) ? Math.max(duration, MIN_BILLED_SECONDS) : duration;
|
|
2176
|
+
}
|
|
2078
2177
|
function seedanceUsdPerSecond(resolution) {
|
|
2079
2178
|
return SEEDANCE_USD_PER_SECOND[resolution ?? DEFAULT_VIDEO_RESOLUTION] ?? FALLBACK_USD_PER_SECOND;
|
|
2080
2179
|
}
|
|
2081
2180
|
var USD_PER_SECOND = {
|
|
2082
2181
|
// Kling publishes one flat rate across every resolution and mode.
|
|
2083
2182
|
"kwaivgi/kling-v3.0-pro": { silent: 0.112, audio: 0.168 },
|
|
2183
|
+
// The three reference-capable avatar models. Rates are the published
|
|
2184
|
+
// per-second SKUs; see MIN_BILLED_SECONDS below for why a short clip still
|
|
2185
|
+
// costs more than rate x duration.
|
|
2186
|
+
"x-ai/grok-imagine-video": {
|
|
2187
|
+
silent: 0.07,
|
|
2188
|
+
audio: 0.07,
|
|
2189
|
+
byResolution: { "480p": { silent: 0.05, audio: 0.05 }, "720p": { silent: 0.07, audio: 0.07 } }
|
|
2190
|
+
},
|
|
2191
|
+
// Flat $0.10/s across resolutions and modes, audio included.
|
|
2192
|
+
"alibaba/wan-2.7": { silent: 0.1, audio: 0.1 },
|
|
2193
|
+
"alibaba/happyhorse-1.1": {
|
|
2194
|
+
silent: 0.1278,
|
|
2195
|
+
audio: 0.1278,
|
|
2196
|
+
byResolution: { "720p": { silent: 0.0988, audio: 0.0988 } }
|
|
2197
|
+
},
|
|
2198
|
+
"google/veo-3.1-lite": {
|
|
2199
|
+
silent: 0.05,
|
|
2200
|
+
audio: 0.08,
|
|
2201
|
+
byResolution: { "720p": { silent: 0.03, audio: 0.05 } }
|
|
2202
|
+
},
|
|
2084
2203
|
// Veo prices 4K far above the base tier — and 4K is a selectable resolution,
|
|
2085
2204
|
// so folding it into the base rate under-quotes the dearest clip we can make.
|
|
2086
2205
|
"google/veo-3.1": {
|
|
@@ -2117,7 +2236,7 @@ function falSeedanceUsdPerSecond(resolution, buildsOnSourceClip = false) {
|
|
|
2117
2236
|
}
|
|
2118
2237
|
function estimateVideoCostUsd(input) {
|
|
2119
2238
|
const { model, duration, resolution, generateAudio, buildsOnSourceClip } = input;
|
|
2120
|
-
const seconds = duration ?? DEFAULT_VIDEO_DURATION_S;
|
|
2239
|
+
const seconds = billedSeconds(model, duration ?? DEFAULT_VIDEO_DURATION_S);
|
|
2121
2240
|
const sourceClipPremium = buildsOnSourceClip ? VIDEO_SOURCE_COST_MULTIPLIER : 1;
|
|
2122
2241
|
if (isGeminiOmniModel(model)) {
|
|
2123
2242
|
return GEMINI_OMNI_WINDOW_SECONDS * GEMINI_OMNI_USD_PER_SECOND * GEMINI_OMNI_WINDOW_MARGIN;
|
|
@@ -8955,4 +9074,4 @@ export {
|
|
|
8955
9074
|
defaultRegistry,
|
|
8956
9075
|
createEngineFromEnv
|
|
8957
9076
|
};
|
|
8958
|
-
//# sourceMappingURL=chunk-
|
|
9077
|
+
//# sourceMappingURL=chunk-CMPAHYLB.js.map
|