kijai / ComfyUI-Florence2

Inference Microsoft Florence2 VLM
MIT License
768 stars 51 forks source link

DownloadAndLoadFlorence2Model downloads all kinds of files #97

Closed felixniemeyer closed 16 hours ago

felixniemeyer commented 1 day ago

When running the following workflow using ComfyUI-Florence2 the first time, many non-model files are being downloaded into comfyUI/models/LLM/.... This does not seem right. Below is the workflow and also the comfyUI log.

image

{
  "10": {
    "inputs": {
      "model": "gokaygokay/Florence-2-Flux-Large",
      "precision": "fp16",
      "attention": "sdpa"
    },
    "class_type": "DownloadAndLoadFlorence2Model",
    "_meta": {
      "title": "DownloadAndLoadFlorence2Model"
    }
  },
  "11": {
    "inputs": {
      "text_input": "",
      "task": "caption",
      "fill_mask": true,
      "keep_model_loaded": false,
      "max_new_tokens": 1024,
      "num_beams": 3,
      "do_sample": true,
      "output_mask_select": "",
      "seed": 667037814261723,
      "image": [
        "12",
        0
      ],
      "florence2_model": [
        "10",
        0
      ]
    },
    "class_type": "Florence2Run",
    "_meta": {
      "title": "Florence2Run"
    }
  },
  "12": {
    "inputs": {
      "image": "ss2.png",
      "upload": "image"
    },
    "class_type": "LoadImage",
    "_meta": {
      "title": "Load Image"
    }
  },
  "14": {
    "inputs": {
      "mode": "raw value",
      "input": [
        "11",
        2
      ]
    },
    "class_type": "DisplayAny",
    "_meta": {
      "title": "šŸ”§ Display Any"
    }
  }
}
Downloading Florence2 model to: /home/felix/davdev/ai/ComfyUI/models/LLM/Florence-2-Flux-Large
/home/felix/davdev/ai/ComfyUI/venv/lib/python3.12/site-packages/huggingface_hub/file_download.py:1204: UserWarning: `local_dir_use_symlinks` parameter is deprecated and will be ignored. The process to download files to a local folder has been updated and do not rely on symlinks anymore. You only need to pass a destination folder as`local_dir`.
For more details, check out https://huggingface.co/docs/huggingface_hub/main/en/guides/download#download-files-to-local-folder.
  warnings.warn(
Fetching 15 files:  20%|ā–ˆā–ˆ        | 3/15 [00:00<00:03,  3.21it/s]

Here are all the files already present after 20%:

ls models/LLM/Florence-2-Flux-Large/
added_tokens.json           merges.txt                README.md                vocab.json
config.json                 modeling_florence2.py     special_tokens_map.json
configuration_florence2.py  preprocessor_config.json  tokenizer_config.json
generation_config.json      processing_florence2.py   tokenizer.json
kijai commented 1 day ago

Yes... that's how diffusers models are, they are folders with lots of files, including confings, model weights and in the case of Florence2 and some other LLMs, part of the inference code.

felixniemeyer commented 16 hours ago

Ok, thanks for the explanantion. I was used to downloading only single model files (checkpoints, loras, controlnets, upscalers ...).