Title: [BUG] CFG (Guidance) Scale Ignored in Image Generation and Always Uses 1.0 in v1.120
Problem Description
When generating images with KoboldCpp v1.120 (both koboldcpp.exe and koboldcpp-nocuda.exe), the CFG Scale (Guidance) value I enter in the web interface (/sdui) is completely ignored.
Generation always uses CFG Scale: 1.0, regardless of whether I enter 3.0, 6.0, or 9.0. This results in poor image quality, deformities in hands/legs, and, in my specific case, pubic hair, despite using very explicit negative prompts to remove it.
Steps to Reproduce the Error
-
Load the Flux model (fluxedUpFluxNSFW_71Q8GGUF.gguf) into KoboldCpp v1.120.
-
Open the image generation web interface (http://localhost:5001/sdui).
-
Enter a prompt and a negative. Set the Guidance (CFG) to 3.0 (or 9.0) and generate.
-
When finished, check the image metadata.
-
Result: The program reports CFG Scale: 1 (or CFG Scale: 1.0) instead of the value I entered.
Expected Behavior
The image metadata should reflect the CFG scale I configured (e.g., CFG Scale: 3.0). Additionally, the image should correctly follow the prompt and negative instructions with that guidance.
Tests performed (excluding common causes)
-
I tested with CFG=3.0 and CFG=9.0 (even higher) and it always reports 1.0.
-
I modified the "VAE Tiling Threshold" to 16 to force tiling, but the CFG failure persists.
-
I tested both the normal .exe (606 MB) and the nocuda (113 MB), and the error occurs in both.
-
I used exactly the same model, same seed, same prompt with sd-cli.exe (the separate stable-diffusion.cpp binary) and the CFG DOES work correctly there, which rules out a problem with the model or parameters. The bug is in KoboldCpp.
Environment
-
Operating System: Windows 10 x64.
Ryzen 9 5900XT, 32 GB RAN DDR4 -3200 MHz
-
KoboldCpp version: v1.120 (released 3 days ago). I also suspect it occurs in earlier versions, but it's confirmed in the latest one.
-
Executable file: koboldcpp.exe and koboldcpp-nocuda.exe.
-
Model: fluxedUpFluxNSFW_71Q8GGUF.gguf (Flux.1 Dev).
-
Backend: CPU (although it also occurs when selecting others).
Additional context
- The problem seems to be in how KoboldCpp passes the
--cfg-scale parameter to the internal backend (stable-diffusion.cpp). It seems to always send 1.0.
Temporary Solution (for developers)
Review the communication between the web UI (/sdui) and the image generation core, specifically how the command or internal API call is constructed with the --cfg-scale flag.
Thank you for your work!
Title: [BUG] CFG (Guidance) Scale Ignored in Image Generation and Always Uses 1.0 in v1.120
Problem Description
When generating images with KoboldCpp v1.120 (both
koboldcpp.exeandkoboldcpp-nocuda.exe), the CFG Scale (Guidance) value I enter in the web interface (/sdui) is completely ignored.Generation always uses CFG Scale: 1.0, regardless of whether I enter 3.0, 6.0, or 9.0. This results in poor image quality, deformities in hands/legs, and, in my specific case, pubic hair, despite using very explicit negative prompts to remove it.
Steps to Reproduce the Error
Load the Flux model (
fluxedUpFluxNSFW_71Q8GGUF.gguf) into KoboldCpp v1.120.Open the image generation web interface (
http://localhost:5001/sdui).Enter a prompt and a negative. Set the Guidance (CFG) to 3.0 (or 9.0) and generate.
When finished, check the image metadata.
Result: The program reports
CFG Scale: 1(orCFG Scale: 1.0) instead of the value I entered.Expected Behavior
The image metadata should reflect the CFG scale I configured (e.g.,
CFG Scale: 3.0). Additionally, the image should correctly follow the prompt and negative instructions with that guidance.Tests performed (excluding common causes)
I tested with CFG=3.0 and CFG=9.0 (even higher) and it always reports 1.0.
I modified the "VAE Tiling Threshold" to 16 to force tiling, but the CFG failure persists.
I tested both the normal
.exe(606 MB) and thenocuda(113 MB), and the error occurs in both.I used exactly the same model, same seed, same prompt with
sd-cli.exe(the separatestable-diffusion.cppbinary) and the CFG DOES work correctly there, which rules out a problem with the model or parameters. The bug is in KoboldCpp.Environment
Operating System: Windows 10 x64.
Ryzen 9 5900XT, 32 GB RAN DDR4 -3200 MHz
KoboldCpp version: v1.120 (released 3 days ago). I also suspect it occurs in earlier versions, but it's confirmed in the latest one.
Executable file:
koboldcpp.exeandkoboldcpp-nocuda.exe.Model:
fluxedUpFluxNSFW_71Q8GGUF.gguf(Flux.1 Dev).Backend: CPU (although it also occurs when selecting others).
Additional context
--cfg-scaleparameter to the internal backend (stable-diffusion.cpp). It seems to always send 1.0.Temporary Solution (for developers)
Review the communication between the web UI (
/sdui) and the image generation core, specifically how the command or internal API call is constructed with the--cfg-scaleflag.Thank you for your work!