Skip to content

Commit

Permalink
fixed prediction selection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
daniandtheweb committed Aug 10, 2024
1 parent b1b8546 commit 1b00b0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const char* schedule_str[] = {
};

const char* prediction_str[] = {
"default",
"eps",
"v",
"flow",
Expand Down Expand Up @@ -104,7 +105,7 @@ struct SDParams {

sample_method_t sample_method = EULER_A;
schedule_t schedule = DEFAULT;
prediction_t prediction = EPS_PRED;
prediction_t prediction = DEFAULT_PRED;
int sample_steps = 20;
float strength = 0.75f;
float control_strength = 0.9f;
Expand Down
2 changes: 1 addition & 1 deletion stable-diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class StableDiffusionGGML {
LOG_INFO("loading model from '%s' completed, taking %.2fs", model_path.c_str(), (t1 - t0) * 1.0f / 1000);


if (prediction != EPS_PRED) {
if (prediction != DEFAULT_PRED) {
switch (prediction) {
case EPS_PRED:
LOG_INFO("running in eps-prediction mode");
Expand Down
1 change: 1 addition & 0 deletions stable-diffusion.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum schedule_t {
};

enum prediction_t {
DEFAULT_PRED,
EPS_PRED,
V_PRED,
FLOW_PRED,
Expand Down

0 comments on commit 1b00b0c

Please sign in to comment.