Skip to content

Commit

Permalink
ignore slg if slg_scale is zero (optimization)
Browse files Browse the repository at this point in the history
  • Loading branch information
stduhpf committed Nov 4, 2024
1 parent bd9b0f1 commit 8577446
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stable-diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ class StableDiffusionGGML {
negative_data = (float*)out_uncond->data;
}

bool has_skiplayer = skip_layers.size() > 0;
bool has_skiplayer = skip_layers.size() > 0 && slg_scale != 0.0;
int stepCount = sigmas.size();
has_skiplayer = has_skiplayer && step > (int)(skip_layer_start * stepCount) && step < (int)(skip_layer_end * stepCount);
float* skip_layer_data = NULL;
Expand Down

0 comments on commit 8577446

Please sign in to comment.