FG
💻 Software🤖 AI & LLMsOpenAI

gpt-image-1 size missing in ImageEditParams

Fresh5 days ago
Mar 14, 20260 views
Confidence Score55%
55%

Problem

Confirm this is a Node library issue and not an underlying OpenAI API issue - [x] This is an issue with the Node library Describe the bug The `Images` type `ImageEditParams` is missing `size` for `gpt-image-1` model. Should align with the comment, to add extra sizes `'1536x1024'` | `'1024x1536'` | `'auto'` [code block] To Reproduce 1. Install latest v4.96.0 update 2. Import ImageEditParams with model `gpt-image-1` Code snippets [code block] OS macOS Node version v20.15.0 Library version 4.96.0

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Add Missing Size Parameter to ImageEditParams for gpt-image-1

Medium Risk

The ImageEditParams type in the Node library version 4.96.0 does not include the 'size' parameter for the gpt-image-1 model. This omission prevents users from specifying the desired output dimensions, which should include '1536x1024', '1024x1536', and 'auto'. This issue arises from an incomplete type definition in the library's codebase.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Locate ImageEditParams Definition

    Find the file where the ImageEditParams type is defined in the Node library. This is typically located in the 'types' or 'models' directory.

    typescript
    import { ImageEditParams } from 'openai';
  2. 2

    Add Size Parameter

    Modify the ImageEditParams type definition to include the 'size' parameter with the appropriate union type for gpt-image-1. Ensure that the new sizes are correctly defined.

    typescript
    interface ImageEditParams { model: 'gpt-image-1'; size?: '1536x1024' | '1024x1536' | 'auto'; }
  3. 3

    Update Documentation

    Ensure that the library's documentation is updated to reflect the new 'size' parameter for the gpt-image-1 model. This helps users understand how to utilize the new feature effectively.

    markdown
    // Update README.md or relevant documentation files.
  4. 4

    Run Tests

    Execute existing unit tests to ensure that the addition of the 'size' parameter does not break any existing functionality. If necessary, add new tests to cover the new parameter.

    bash
    npm test
  5. 5

    Publish Update

    Once all changes are verified and tested, publish the updated library version to npm to make the fix available to users.

    bash
    npm version patch && npm publish

Validation

To confirm the fix worked, import the updated ImageEditParams and check that the 'size' parameter is now available for the gpt-image-1 model. Create a sample request using the new parameter and verify that it functions as expected without errors.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

openaigptllmapibug