-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
Added command line argument --electron to open the WebUI as a Electron app. #12694
Conversation
…ndalone Electron app. Signed-off-by: Diego Casorran <dcasorran@gmail.com>
Feels crippling to only be able to use one browser tab... Anyway, since this requires some external software, it's probably going to be some time until I get to test it. If anyone uses this and has something to report, please do. |
Thanks for the review / feedback. Well, let's say this is a preliminary version, if there is acceptance / demand from the users i was intending to improve it over time, for what multiple tabs concerns we could use this component but it will require setting up a normal electron app instead of just opening the URL from the command-line. |
@diegocr so I have a look and I found that it's actually pretty simple to turn this into an extension I sent you a collaborator invite to my repo, you may do anything you like I feel like this is very rough but from my testing it does work the extension also includes auto setup of electron provided that note is installed and added to path, only tested on Windows this should be back with compatible with at least quite a few versions of webui, but I only tested with 1.5.2 and dev I didn't add the |
Well, I will need to learn extensions development here, since i only started using SD early this month and basically have no idea about anything, but thanks for the boilerplate code in that repo which could help me to get started.
Personally i would discourage installing Electron from within the extension, i think it will turn a nuisance having to keep it up-to-date when we could just rely on the globally-installed one.
Can you confirm there is some way to turn extensions on/off from the command line? at first glance i didn't found a suitable one in |
do whatever you think it's best I have no idea no concept of how node and electron works, I already sent you an invite you can do any modification you wish, if your face problems I'm willing to try and answer your questions
I didn't add the argument because my I think if someone don't want to use electron they could just disable extension when possible I would suggest adding stuff as a setting in the setting tab as opposed to a arg, as it is generally more user friendly this way if you do think adding command line arguments is necessary then it can be added in |
I personally think this should be made an extension as w-e-w has shown an example of. The benefit is it gives you the opportunity to maintain it yourself. |
tested on 1.6.0-RC can confirm working only requiring --autolaunch after installing properly but wouldnt hurt to put a tutorial(on their end) on how to install NPM and electron on windows and linux. |
can vouch for after using, also improves gen speed a got a 1-3it/s boost vs having in web browser. |
Out of curiosity, what is stopping you from configuring the browser to use the integrated GPU? I also think this should be an extension. |
depending on the system there could be strange issues
|
There's almost no scrolling in SD Web UI so even that would be a weak excuse. Whatever the reason, I think it's easier that people are asked to avoid unsupported hadware and software configurations than to bundle Electron and Node.js as a band-aid. It should at least be fully optional if not done as an extension. Also, Electron is based on Chrome so I highly doubt it's less memory intensive than any browser based on Chrome (i.e. all except Firefox), not to mention having to add a Node.js to the mix probably with another bunch of packages as if vetting what gets installed from PyPI isn't hard enough already and doesn't create large enough attack surface. Finally, if they can't set their main browser to iGPU, then they can surely install one of the numerous 3rd-party browsers (Opera, Vivaldi, Brave, Chrome, Firefox, etc), set that one to run on an iGPU, and use it exclusively to run stable diffusion? Why burden everyone with Electron and Node.js integration to cater for something that can be solved locally by installing a second browser and fiddling with some graphics card control panel settings? |
the default Autolaunch uses the default browser, what you meant the configuration of the default browser and it's not use only for web UI, it has nothing to do with unsupported Hardware
but yes I do agree that this is an extension and I have already made it so
you completely missed the point, the concerned is about VRAM not system RAM
this this electron business is basically a 3rd-party browsers and launched with configuration without hardware installation |
Why would anybody on their right mind do that? Well, at least beyond the kind of issues @w-e-w did mentioned, but it isn't the case here - this is about regaining the VRAM the main browser might be consuming by closing it, which we couldn't do if we have the WebUI running on it, i suggest you do re-read the initial post with the description, i'm just repeating what i said there.
Again, re-read the description, and if that wasn't enough check the code-changes, you'll find it's fully optional.
You're obviously not understanding anything here, sorry to say. This is not installing anything.
Why would i want to mess installing a second browser, when i do already have Electron installed ? it's just a matter of providing options mate, if you don't have Electron installed and want to use a full bloated second browser just for the WebUI then go for it. Nuff said, cheers :) |
well I do it, my 3090 dGPU is my secondery GPU, I only use it when I need it, for every day task I use iGPU normally you will connect your monitor to your dGPU and have every thing use dGPU |
Because (unless you are using a very old laptop), your iGPU is good enough for most tasks you do in the browser? Nowadays even iGPU has hardware video decoding and it would also free your dGPU VRAM for other tasks that are important to you. To be clear, I am not against implementing an option to use Electron instead of a browser (you can also add optional support for Microsoft Edge WebView2 if you want), but I must admit it looked a bit silly to go through all that trouble of implementing this when you could have just set the browser to use iGPU to achieve pretty much the same effect. That said, I just wanted to make sure it's fully optional hence the questions. Carry on. |
Well, some fair points there have to tell, but let me add that for example Chrome is refusing to play HEVC video on the iGPU, so by that alone i won't have the browser using it, together with all other kind of media capabilities that would benefit by using the dGPU on the browser. |
I agree with other posters who say this should be an extension. If it becomes really popular and gets updated to automatically install the requirements, we should consider integrating it as a built-in extension. |
I transferred my extension repo to him but since then he hasn't done anything with it |
Yep, thanks @w-e-w, just too busy with other stuff ;-) Anyway, I do still feel with the current support / API for extensions we will lack the capability to properly setup this, in a clean way at least... if we do have to rely on kind of a hackpatch to intercept when the app is launched etc. If as said there is demand for this, i may consider moving forward with it either way, although what i am not so sure about doing is the extension installing nodejs and all dependencies. Cheers, and HNY! :) |
there are other ways to intercept the launch |
"by patching" ... :-) I think nothing will be in a more clean way that just providing a command-line argument just like this PR is doing, i think the changes here are minimal and doesn't harm, but yeah if does requires to have the dependencies installed, although i also think no big deal that whoever does want to use this do install them manually if they don't have them already, which i think it's better than over engineering the integration at this time. |
Description
So...
--autolaunch
is cool, but my default browser is using the discrete GPU and consuming around +1GB of VRAM.Hence, thought on supporting a
--electron
option so that instead of the default browser we do launch the WebUI as a standalone Electron app, which i can configure to use the integrated GPU and allows me to close the default browser to regain the VRAM it does uses.The
--electron
option does requires supplying--autolaunch
as well, and obviously NodeJS and the Electron package being installed. If there is any issue finding Electron, we will still fallback to use the default browser.Screenshots/videos:
Checklist: