leejet / stable-diffusion.cpp

Stable Diffusion and Flux in pure C/C++
MIT License
3.31k stars 279 forks source link

report a bug instead of crash when vae_decoder_only=True and using img2img #237

Open chinshou opened 5 months ago

chinshou commented 5 months ago

At now if we use new_sd_ctx with vae_decoder_only=true , the img2img api call will crash without any exception catched.

We had better checking the vae_decoder_only flag in the img2img function to report ng flag and return NULL instead of crash that is much more user friendly.

Windsander commented 5 months ago

this too =D

leejet commented 5 months ago

The current API lacks extensive documentation, requiring users to have a deeper understanding of some code details. I'll find some time later to improve the documentation for certain APIs.