[GH-ISSUE #168] Follow symlinks #121

Closed
opened 2026-10-30 21:19:41 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @catboxanon on GitHub (May 3, 2023).
Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/168

The web UI currently reads all extra networks recursively and follows symlinks, something the glob module supports but I don't believe pathlib does yet. This can be verified by symlinking a directory, and comparing the list in the extra networks list compared to those returned by tagcomplete. A few examples here:
github.com/AUTOMATIC1111/stable-diffusion-webui@5ab7f213be/extensions-builtin/Lora/lora.py (L349-L352)
github.com/AUTOMATIC1111/stable-diffusion-webui@5ab7f213be/modules/hypernetworks/hypernetwork.py (L315)
I know Gradio is pretty restrictive about anything outside of working directory, but I imagine if the extra networks list can read them fine then extensions could too.

Originally created by @catboxanon on GitHub (May 3, 2023). Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/168 The web UI currently reads all extra networks recursively _and_ follows symlinks, something the `glob` module supports but I don't believe `pathlib` does yet. This can be verified by symlinking a directory, and comparing the list in the extra networks list compared to those returned by tagcomplete. A few examples here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/5ab7f213bec2f816f9c5644becb32eb72c8ffb89/extensions-builtin/Lora/lora.py#L349-L352 https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/5ab7f213bec2f816f9c5644becb32eb72c8ffb89/modules/hypernetworks/hypernetwork.py#L315 I know Gradio is pretty restrictive about anything outside of working directory, but I imagine if the extra networks list can read them fine then extensions could too.
Author
Owner

@DominikDoom commented on GitHub (May 3, 2023):

True, the Gradio restrictions only apply to the client side, so if the JavaScript part wants to load something. This isn't a problem for the list of hypernets and lora since they are written to a temp file. Only when those temp files are outside the root (so when the extensions dir itself is symlinked) there are problems.

I changed it to use glob similar to the webui implementation like you suggested, so it should follow them now.

<!-- gh-comment-id:1532662468 --> @DominikDoom commented on GitHub (May 3, 2023): True, the Gradio restrictions only apply to the client side, so if the JavaScript part wants to load something. This isn't a problem for the list of hypernets and lora since they are written to a temp file. Only when those temp files are outside the root (so when the extensions dir itself is symlinked) there are problems. I changed it to use glob similar to the webui implementation like you suggested, so it should follow them now.
Author
Owner

@catboxanon commented on GitHub (May 3, 2023):

Works now, thanks!

<!-- gh-comment-id:1533064029 --> @catboxanon commented on GitHub (May 3, 2023): Works now, thanks!
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#121
No description provided.