Module: OpenAI::Models::ImageGenerateParams::Size

Extended by:
Internal::Type::Union
Defined in:
lib/openai/models/image_generate_params.rb,
sig/openai/models/image_generate_params.rbs

Overview

The size of the generated images. For gpt-image-2 and gpt-image-2-2026-04-21, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing. For dall-e-2, use one of 256x256, 512x512, or 1024x1024. For dall-e-3, use one of 1024x1024, 1792x1024, or 1024x1792.

collapse

AUTO =

Returns:

  • (:auto)
:auto
SIZE_1024X1024 =

Returns:

  • (:"1024x1024")
:"1024x1024"
SIZE_1536X1024 =

Returns:

  • (:"1536x1024")
:"1536x1024"
SIZE_1024X1536 =

Returns:

  • (:"1024x1536")
:"1024x1536"
SIZE_256X256 =

Returns:

  • (:"256x256")
:"256x256"
SIZE_512X512 =

Returns:

  • (:"512x512")
:"512x512"
SIZE_1792X1024 =

Returns:

  • (:"1792x1024")
:"1792x1024"
SIZE_1024X1792 =

Returns:

  • (:"1024x1792")
:"1024x1792"

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Class Method Details

.variantsArray(String, Symbol)

Returns:

  • (Array(String, Symbol))


308
309
310
# File 'lib/openai/models/image_generate_params.rb', line 308

define_sorbet_constant!(:Variants) do
  T.type_alias { T.any(String, OpenAI::ImageGenerateParams::Size::TaggedSymbol) }
end

Instance Method Details

#self?.variants::Array[OpenAI::Models::ImageGenerateParams::size]

Returns:

  • (::Array[OpenAI::Models::ImageGenerateParams::size])


170
# File 'sig/openai/models/image_generate_params.rbs', line 170

def self?.variants: -> ::Array[OpenAI::Models::ImageGenerateParams::size]