File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1497,6 +1497,17 @@ class StableDiffusionGGML {
14971497 std::vector<int > skip_layers (guidance.slg .layers , guidance.slg .layers + guidance.slg .layer_count );
14981498
14991499 float cfg_scale = guidance.txt_cfg ;
1500+ if (cfg_scale < 1 .f ) {
1501+ if (cfg_scale == 0 .f ) {
1502+ // Diffusers follow the convention from the original paper
1503+ // (https://arxiv.org/abs/2207.12598v1), so many distilled model docs
1504+ // recommend 0 as guidance; warn the user that it'll disable prompt folowing
1505+ LOG_WARN (" unconditioned mode, images won't follow the prompt (use cfg-scale=1 for distilled models)" );
1506+ } else {
1507+ LOG_WARN (" cfg value out of expected range may produce unexpected results" );
1508+ }
1509+ }
1510+
15001511 float img_cfg_scale = std::isfinite (guidance.img_cfg ) ? guidance.img_cfg : guidance.txt_cfg ;
15011512 float slg_scale = guidance.slg .scale ;
15021513
You can’t perform that action at this time.
0 commit comments