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

FastAPI issue #11

Open
EnragedAntelope opened this issue Sep 7, 2024 · 3 comments
Open

FastAPI issue #11

EnragedAntelope opened this issue Sep 7, 2024 · 3 comments

Comments

@EnragedAntelope
Copy link

Hi,
Thank you for making this!
Please review how this is importing fastapi - may be a capitalization error? Not sure if something changed between versions of fastapi but trying to run lextools consistently throws this error:

Traceback (most recent call last):
  File "D:\ComfyUI\nodes.py", line 1993, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\ComfyUI\custom_nodes\ComfyUI-LexTools\__init__.py", line 2, in <module>
    from .nodes import SegformerNode,ImageCaptioningNode,ImageProcessingNode
  File "D:\ComfyUI\custom_nodes\ComfyUI-LexTools\nodes\ImageProcessingNode.py", line 2, in <module>
    from fastapi import FastApi
ImportError: cannot import name 'FastApi' from 'fastapi' (D:\ComfyUI\venv\Lib\site-packages\fastapi\__init__.py)
@secretivebanana
Copy link

secretivebanana commented Sep 8, 2024

Hello, I had the same problem and managed to fix it. Here's how:

  1. In the "ComfyUI-LexTools\nodes" folder, open ImageProcessingNode.py in a text editor.
  2. On the second line, change:
    "from fastapi import FastApi"
    to
    "from fastapi import FastAPI"
    (It seems that API needs to be fully capitalized.)
  3. Save the file.
  4. Restart ComfiUI.

@EnragedAntelope
Copy link
Author

Thank you, I appreciate that. I am hopeful the dev will incorporate this fix into the repo!

@6DEADSHOT9
Copy link

6DEADSHOT9 commented Jan 7, 2025

Hi, I have opened up a PR #12 with the fix for the same issue.

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

3 participants