-
Notifications
You must be signed in to change notification settings - Fork 5
/
stable-diffusion-abi.cpp
53 lines (46 loc) · 1.14 KB
/
stable-diffusion-abi.cpp
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "stable-diffusion-abi.h"
#include "stable-diffusion.h"
#include <string>
uint8_t* get_image_data(const sd_image_t* images, int index) {
return images[index].data;
}
uint32_t get_image_width(const sd_image_t* images, int index) {
return images[index].width;
}
uint32_t get_image_height(const sd_image_t* images, int index) {
return images[index].height;
}
uint32_t get_image_channel(const sd_image_t* images, int index) {
return images[index].channel;
}
void sd_images_free(const sd_image_t* images) {
if (images != nullptr) {
delete []images;
}
images = nullptr;
}
void sd_image_free(sd_image_t* image) {
if (image != nullptr) {
delete image;
}
image = nullptr;
}
// sd_image_t new_image() {
//
// }
//
// void set_image_data(sd_image_t image, uint8_t* data) {
// image.data = data;
// }
//
// void set_image_width(sd_image_t image, uint32_t width) {
// image.width = width;
// }
//
// void set_image_height(sd_image_t image, uint32_t height) {
// imageheight = height;
// }
//
// void set_image_channel(sd_image_t image, uint32_t channel) {
// image->channel = channel;
// }