gligen-gui icon indicating copy to clipboard operation
gligen-gui copied to clipboard

Issue with Flask

Open OldNewDesign opened this issue 1 year ago • 9 comments

Maybe I am doing something wrong, but this is the output I get when I follow the steps. I have the issue when trying to start the GUI.

PS C:\Users\phill\Ai Creation Tools\ComfyUI\ComfyUI> pip install flask Requirement already satisfied: flask in c:\users\phill\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (3.0.2) Requirement already satisfied: Werkzeug>=3.0.0 in c:\users\phill\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from flask) (3.0.1) Requirement already satisfied: Jinja2>=3.1.2 in c:\users\phill\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from flask) (3.1.2) Requirement already satisfied: itsdangerous>=2.1.2 in c:\users\phill\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from flask) (2.1.2) Requirement already satisfied: click>=8.1.3 in c:\users\phill\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from flask) (8.1.7) Requirement already satisfied: blinker>=1.6.2 in c:\users\phill\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from flask) (1.7.0) Requirement already satisfied: colorama in c:\users\phill\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from click>=8.1.3->flask) (0.4.6) Requirement already satisfied: MarkupSafe>=2.0 in c:\users\phill\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from Jinja2>=3.1.2->flask) (2.1.3) PS C:\Users\phill\Ai Creation Tools\ComfyUI\ComfyUI> git clone https://github.com/mut-ex/gligen-gui.git Cloning into 'gligen-gui'... remote: Enumerating objects: 27, done. remote: Counting objects: 100% (27/27), done. remote: Compressing objects: 100% (22/22), done. remote: Total 27 (delta 4), reused 27 (delta 4), pack-reused 0 Receiving objects: 100% (27/27), 1.32 MiB | 1.88 MiB/s, done. Resolving deltas: 100% (4/4), done. PS C:\Users\phill\Ai Creation Tools\ComfyUI\ComfyUI> cd gligen-gui **PS C:\Users\phill\Ai Creation Tools\ComfyUI\ComfyUI\gligen-gui> flask --app 'gligen_gui:create_app(8188)' run --port 5000 flask : The term 'flask' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • flask --app 'gligen_gui:create_app(8188)' run --port 5000
  •   + CategoryInfo          : ObjectNotFound: (flask:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException**
    
    

PS C:\Users\phill\Ai Creation Tools\ComfyUI\ComfyUI\gligen-gui>

OldNewDesign avatar Feb 17 '24 05:02 OldNewDesign

Hey looks like flask cannot be found in your path. Try running python -m flask --app 'gligen_gui:create_app(8188)' run --port 5000

H4sh3 avatar Feb 17 '24 11:02 H4sh3

Thanks that is what ChatGPT had me do and it started to work.

On Sat, Feb 17, 2024 at 14:32 H4sh3 @.***> wrote:

Hey looks like flask cannot be found in your path. Try running python -m flask --app 'gligen_gui:create_app(8188)' run --port 5000

— Reply to this email directly, view it on GitHub https://github.com/mut-ex/gligen-gui/issues/2#issuecomment-1949943056, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6MI76MBYA4DBXE54N2ZV3TYUCILPAVCNFSM6AAAAABDNBNAMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZHE2DGMBVGY . You are receiving this because you authored the thread.Message ID: @.***>

OldNewDesign avatar Feb 17 '24 11:02 OldNewDesign

Here is what you need to put in a .bat file to start it (also got that from chatgpt):

@echo off setlocal

rem Change directory to where your Flask app is located cd C:\INSERTYOURPATHHERE\gligen-gui

rem Execute the Flask command flask --app "gligen_gui:create_app(8188)" run --port 5000

endlocal

MoreColors123 avatar Feb 17 '24 11:02 MoreColors123

pay attention to quotes, for me it works only with double quotes:

... "gligen_gui:create_app(8188)" ...

djdance avatar Feb 17 '24 21:02 djdance

pay attention to quotes, for me it works only with double quotes:

... "gligen_gui:create_app(8188)" ...

thank you! i couldn't figure this out

dangerweenie avatar Feb 20 '24 18:02 dangerweenie

Error: No such option: --app

Can someone help me with this?

leravalera4 avatar Feb 20 '24 19:02 leravalera4

Error: No such option: --app

Can someone help me with this?

Create a new run.bat file in the root folder (that contains README.md) with the contents:

set FLASK_APP=gligen_gui:create_app(8188)
python -m flask run --port 5000
pause

Dutchs avatar Feb 21 '24 09:02 Dutchs

Error: Could not import "'gligen_gui".

robji15 avatar Feb 27 '24 12:02 robji15

Error: Could not import "'gligen_gui". try: python -m flask --app "gligen_gui:create_app(8188)" run --port 5000

not python -m flask --app 'gligen_gui:create_app(8188)' run --port 5000

(for the keen-eyed, clue was the extra single quote in the error message)

twobob avatar Mar 02 '24 01:03 twobob