We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17a2b4a commit 138da14Copy full SHA for 138da14
1 file changed
src/runtime/guidance.cpp
@@ -173,8 +173,9 @@ namespace sd::guidance {
173
}
174
175
float diff_norm = 0.0f;
176
+ const int standard_res = 2 * 1024 / 8; // Use SDXL as the standard resolution (1024x1024, 8x8 patches, 4=2x2 channels)
177
if (params_.norm_threshold > 0.0f) {
- diff_norm = std::sqrt((deltas * deltas).sum());
178
+ diff_norm = std::sqrt((deltas * deltas).sum()) * standard_res / std::sqrt(static_cast<float>(deltas.numel()));
179
180
181
float apg_scale_factor = 1.0f;
0 commit comments