Skip to content

Commit a80ecea

Browse files
committed
Add gpt-image-1.5
1 parent a524761 commit a80ecea

File tree

7 files changed

+59
-46
lines changed

7 files changed

+59
-46
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
### 4.46.0
3+
- Add `gpt-image-1.5`.
4+
25
### 4.45.0
36
- Add `gpt-5.2` models.
47

Docs/Request-ImageEdit.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ https://platform.openai.com/docs/guides/image-generation
5858

5959
### Example 1: Edit an image with a prompt.
6060
```PowerShell
61-
Request-ImageEdit -Model 'gpt-image-1' -Prompt 'A bird on the desert' -Image 'C:\sand_with_fether.png' -OutFile 'C:\bird_on_desert.png' -Size 1024x1024
61+
Request-ImageEdit -Model 'gpt-image-1.5' -Prompt 'A bird on the desert' -Image 'C:\sand_with_fether.png' -OutFile 'C:\bird_on_desert.png' -Size 1024x1024
6262
```
6363

6464
| Original | Generated |
@@ -68,7 +68,7 @@ Request-ImageEdit -Model 'gpt-image-1' -Prompt 'A bird on the desert' -Image 'C:
6868

6969
### Example 2: Create variation image from source and mask.
7070
```PowerShell
71-
Request-ImageEdit -Model 'gpt-image-1' -Image C:\sand_with_feather.png -Mask C:\fether_mask.png -Prompt "A bird on the desert" -OutFile C:\edit2.png
71+
Request-ImageEdit -Model 'gpt-image-1.5' -Image C:\sand_with_feather.png -Mask C:\fether_mask.png -Prompt "A bird on the desert" -OutFile C:\edit2.png
7272
```
7373

7474
| Source (sand_with_feather.png) | Mask (fether_mask.png) | Generated (edit2.png) |
@@ -81,7 +81,7 @@ Request-ImageEdit -Model 'gpt-image-1' -Image C:\sand_with_feather.png -Mask C:\
8181

8282
### -Image
8383
(Required)
84-
The image(s) to edit. Must be a supported image file or an array of images. For gpt-image-1, each image should be a png, webp, or jpg file less than 25MB. For dall-e-2, you can only provide one image, and it should be a square png file less than 4MB.
84+
The image(s) to edit. Must be a supported image file or an array of images. For the GPT image models, each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. For dall-e-2, you can only provide one image, and it should be a square png file less than 4MB.
8585

8686
```yaml
8787
Type: String[]
@@ -92,7 +92,7 @@ Position: Named
9292
9393
### -Prompt
9494
(Required)
95-
A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2, and 32000 characters for gpt-image-1.
95+
A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
9696

9797
```yaml
9898
Type: String
@@ -110,7 +110,7 @@ Position: Named
110110
```
111111

112112
### -Model
113-
The model to use for image generation. Only dall-e-2 and gpt-image-1 are supported. Defaults to dall-e-2 unless a parameter specific to gpt-image-1 is used.
113+
The model to use for image generation. Only `dall-e-2` and the GPT image models are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
114114

115115
```yaml
116116
Type: String
@@ -130,7 +130,11 @@ Default value: 1
130130
```
131131

132132
### -Quality
133-
The quality of the image that will be generated. high, medium and low are only supported for gpt-image-1. dall-e-2 only supports standard quality. Defaults to auto.
133+
The quality of the image that will be generated.
134+
- `auto` (default value) will automatically select the best quality for the given model.
135+
- `high`, `medium` and `low` are supported for the GPT image models.
136+
- `hd` and `standard` are supported for `dall-e-3`.
137+
- `standard` is the only option for `dall-e-2`.
134138

135139
```yaml
136140
Type: String
@@ -140,7 +144,7 @@ Default value: auto
140144
```
141145

142146
### -Size
143-
The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for gpt-image-1, and one of `256x256`, `512x512`, or `1024x1024` for dall-e-2.
147+
The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, and one of `256x256`, `512x512`, or `1024x1024` for dall-e-2, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.
144148

145149
```yaml
146150
Type: String
@@ -150,7 +154,7 @@ Default value: auto
150154
```
151155

152156
### -ResponseFormat
153-
The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. gpt-image-1 only supports `base64`.
157+
The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format.
154158

155159
```yaml
156160
Type: String

