Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect extra network preview endpoint #217

Closed
catboxanon opened this issue Aug 7, 2023 · 3 comments
Closed

Incorrect extra network preview endpoint #217

catboxanon opened this issue Aug 7, 2023 · 3 comments

Comments

@catboxanon
Copy link

catboxanon commented Aug 7, 2023

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

@DominikDoom
Copy link
Owner

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.

@DominikDoom
Copy link
Owner

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.

@catboxanon
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants