Repository navigation
Support custom image dimensions for GPT-Image-2.5 (e.g. 3840x2160) #15897
Support custom image dimensions for GPT-Image-2.5 (e.g. 3840x2160)Is your feature request related to a problem?Yes. I'm running LibreChat v0.8.8-rc2 and testing GPT-Image-2.5. I requested a 4K image (
GPT-Image-2.5 supports custom dimensions and high-resolution outputs, including 4K-sized images. However, it appears that LibreChat may not currently allow these values to be passed to the API. Current schema: size: {
type: 'string',
enum: ['auto', '1024x1024', '1536x1024', '1024x1536'],
description:
'The size of the generated image. One of 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default).',
},Describe the solution you'd likeAllow custom dimensions supported by GPT-Image-2.5 to be passed through LibreChat. Examples:
Ideally, LibreChat could support any valid For example: size: {
type: 'string',
description: 'Image dimensions (WIDTHxHEIGHT) or auto',
},The value could then be validated on the server according to the limits of the selected model. Describe alternatives you've consideredAn alternative would be to extend the existing enum list with commonly used high-resolution sizes: size: {
type: 'string',
enum: [
'auto',
'1024x1024',
'1536x1024',
'1024x1536',
'2048x2048',
'2048x1152',
'3840x2160',
'2160x3840',
],
},This would provide access to common high-resolution output sizes while retaining the existing fixed-list approach. Additional contextEnvironment:
Questions:
Thank you for considering this enhancement. |
Replies: 1 comment 1 reply
|
Thanks for the detailed report. Two things are going on, and the second is why you got
Workaround for the resize (works today): keep the original resolution by adding this to fileConfig:
imageGeneration:
percentage: 100Or cap the output instead, e.g. With that setting plus #15904, a |
Thanks for the detailed report. Two things are going on, and the second is why you got
1365x768:The schema limits the sizes. The
sizeenum was written for gpt-image-1, so the model can't send3840x2160. It falls back toautoor one of the listed sizes. #15904 replaces the enum with aWIDTHxHEIGHT(orauto) pattern for both image generation and editing. The image API then decides which dimensions your model accepts.LibreChat resizes generated images when it saves them. By default, generated images are downscaled to a 768px short side, and 16:9 at that height is exactly 1365x768. So that's our resize on save, not what the API returned.
Workaround for the resize (works today): keep t…