Skip to content

Commit 0ce2c91

Browse files
committed
fix apg cli args with new api
1 parent 33368ec commit 0ce2c91

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

examples/cli/main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ void print_usage(int argc, const char* argv[]) {
211211
printf(" --img-cfg-scale SCALE image guidance scale for inpaint or instruct-pix2pix models: (default: same as --cfg-scale)\n");
212212
printf(" --guidance SCALE distilled guidance scale for models with guidance input (default: 3.5)\n");
213213
printf(" --apg-eta VALUE parallel projected guidance scale for APG (default: 1.0, recommended: between 0 and 1)\n");
214-
printf(" --apg-momentum VALUE CFG update direction momentum for APG (default: 0, recommended: around -0.5)\n");
215-
printf(" --apg-nt, --apg-rescale VALUE CFG update direction norm threshold for APG (default: 0 = disabled, recommended: 4-15)\n");
216-
printf(" --apg-nt-smoothing VALUE EXPERIMENTAL! Norm threshold smoothing for APG (default: 0 = disabled)\n");
214+
printf(" --apg-momentum VALUE Momentum for guidance adjustments with APG (default: 0, recommended: around -0.5 (negative))\n");
215+
printf(" --apg-nt VALUE APG norm threshold: Upper bound allowed for the amplitude (L2 norm) of guidance updates (default: 0 = disabled, recommended: 4-15)\n");
216+
printf(" --apg-nt-smoothing VALUE EXPERIMENTAL! Norm threshold smoothing for APG, smoothly decrease the amplitude of the guidance update if it gets too close to the norm threshold (default: 0 = disabled)\n");
217217
printf(" (replaces saturation with a smooth approximation)\n");
218218
printf(" --slg-scale SCALE skip layer guidance (SLG) scale, only for DiT models: (default: 0)\n");
219219
printf(" 0 means disabled, a value of 2.5 is nice for sd3.5 medium\n");
@@ -426,7 +426,10 @@ void parse_args(int argc, const char** argv, SDParams& params) {
426426
{"", "--slg-scale", "", &params.slg_scale},
427427
{"", "--skip-layer-start", "", &params.skip_layer_start},
428428
{"", "--skip-layer-end", "", &params.skip_layer_end},
429-
429+
{"", "--apg-eta", "", &params.apg_eta},
430+
{"", "--apg-momentum", "", &params.apg_momentum},
431+
{"", "--apg-nt", "", &params.apg_norm_threshold},
432+
{"", "--apg-nt-smoothing", "", &params.apg_norm_smoothing},
430433
};
431434

432435
options.bool_options = {
@@ -439,6 +442,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
439442
{"", "--canny", "", true, &params.canny_preprocess},
440443
{"-v", "--verbos", "", true, &params.verbose},
441444
{"", "--color", "", true, &params.color},
445+
{"", "--slg-uncond", "", true, &params.slg_uncond},
442446
{"", "--chroma-disable-dit-mask", "", false, &params.chroma_use_dit_mask},
443447
{"", "--chroma-enable-t5-mask", "", true, &params.chroma_use_t5_mask},
444448
};

0 commit comments

Comments
 (0)