forked from olrea/openai-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path04-image.cpp
More file actions
29 lines (24 loc) · 705 Bytes
/
Copy path04-image.cpp
File metadata and controls
29 lines (24 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "openai.hpp"
#include <iostream>
int main() {
openai::start();
auto image = openai::image().create(R"({
"prompt": "A cute baby sea otter",
"n": 2,
"size": "512x512"
})"_json);
std::cout << image.dump(2) << '\n';
auto image_edit = openai::image().edit(R"({
"image": "otter.png",
"prompt": "A cute baby sea otter wearing a beret",
"n": 1,
"size": "256x256"
})"_json);
std::cout << image_edit.dump(2) << '\n';
auto image_variation = openai::image().variation(R"({
"image": "otter.png",
"n": 2,
"size": "256x256"
})"_json);
std::cout << image_variation.dump(2) << '\n';
}