mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-11-05 00:17:25 +00:00
[GH-ISSUE #55] Error running on colab webui automatic111 as an extension. #41
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#41
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?
Originally created by @imesha10 on GitHub (Oct 31, 2022).
Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/55
Quick Description how I got this error.
I installed this as instructed in the readme as an extension. Then once the webui is in final stages of loading up this error pops up. (note that the webui still functions and I can produce images, just the extention keeps spitting out errors constantly, the error following is the first error I get").
Error Log
Error loading script: tag_autocomplete_helper.py
Traceback (most recent call last):
File "/content/stable-diffusion-webui/modules/scripts.py", line 168, in load_scripts
exec(compiled, module.dict)
File "/content/stable-diffusion-webui/extensions/tag-autocomplete/scripts/tag_autocomplete_helper.py", line 24, in
TAGS_PATH = get_tags_base_path()
File "/content/stable-diffusion-webui/extensions/tag-autocomplete/scripts/tag_autocomplete_helper.py", line 18, in get_tags_base_path
if (script_path.is_relative_to(EXT_PATH)):
AttributeError: 'PosixPath' object has no attribute 'is_relative_to'
My guess on what this could be
Looking at the error message I think the issue is script_path is not initialized. I looked at the code and the following is where its initialized.
github.com/DominikDoom/a1111-sd-webui-tagcomplete@372a499615/scripts/tag_autocomplete_helper.py (L16-L18)@DominikDoom commented on GitHub (Oct 31, 2022):
The error states that is_relative_to can't be found. This is a python version problem, that attribute was only added in python 3.9. For local it isn't a problem since 3.10.6 is recommended for the webui, but it seems Colab is running 3.7.x by default, which I wasn't aware of. You can technically change the version since you have full access to the instance Debian backend, but it seems pretty annoying to do.
One workaround is the option used in #45, which I originally didn't want to use, but now that I know it's needed on colab maybe I should use it after all or add a version check / fallback to it.
@imesha10 commented on GitHub (Oct 31, 2022):
Wow lol you are right, I forgot about the python version requirment. Thanks, I managed to get around it somehow. By the way I was looking at the code and looking at what that was trying to do.
github.com/DominikDoom/a1111-sd-webui-tagcomplete@372a499615/scripts/tag_autocomplete_helper.py (L7-L24)From what I can see line 8-24 is trying to get the tags base path. I was looking through what the scripts.basedir() does in the documentation(code) from automatic111webui and found this.
I might be wrong but doesn't both of these produce the same result without the check?
If it was not installed as an extension then it would return .../stable-diff-webui/.
If it was an extension it would return .../stable-diff-webui/extensions/a111-sd-webui-tagcomplete/.
Either way when appending 'tags' to scripts.basedir(), you get the right path.
(I have not tested the code)
Anyways thanks for the help.
@DominikDoom commented on GitHub (Oct 31, 2022):
Huh I actually never thought about that, since it wasn't mentioned in the Wiki about extension development.
But from a quick look it seems like it would work. I'll try it out later.
@DominikDoom commented on GitHub (Oct 31, 2022):
You were correct, this makes the whole check unnecessary. Thanks for the pointer!
That should also make it work with Python 3.7 out of the box.