fix(baoyu-imagine): align Replicate schemas and output handling

This commit is contained in:
justnodejs 2026-04-11 15:51:43 +08:00
parent 4c3238ba1c
commit 7b3214e27a
2 changed files with 27 additions and 0 deletions

View File

@ -82,6 +82,29 @@ test("Replicate input builder keeps nano-banana mapping for compatible models",
); );
}); });
test("Replicate fallback preserves --n for unknown models", () => {
assert.deepEqual(
buildInput(
"A robot painter",
"unknown-owner/unknown-model",
makeArgs({
aspectRatio: "16:9",
quality: "2k",
n: 4,
}),
["ref"],
),
{
prompt: "A robot painter",
aspect_ratio: "16:9",
resolution: "2K",
number_of_images: 4,
output_format: "png",
image_input: ["ref"],
},
);
});
test("Replicate input builder maps Seedream models to size-based schema", () => { test("Replicate input builder maps Seedream models to size-based schema", () => {
assert.deepEqual( assert.deepEqual(
buildInput( buildInput(

View File

@ -138,6 +138,10 @@ function buildNanoBananaInput(prompt: string, args: CliArgs, referenceImages: st
input.resolution = "2K"; input.resolution = "2K";
} }
if (args.n > 1) {
input.number_of_images = args.n;
}
input.output_format = "png"; input.output_format = "png";
if (referenceImages.length > 0) { if (referenceImages.length > 0) {