mix1009 / sdwebuiapi

Python API client for AUTOMATIC1111/stable-diffusion-webui
MIT License
1.35k stars 181 forks source link

sd1.9 need SCHEDULER_NAMES parameter #164

Closed jichenghan800 closed 2 months ago

jichenghan800 commented 3 months ago

when I changed into sd1.9,api did not work,because sd1.9 add a new parameter SCHEDULER_NAMES like this: SCHEDULER_NAMES = ["normal", "karras", "exponential", "sgm_uniform", "simple", "ddim_uniform"] SAMPLER_NAMES = KSAMPLER_NAMES + ["ddim", "uni_pc", "uni_pc_bh2"]

this IS error info: ERROR:root:request_id=20240515104136BBD72C0498C08633979A err_msg=err occurred, (404, '{"error":"HTTPException","detail":"Sampler not found","body":"","errors":""}')

jichenghan800 commented 2 months ago

webuiapi.py.txt -- add scheduler to support sdwebui 1.8.0+ -- 增加一个参数scheduler ,用来支持sdwebui的新版本,新版本将sampler拆成了两段,sampler+scheduler @mix1009 If causing trouble, please delete!

mix1009 commented 2 months ago

Thank you.

I updated the code to add 'scheduler' to txt2img and img2img. api.util_get_scheduler_names() is also added. scheduler parameters should use 'name' which is lower case.

przemoc commented 2 months ago

Default scheduler should be "Automatic" (starting from upper-case letter) to work properly, not "automatic".

"automatic" is unrecognized and left as such in image info parameters. You can try "xyz" and it will give the same image as "automatic". "Automatic" is properly processed, so if you use "DPM++ 2M" sampler for instance, it will be turned into Karras.