Giter Site home page Giter Site logo

Comments (4)

DominikDoom avatar DominikDoom commented on June 24, 2024 2

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.

from a1111-sd-webui-tagcomplete.

DominikDoom avatar DominikDoom commented on June 24, 2024 1

I might be wrong but doesn't both of these produce the same result without the check?

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.

from a1111-sd-webui-tagcomplete.

DominikDoom avatar DominikDoom commented on June 24, 2024

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.

from a1111-sd-webui-tagcomplete.

imesha10 avatar imesha10 commented on June 24, 2024

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.

# Webui root path
FILE_DIR = Path().absolute()
# The extension base path
EXT_PATH = FILE_DIR.joinpath('extensions')
# Tags base path
def get_tags_base_path():
script_path = Path(scripts.basedir())
if (script_path.is_relative_to(EXT_PATH)):
return script_path.joinpath('tags')
else:
return FILE_DIR.joinpath('tags')
TAGS_PATH = get_tags_base_path()

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.

def basedir():
    """returns the base directory for the current script. For scripts in the main scripts directory,
    this is the main directory (where webui.py resides), and for scripts in extensions directory
    (ie extensions/aesthetic/script/aesthetic.py), this is extension's directory (extensions/aesthetic)
    """
    return current_basedir

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.

import os

def get_tags_base_path():
    return os.path.join(scripts.basedir(), "tags")
(I have not tested the code)

Anyways thanks for the help.

from a1111-sd-webui-tagcomplete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.