mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-01-26 11:19:55 +00:00
The token counter was crashing during model loading/unloading (race condition) because it was attempting to access attributes on an object that was momentarily None. This fix introduces a sequential and robust null check (sd_models.model_data is None or sd_models.model_data.sd_model is None) at the start of the function to safely return 0 tokens during unstable states.