Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/provider-hypihub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
30 changes: 15 additions & 15 deletions packages/provider-hypihub/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand All @@ -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" },
Expand All @@ -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" },
Expand All @@ -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" },
Expand Down
22 changes: 11 additions & 11 deletions packages/provider-hypihub/test/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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" });
Expand All @@ -63,7 +63,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,
});
});
Expand Down Expand Up @@ -180,11 +180,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 },
});
},
Expand All @@ -201,10 +201,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 },
},
}]);
Expand All @@ -214,8 +214,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 = {
Expand All @@ -232,7 +232,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",
});
});

Expand Down Expand Up @@ -471,12 +471,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",
Expand Down
10 changes: 5 additions & 5 deletions packages/provider-hypihub/test/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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",
Expand Down Expand Up @@ -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");
}
});
Loading