hayden-fr / ComfyUI-Model-Manager

Manage models: browsing, donwload and delete.
GNU General Public License v3.0
64 stars 21 forks source link

`migrate_legacy_information` should check for existance of model before initiating the corresponding migration #59

Closed sansmoraxz closed 1 day ago

sansmoraxz commented 5 days ago

Not all json files in models folders are metadata, but presently it's scanning all txt, json and image files https://github.com/hayden-fr/ComfyUI-Model-Manager/blob/1796b101c565f527b5c459dc016f65288499c006/py/services.py#L263-L272

However ideally there should be a check for whether the json file is related to a model or not. In my case it was giving error for line 270 for animatediff artifacts because it was not able to find corresponding field in the model.

Same with the other artifacts that's being scanned.

hayden-fr commented 5 days ago

The migration work is done by scanning the model and then scanning the related files. The working principle is basically the same as the scanned model list.

https://github.com/hayden-fr/ComfyUI-Model-Manager/blob/1796b101c565f527b5c459dc016f65288499c006/py/services.py#L223-L272

hayden-fr commented 5 days ago

The error you are encountering may be caused by other problems.

sansmoraxz commented 5 days ago

Yeah, seems like an edge case.

This extension https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved adds objects to folder_paths.

For example these:

https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved/blob/main/video_formats/av1-webm.json

Perhaps that's why it's being treated. In any case these cannot be treated as metadata.

Also basic schema validation with the old model should happen (cause who knows if some other extension follows similar naming convention but different keys).

hayden-fr commented 4 days ago

Thanks for the information, it helped me a lot. These issues do need to be considered more rigorously.