[GH-ISSUE #217] Incorrect extra network preview endpoint #157

Closed
opened 2026-10-30 21:20:12 +00:00 by bsakaguchi · 3 comments
Owner

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

I don't think this is using the correct endpoint currently. Since I have symlinked folders these preview URLs don't work for me, and returns a 403 error.

http://127.0.0.1:7860/file=E:/SD/LoRA\styles\lora.png

The extra networks implementation actually uses a separate endpoint for this to workaround this issue, which looks something like this.

http://127.0.0.1:7860/sd_extra_networks/thumb?filename=E:/SD/LoRA/styles/lora.png&mtime=1677337028.0

github.com/AUTOMATIC1111/stable-diffusion-webui@68f336bd99/modules/ui_extra_networks.py (L124)

Originally created by @catboxanon on GitHub (Aug 7, 2023). Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/217 I don't think this is using the correct endpoint currently. Since I have symlinked folders these preview URLs don't work for me, and returns a `403` error. `http://127.0.0.1:7860/file=E:/SD/LoRA\styles\lora.png` The extra networks implementation actually uses a separate endpoint for this to workaround this issue, which looks something like this. `http://127.0.0.1:7860/sd_extra_networks/thumb?filename=E:/SD/LoRA/styles/lora.png&mtime=1677337028.0` https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/68f336bd994bed5442ad95bad6b6ad5564a5409a/modules/ui_extra_networks.py#L124
Author
Owner

@DominikDoom commented on GitHub (Aug 7, 2023):

I'm aware of this endpoint, the reason I didn't use it was for compatibility with older webui versions that don't have it. But if the current version breaks with symlinks I'll try to use the proper one first and the naive as a fallback.

<!-- gh-comment-id:1668422131 --> @DominikDoom commented on GitHub (Aug 7, 2023): I'm aware of this endpoint, the reason I didn't use it was for compatibility with older webui versions that don't have it. But if the current version breaks with symlinks I'll try to use the proper one first and the naive as a fallback.
Author
Owner

@DominikDoom commented on GitHub (Aug 7, 2023):

Sorry it took a while, I was experimenting with different fallback methods.
The proper API endpoint already exists longer than I thought (since v1.1.0 it seems), so a failure case should be quite rare.
But in case it does happen, instead of the naive file= fetch request I now return a direct file response and create a blob URL, so it should still load the pic even with symlinks / external directories. Will still log a 404 in the browser console from the failed try, but at least normal use isn't impacted.

<!-- gh-comment-id:1668521035 --> @DominikDoom commented on GitHub (Aug 7, 2023): Sorry it took a while, I was experimenting with different fallback methods. The proper API endpoint already exists longer than I thought (since v1.1.0 it seems), so a failure case should be quite rare. But in case it does happen, instead of the naive `file=` fetch request I now return a direct file response and create a blob URL, so it should still load the pic even with symlinks / external directories. Will still log a 404 in the browser console from the failed try, but at least normal use isn't impacted.
Author
Owner

@catboxanon commented on GitHub (Aug 7, 2023):

No worries. That fix did the trick -- thanks!

<!-- gh-comment-id:1668552741 --> @catboxanon commented on GitHub (Aug 7, 2023): No worries. That fix did the trick -- 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#157
No description provided.