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

Issue with Flask #2

Open
OldNewDesign opened this issue Feb 17, 2024 · 9 comments
Open

Issue with Flask #2

OldNewDesign opened this issue Feb 17, 2024 · 9 comments

Comments

@OldNewDesign
Copy link

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>

@H4sh3
Copy link

H4sh3 commented Feb 17, 2024

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

@OldNewDesign
Copy link
Author

OldNewDesign commented Feb 17, 2024 via email

@MoreColors123
Copy link

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

@djdance
Copy link

djdance commented Feb 17, 2024

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

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

@dangerweenie
Copy link

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

@leravalera4
Copy link

Error: No such option: --app

Can someone help me with this?

@Dutchs
Copy link

Dutchs commented Feb 21, 2024

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

@robji15
Copy link

robji15 commented Feb 27, 2024

Error: Could not import "'gligen_gui".

@twobob
Copy link

twobob commented Mar 2, 2024

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)

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

9 participants