Commit Graph

88 Commits (main)

Author SHA1 Message Date
hirorohi 2aa33fd12a Fix ModuleNotFoundError for sd_hijack
by KidouEita
2026-04-20 16:34:50 +09:00
ねおん 88be6531e8
Fix: Use try-except to stabilize token counter during model access
This fixes a server crash (TypeError NoneType in torch/nn/modules/module.py) when the token counter API is triggered during model load/switch.

Standard sequential null checks failed because the crash occurred inside PyTorch's internal attribute lookup process. The whole function is wrapped in try-except as a robust defense against this race condition.
2025-11-26 16:22:35 +09:00
ねおん 077daf3f6e
FIX: Prevent critical TypeError in token counter with robust null check (v4)
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.
2025-11-26 02:07:14 +09:00
ねおん b49e275eb0
FIX: Prevent TypeError in token counter during model switching (v2)
The previous fix (v1) was incomplete, as sd_model.cond_stage_model could still be None during model loading/unloading sequences (observed with XYZ Plot model swapping).
This v2 fix adds a specific check for cond_stage_model to ensure stability in dynamic environments.
2025-11-15 23:52:24 +09:00
ねおん fea3070a40
FIX: Prevent TypeError: NoneType on model switching in token counter
This fixes the critical `TypeError: argument of type 'NoneType' is not iterable` that frequently occurs in the token counter when the main Stable Diffusion model is being unloaded or reloaded (e.g., during XYZ Plot or manual model switching).

The error happens because the `get_token_counter` function tries to access `sd_models.model_data.sd_model.cond_stage_model` when `sd_model` is momentarily `None`.

The fix adds a robust check for `sd_models.model_data.sd_model is None` at the start of the function, ensuring the token counter safely returns 0 instead of causing an ASGI application crash across all environments (A1111, Forge/reForge).
2025-11-10 02:49:34 +09:00
ねおん 0aa3c04de4
Update get_token_counter.py 2025-11-10 02:44:22 +09:00
ねおん 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
PTCMode 2938717315 [fix] 修复一个由于遗留锁导致UI加载可能会失败的问题 2024-12-14 01:54:16 +08:00
physton 2cd8bf2c6c Update Translators => 5.9.0 2024-03-28 23:38:57 +08:00
yangming 90d05207ec let it work better with extranetwork-lora 2024-03-10 03:16:37 +08: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 48cf8eb793 #276 [Bug] Fixing the issue of OpenAI not running
[Bug] 修复openai无法运行的问题
2023-11-27 16:55:33 +08:00
Physton 6e4f3cd2cb Update csv.py 2023-11-26 18:22:09 +08:00
Physton 63f0c23640 #256 Sort Favorites option 2023-10-31 16:21:45 +08:00
Physton d804c98a76 fix bug #250 2023-10-31 15:23:11 +08:00
Physton 6e06fb051a fix bug 2023-09-27 00:45:38 +08:00
Physton 6d76895a5c #249 fix bug 2023-09-26 10:02:59 +08:00
Physton 63d683bc6a Update get_extra_networks.py 2023-09-11 16:52:18 +08:00
Physton 3696babae4 PR #214 Remove slugify 2023-09-10 23:33:13 +08:00
Physton 61f103e9fa Update slugify.py 2023-09-09 13:07:17 +08:00
Physton c6398671f3 PR #214 Code refactoring 2023-09-08 22:53:35 +08:00
Physton e400efff70 #199 [Feature] Show ExtraNetworks information when the mouse hovers over the keyword
鼠标移动到关键词上展示ExtraNetworks信息
2023-09-07 17:33:39 +08:00
bluelovers fb2f5af3d8 fix(extra-networks): 修正 civitai_info 2023-08-29 23:43:11 +08:00
Physton 7935404fc6 Update get_group_tags.py 2023-08-18 18:24:17 +08:00
Physton bc407650dc Keyword group supports custom append content file: prepend.yaml
关键词组支持自定义追加内容文件:prepend.yaml
2023-08-16 11:15:28 +08:00
Physton 97b3279e8e Keyword group supports custom append content file: append.yaml
关键词组支持自定义追加内容文件:append.yaml
2023-08-16 10:59:48 +08:00
Physton 787575aca2 New Feature: Keyword Grouping / One-Click Keyword Addition
新功能:关键词分组 / 一键添加关键词
2023-08-15 15:56:26 +08:00
Physton 2cbbcf953b Update Translators => 5.8.2 2023-08-01 17:35:26 +08:00
Physton a46e7f24a9 Fix bug 2023-07-15 08:56:50 +08:00
Physton 845e38cae8 #151 New Feature: API KEY Masking
新功能:API KEY 脱敏处理。前端和API接口中,用*号代替。
2023-07-14 17:02:12 +08:00
Physton 34b4889e56 Update Translators => 5.8.0 2023-07-11 09:15:08 +08:00
Physton e4ea196fdd Update Translators => 5.7.8.1 2023-07-05 01:21:01 +08:00
Physton e19b3e238d Optimize offline translation model loading
优化离线翻译模型加载
2023-06-28 11:24:50 +08:00
Physton 8f00fbc1c3 Added translation API: iflytek
增加翻译API:讯飞翻译
2023-06-27 01:43:56 +08:00
Physton 6976a4ce0d Update mbart50.py 2023-06-25 00:08:32 +08:00
Physton 44c98e503d added Google Translate mirror
增加google翻译镜像
2023-06-24 16:48:02 +08:00
Physton ba135d1a48 fixed Caiyun Translate 2023-06-24 16:47:29 +08:00
Physton 17e49fcfb5 Update server.py 2023-06-24 15:47:21 +08:00
Physton ae6c71ae3a built-in translators package 2023-06-24 15:41:23 +08:00
Physton bbf408ae19 Added Offline Translation: mbart-large-50-many-to-one-mmt
添加离线翻译:mbart-large-50-many-to-one-mmt
2023-06-23 09:52:50 +08:00
Physton 92f37a1135 Added translation API: volcengine
增加翻译API:火山翻译
2023-06-22 20:28:56 +08:00
Physton 4ce2db92af Added translation API: Caiyun
增加翻译API:彩云小译
2023-06-22 19:13:45 +08:00
Physton 9767dc6945 Added translation API: Niutrans
增加翻译API:小牛翻译
2023-06-22 18:49:29 +08:00
Physton 43aea0cedc Added translation API: MyMemory
增加翻译API:MyMemory
2023-06-22 17:17:01 +08:00
Physton cdb05a7836 Update get_version.py 2023-06-17 15:38:00 +08:00
Physton 510fa649c6 Optimize Python code
Former-commit-id: 8d08367816ff84a2a2f62470b06421c0340f5fdb
2023-06-15 17:21:56 +08:00
Physton 1bd3eb61f4 Add About window
Former-commit-id: 5fc236655eae88c1a2de0b1167733e0a0986bdcb
2023-06-15 15:26:11 +08:00
Physton 96d05c1f92 Optimize error messages
Former-commit-id: 9fcb67b96a9e9409678b9d3c133c3655a6d84d08
2023-06-15 10:30:55 +08:00
Physton abdee6e00e Update on_app_started.py
Former-commit-id: 69a9d14afaa49de722b862e02a73ccef1d4fcdc1
2023-06-10 00:16:10 +08:00