[GH-ISSUE #291] 'get_embeddings' issue with symbolic paths (I think) #202

Open
opened 2026-10-30 21:20:56 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @silveroxides on GitHub (Jun 29, 2024).
Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/291

SO I keep getting this issue. This is the only extension I have that causes issues with my symbolic links I have within my models and embeddings directories. Is this because of the extension using sys module rather than the webui internal paths module?

*** Error executing callback model_loaded_callback for C:\Stable_Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py
    Traceback (most recent call last):
      File "C:\Stable_Diffusion\stable-diffusion-webui\modules\script_callbacks.py", line 273, in model_loaded_callback
        c.callback(sd_model)
      File "C:\Stable_Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 221, in get_embeddings
        emb_unknown.append((Path(emb.filename), Path(emb.filename).relative_to(EMB_PATH).as_posix(), ""))
      File "C:\Program Files\Python310\lib\pathlib.py", line 818, in relative_to
        raise ValueError("{!r} is not in the subpath of {!r}"
    ValueError: '.' is not in the subpath of 'C:\\Stable_Diffusion\\stable-diffusion-webui\\embeddings' OR one path is relative and the other is absolute.
Originally created by @silveroxides on GitHub (Jun 29, 2024). Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/291 SO I keep getting this issue. This is the only extension I have that causes issues with my symbolic links I have within my models and embeddings directories. Is this because of the extension using sys module rather than the webui internal paths module? ``` *** Error executing callback model_loaded_callback for C:\Stable_Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py Traceback (most recent call last): File "C:\Stable_Diffusion\stable-diffusion-webui\modules\script_callbacks.py", line 273, in model_loaded_callback c.callback(sd_model) File "C:\Stable_Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 221, in get_embeddings emb_unknown.append((Path(emb.filename), Path(emb.filename).relative_to(EMB_PATH).as_posix(), "")) File "C:\Program Files\Python310\lib\pathlib.py", line 818, in relative_to raise ValueError("{!r} is not in the subpath of {!r}" ValueError: '.' is not in the subpath of 'C:\\Stable_Diffusion\\stable-diffusion-webui\\embeddings' OR one path is relative and the other is absolute. ```
Author
Owner

@DominikDoom commented on GitHub (Jun 29, 2024):

Symlinks should not be a problem, I use them myself to share embeddings between different SD frontends.
EMB_PATH is specified like this:

EMB_PATH = Path(shared.cmd_opts.embeddings_dir).absolute()

and shared.cmd_opts obviously comes directly from the webui, either a custom value or the default.

From this part of the error message:

ValueError: '.' is not in the subpath of 'C:\\Stable_Diffusion\\stable-diffusion-webui\\embeddings' OR one path is relative and the other is absolute.

It seems more like a filename issue? emb.filename shouldn't just be '.' at that point, normally the webui would provide an absolute path there. Also, it gets appended to the emb_unknown dictionary, meaning the embedding type itself wasn't detected either. Maybe there's a corrupt file in your embedding folder or something like that?

<!-- gh-comment-id:2198124079 --> @DominikDoom commented on GitHub (Jun 29, 2024): Symlinks should not be a problem, I use them myself to share embeddings between different SD frontends. EMB_PATH is specified like this: ```python EMB_PATH = Path(shared.cmd_opts.embeddings_dir).absolute() ``` and shared.cmd_opts obviously comes directly from the webui, either a custom value or the default. From this part of the error message: ``` ValueError: '.' is not in the subpath of 'C:\\Stable_Diffusion\\stable-diffusion-webui\\embeddings' OR one path is relative and the other is absolute. ``` It seems more like a filename issue? emb.filename shouldn't just be '.' at that point, normally the webui would provide an absolute path there. Also, it gets appended to the emb_unknown dictionary, meaning the embedding type itself wasn't detected either. Maybe there's a corrupt file in your embedding folder or something like that?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DominikDoom/a1111-sd-webui-tagcomplete#202
No description provided.