feat: add CUDA RNG

This commit is contained in:
leejet committed 2023-09-03 19:24:07 +08:00
1 parent 31e77e1573
commit e5a7aec252
6 files changed
+217 -26

No files matched your search

+8 -2
View File
@@ -4,13 +4,18 @@
#include <memory>
#include <vector>
enum class SDLogLevel {
enum SDLogLevel {
DEBUG,
INFO,
WARN,
ERROR
};
enum RNGType {
STD_DEFAULT_RNG,
CUDA_RNG
};
enum SampleMethod {
EULAR_A,
};
@@ -24,7 +29,8 @@ class StableDiffusion {
public:
StableDiffusion(int n_threads = -1,
bool vae_decode_only = false,
bool free_params_immediately = false);
bool free_params_immediately = false,
RNGType rng_type = STD_DEFAULT_RNG);
bool load_from_file(const std::string& file_path);
std::vector<uint8_t> txt2img(
const std::string& prompt,