Skip to content

Conversation

@opsec-ai
Copy link

@opsec-ai opsec-ai commented Feb 3, 2026

What:
sd_xl_turbo_1.0_fp16 generates low-quality images.

Why:
cfg_scale is not being passed along from sd-server to stable-diffusion
sd_xl_turbo_1.0_fp16 requires setting cfg_scale to 1.0 for good result

How:
This update passes along cfg_scale from server's json request.value to stable-diffusion's gen_params.sample_params.guidance.txt_cfg parameter.

@wbruna
Copy link
Contributor

wbruna commented Feb 3, 2026

Note the /v1/images/generations endpoint follows the OpenAI spec, which does not include that parameter. You should use the parameters embedded on the prompt, which already support cfg_scale.

Also, this isn't relevant for the use with stable-ui (#1207), which uses a different endpoint /sdapi/v1/txt2img.

For sdxl-turbo, it's actually easier to pass --cfg-scale 1 to the server command line; but stable-ui doesn't have a way to request the default cfg_scale, so Guidance needs to be set to 1 on the web interface anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants