fix(pai-art-skill): Apply model-specific default sizes in Generate.ts - #379
Closed
b1ackmartian wants to merge 1 commit into
Closed
fix(pai-art-skill): Apply model-specific default sizes in Generate.ts#379b1ackmartian wants to merge 1 commit into
b1ackmartian wants to merge 1 commit into
Conversation
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>
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--sizeis omitted or invalidFixes #380
Problem
The validation logic was structured as:
When using
gpt-image-1without--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 like1024x1024, 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 to1024x1024nano-banana-pro: defaults to2Kflux/nano-banana: defaults to16:9Test Plan
--model gpt-image-1without--size- now defaults to 1024x1024--model nano-banana-prowithout--size- works with 2K default🤖 Generated with Claude Code