ComfyUI-3D-Pack icon indicating copy to clipboard operation
ComfyUI-3D-Pack copied to clipboard

Place checkpoints in global comfyui models directory

Open Praecordi opened this issue 1 year ago • 6 comments

In general, it's a bad idea to keep models and checkpoints in the custom node's directory. I think it would be better if you created a 3D_Pack_checkpoints in the model directory to store the checkpoints in. For backward compatibility, you can probably search for the relevant checkpoints in the old directories, but this would be very helpful since I keep all of my large checkpoints in a separate disk to stop them from clogging my main disk.

If I have time, I can implement this and send a pull request myself.

Praecordi avatar Mar 13 '24 11:03 Praecordi

I've thought about it. But as for now, all the checkpoint are downloaded from hugging face, and if it is downloaded automatically, then it will only store once on disk, and be dynamically referenced else where. And also since almost all the checkpoints currently used in Comfy3D can almost only be used in this tool (Like ComtrolNet or AnimateDiff custom comfy packages), so for now I don't see the benefit of changing checkpoints directory.

MrForExample avatar Mar 13 '24 14:03 MrForExample

+1 for models directory. It allows for more portable environments vis-a-vis docker with volumes. Placing into the model directory and using folder_paths.py let's the 'extra_model_paths.yml' to be used. But get why it wouldn't be a priority

NicholasKao1029 avatar Mar 14 '24 22:03 NicholasKao1029

Model directory +1, because if you run in the cloud, the space allocated to the cloud host disk is too small, and the model really cannot fit.

liulsg avatar Mar 15 '24 09:03 liulsg

Ok, then, I'll change it 👍

MrForExample avatar Mar 15 '24 09:03 MrForExample

At moment i have following setup for volumes in dokcer-compose.yml:

    volumes:
      - ./data/cache:/root/.cache
      - ./data/comfyui/custom_nodes/ComfyUI-3D-Pack/checkpoints/crm:/app/custom_nodes/ComfyUI-3D-Pack/checkpoints/crm
      - ./data/comfyui/custom_nodes/ComfyUI-3D-Pack/checkpoints/lgm:/app/custom_nodes/ComfyUI-3D-Pack/checkpoints/lgm
      - ./data/comfyui/custom_nodes/ComfyUI-3D-Pack/checkpoints/tgs:/app/custom_nodes/ComfyUI-3D-Pack/checkpoints/tgs
      - ...
      - ./data/models:/app/models
      - ...
      # https://huggingface.co/flamehaze1115/wonder3d-v1.0/tree/main/
      - ./data/comfyui/custom_nodes/ComfyUI-3D-Pack/checkpoints/flamehaze1115/wonder3d-v1.0/image_encoder/pytorch_model.bin:/app/custom_nodes/ComfyUI-3D-Pack/checkpoints/flamehaze1115/wonder3d-v1.0/image_encoder/pytorch_model.bin
      - ./data/comfyui/custom_nodes/ComfyUI-3D-Pack/checkpoints/flamehaze1115/wonder3d-v1.0/unet/diffusion_pytorch_model.bin:/app/custom_nodes/ComfyUI-3D-Pack/checkpoints/flamehaze1115/wonder3d-v1.0/unet/diffusion_pytorch_model.bin
      - ./data/comfyui/custom_nodes/ComfyUI-3D-Pack/checkpoints/flamehaze1115/wonder3d-v1.0/vae/diffusion_pytorch_model.bin:/app/custom_nodes/ComfyUI-3D-Pack/checkpoints/flamehaze1115/wonder3d-v1.0/vae/diffusion_pytorch_model.bin
  1. some models should be downloaded manually, so i mounted them per file, as doing this in docker build step will result in a huge layers for each build
  2. some models downloaded automatically but i can not to mount whole models storage as it have a lot of config files, so i have to mount volume for each model, otherwise model will be downloaded after each docker rebuild that would be quite often in complex ComfyUi setup like mine (with a lot of custom nodes that would be frequently updated)

kalemas avatar Mar 16 '24 00:03 kalemas

I've thought about it. But as for now, all the checkpoint are downloaded from hugging face, and if it is downloaded automatically, then it will only store once on disk, and be dynamically referenced else where. And also since almost all the checkpoints currently used in Comfy3D can almost only be used in this tool (Like ComtrolNet or AnimateDiff custom comfy packages), so for now I don't see the benefit of changing checkpoints directory.

Sorry for the late reply. Furthermore, I noticed that models downloaded via huggingface are not going to the huggingface cache in home, but the internal comfy3d pack directory. I realize what your intentions are, but with this and the other reasons, I think the model directory is the best way to go.

Praecordi avatar Mar 17 '24 11:03 Praecordi