Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

fix(hypihub): send the model ids the service now publishes (#197)

Sharky Wang18b98bfb07aa
diff --git a/packages/provider-hypihub/README.md b/packages/provider-hypihub/README.md
index aaa10ed8..d0d30556 100644
--- a/packages/provider-hypihub/README.md
+++ b/packages/provider-hypihub/README.md
@@ -16,7 +16,7 @@ admits them into the current Build's working byte area. Image references use Hyp
`reference_image_urls`, `reference_videos`, and `reference_audios` fields. A single reference video
remains in `reference_videos`; `ref_video_url` is reserved for a model's source-video port. First/last-frame images use `first_frame` and `last_frame`.
-Seedance 2.5 (`@hypit/seedance` model `2.5`) maps to `bytedance/seedance-2-5` and supports
+Seedance 2.5 (`@hypit/seedance` model `2.5`) maps to `seedance-2.5` and supports
`480p`, `720p` and `1080p`. The Provider passes the authored `resolution` to `POST /v1/videos`;
omitting it in the Seedance Surface defaults to `720p`.
diff --git a/packages/provider-hypihub/src/mapping.ts b/packages/provider-hypihub/src/mapping.ts
index 40016c82..05a19ee7 100644
--- a/packages/provider-hypihub/src/mapping.ts
+++ b/packages/provider-hypihub/src/mapping.ts
@@ -38,14 +38,14 @@ export const hypiHubMappings: readonly GenerationWireMapping[] = [
format: { as: "value", field: "format", whenAbsent: "WEBM" },
},
},
- seedance("seedance-2", "bytedance/seedance-2"),
- seedance("seedance-2-fast", "bytedance/seedance-2-fast"),
- seedance("seedance-2-mini", "bytedance/seedance-2-mini"),
- seedance("seedance-2.5", "bytedance/seedance-2-5"),
+ seedance("seedance-2", "seedance-2"),
+ seedance("seedance-2-fast", "seedance-2-fast"),
+ seedance("seedance-2-mini", "seedance-2-mini"),
+ seedance("seedance-2.5", "seedance-2.5"),
{
capability: { module: GPT_IMAGE, name: "gpt-image-2" }, result: "image", routes: [
- { model: "gpt-image-2-image-to-image", whenPresent: ["images"] },
- { model: "gpt-image-2-text-to-image" },
+ { model: "gpt-image-2", whenPresent: ["images"] },
+ { model: "gpt-image-2" },
],
fields: {
prompt: { as: "value", field: "prompt" },
@@ -67,8 +67,8 @@ export const hypiHubMappings: readonly GenerationWireMapping[] = [
})),
{
capability: { module: SEEDREAM, name: "seedream-5-lite" }, result: "image", routes: [
- { model: "seedream/5-lite-image-to-image", whenPresent: ["images"] },
- { model: "seedream/5-lite-text-to-image" },
+ { model: "seedream-5-lite", whenPresent: ["images"] },
+ { model: "seedream-5-lite" },
],
fields: {
prompt: { as: "value", field: "prompt" },
@@ -81,11 +81,11 @@ export const hypiHubMappings: readonly GenerationWireMapping[] = [
},
{
capability: { module: MINIMAX, name: "minimax-h3" }, result: "video", routes: [
- { model: "minimax-h3/image-to-video", whenPresent: ["lastFrame"] },
- { model: "minimax-h3/image-to-video", whenPresent: ["firstFrame"] },
- { model: "minimax-h3/reference-to-video", whenPresent: ["referenceImage"] },
- { model: "minimax-h3/reference-to-video", whenPresent: ["referenceVideo"] },
- { model: "minimax-h3/text-to-video" },
+ { model: "minimax-h3", whenPresent: ["lastFrame"] },
+ { model: "minimax-h3", whenPresent: ["firstFrame"] },
+ { model: "minimax-h3", whenPresent: ["referenceImage"] },
+ { model: "minimax-h3", whenPresent: ["referenceVideo"] },
+ { model: "minimax-h3" },
],
fields: {
prompt: { as: "value", field: "prompt" }, duration: { as: "value", field: "seconds" },
@@ -99,8 +99,8 @@ export const hypiHubMappings: readonly GenerationWireMapping[] = [
},
{
capability: { module: GROK, name: "grok-imagine-video" }, result: "video", routes: [
- { model: "grok-imagine/image-to-video", whenPresent: ["images"] },
- { model: "grok-imagine/text-to-video" },
+ { model: "grok-imagine-video", whenPresent: ["images"] },
+ { model: "grok-imagine-video" },
],
fields: {
prompt: { as: "value", field: "prompt" }, duration: { as: "value", field: "seconds" },
diff --git a/packages/provider-hypihub/test/provider.test.ts b/packages/provider-hypihub/test/provider.test.ts
index 9aeca6b8..62f6eb30 100644
--- a/packages/provider-hypihub/test/provider.test.ts
+++ b/packages/provider-hypihub/test/provider.test.ts
@@ -105,7 +105,7 @@ test("HypiHub Seedance 2.5 resolves and submits 1080p without downgrading", asyn
let submitted: unknown;
const endpoint = await endpointFor(request, async (input, init) => {
const url = String(input);
- if (url.endsWith("/models/bytedance%2Fseedance-2-5")) return Response.json({ endpoints: ["videos"] });
+ if (url.endsWith("/models/seedance-2.5")) return Response.json({ endpoints: ["videos"] });
if (url.endsWith("/videos")) {
submitted = JSON.parse(String(init?.body));
return Response.json({ id: "job_seedance25_1080p", status: "queued" });
@@ -119,7 +119,7 @@ test("HypiHub Seedance 2.5 resolves and submits 1080p without downgrading", asyn
});
assert.equal(started.status, "pending");
assert.deepEqual(submitted, {
- model: "bytedance/seedance-2-5", prompt: "A presenter speaks to camera.",
+ model: "seedance-2.5", prompt: "A presenter speaks to camera.",
resolution: "1080p", aspect_ratio: "9:16", seconds: 5, generate_audio: true, web_search: false,
});
});
@@ -236,11 +236,11 @@ test("HypiHub returns its current model-pricing document", async () => {
const provider = createHypiHubProvider({
pricingRequestTimeoutMs: 1_000,
fetch: async (input, init) => {
- assert.equal(String(input), "https://hypit.ai/v1/pricing?model=bytedance%2Fseedance-2");
+ assert.equal(String(input), "https://hypit.ai/v1/pricing?model=seedance-2");
assert.equal((init?.headers as Record<string, string>).authorization, "Bearer test-key");
return Response.json({
object: "model_pricing",
- model: "bytedance/seedance-2",
+ model: "seedance-2",
pricing: { mode: "per_second", per_second_usd: 0.1045 },
});
},
@@ -257,10 +257,10 @@ test("HypiHub returns its current model-pricing document", async () => {
request,
credentials: async () => ({ apiKey: { secret: "test-key" } }),
}), [{
- source: "https://hypit.ai/v1/pricing?model=bytedance%2Fseedance-2",
+ source: "https://hypit.ai/v1/pricing?model=seedance-2",
data: {
object: "model_pricing",
- model: "bytedance/seedance-2",
+ model: "seedance-2",
pricing: { mode: "per_second", per_second_usd: 0.1045 },
},
}]);
@@ -270,8 +270,8 @@ test("HypiHub prices the wire route selected by an authored future input", async
const provider = createHypiHubProvider({
pricingRequestTimeoutMs: 1_000,
fetch: async (input) => {
- assert.equal(String(input), "https://hypit.ai/v1/pricing?model=gpt-image-2-image-to-image");
- return Response.json({ object: "model_pricing", model: "gpt-image-2-image-to-image" });
+ assert.equal(String(input), "https://hypit.ai/v1/pricing?model=gpt-image-2");
+ return Response.json({ object: "model_pricing", model: "gpt-image-2" });
},
});
const request = {
@@ -288,7 +288,7 @@ test("HypiHub prices the wire route selected by an authored future input", async
});
assert.deepEqual(document?.data, {
object: "model_pricing",
- model: "gpt-image-2-image-to-image",
+ model: "gpt-image-2",
});
});
@@ -527,12 +527,12 @@ test("HypiHub uploads one referenced Resource once and submits its HTTPS URL", a
assert.equal(body.parts.length, 3);
return Response.json({ url: "https://hypit.ai/files/as_reference.png" });
}
- if (url.endsWith("/v1/models/bytedance%2Fseedance-2-mini")) {
+ if (url.endsWith("/v1/models/seedance-2-mini")) {
return Response.json({ endpoints: ["videos"] });
}
if (url.endsWith("/v1/videos")) {
const body = JSON.parse(String(init?.body)) as Record<string, unknown>;
- assert.equal(body.model, "bytedance/seedance-2-mini");
+ assert.equal(body.model, "seedance-2-mini");
assert.deepEqual(body.reference_image_urls, [
"https://hypit.ai/files/as_reference.png",
"https://hypit.ai/files/as_reference.png",
diff --git a/packages/provider-hypihub/test/routes.test.ts b/packages/provider-hypihub/test/routes.test.ts
index 511d2f5e..4c114426 100644
--- a/packages/provider-hypihub/test/routes.test.ts
+++ b/packages/provider-hypihub/test/routes.test.ts
@@ -27,7 +27,7 @@ test("HypiHub GPT image requests use canonical edit references and the authored
images: [{ role: "image", artifact: image }],
},
}, resolve);
- assert.equal(result.model, "gpt-image-2-image-to-image");
+ assert.equal(result.model, "gpt-image-2");
assert.deepEqual(result.input, {
prompt: "edit",
aspect_ratio: "1:1",
@@ -84,7 +84,7 @@ test("HypiHub image-to-video requests preserve Hypit's first-frame semantics", a
firstFrame: [{ role: "image", artifact: image }],
},
}, resolve);
- assert.equal(result.model, "minimax-h3/image-to-video");
+ assert.equal(result.model, "minimax-h3");
assert.deepEqual(result.input, {
prompt: "animate",
seconds: 5,
@@ -126,7 +126,7 @@ test("HypiHub Seedance sends reference images through the public top-level field
],
},
}, resolve);
- assert.equal(result.model, "bytedance/seedance-2");
+ assert.equal(result.model, "seedance-2");
assert.deepEqual(result.input, {
prompt: "animate",
seconds: 5,
@@ -145,7 +145,7 @@ test("HypiHub MiniMax reference mode preserves the public image array", async ()
prompt: ["animate"], duration: [6], aspectRatio: ["16:9"],
referenceImage: [{ role: "image", artifact: image }],
} }, resolve);
- assert.equal(result.model, "minimax-h3/reference-to-video");
+ assert.equal(result.model, "minimax-h3");
assert.deepEqual(result.input, {
prompt: "animate", seconds: 6, aspect_ratio: "16:9",
resolution: "2k",
@@ -231,7 +231,7 @@ test("exact model identity survives reference mode and preview selection", async
for (const images of [[], [{ role: "image", artifact: image }]]) {
const request = { ports: { prompt: ["A scene"], ...(images.length ? { images } : {}) } };
assert.equal((await lite.compile(request, resolve)).model,
- images.length ? "seedream/5-lite-image-to-image" : "seedream/5-lite-text-to-image");
+ "seedream-5-lite");
assert.equal((await preview.compile(request, resolve)).model, "grok-imagine-video-1.5-preview");
}
});