mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-12-03 18:42:25 +07:00
[PR #366] [MERGED] Fix: Prevent TypeError: 'NoneType' is not iterable on model switching #360
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Physton/sd-webui-prompt-all-in-one#360
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Physton/sd-webui-prompt-all-in-one/pull/366
Author: @neon-aiart
Created: 11/3/2025
Status: ✅ Merged
Merged: 11/10/2025
Merged by: @Physton
Base:
main← Head:main📝 Commits (5)
9e1ced6Fix: Prevent TypeError: 'NoneType' is not iterable on model switching (Forge/reForge)d786590Update get_token_counter.py8bf3dbaFIX: Safely handle None model data during model switching to prevent TypeError in token counter0aa3c04Update get_token_counter.pyfea3070FIX: Prevent TypeError: NoneType on model switching in token counter📊 Changes
1 file changed (+4 additions, -0 deletions)
View changed files
📝
scripts/physton_prompt/get_token_counter.py(+4 -0)📄 Description
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.