Skip to content

Commit 33518e2

Browse files
committed
refactor(tx): add version util
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 63f027e commit 33518e2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

stable-diffusion.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,3 +2208,10 @@ SD_API sd_image_t* img2vid(sd_ctx_t* sd_ctx,
22082208

22092209
return result_images;
22102210
}
2211+
2212+
int sd_get_version(sd_ctx_t* sd_ctx) {
2213+
if (sd_ctx == NULL) {
2214+
return VERSION_COUNT;
2215+
}
2216+
return sd_ctx->sd->version;
2217+
}

stable-diffusion.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ SD_API sd_image_t* img2vid(sd_ctx_t* sd_ctx,
241241
float strength,
242242
int64_t seed);
243243

244+
SD_API int sd_get_version(sd_ctx_t* sd_ctx);
245+
244246
typedef struct upscaler_ctx_t upscaler_ctx_t;
245247

246248
SD_API upscaler_ctx_t* new_upscaler_ctx(const char* esrgan_path,

0 commit comments

Comments
 (0)