File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1484,6 +1484,23 @@ 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 == 1 .f ) {
1489+ LOG_INFO (" pure conditioned mode (no negatives)" );
1490+ } else if (cfg_scale == 0 .f ) {
1491+ // Diffusers follow the convention from the original paper//
1492+ // (https://arxiv.org/abs/2207.12598v1), so many distilled model docs recommend
1493+ // 0 as guidance; warn the user that it disables prompt folowing instead
1494+ LOG_WARN (" unconditioned mode (cfg-scale=0), images won't follow the prompt (use cfg-scale=1 for distilled models)" );
1495+ } else if (cfg_scale < 1 ) {
1496+ if (cfg_scale < 0 ) {
1497+ LOG_WARN (" negative cfg-scale values aren't supported" );
1498+ } else {
1499+ LOG_WARN (" cfg-scale values between 0 and 1 aren't supported" );
1500+ }
1501+ }
1502+ }
1503+
14871504 float img_cfg_scale = std::isfinite (guidance.img_cfg ) ? guidance.img_cfg : guidance.txt_cfg ;
14881505 float slg_scale = guidance.slg .scale ;
14891506
You can’t perform that action at this time.
0 commit comments