Updated stablediffusion.cpp to c6071fa

This commit is contained in:
Darth Affe 2024-01-16 23:40:58 +01:00
parent 5a217eb8ec
commit 97f44b89bc
3 changed files with 10 additions and 1 deletions

View File

@ -104,6 +104,12 @@ internal unsafe partial class Native
sd_image_t input_image, sd_image_t input_image,
int upscale_factor); int upscale_factor);
[LibraryImport(LIB_NAME, EntryPoint = "convert")]
internal static partial void convert([MarshalAs(UnmanagedType.LPStr)] string input_path,
[MarshalAs(UnmanagedType.LPStr)] string vae_path,
[MarshalAs(UnmanagedType.LPStr)] string output_path,
sd_type_t output_type);
[LibraryImport(LIB_NAME, EntryPoint = "sd_set_log_callback")] [LibraryImport(LIB_NAME, EntryPoint = "sd_set_log_callback")]
internal static partial void sd_set_log_callback(sd_log_cb_t sd_log_cb, void* data); internal static partial void sd_set_log_callback(sd_log_cb_t sd_log_cb, void* data);

View File

@ -180,6 +180,9 @@ public sealed unsafe class StableDiffusionModel : IDisposable
_disposed = true; _disposed = true;
} }
public static void Convert(string modelPath, string vaePath, Quantization quantization, string outputPath)
=> Native.convert(modelPath, vaePath, outputPath, quantization);
public static string GetSystemInfo() public static string GetSystemInfo()
{ {
void* s = Native.sd_get_system_info(); void* s = Native.sd_get_system_info();

View File

@ -4,7 +4,7 @@ if not exist stable-diffusion.cpp (
cd stable-diffusion.cpp cd stable-diffusion.cpp
git fetch git fetch
git checkout 2b6ec97fe244d03c40aa8d70131d40bb086099b0 git checkout c6071fa82fb1d0e688f75c9a3d870fe71d3a7a1d
git submodule init git submodule init
git submodule update git submodule update