mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-11-05 00:17:25 +00:00
[PR #340] [MERGED] Add sibling-import fallback for Forge Neo / namespace-package edge cases #307
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
low priority
low priority
pull-request
question
waiting for feedback
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DominikDoom/a1111-sd-webui-tagcomplete#307
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/DominikDoom/a1111-sd-webui-tagcomplete/pull/340
Author: @RedNodeAI
Created: 5/17/2026
Status: ✅ Merged
Merged: 5/17/2026
Merged by: @DominikDoom
Base:
main← Head:main📝 Commits (3)
dcad9fcAdd sibling-import fallback for Forge Neoe49631fAdd sibling-import fallback for Forge Neo20472d5Add sibling-import fallback for Forge Neo📊 Changes
3 files changed (+24 additions, -7 deletions)
View changed files
📝
scripts/model_keyword_support.py(+6 -2)📝
scripts/tag_autocomplete_helper.py(+11 -4)📝
scripts/tag_frequency_db.py(+7 -1)📄 Description
Problem
On some Forge Neo and Forge Classic installs, the extension silently fails to load with:
*** Error loading script: model_keyword_support.py
ModuleNotFoundError: No module named 'scripts.shared_paths'
*** Error loading script: tag_autocomplete_helper.py
ModuleNotFoundError: No module named 'scripts.model_keyword_support'
*** Error loading script: tag_frequency_db.py
ModuleNotFoundError: No module named 'scripts.shared_paths'
Result: the extension's
on_ui_settingscallback never registers, so notac_*keys reach the JSoptsobject, soJSON.parse(opts["tac_keymap"])throws onundefined, and the tag popup never wires up. From the user's point of view: "the extension does nothing."Cause
Python's namespace-package resolution for
scriptsdoesn't always pick up the extension'sscripts/folder when the webui has its ownscripts/folder — the webui's folder is found first, doesn't containshared_paths, andModuleNotFoundErroris raised instead of also checking the extension's folder.Fix
Mirrors the existing fallback pattern already used in
tag_autocomplete_helper.pyfortag_frequency_db: try the package-style import first, and if it fails, add the script's own directory tosys.pathand re-import bare. No behavior change on webuis where the package import works.Applied to:
scripts/model_keyword_support.pyscripts/tag_frequency_db.pyscripts/tag_autocomplete_helper.pyTested on Forge Neo and Forge Classic.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.