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 @@ -1484,6 +1484,17 @@ class StableDiffusionGGML {
14841484 std::vector<int > skip_layers (guidance.slg .layers , guidance.slg .layers + guidance.slg .layer_count );
14851485
14861486 float cfg_scale = guidance.txt_cfg ;
1487+ if (cfg_scale < 1 ) {
1488+ if (cfg_scale == 0 .f ) {
1489+ // Diffusers follow the convention from the original paper
1490+ // (https://arxiv.org/abs/2207.12598v1), so many distilled model docs
1491+ // recommend 0 as guidance; warn the user that it'll disable prompt folowing
1492+ LOG_WARN (" unconditioned mode, images won't follow the prompt (use cfg-scale=1 for distilled models)" );
1493+ } else {
1494+ LOG_WARN (" unsupported cfg-scale value" );
1495+ }
1496+ }
1497+
14871498 float img_cfg_scale = std::isfinite (guidance.img_cfg ) ? guidance.img_cfg : guidance.txt_cfg ;
14881499 float slg_scale = guidance.slg .scale ;
14891500
You can’t perform that action at this time.
0 commit comments