comfy-cli icon indicating copy to clipboard operation
comfy-cli copied to clipboard

comfy model download --filename ?

Open vesper8 opened this issue 1 year ago • 2 comments
trafficstars

I'm trying to make use of comfy-cli in scripts and I can't seem to get it to download a file unattended

the --no-prompt doesn't work and, when I run for example this command:

comfy model download --url https://huggingface.co/h94/IP-Adapter/resolve/main/models/image_encoder/model.safetensors --relative-path ComfyUI/models/clip_vision/CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors

It prompts me ? Enter filename to save model as model.safetensors

Am I missing something?

vesper8 avatar Jul 19 '24 22:07 vesper8

You can use --skip-prompt flag

comfy --skip-prompt model download --url https://huggingface.co/h94/IP-Adapter/resolve/main/models/image_encoder/model.safetensors --relative-path ComfyUI/models/clip_vision/CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors

punitda avatar Aug 13 '24 06:08 punitda

UPDATE 👇🏻

--UPDATE: they added a --filename command. You can verify this with the --help option:

comfy model download --help

(previous remark below)

@punitda this doesn't work the way the user would anticipate:

comfy --skip-prompt model download --url '<URL>' --relative-path ./path/to/models/loras/model.safetensors

Will frustratingly create a directory named .../loras/model.safetensors/ and then put a file inside it,

i.e.: ./path/to/models/loras/model.safetensors/model.safetensors


I found this issue in search of a --filename argument, ~~which I believe does not (yet) exist for the comfy model download command.~~

Leaving this here comment in case other people were/are surprised by this behavior.

austintraver avatar Apr 16 '25 15:04 austintraver

I think we can close this question since the correct answer was given by austintraver?

CIVITAI_API_TOKEN=XXXX python3 -m comfy_cli model download --url=https://civitai.com/api/download/models/955535 --filename=test-aidmaflux.safetensors

Start downloading URL: https://civitai.com/api/download/models/955535 into /home/shurik/comfy/ComfyUI/models/loras/Flux.1D/test-aidmaflux.safetensors
Downloading 73 MB ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00

bigcat88 avatar Jul 29 '25 12:07 bigcat88