kijai / ComfyUI-Florence2

Inference Microsoft Florence2 VLM
MIT License
645 stars 40 forks source link

Not seeing any auto-downloaded LLM in ComfyUI folder after clone this repository in ComfyUI/custom_nodes #12

Open ChenxiangLi0620 opened 3 months ago

kijai commented 3 months ago

The loader node should download the selected model on first run, cloning the repo won't.

ChenxiangLi0620 commented 3 months ago

I am sorry, but which Python script I should run here? I think running ./ComfyUI/custom_nodes/ComfyUI-Florence2/nodes.py gives me error.

if text_input is not "": /home/hammond/miniconda3/envs/yolov10/lib/python3.9/site-packages/requests/init.py:109: RequestsDependencyWarning: urllib3 (1.26.19) or chardet (5.2.0)/charset_normalizer (2.0.12) doesn't match a supported version! warnings.warn( Traceback (most recent call last): File "/home/hammond/ComfyUI/custom_nodes/ComfyUI-Florence2/nodes.py", line 19, in def fixed_get_imports(filename: str | os.PathLike) -> list[str]: TypeError: unsupported operand type(s) for |: 'type' and 'ABCMeta'

kijai commented 3 months ago

You don't need to run any script, the node itself downloads the model when you use it in Comfy.

Baojch commented 1 month ago

This problem is because of python version<3.10. You can modify as the following to solve it.

from typing import Union
def fixed_get_imports(filename: Union[str, os.PathLike]) -> list[str]:
    if not str(filename).endswith("modeling_florence2.py"):
        return get_imports(filename)
    imports = get_imports(filename)
    imports.remove("flash_attn")
    return imports