feat: add img2img mode (#5)

This commit is contained in:
leejet authored and GitHub committed 2023-08-16 01:48:07 +08:00
1 parent fec86b8b76
commit 58735a2813
7 files changed
+8658 -40

No files matched your search

+13 -1
View File
@@ -22,7 +22,8 @@ class StableDiffusion {
std::shared_ptr<StableDiffusionGGML> sd;
public:
StableDiffusion(int n_threads = -1);
StableDiffusion(int n_threads = -1,
bool vae_decode_only = false);
bool load_from_file(const std::string& file_path);
std::vector<uint8_t> txt2img(
const std::string& prompt,
@@ -33,6 +34,17 @@ class StableDiffusion {
SampleMethod sample_method,
int sample_steps,
int seed);
std::vector<uint8_t> img2img(
const std::vector<uint8_t>& init_img,
const std::string& prompt,
const std::string& negative_prompt,
float cfg_scale,
int width,
int height,
SampleMethod sample_method,
int sample_steps,
float strength,
int seed);
};
void set_sd_log_level(SDLogLevel level);