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
For precise edits, use a mask to specify which areas to modify:
198
+
199
+
```php
200
+
$response = Prism::image()
201
+
->using('openai', 'gpt-image-1')
202
+
->withPrompt('Replace the sky with a starry night', [
203
+
Image::fromLocalPath('landscape.png'),
204
+
])
205
+
->withProviderOptions([
206
+
'mask' => Image::fromLocalPath('sky-mask.png'), // White areas will be edited
207
+
'size' => '1024x1024',
208
+
'output_format' => 'png',
209
+
])
210
+
->generate();
211
+
```
212
+
213
+
> [!NOTE]
214
+
> The mask should be a PNG image where white pixels indicate areas to edit and transparent pixels indicate areas to preserve.
215
+
161
216
### Gemini Options
162
217
163
218
Gemini offers customizations, depending on what model is selected. All Gemini image generation models return base64-encoded images only. They also return `mimeType`.
164
219
165
220
### Gemini Flash Preview Image Generation
166
221
167
-
Gemini conversational image generation provides the option to edit images:
222
+
Gemini conversational image generation provides the option to edit images by passing them as the second parameter to `withPrompt()`:
0 commit comments