feat: load weights from safetensors and ckpt (#101)

This commit is contained in:
leejet authored and GitHub committed 2023-12-03 15:47:20 +08:00
1 parent 47dd704198
commit d7af2c2ba9
28 files changed
+49180 -2415

No files matched your search

+4 -9
View File
@@ -5,13 +5,6 @@
#include <memory>
#include <vector>
enum SDLogLevel {
DEBUG,
INFO,
WARN,
ERROR
};
enum RNGType {
STD_DEFAULT_RNG,
CUDA_RNG
@@ -48,7 +41,10 @@ public:
bool free_params_immediately = false,
std::string lora_model_dir = "",
RNGType rng_type = STD_DEFAULT_RNG);
bool load_from_file(const std::string& file_path, Schedule d = DEFAULT);
bool load_from_file(const std::string& model_path,
const std::string& vae_path,
ggml_type wtype,
Schedule d = DEFAULT);
std::vector<uint8_t*> txt2img(
std::string prompt,
std::string negative_prompt,
@@ -73,7 +69,6 @@ public:
int64_t seed);
};
void set_sd_log_level(SDLogLevel level);
std::string sd_get_system_info();
#endif // __STABLE_DIFFUSION_H__