Docs/Request-ImageGeneration.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ https://oaidalleapiprodscus.blob.core.windows.net/private/org-BXLtGIt0xglP9if8FV
8585

8686
### -Prompt
8787
(Required)
88-
A text description of the desired image(s). The maximum length is 32000 characters for gpt-image-1, 1000 characters for dall-e-2 and 4000 characters for dall-e-3.
88+
A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
8989

9090
```yaml
9191
Type: String
@@ -95,7 +95,7 @@ Accept pipeline input: True (ByValue)
9595
```
9696
9797
### -Model
98-
The model to use for image generation. One of dall-e-2, dall-e-3, or gpt-image-1. Defaults to dall-e-2 unless a parameter specific to gpt-image-1 is used.
98+
The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
9999

100100
```yaml
101101
Type: String
@@ -116,7 +116,7 @@ Default value: 1
116116
```
117117

118118
### -Size
119-
The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for gpt-image-1, one of `256x256`, `512x512`, or `1024x1024` for dall-e-2, and one of `1024x1024`, `1792x1024`, or `1024x1792` for dall-e-3.
119+
The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.
120120

121121
```yaml
122122
Type: String
@@ -126,7 +126,11 @@ Default value: auto
126126
```
127127

128128
### -Quality
129-
The quality of the image that will be generated. `auto` (default value) will automatically select the best quality for the given model. high, medium and low are supported for gpt-image-1, hd and standard are supported for dall-e-3, standard is the only option for dall-e-2.
129+
The quality of the image that will be generated.
130+
- `auto` (default value) will automatically select the best quality for the given model.
131+
- `high`, `medium` and `low` are supported for the GPT image models.
132+
- `hd` and `standard` are supported for `dall-e-3`.
133+
- `standard` is the only option for `dall-e-2`.
130134

131135
```yaml
132136
Type: String
@@ -146,7 +150,7 @@ Default value: vivid
146150
```
147151

148152
### -Background
149-
Allows to set transparency for the background of the generated image(s). This parameter is only supported for gpt-image-1. Must be one of transparent, opaque or auto (default value).
153+
Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one of `transparent`, `opaque` or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image.
150154

151155
```yaml
152156
Type: String
@@ -155,7 +159,7 @@ Position: Named
155159
```
156160

157161
### -Moderation
158-
Control the content-moderation level for images generated by gpt-image-1. Must be either low for less restrictive filtering or auto (default value).
162+
Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value).
159163

160164
```yaml
161165
Type: String
@@ -164,7 +168,7 @@ Position: Named
164168
```
165169

166170
### -OutputCompression
167-
The compression level (0-100%) for the generated images. This parameter is only supported for gpt-image-1 with the webp or jpeg output formats, and defaults to 100.
171+
The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100.
168172

169173
```yaml
170174
Type: UInt16
@@ -174,7 +178,7 @@ Position: Named
174178
```
175179

176180
### -OutputFormat
177-
The format in which the generated images are returned. This parameter is only supported for gpt-image-1. Must be one of png, jpeg, or webp.
181+
The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
178182

179183
```yaml
180184
Type: String
@@ -184,7 +188,7 @@ Position: Named
184188
```
185189

186190
### -ResponseFormat
187-
The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. gpt-image-1 only supports `base64`.
191+
The format in which the generated images are returned. Must be one of `url`, `base64` or `byte`. This parameter is only supported for `dall-e-2`, as the GPT image models always return images in `base64` format.
188192

189193
```yaml
190194
Type: String

Public/Images/Request-ImageEdit.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ function Request-ImageEdit {
1616

1717
[Parameter()]
1818
[Completions(
19+
'gpt-image-1.5',
1920
'gpt-image-1',
2021
'gpt-image-1-mini',
2122
'dall-e-2'
@@ -228,7 +229,7 @@ function Request-ImageEdit {
228229
}
229230

230231
if ($Model -like 'gpt-image-*') {
231-
# The output_format parameter is only supported for gpt-image-1.
232+
# The output_format parameter is only supported for the GPT image models.
232233
if ($PSBoundParameters.ContainsKey('OutputFormat')) {
233234
$PostBody.output_format = $OutputFormat
234235
}
@@ -248,7 +249,7 @@ function Request-ImageEdit {
248249
}
249250
}
250251

251-
# reponse_formart parameter is not supported for gpt-image-1.
252+
# reponse_formart parameter is not supported for the GPT image models.
252253
if ($PostBody.Contains('response_format')) {
253254
$PostBody.Remove('response_format')
254255
}

Public/Images/Request-ImageGeneration.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function Request-ImageGeneration {
77

88
[Parameter()]
99
[Completions(
10+
'gpt-image-1.5',
1011
'gpt-image-1',
1112
'gpt-image-1-mini',
1213
'dall-e-3',
@@ -195,7 +196,7 @@ function Request-ImageGeneration {
195196
}
196197

197198
if ($Model -like 'gpt-image-*') {
198-
# The output_format parameter is only supported for gpt-image-1.
199+
# The output_format parameter is only supported for the GPT image models.
199200
if ($PSBoundParameters.ContainsKey('OutputFormat')) {
200201
$PostBody.output_format = $OutputFormat
201202
}
@@ -215,7 +216,7 @@ function Request-ImageGeneration {
215216
}
216217
}
217218

218-
# reponse_formart parameter is not supported for gpt-image-1.
219+
# reponse_formart parameter is not supported for the GPT image models.
219220
if ($PostBody.Contains('response_format')) {
220221
$PostBody.Remove('response_format')
221222
}

Tests/Images/Request-ImageEdit.tests.ps1

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Describe 'Request-ImageEdit' {
7979
Image = @(($script:TestImageData + '/fether_mask.png'), ($script:TestImageData + '/cupcake.png'))
8080
NumberOfImages = 3
8181
OutFile = Join-Path $TestDrive 'fileA.png'
82-
Model = 'gpt-image-1'
82+
Model = 'gpt-image-1.5'
8383
Size = 'auto'
8484
ErrorAction = 'Stop'
8585
}
@@ -114,7 +114,7 @@ Describe 'Request-ImageEdit' {
114114
Mask = ($script:TestImageData + '/fether_mask.png')
115115
NumberOfImages = 1
116116
OutFile = Join-Path $TestDrive 'fileB.png'
117-
Model = 'gpt-image-1'
117+
Model = 'gpt-image-1.5'
118118
Size = 'auto'
119119
ErrorAction = 'Stop'
120120
}
@@ -142,7 +142,7 @@ Describe 'Request-ImageEdit' {
142142
$Result | Should -Be 'https://dummyimage.example.com'
143143
}
144144

145-
It 'gpt-image-1 model does not support response_format = url. Defaulting to object.' {
145+
It 'The GPT image models are not support response_format = url. Defaulting to object.' {
146146
$TestResponse = @'
147147
{
148148
"created": 1678359675,
@@ -188,7 +188,7 @@ Describe 'Request-ImageEdit' {
188188
{ $splat = @{
189189
Prompt = 'Hello'
190190
Image = ($script:TestImageData + '/fether_mask.png')
191-
Model = 'gpt-image-1'
191+
Model = 'gpt-image-1.5'
192192
Size = '1024x1024'
193193
OutFile = Join-Path $TestDrive 'file.png'
194194
ErrorAction = 'Stop'
@@ -213,7 +213,7 @@ Describe 'Request-ImageEdit' {
213213
{ $splat = @{
214214
Prompt = 'Hello'
215215
Image = ($script:TestImageData + '/fether_mask.png')
216-
Model = 'gpt-image-1'
216+
Model = 'gpt-image-1.5'
217217
Size = '1024x1024'
218218
OutFile = Join-Path $TestDrive 'file.png'
219219
PartialImages = 3
@@ -239,7 +239,7 @@ Describe 'Request-ImageEdit' {
239239
{ $splat = @{
240240
Prompt = 'Hello'
241241
Image = ($script:TestImageData + '/fether_mask.png')
242-
Model = 'gpt-image-1'
242+
Model = 'gpt-image-1.5'
243243
Size = '1024x1024'
244244
ResponseFormat = 'object'
245245
PartialImages = 1
@@ -269,7 +269,7 @@ Describe 'Request-ImageEdit' {
269269
{ $splat = @{
270270
Prompt = 'Hello'
271271
Image = ($script:TestImageData + '/fether_mask.png')
272-
Model = 'gpt-image-1'
272+
Model = 'gpt-image-1.5'
273273
Size = '1024x1024'
274274
ResponseFormat = 'base64'
275275
PartialImages = 1
@@ -292,7 +292,7 @@ Describe 'Request-ImageEdit' {
292292
{ $splat = @{
293293
Prompt = 'Hello'
294294
Image = ($script:TestImageData + '/fether_mask.png')
295-
Model = 'gpt-image-1'
295+
Model = 'gpt-image-1.5'
296296
Size = '1024x1024'
297297
ResponseFormat = 'byte'
298298
PartialImages = 0
@@ -316,7 +316,7 @@ Describe 'Request-ImageEdit' {
316316
{ $splat = @{
317317
Prompt = 'Hello'
318318
Image = ($script:TestImageData + '/fether_mask.png')
319-
Model = 'gpt-image-1'
319+
Model = 'gpt-image-1.5'
320320
Size = '1024x1024'
321321
ResponseFormat = 'byte'
322322
PartialImages = 1
@@ -342,7 +342,7 @@ Describe 'Request-ImageEdit' {
342342
{ $splat = @{
343343
Prompt = 'Hello'
344344
Image = ($script:TestImageData + '/fether_mask.png')
345-
Model = 'gpt-image-1'
345+
Model = 'gpt-image-1.5'
346346
Size = '1024x1024'
347347
ResponseFormat = 'byte'
348348
PartialImages = 1
@@ -367,7 +367,7 @@ Describe 'Request-ImageEdit' {
367367
{ $splat = @{
368368
Prompt = 'Hello'
369369
Image = ($script:TestImageData + '/fether_mask.png')
370-
Model = 'gpt-image-1'
370+
Model = 'gpt-image-1.5'
371371
Size = '1024x1024'
372372
ErrorAction = 'Stop'
373373
}
@@ -406,7 +406,7 @@ Describe 'Request-ImageEdit' {
406406
Image = @(($script:TestImageData + '/fether_mask.png'), ($script:TestImageData + '/sand_with_feather.png'))
407407
Prompt = 'sunflower'
408408
ResponseFormat = 'base64'
409-
Model = 'gpt-image-1'
409+
Model = 'gpt-image-1.5'
410410
NumberOfImages = 2
411411
Size = '1024x1024'
412412
Quality = 'low'
@@ -439,7 +439,7 @@ Describe 'Request-ImageEdit' {
439439
{ $splat = @{
440440
Image = $script:TestImageData + '/sand_with_feather.png'
441441
Prompt = 'A bird on the desert'
442-
Model = 'gpt-image-1'
442+
Model = 'gpt-image-1.5'
443443
OutFile = Join-Path $TestDrive 'file4.png'
444444
Size = '1024x1024'
445445
Stream = $true

0 commit comments

Comments
 (0)