Closed drozbay closed 6 months ago
Thank you for acknowledging and working to fix this issue. I tried the latest commit and am still seeing this problem:
Thanks for pointing that out. https://github.com/shiimizu/ComfyUI_smZNodes/commit/c91ab1a9568ffb17ffdc8c2932be47ee68205490 was to fix inputting embeddings with brackets in their filename like emb_\(test\)
.
https://github.com/shiimizu/ComfyUI_smZNodes/commit/a1627ce2ade31822694d82aa9600a4eff0f99d69 should fix your issue now.
Thank you for fixing this issue, it is working perfectly now!
Issue Description: When using parsing mode A1111 in the text encoder prompt parser, backslashes () used in Windows directory paths for embeddings are misinterpreted or removed, leading to unrecognized embeddings. The problem is traced back to prompt_parser.py in parse_prompt_attention() where backslashes are removed regardless of if they are part of an embedding directory structure or not:
This results in the non-application of embeddings, even though the embeddings with backslash characters are correctly registered in parse_and_register_embeddings.
There are common extensions, specifically the custom-scripts extension from pythongosssss, that allow for quick adding of embedding text, but in Windows at least it uses the backslash character for the directory structure. This means that a bunch of people using both extensions may not be actually applying the embeddings even though it seems like they are.
Proposed possible fix: I tried adding this code, which just makes sure that there are no backslash characters in an embedding directory name after being parsed as a valid embedding. Seems to work with my testing.
In parse_and_register_embeddings, in file smZNodes.py: