InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: Flag --gui no longer working

Open dhelonious opened this issue 3 years ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS

Windows

GPU

cuda

VRAM

8GB

What happened?

Calling invoke.py --gui gives the following error:

TypeError: FlaskUI.__init__() got an unexpected keyword argument 'start_server'

This seems to be an issue with newer versions of flaskwebgui. Apparently, the start_server argument was renamed to server in commit e023f1c. However, also the idle_interval argument is no longer present in current releases of flaskwebgui.

I noticed that no version of flaskebgui is specified in the environment.yaml (in fact, flaskwebgui is not even included). Adding flaskwebgui==0.3.7 would also solve this issue.

Screenshots

No response

Additional context

No response

Contact Details

No response

dhelonious avatar Dec 08 '22 21:12 dhelonious

You can use the --web flag and access the UI in your browser at http://localhost:9090 - it's essentially the same thing

ebr avatar Dec 08 '22 23:12 ebr

Previously in #1687, I changed flaskwebui initialization process in order to fix similar issue that happend in InvokeAI that was installed manually using pip. I was not aware with the version difference of flaskwebgui in the requirements file used by pip and conda installers at that time. Hence, the --gui broke in InvokeAI that installed using conda.

I think this issue is easy to fix if the project still want to maintain --gui option. As @dhelonious said, flaskwebgui version needs to be pinned in the requirement files used by conda.

addianto avatar Dec 09 '22 00:12 addianto

@ebr: I actually like to have a separate window for the UI. I would not mind using the --web flag if there was an option to automatically open the url in my browser. However, I'm also fine if the maintainers decide to drop the --gui flag, as long as there is no longer a broken flag.

dhelonious avatar Dec 09 '22 21:12 dhelonious

Didnt decide to drop it. The library was updated and the new version has a different syntax. I think we didn't pin the version in the installer so it installed the latest version instead of the tested version.

As a temporary fix you can do this. We'll fix this up in the next release.

Go to invoke_ai_web_server.py and find this code and replace it to the one below.

From:

FlaskUI(
                    app=self.app,
                    socketio=self.socketio,
                    start_server="flask-socketio",
                    width=1600,
                    height=1000,
                    idle_interval=10,
                    port=self.port
                ).run()

To:

FlaskUI(
                    app=self.app,
                    socketio=self.socketio,
                    server="flask_socketio",
                    width=1600,
                    height=1000,
                    port=self.port
                ).run()

blessedcoolant avatar Dec 10 '22 15:12 blessedcoolant

Thanks, I'll look forward to the update! As a workaround, I downgraded flaskwebgui in my virtual env, so that I do not have to make changes that could be overwritten on git pull.

dhelonious avatar Dec 10 '22 15:12 dhelonious

Thanks, I'll look forward to the update! As a workaround, I downgraded pywebgui in my virtual env, so that I do not have to make changes that could be overwritten on git pull.

flaskwebgui .. Not pywebgui

blessedcoolant avatar Dec 10 '22 16:12 blessedcoolant

Typo... thanks! I corrected this.

dhelonious avatar Dec 10 '22 17:12 dhelonious

Fixed in 2.2.4

dhelonious avatar Dec 12 '22 23:12 dhelonious