stable-diffusion-webui-forge
stable-diffusion-webui-forge copied to clipboard
Setting `--data-dir` leads to 403 trying to load files from `<sd-folder>/javascript`
If you set export COMMANDLINE_ARGS="--cuda-malloc --xformers --listen --data-dir /some/other/folder", when you open the UI, it gets completely broken:
If I remove the --data-dir argument, then it loads fine.
Checking the browser logs, I see a bunch of 403 errors trying to load I assume files from the <sd-folder>/javascript folder:
I tried copying the javascript folder into the data-dir folder I have, but it also doesn't fix it.
On Automatic1111 this setting works fine with the same dir. Also, those javascript files seem to get cached, so when you change the --data-dir flag you need to do a hard reload with ctrl shift r for it to happen.
Is this flag unsupported? or its just a bug? Or maybe I'm missing something else?
I'm running this on linux, if thats relevant
This is one of the breaking change in gradio 4
Since the working directory is now not served by default, if you reference local files within your CSS or in a gr.HTML component using the /file= route, you will need to explicitly allow access to those files (or their parent directories) using the allowed_paths parameter in launch()
https://github.com/gradio-app/gradio/issues/6339
TL;DR
For user
Add this to the arguments --gradio-allowed-path "."
For forge dev
demo.launch(allowed_paths=["."])
However, it is best to clearly list all the files/directories that need to be served.
Can confirm, adding --gradio-allowed-path "." to the COMMANDLINE_ARGS list addresses the issue
This is one of the breaking change in gradio 4
Since the working directory is now not served by default, if you reference local files within your CSS or in a gr.HTML component using the /file= route, you will need to explicitly allow access to those files (or their parent directories) using the allowed_paths parameter in launch()
TL;DR
For user
Add this to the arguments
--gradio-allowed-path "."For forge dev
demo.launch(allowed_paths=["."])However, it is best to clearly list all the files/directories that need to be served.
Thank you for this! It was driving me crazy why I had no problems with A1111 and reForge, but Forge always just silently did nothing.