You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create an image with stream set to true, the server will emit server-sent events to the client as the image is generated. All events and their payloads can be found in [OpenAI docs](https://platform.openai.com/docs/api-reference/images-streaming).
1299
+
1300
+
```php
1301
+
$stream = $client->images()->createStreamed([
1302
+
'model' => 'gpt-image-1',
1303
+
'prompt' => 'A cute baby sea otter',
1304
+
'n' => 1,
1305
+
'size' => '1024x1024',
1306
+
'response_format' => 'url',
1307
+
]);
1308
+
1309
+
foreach ($stream as $image) {
1310
+
$image->type; // 'image_generation.partial_image'
1311
+
}
1312
+
```
1313
+
1296
1314
#### `edit`
1297
1315
1298
1316
Creates an edited or extended image given an original image and a prompt.
@@ -1317,6 +1335,24 @@ foreach ($response->data as $data) {
When you edit an image with stream set to true, the server will emit server-sent events to the client as the image is generated. All events and their payloads can be found in [OpenAI docs](https://platform.openai.com/docs/api-reference/images-streaming).
0 commit comments