mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
feat(cli): price and validate minimax-h3-image, and image models at 1.5x (#7589)
Adds minimax-h3-image (2K) and minimax-h3-image-4k to media-use generate, refuses aspect ratios and reference counts each /v3/images model does not take, and re-bases every image price on the live rows: an API key pays 1.5x the vendor price, a HyperFrames plan the hf_image rows at x1.6545. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6b602495db
commit
88e74e088f
@@ -131,7 +131,7 @@ export default defineCommand({
|
||||
model: {
|
||||
type: "string",
|
||||
description:
|
||||
"image: nano-banana-2 (default), nano-banana-2.1, gpt-image-2.5, gpt-image-2.6 or gpt-image-2.6-flare",
|
||||
"image: nano-banana-2 (default), nano-banana-2.1, gpt-image-2.5, gpt-image-2.6, gpt-image-2.6-flare, minimax-h3-image (2K) or minimax-h3-image-4k",
|
||||
},
|
||||
bpm: { type: "string", description: "music: tempo, 60–180" },
|
||||
vocals: {
|
||||
@@ -142,7 +142,7 @@ export default defineCommand({
|
||||
"max-credits": {
|
||||
type: "string",
|
||||
description:
|
||||
"The person's credit limit, less what earlier calls used: make nothing when this call would cost more. A gpt-image call is charged at the vendor's cost, so it is checked against its estimate plus 10%; that is not a hard ceiling, and an edit with many references can still go over. The project's credit-limit.json follows the same rule",
|
||||
"The person's credit limit, less what earlier calls used: make nothing when this call would cost more. A gpt-image or minimax-h3-image call is charged on the vendor's bill, so it is checked against its estimate plus 10%; that is not a hard ceiling, and an edit with many references can still go over. The project's credit-limit.json follows the same rule",
|
||||
},
|
||||
plan: {
|
||||
type: "boolean",
|
||||
|
||||
@@ -169,7 +169,7 @@ describe("generate", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps 10% headroom under the run's credit limit for an image charged at the vendor's cost", async () => {
|
||||
it("keeps 10% headroom under the run's credit limit for an image charged on the vendor's bill", async () => {
|
||||
const run = (limit: number) => {
|
||||
const dir = mkdtempSync(join(tmpdir(), "hf-generate-limit-"));
|
||||
writeFileSync(join(dir, "index.html"), "<html></html>");
|
||||
@@ -198,10 +198,39 @@ describe("generate", () => {
|
||||
},
|
||||
}),
|
||||
);
|
||||
await expect(run(43)).rejects.toThrow(
|
||||
"about 40 credits, 44 with 10% headroom because it is charged at the vendor's cost and the run's credit limit of 43 leaves 43",
|
||||
await expect(run(72)).rejects.toThrow(
|
||||
"about 66 credits, 73 with 10% headroom because it is charged on the vendor's bill and the run's credit limit of 72 leaves 72",
|
||||
);
|
||||
await expect(run(44)).resolves.toMatchObject({ job: "img4" });
|
||||
await expect(run(73)).resolves.toMatchObject({ job: "img4" });
|
||||
});
|
||||
|
||||
it("sends a MiniMax H3 image one picture at its aspect, with no seed", async () => {
|
||||
const sent: Record<string, unknown>[] = [];
|
||||
vi.stubGlobal("fetch", async (url: string, init?: RequestInit) => {
|
||||
if (init?.body) sent.push(JSON.parse(String(init.body)));
|
||||
return url === "https://files.test/h3.png"
|
||||
? new Response(new Uint8Array([1]))
|
||||
: json({
|
||||
data: {
|
||||
id: "img6",
|
||||
status: "completed",
|
||||
images: [{ url: "https://files.test/h3.png" }],
|
||||
},
|
||||
});
|
||||
});
|
||||
await generate({
|
||||
type: "image",
|
||||
out: join(project, "assets/h3.png"),
|
||||
prompt: "a wide desk",
|
||||
model: "minimax-h3-image-4k",
|
||||
aspect: "21:9",
|
||||
});
|
||||
expect(sent[0]).toEqual({
|
||||
model: "minimax-h3-image-4k",
|
||||
prompt: "a wide desk",
|
||||
num_images: 1,
|
||||
aspect_ratio: "21:9",
|
||||
});
|
||||
});
|
||||
|
||||
it("reports no charge in HyperFrames credits for a charge to another pool", async () => {
|
||||
@@ -854,7 +883,7 @@ describe("generate", () => {
|
||||
} as const;
|
||||
await expect(
|
||||
generate(request, undefined, creditsOf(priceOf(request)) ?? undefined),
|
||||
).rejects.toThrow("this step needs about 67");
|
||||
).rejects.toThrow("this step needs about 111");
|
||||
});
|
||||
|
||||
it("prices before making", () => {
|
||||
@@ -868,7 +897,7 @@ describe("generate", () => {
|
||||
aspect: "1:1",
|
||||
references: ["a", "b"],
|
||||
}).usd,
|
||||
).toBe(0.09);
|
||||
).toBe(0.12);
|
||||
expect(priceOf({ type: "voice", out: "a.mp3" }).usd).toBeNull();
|
||||
expect(creditsOf(priceOf({ type: "voice", out: "a.mp3", script: "今天聊黄金" }))).toBe(1);
|
||||
});
|
||||
@@ -877,30 +906,129 @@ describe("generate", () => {
|
||||
const edit = (model: string, references: string[]) =>
|
||||
creditsOf(priceOf({ type: "image", out: "a.png", model, aspect: "16:9", references }));
|
||||
for (const model of ["gpt-image-2.5", "gpt-image-2.6", "gpt-image-2.6-flare"]) {
|
||||
expect(edit(model, [])).toBe(40);
|
||||
expect(edit(model, ["a"])).toBe(53);
|
||||
expect(edit(model, [])).toBe(66);
|
||||
expect(edit(model, ["a"])).toBe(87);
|
||||
expect(
|
||||
edit(
|
||||
model,
|
||||
Array.from({ length: 16 }, (_, i) => `r${i}`),
|
||||
),
|
||||
).toBe(240);
|
||||
).toBe(397);
|
||||
}
|
||||
expect(
|
||||
creditsOf(
|
||||
priceOf({ type: "image", out: "a.png", model: "nano-banana-2.1", references: ["a", "b"] }),
|
||||
),
|
||||
).toBe(37);
|
||||
).toBe(62);
|
||||
expect(priceOf({ type: "image", out: "a.png", model: "some-new-model" }).credits).toBeNull();
|
||||
});
|
||||
|
||||
it("says a GPT Image price is an estimate charged at vendor cost, and a Nano Banana one is not", () => {
|
||||
it("says a GPT Image price is an estimate charged on the vendor's bill, and a Nano Banana one is not", () => {
|
||||
expect(
|
||||
priceOf({ type: "image", out: "a.png", model: "gpt-image-2.5", aspect: "16:9" }).basis,
|
||||
).toBe(
|
||||
"gpt-image-2.5 at 16:9, about 40 credits (charged at vendor cost), with about $0.0125 a reference",
|
||||
"gpt-image-2.5 at 16:9, about 66 credits (charged on the vendor's bill), with about $0.0125 a reference; vendor price x1.5 on an API key, x1.6545 in HyperFrames credits",
|
||||
);
|
||||
expect(priceOf({ type: "image", out: "a.png" }).basis).toBe("nano-banana-2, $0.067 an image");
|
||||
expect(priceOf({ type: "image", out: "a.png" }).basis).toBe(
|
||||
"nano-banana-2, $0.067 an image; vendor price x1.5 on an API key, x1.6545 in HyperFrames credits",
|
||||
);
|
||||
});
|
||||
|
||||
it("prices a MiniMax H3 image at 2K and 4K, with references, for an API key and a plan", () => {
|
||||
const h3 = (model: string, references: number, aspect = "16:9") =>
|
||||
priceOf({
|
||||
type: "image",
|
||||
out: "a.png",
|
||||
model,
|
||||
aspect,
|
||||
references: Array.from({ length: references }, (_, i) => `r${i}`),
|
||||
});
|
||||
// The hf_image rows: 41.3625 a 2K output, 115.815 a 4K output, 24.8175 a reference.
|
||||
expect(h3("minimax-h3-image", 0).credits).toBeCloseTo(41.3625, 6);
|
||||
expect(h3("minimax-h3-image-4k", 0).credits).toBeCloseTo(115.815, 6);
|
||||
expect(h3("minimax-h3-image", 1).credits! - h3("minimax-h3-image", 0).credits!).toBeCloseTo(
|
||||
24.8175,
|
||||
6,
|
||||
);
|
||||
expect(
|
||||
h3("minimax-h3-image-4k", 1).credits! - h3("minimax-h3-image-4k", 0).credits!,
|
||||
).toBeCloseTo(24.8175, 6);
|
||||
const both = (p: ReturnType<typeof h3>) => [p.list, p.usd, creditsOf(p)];
|
||||
expect(both(h3("minimax-h3-image", 0))).toEqual([expect.closeTo(0.0375, 9), 0.05, 42]);
|
||||
expect(both(h3("minimax-h3-image", 2))).toEqual([expect.closeTo(0.0825, 9), 0.09, 91]);
|
||||
expect(both(h3("minimax-h3-image-4k", 0))).toEqual([expect.closeTo(0.105, 9), 0.12, 116]);
|
||||
expect(both(h3("minimax-h3-image-4k", 1))).toEqual([expect.closeTo(0.1275, 9), 0.14, 141]);
|
||||
expect(creditsOf(h3("minimax-h3-image", 16))).toBe(439);
|
||||
// One price at every aspect: H3 bills by area tier, not shape.
|
||||
expect(h3("minimax-h3-image", 0, "21:9").credits).toBe(
|
||||
h3("minimax-h3-image", 0, "1:1").credits,
|
||||
);
|
||||
expect(h3("minimax-h3-image-4k", 0, "21:9").basis).toBe(
|
||||
"minimax-h3-image-4k at 21:9, about 116 credits (charged on the vendor's bill), with about $0.015 a reference; vendor price x1.5 on an API key, x1.6545 in HyperFrames credits",
|
||||
);
|
||||
for (const model of ["minimax-h3-image", "minimax-h3-image-4k"])
|
||||
expect(isVendorPriced({ type: "image", out: "a.png", model })).toBe(true);
|
||||
});
|
||||
|
||||
it("prices every image model at its hf_image row for a plan and 1.5x its vendor price for an API key", () => {
|
||||
const image = (model: string, aspect: string, references = 0) =>
|
||||
priceOf({
|
||||
type: "image",
|
||||
out: "a.png",
|
||||
model,
|
||||
aspect,
|
||||
references: Array.from({ length: references }, (_, i) => `r${i}`),
|
||||
});
|
||||
const rows: [string, string, number][] = [
|
||||
["gpt-image-2.6", "1:1", 87.15906],
|
||||
["gpt-image-2.6-flare", "16:9", 65.5182],
|
||||
["gpt-image-2.5", "4:3", 59.76054],
|
||||
["nano-banana-2", "21:9", 110.8515],
|
||||
["nano-banana-2.1", "3:2", 55.5912],
|
||||
];
|
||||
for (const [model, aspect, row] of rows)
|
||||
expect(image(model, aspect).credits).toBeCloseTo(row, 6);
|
||||
expect(
|
||||
image("gpt-image-2.6", "16:9", 1).credits! - image("gpt-image-2.6", "16:9").credits!,
|
||||
).toBeCloseTo(20.68125, 6);
|
||||
expect(
|
||||
image("nano-banana-2.1", "1:1", 1).credits! - image("nano-banana-2.1", "1:1").credits!,
|
||||
).toBeCloseTo(2.77956, 6);
|
||||
expect(image("nano-banana-2", "1:1", 3).credits).toBe(image("nano-banana-2", "1:1").credits);
|
||||
expect(image("nano-banana-2", "1:1").list).toBeCloseTo(0.1005, 9);
|
||||
expect(image("nano-banana-2", "1:1").usd).toBe(0.12);
|
||||
expect(image("gpt-image-2.6", "16:9").list).toBeCloseTo(0.0594, 9);
|
||||
expect(image("gpt-image-2.6", "16:9").usd).toBe(0.07);
|
||||
expect(image("nano-banana-2.1", "16:9", 2).list).toBeCloseTo((0.0336 + 2 * 0.00168) * 1.5, 9);
|
||||
});
|
||||
|
||||
it("refuses an aspect ratio or a reference count the model does not take", () => {
|
||||
const check =
|
||||
(model: string, aspect?: string, references = 0) =>
|
||||
() =>
|
||||
checkRequest({
|
||||
type: "image",
|
||||
out: join(project, "assets/limits.png"),
|
||||
prompt: "a desk",
|
||||
model,
|
||||
...(aspect ? { aspect } : {}),
|
||||
references: Array.from({ length: references }, (_, i) =>
|
||||
join(project, `missing-${i}.png`),
|
||||
),
|
||||
});
|
||||
for (const model of ["minimax-h3-image", "minimax-h3-image-4k"]) {
|
||||
for (const aspect of ["1:1", "16:9", "9:16", "4:3", "3:4", "21:9"])
|
||||
expect(check(model, aspect)).not.toThrow();
|
||||
expect(check(model, "3:2")).toThrow(`${model} does not make 3:2`);
|
||||
expect(check(model, undefined, 17)).toThrow(
|
||||
`${model} takes at most 16 --reference pictures, not 17`,
|
||||
);
|
||||
expect(check(model, undefined, 16)).toThrow("no file at");
|
||||
}
|
||||
expect(check("gpt-image-2.6", "21:9")).toThrow("gpt-image-2.6 does not make 21:9");
|
||||
expect(check("nano-banana-2.1", "21:9")).not.toThrow();
|
||||
expect(check("nano-banana-2", undefined, 15)).toThrow("at most 14 --reference pictures");
|
||||
expect(check("some-new-model", "7:5")).not.toThrow();
|
||||
});
|
||||
|
||||
it("prices only a request the real call would accept", () => {
|
||||
@@ -1056,26 +1184,26 @@ describe("generate", () => {
|
||||
it("keeps a call under the person's credit limit, or refuses it before sending", () => {
|
||||
const shot = creditsOf(priceOf({ type: "video", out: "a.mp4", seconds: 6 }));
|
||||
expect(shot).toBe(108);
|
||||
expect(creditsOf(priceOf({ type: "image", out: "a.png" }))).toBe(67);
|
||||
expect(creditsOf(priceOf({ type: "image", out: "a.png" }))).toBe(111);
|
||||
expect(() => checkLimit(shot, 108)).not.toThrow();
|
||||
expect(() => checkLimit(shot, 30)).toThrow("about 108 credits, over --max-credits 30");
|
||||
expect(() => checkLimit(null, 30)).toThrow("cannot be priced ahead");
|
||||
expect(() => checkLimit(null, undefined)).not.toThrow();
|
||||
});
|
||||
|
||||
it("keeps 10% headroom under the limit for an image charged at the vendor's cost", () => {
|
||||
it("keeps 10% headroom under the limit for an image charged on the vendor's bill", () => {
|
||||
const limited = (request: GenerateRequest, limit: number) => () =>
|
||||
checkLimit(creditsOf(priceOf(request)), limit, isVendorPriced(request));
|
||||
const gpt = { type: "image", out: "a.png", model: "gpt-image-2.5", aspect: "16:9" } as const;
|
||||
expect(creditsOf(priceOf(gpt))).toBe(40);
|
||||
expect(limited(gpt, 40)).toThrow(
|
||||
"about 40 credits, 44 with 10% headroom because it is charged at the vendor's cost, over --max-credits 40",
|
||||
expect(creditsOf(priceOf(gpt))).toBe(66);
|
||||
expect(limited(gpt, 66)).toThrow(
|
||||
"about 66 credits, 73 with 10% headroom because it is charged on the vendor's bill, over --max-credits 66",
|
||||
);
|
||||
expect(limited(gpt, 43)).toThrow("44 with 10% headroom");
|
||||
expect(limited(gpt, 44)).not.toThrow();
|
||||
expect(limited(gpt, 72)).toThrow("73 with 10% headroom");
|
||||
expect(limited(gpt, 73)).not.toThrow();
|
||||
const nano = { type: "image", out: "a.png", model: "nano-banana-2" } as const;
|
||||
expect(isVendorPriced(nano)).toBe(false);
|
||||
expect(limited(nano, 67)).not.toThrow();
|
||||
expect(limited(nano, 111)).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -168,7 +168,22 @@ export const VENDOR_PRICED_IMAGES = new Set([
|
||||
"gpt-image-2.5",
|
||||
"gpt-image-2.6",
|
||||
"gpt-image-2.6-flare",
|
||||
"minimax-h3-image",
|
||||
"minimax-h3-image-4k",
|
||||
]);
|
||||
const GPT_ASPECTS = ["1:1", "16:9", "9:16", "4:3", "3:4"];
|
||||
const GEMINI_ASPECTS = [...GPT_ASPECTS, "3:2", "2:3", "21:9"];
|
||||
const MINIMAX_ASPECTS = [...GPT_ASPECTS, "21:9"];
|
||||
/** What /v3/images accepts from each model: its aspect ratios and how many reference pictures. */
|
||||
const IMAGE_MODELS: Record<string, { aspects: string[]; references: number }> = {
|
||||
"nano-banana-2": { aspects: GEMINI_ASPECTS, references: 14 },
|
||||
"nano-banana-2.1": { aspects: GEMINI_ASPECTS, references: 14 },
|
||||
"gpt-image-2.5": { aspects: GPT_ASPECTS, references: 16 },
|
||||
"gpt-image-2.6": { aspects: GPT_ASPECTS, references: 16 },
|
||||
"gpt-image-2.6-flare": { aspects: GPT_ASPECTS, references: 16 },
|
||||
"minimax-h3-image": { aspects: MINIMAX_ASPECTS, references: 16 },
|
||||
"minimax-h3-image-4k": { aspects: MINIMAX_ASPECTS, references: 16 },
|
||||
};
|
||||
export const isVendorPriced = (r: GenerateRequest): boolean =>
|
||||
r.type === "image" && VENDOR_PRICED_IMAGES.has(r.model ?? "");
|
||||
const VIDEO_RESOLUTION = "768p";
|
||||
@@ -182,6 +197,21 @@ const need = <T>(value: T | undefined, flag: string, example: string): T => {
|
||||
return value;
|
||||
};
|
||||
|
||||
function imageModel(r: GenerateRequest): string {
|
||||
const model = r.model ?? DEFAULTS.image;
|
||||
const spec = IMAGE_MODELS[model];
|
||||
if (!spec) return model;
|
||||
if (r.aspect && !spec.aspects.includes(r.aspect))
|
||||
throw new Fix(`${model} does not make ${r.aspect}`, `--aspect ${spec.aspects.join("|")}`);
|
||||
const refs = r.references?.length ?? 0;
|
||||
if (refs > spec.references)
|
||||
throw new Fix(
|
||||
`${model} takes at most ${spec.references} --reference pictures, not ${refs}`,
|
||||
`pass the ${spec.references} that matter most`,
|
||||
);
|
||||
return model;
|
||||
}
|
||||
|
||||
const ROUTES: Record<GenerateType, Route> = {
|
||||
image: {
|
||||
path: "/v3/images",
|
||||
@@ -189,7 +219,7 @@ const ROUTES: Record<GenerateType, Route> = {
|
||||
c.createImage({ body: body as ImageCreateRequest, idempotencyKey: key, signal }),
|
||||
status: (c, id, signal) => c.getImage({ generation_id: id, signal }),
|
||||
body: (r, media) => ({
|
||||
model: r.model ?? DEFAULTS.image,
|
||||
model: imageModel(r),
|
||||
prompt: need(r.prompt, "--prompt", '--prompt "the same room, empty, no text"'),
|
||||
num_images: 1,
|
||||
...(r.aspect ? { aspect_ratio: r.aspect } : {}),
|
||||
|
||||
@@ -35,6 +35,21 @@ const GPT_REFERENCE = 0.0125;
|
||||
const NANO_IMAGE = 0.067;
|
||||
const NANO_2_1_IMAGE = 0.0336;
|
||||
const NANO_2_1_REFERENCE = 0.00168;
|
||||
const MINIMAX_IMAGE: Record<string, number> = {
|
||||
"minimax-h3-image": 0.025,
|
||||
"minimax-h3-image-4k": 0.07,
|
||||
};
|
||||
const MINIMAX_REFERENCE = 0.015;
|
||||
// An API key pays 1.5x the vendor price; the price book's hf_image rows charge it x1.103 serving overhead x1.5.
|
||||
const API_IMAGE_MARKUP = 1.5;
|
||||
const HF_IMAGE_MARKUP = 1.103 * 1.5;
|
||||
const MARKUPS = "x1.5 on an API key, x1.6545 in HyperFrames credits";
|
||||
const image = (vendorUsd: number, basis: string): Price =>
|
||||
at(
|
||||
vendorUsd * API_IMAGE_MARKUP,
|
||||
`${basis}; vendor price ${MARKUPS}`,
|
||||
vendorUsd * HF_IMAGE_MARKUP * HF_CREDITS_PER_USD,
|
||||
);
|
||||
const VIDEO_768P_PER_S = 0.018;
|
||||
// A reference shot (pictures, voice or guide clip) bills more, and its guide clip's seconds bill too: measured
|
||||
// 2026-10-23 from the wallet, 5 s with a picture $0.25, 10 s $0.50, 5 s with a 1 s guide $0.30, with a 3 s guide $0.40.
|
||||
@@ -62,20 +77,23 @@ export function priceOf(r: GenerateRequest): Price {
|
||||
case "image": {
|
||||
const refs = r.references?.length ?? 0;
|
||||
const model = r.model ?? "nano-banana-2";
|
||||
if (model === "nano-banana-2") return at(NANO_IMAGE, "nano-banana-2, $0.067 an image");
|
||||
if (model === "nano-banana-2") return image(NANO_IMAGE, "nano-banana-2, $0.067 an image");
|
||||
if (model === "nano-banana-2.1")
|
||||
return at(
|
||||
return image(
|
||||
NANO_2_1_IMAGE + refs * NANO_2_1_REFERENCE,
|
||||
"nano-banana-2.1, $0.0336 an image and $0.00168 a reference",
|
||||
);
|
||||
if (!VENDOR_PRICED_IMAGES.has(model))
|
||||
return { usd: null, list: null, credits: null, basis: `${model}, not priced ahead` };
|
||||
const each = GPT_IMAGE[r.aspect ?? "16:9"] ?? GPT_IMAGE["16:9"]!;
|
||||
const list = each + refs * GPT_REFERENCE;
|
||||
const about = Math.ceil(list * HF_CREDITS_PER_USD - 1e-9);
|
||||
return at(
|
||||
const aspect = r.aspect ?? "16:9";
|
||||
const minimax = MINIMAX_IMAGE[model];
|
||||
const each = minimax ?? GPT_IMAGE[aspect] ?? GPT_IMAGE["16:9"]!;
|
||||
const reference = minimax === undefined ? GPT_REFERENCE : MINIMAX_REFERENCE;
|
||||
const list = each + refs * reference;
|
||||
const about = Math.ceil(list * HF_IMAGE_MARKUP * HF_CREDITS_PER_USD - 1e-9);
|
||||
return image(
|
||||
list,
|
||||
`${model} at ${r.aspect ?? "16:9"}, about ${about} credits (charged at vendor cost), with about $0.0125 a reference`,
|
||||
`${model} at ${aspect}, about ${about} credits (charged on the vendor's bill), with about $${reference} a reference`,
|
||||
);
|
||||
}
|
||||
case "video": {
|
||||
@@ -139,7 +157,7 @@ export function priceOf(r: GenerateRequest): Price {
|
||||
}
|
||||
}
|
||||
|
||||
// No HeyGen unit rounding here: a $0.067 image is charged 67 credits, measured on dev 2026-10-29. Still an estimate.
|
||||
// No HeyGen unit rounding here, only up to a whole credit: the price book rounds a call's lines once. Still an estimate.
|
||||
export const creditsOf = (p: Price): number | null =>
|
||||
p.credits === null ? null : Math.ceil(p.credits - 1e-9);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export function limitCheck(credits: number, vendorPriced = false) {
|
||||
return {
|
||||
checked,
|
||||
about: vendorPriced
|
||||
? `about ${credits} credits, ${checked} with 10% headroom because it is charged at the vendor's cost`
|
||||
? `about ${credits} credits, ${checked} with 10% headroom because it is charged on the vendor's bill`
|
||||
: `about ${credits} credits`,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"files": 13
|
||||
},
|
||||
"media-use": {
|
||||
"hash": "457c93b8b5216c0f",
|
||||
"hash": "61f2d9d424f6576a",
|
||||
"files": 125
|
||||
},
|
||||
"remotion-to-hyperframes": {
|
||||
|
||||
@@ -37,7 +37,7 @@ It prints one line, `resolved <id> → <path> (<type>, <metadata>)`. List reusab
|
||||
|
||||
**HeyGen.** `npx hyperframes media-use generate` makes images, shots, talking photos, voices and music on the sign-in alone. Helpers and direct recipes need the [`heygen` CLI](https://developers.heygen.com/cli); if it is missing, give the link and wait until they say it is installed. Direct `heygen` recipes bill that CLI's own login: use them only when that payer is selected.
|
||||
|
||||
**Credits.** Plan for the best result: no cheaper or free swaps, no dropped items, unless asked to save cost. Don't volunteer prices, estimates or usage; `--plan` is for you. A credit limit the person sets: write it once to `.hyperframes/credit-limit.json` as `{"credits": N}`; every paid call then refuses what would go past it, GPT Image only at estimate +10% (`references/heygen.md`) (`--max-credits` only tightens). A step that won't fit (a `--plan` over what is left, or a refused call): say what doesn't, ask before dropping or shrinking it. A refused call names a `billing` command: say why, ask them to run it, then retry.
|
||||
**Credits.** Plan for the best result: no cheaper or free swaps, no dropped items, unless asked to save cost. Don't volunteer prices, estimates or usage; `--plan` is for you. A credit limit the person sets: write it once to `.hyperframes/credit-limit.json` as `{"credits": N}`; every paid call then refuses what would go past it, GPT Image and H3 at estimate +10% (`references/heygen.md`) (`--max-credits` only tightens). A step that won't fit (a `--plan` over what is left, or a refused call): say what doesn't, ask before dropping or shrinking it. A refused call names a `billing` command: say why, ask them to run it, then retry.
|
||||
|
||||
## Looks on real footage
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ A refusal names its fix: `api_key_required` needs an API key, `402` or `insuffic
|
||||
|
||||
## Making media: `media-use generate`
|
||||
|
||||
Make it without quoting a price or asking for a budget; `--plan` only prints what a call would cost (`credits` is an estimate in HyperFrames credits), for your own planning; never pass it on. When the person names a credit limit, record it in the project's credit-limit file (SKILL.md, Credits). A GPT Image call is charged the vendor's cost, so the limit checks it against its estimate plus 10% and is not a hard ceiling for it: a reference-heavy edit can still go past. A finished call's charge, when HeyGen reports it, counts toward the limit afterwards. Make a piece again only for a fault you can name (a cut inside it, text in it, the wrong framing), once, never to chase a motion or look score; a `content_policy_violation` gets one reworded try. A failed or refused job also gets one more try, test calls included; then stop and ask the person, without saying what was spent or what another try costs.
|
||||
Make it without quoting a price or asking for a budget; `--plan` only prints what a call would cost (`credits` is an estimate in HyperFrames credits), for your own planning; never pass it on. When the person names a credit limit, record it in the project's credit-limit file (SKILL.md, Credits). A GPT Image or MiniMax H3 call is charged on the vendor's bill, so the limit checks it against its estimate plus 10% and is not a hard ceiling for it: a reference-heavy edit can still go past. A finished call's charge, when HeyGen reports it, counts toward the limit afterwards. Make a piece again only for a fault you can name (a cut inside it, text in it, the wrong framing), once, never to chase a motion or look score; a `content_policy_violation` gets one reworded try. A failed or refused job also gets one more try, test calls included; then stop and ask the person, without saying what was spent or what another try costs.
|
||||
|
||||
```bash
|
||||
# a still, edited from a reference picture: a clean plate with the words removed
|
||||
@@ -46,15 +46,17 @@ npx hyperframes media-use generate --type music --prompt "warm lo-fi, soft keys"
|
||||
|
||||
The file lands at `--out` and the media ledger records it as generated, with the route, model, job, prompt and the files it was made from. Pictures and shots carry no text or logos: ask for clean plates and draw words in HyperFrames.
|
||||
|
||||
| Type | Model | Price |
|
||||
| ------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| image | nano-banana-2 (default), or nano-banana-2.1, gpt-image-2.5, gpt-image-2.6 or gpt-image-2.6-flare with `--model` | $0.067 an image; nano-banana-2.1 $0.034 plus $0.0017 a reference; gpt-image about $0.036–0.053 by aspect plus $0.0125 a reference, a plan charges vendor cost |
|
||||
| video | heygen-video-1, 768p | $0.02 a second from a prompt or first frame; $0.05 a second with a reference picture, voice or guide clip, and the guide's seconds count too (1080p costs about twice) |
|
||||
| lipsync | HeyGen lipsync, speed | 7 credits a second of the video on a plan |
|
||||
| avatar | talking photo | $4.83 a minute of speech |
|
||||
| cutout | HeyGen background removal | not priced ahead |
|
||||
| music | lyria-3-pro | $0.08 a track |
|
||||
| voice | the voice's engine | charged per character, not priced ahead |
|
||||
| Type | Model | Price |
|
||||
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| image | nano-banana-2 (default), or nano-banana-2.1, gpt-image-2.5, gpt-image-2.6, gpt-image-2.6-flare, minimax-h3-image (2K) or minimax-h3-image-4k with `--model` | 1.5x the vendor price on an API key: $0.10 an image; nano-banana-2.1 $0.05 plus $0.0025 a reference; gpt-image about $0.054–0.079 by aspect plus $0.019 a reference; minimax-h3-image $0.0375 (4K $0.105) plus $0.0225 a reference. A plan charges the vendor price x1.6545 in credits; gpt-image and minimax-h3-image are charged on the vendor's bill |
|
||||
| video | heygen-video-1, 768p | $0.02 a second from a prompt or first frame; $0.05 a second with a reference picture, voice or guide clip, and the guide's seconds count too (1080p costs about twice) |
|
||||
| lipsync | HeyGen lipsync, speed | 7 credits a second of the video on a plan |
|
||||
| avatar | talking photo | $4.83 a minute of speech |
|
||||
| cutout | HeyGen background removal | not priced ahead |
|
||||
| music | lyria-3-pro | $0.08 a track |
|
||||
| voice | the voice's engine | charged per character, not priced ahead |
|
||||
|
||||
Each image model takes only its own aspect ratios and reference count, and generate refuses the rest: gpt-image 1:1, 16:9, 9:16, 4:3 or 3:4 with up to 16 references; nano-banana those and 3:2, 2:3 or 21:9 with up to 14; minimax-h3-image gpt-image's and 21:9 with up to 16.
|
||||
|
||||
`--plan`'s `usd` is what an API key is charged (HeyGen rounds up to units of $1/60); its `credits` is what a HyperFrames plan charges, on the plan's own rates: a video shot's seconds and guide seconds, plus each picture past the first two. Without `--voice`, generate lists voice ids to pick from on the sign-in alone; a cloned voice from `heygen voice clone create` (`operations.md`).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user