Skip to content

Commit ea688d2

Browse files
committed
refactor(tx): add version util
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 030d1c9 commit ea688d2

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
@@ -1872,3 +1872,10 @@ SD_API sd_image_t* img2vid(sd_ctx_t* sd_ctx,
18721872

18731873
return result_images;
18741874
}
1875+
1876+
int sd_get_version(sd_ctx_t* sd_ctx) {
1877+
if (sd_ctx == NULL) {
1878+
return VERSION_COUNT;
1879+
}
1880+
return sd_ctx->sd->version;
1881+
}

stable-diffusion.h

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

226+
SD_API int sd_get_version(sd_ctx_t* sd_ctx);
227+
226228
typedef struct upscaler_ctx_t upscaler_ctx_t;
227229

228230
SD_API upscaler_ctx_t* new_upscaler_ctx(const char* esrgan_path,

0 commit comments

Comments
 (0)