Commit Graph

4 Commits

Author SHA1 Message Date
ねおん
d7865901ec Update get_token_counter.py 2025-11-10 02:28:05 +09:00
ねおん
9e1ced6438 Fix: Prevent TypeError: 'NoneType' is not iterable on model switching (Forge/reForge)
This fixes the TypeError that occurs during model switching in sd-webui-reforge and possibly other optimized environments.

The error happens because 'get_token_counter' tries to access 'sd_models.model_data.sd_model.cond_stage_model' before the model is fully loaded (when 'sd_model' is None).

The fix adds a check for the 'None' value to safely return 0 tokens instead of throwing an error.
2025-11-04 03:14:14 +09:00
Serick
8a41850bff Add cond_stage_model to get_prompt_lengths argument only when using forge 2024-02-14 13:42:13 +09:00
Physton
510fa649c6 Optimize Python code
Former-commit-id: 8d08367816ff84a2a2f62470b06421c0340f5fdb
2023-06-15 17:21:56 +08:00