mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-12-03 18:42:25 +07:00
[PR #378] fix: Forge compatibility for get_token_counter (modules.sd_hijack rem… #367
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#367
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/378
Author: @xiansk
Created: 5/4/2026
Status: 🔄 Open
Base:
main← Head:fix/forge-compatibility-token-counter📝 Commits (1)
4d73962fix: Forge compatibility for get_token_counter (modules.sd_hijack removed)📊 Changes
1 file changed (+92 additions, -37 deletions)
View changed files
📝
scripts/physton_prompt/get_token_counter.py(+92 -37)📄 Description
…oved)
问题
Forge 移除了
modules.sd_hijack模块,导致插件在 Forge 下启动报错:ModuleNotFoundError: No module named 'modules.sd_hijack'修复方案
model_hijack改为 try/except 导入,不存在时不崩溃_get_prompt_lengths_forge()平替实现,三层 fallback:cond_stage_model.tokenize_line()cond_stage_model.tokenize()transformers.CLIPTokenizer(兜底)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.