Skip to content

Commit 04bf07c

Browse files
committed
Add example to README
1 parent 7cc7e57 commit 04bf07c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,21 @@ puts response.dig("data", 0, "url")
15641564

15651565
![Ruby](https://i.ibb.co/sWVh3BX/dalle-ruby.png)
15661566

1567+
You can also upload arrays of images, eg.
1568+
1569+
```ruby
1570+
client = OpenAI::Client.new
1571+
response = client.images.edit(
1572+
parameters: {
1573+
model: "gpt-image-1",
1574+
image: [File.open(base_image_path, "rb"), "image.png"],
1575+
prompt: "Take the first image as base and apply the second image as a watermark on the bottom right corner",
1576+
size: "1024x1024"
1577+
# Removed response_format parameter as it's not supported with gpt-image-1
1578+
}
1579+
)
1580+
```
1581+
15671582
### Image Variations
15681583

15691584
Create n variations of an image.

0 commit comments

Comments
 (0)