ImageSize enum

Image size options.

DALL-E 2 supports 256x256, 512x512, 1024x1024. DALL-E 3 supports 1024x1024, 1792x1024, 1024x1792. GPT image models (including gpt-image-2) support auto, 1024x1024, 1536x1024, 1024x1536.

Inheritance
Available extensions

Values

unknown → const ImageSize

Unknown size — forward-compat fallback for unrecognized server values.

Streaming partial-image events sometimes carry transient sizes like 1254x1254 that don't appear in the spec; those map here.

const ImageSize._('unknown')
size256x256 → const ImageSize

256×256 (DALL-E 2 only).

const ImageSize._('256x256')
size512x512 → const ImageSize

512×512 (DALL-E 2 only).

const ImageSize._('512x512')
size1024x1024 → const ImageSize

1024×1024 square output.

const ImageSize._('1024x1024')
size1792x1024 → const ImageSize

1792×1024 landscape (DALL-E 3 only).

const ImageSize._('1792x1024')
size1024x1792 → const ImageSize

1024×1792 portrait (DALL-E 3 only).

const ImageSize._('1024x1792')
size1536x1024 → const ImageSize

1536×1024 landscape (GPT image models).

const ImageSize._('1536x1024')
size1024x1536 → const ImageSize

1024×1536 portrait (GPT image models).

const ImageSize._('1024x1536')
auto → const ImageSize

Automatically choose the output size (GPT image models).

const ImageSize._('auto')

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
Converts to JSON string.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<ImageSize>
A constant List of the values in this enum, in order of their declaration.