Skip to content

fix(pai-art-skill): Apply model-specific default sizes in Generate.ts - #379

Closed
b1ackmartian wants to merge 1 commit into
danielmiessler:mainfrom
b1ackmartian:fix/art-skill-size-validation
Closed

fix(pai-art-skill): Apply model-specific default sizes in Generate.ts#379
b1ackmartian wants to merge 1 commit into
danielmiessler:mainfrom
b1ackmartian:fix/art-skill-size-validation

Conversation

@b1ackmartian

@b1ackmartian b1ackmartian commented Jan 11, 2026

Copy link
Copy Markdown

Summary

  • Fixed broken size validation logic in Generate.ts that caused errors when using models with different size formats
  • Applied sensible model-specific defaults when --size is omitted or invalid

Fixes #380

Problem

The validation logic was structured as:

if (gpt-image-1 && NOT valid) throw
else if (nano-banana-pro) { validate }
else if (NOT valid for replicate) throw

When using gpt-image-1 without --size, the default "2K" would pass the first condition (since the size IS technically invalid for OpenAI), but then if you specify a valid OpenAI size like 1024x1024, the first condition becomes false and it falls through to the replicate check which fails.

Solution

Restructured to properly branch per model type and apply defaults:

  • gpt-image-1: defaults to 1024x1024
  • nano-banana-pro: defaults to 2K
  • flux/nano-banana: defaults to 16:9

Test Plan

  • Tested --model gpt-image-1 without --size - now defaults to 1024x1024
  • Tested --model nano-banana-pro without --size - works with 2K default
  • Generated test image successfully with Google API

🤖 Generated with Claude Code

The size validation logic was broken - when using gpt-image-1 with the
default size (2K), the validation would pass the first check but then
fail in the else-if chain against REPLICATE_SIZES.

Changes:
- Restructure validation to properly branch per model type
- Apply sensible defaults when size is missing or invalid for the model:
  - gpt-image-1: defaults to 1024x1024
  - nano-banana-pro: defaults to 2K
  - flux/nano-banana: defaults to 16:9

This allows users to omit --size and get a working default for any model.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kaimagnus

Copy link
Copy Markdown
Collaborator

Thank you for this fix, @b1ackmartian! You nailed the issue — each model needs its own default size format.

We've applied this fix in commit 0fc1931, which adds model-specific default sizing (flux/nano-banana get aspect ratios, gpt-image-1 gets pixel dimensions, nano-banana-pro gets resolution tiers). Closing in favor of that commit. Great analysis!

@kaimagnus kaimagnus closed this Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(pai-art-skill): Generate.ts size validation fails for gpt-image-1 model

2 participants