diff --git a/src/internal/image-models.ts b/src/internal/image-models.ts index 509cf29..fd691f4 100644 --- a/src/internal/image-models.ts +++ b/src/internal/image-models.ts @@ -16,16 +16,17 @@ export const IMAGE_MODELS = [ export const DEFAULT_IMAGE_MODEL = "gpt-image-2"; export const IMAGE_MODEL_HELP = - "gpt-image-2 (default, best; ratios 1:1|3:2|2:3) | nano-banana-pro | nano-banana-2 | " + + "gpt-image-2 (default, best; ratios 1:1|16:9|9:16|3:2|2:3) | nano-banana-pro | nano-banana-2 | " + "nano-banana-2-lite (fastest, cheapest) | nano-banana (legacy)"; export const ASPECT_RATIOS = ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"] as const; export const ASPECT_RATIO_HELP = - "default: 1:1. nano-banana*: 1:1|16:9|9:16|4:3|3:4. gpt-image-2: 1:1|3:2|2:3. " + + "default: 1:1. nano-banana*: 1:1|16:9|9:16|4:3|3:4. " + + "gpt-image-2: 1:1|16:9|9:16|3:2|2:3. " + "Mutually exclusive with --generate-multi-view"; -const GPT_IMAGE_2_RATIOS = new Set(["1:1", "3:2", "2:3"]); +const GPT_IMAGE_2_RATIOS = new Set(["1:1", "16:9", "9:16", "3:2", "2:3"]); const NANO_BANANA_RATIOS = new Set(["1:1", "16:9", "9:16", "4:3", "3:4"]); /** @@ -47,7 +48,7 @@ export function checkImageCombo(opts: { if (!supported.has(ratio)) { throw new UsageError( opts.aiModel === "gpt-image-2" - ? `--aspect-ratio ${ratio} is not supported by gpt-image-2 (use 1:1, 3:2, or 2:3)` + ? `--aspect-ratio ${ratio} is not supported by gpt-image-2 (use 1:1, 16:9, 9:16, 3:2, or 2:3)` : `--aspect-ratio ${ratio} is only supported by gpt-image-2`, ); } diff --git a/tests/image-models.test.ts b/tests/image-models.test.ts index 065e920..f780fdc 100644 --- a/tests/image-models.test.ts +++ b/tests/image-models.test.ts @@ -21,11 +21,11 @@ test("checkImageCombo — multi-view excludes aspect-ratio", () => { checkImageCombo({ aiModel: "nano-banana", generateMultiView: true }); }); -test("checkImageCombo — gpt-image-2 accepts only 1:1, 3:2, 2:3", () => { - for (const ratio of ["1:1", "3:2", "2:3"]) { +test("checkImageCombo — gpt-image-2 accepts square, widescreen, and native ratios", () => { + for (const ratio of ["1:1", "16:9", "9:16", "3:2", "2:3"]) { checkImageCombo({ aiModel: "gpt-image-2", aspectRatio: ratio }); } - for (const ratio of ["16:9", "9:16", "4:3", "3:4"]) { + for (const ratio of ["4:3", "3:4"]) { assert.throws( () => checkImageCombo({ aiModel: "gpt-image-2", aspectRatio: ratio }), /not supported by gpt-image-2/,