[GH-ISSUE #747] feat: Add --base-directory argument for ComfyUI #221

Closed
opened 2026-10-31 22:10:15 +00:00 by bsakaguchi · 17 comments
Owner

Originally created by @JaFarey on GitHub (Jan 28, 2025).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/747

Originally assigned to: @webfiltered on GitHub.

I use desktop version of comfy and during installation I specified main folder as F:\AI\ComfyUI so I wanted all the models would be stored by default on F:\AI\ComfyUI\models.
Then I edited exrtra modec config.json file so some of the largest and most used models would be stored in separate folder F:\AI\External models\ComfyUI\models

comfyui_desktop:
is_default: "true"
checkpoints: F:\AI\External models\ComfyUI\models\checkpoints
classifiers: models\classifiers
clip: F:\AI\External models\ComfyUI\models\clip
clip_vision: F:\AI\External models\ComfyUI\models\clip_vision
configs: models\configs
controlnet: F:\AI\External models\ComfyUI\models\controlnet
diffusers: models\diffusers
diffusion_models: models\diffusion_models
embeddings: F:\AI\External models\ComfyUI\models\embeddings
gligen: models\gligen
hypernetworks: models\hypernetworks
loras: F:\AI\External models\ComfyUI\models\loras
photomaker: models\photomaker
style_models: F:\AI\External models\ComfyUI\models\style_models
unet: F:\AI\External models\ComfyUI\models\unet
upscale_models: F:\AI\External models\ComfyUI\models\upscale_models
vae: F:\AI\External models\ComfyUI\models\vae
vae_approx: models\vae_approx
animatediff_models: models\animatediff_models
animatediff_motion_lora: models\animatediff_motion_lora
animatediff_video_formats: models\animatediff_video_formats
ipadapter: F:\AI\External models\ComfyUI\models\ipadapter
liveportrait: models\liveportrait
insightface: F:\AI\External models\ComfyUI\models\insightface
layerstyle: models\layerstyle
LLM: F:\AI\External models\ComfyUI\models\LLM
Joy_caption: models\Joy_caption
sams: F:\AI\External models\ComfyUI\models\sams
blip: models\blip
CogVideo: models\CogVideo
xlabs: F:\AI\External models\ComfyUI\models\xlabs
instantid: F:\AI\External models\ComfyUI\models\instantid
CatVTON: F:\AI\External models\ComfyUI\models\CatVTON
custom_nodes: custom_nodes/
download_model_base: models
base_path: F:\AI\ComfyUI

So Why comfy keeps downloading some of the models (like LLM) to it's root folder C:\Users\farey\AppData\Local\Programs@comfyorgcomfyui-electron\resources\ComfyUI\models

...and althoug I have some of the models installed in my default or extra folder it keeps giving me errors that it can't find the model in the root location:
Error no file named diffusion_pytorch_model.bin found in directory C:\Users\farey\AppData\Local\Programs@comfyorgcomfyui-electron\resources\ComfyUI\models\CatVTON\sd-vae-ft-mse.

I have this issue with the catVTON model. It did not see it in my default location specified during the installation, so I moved the models to "extra folder" and updated the .yaml file and still no result. It started seing the model when I moved it to it's root file but now it is screaming because it can't find .vae file in the same location...

Why is this happening?
Is there any way to keep everything simple and tidy???
All I wanted is to be able to keep all the files in my default location: F:\AI\ComfyUI
and all common models that I could share with other apps in F:\AI\External models\ComfyUI\models

How do I solve it?
How do I stop comfy from downloading some of the models and looking for the models in the root installation folder?

┆Issue is synchronized with this Notion page by Unito

Originally created by @JaFarey on GitHub (Jan 28, 2025). Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/747 Originally assigned to: @webfiltered on GitHub. I use desktop version of comfy and during installation I specified main folder as F:\AI\ComfyUI so I wanted all the models would be stored by default on F:\AI\ComfyUI\models. Then I edited exrtra modec config.json file so some of the largest and most used models would be stored in separate folder F:\AI\External models\ComfyUI\models comfyui_desktop: is_default: "true" checkpoints: F:\AI\External models\ComfyUI\models\checkpoints classifiers: models\classifiers\ clip: F:\AI\External models\ComfyUI\models\clip clip_vision: F:\AI\External models\ComfyUI\models\clip_vision configs: models\configs\ controlnet: F:\AI\External models\ComfyUI\models\controlnet diffusers: models\diffusers\ diffusion_models: models\diffusion_models\ embeddings: F:\AI\External models\ComfyUI\models\embeddings gligen: models\gligen\ hypernetworks: models\hypernetworks\ loras: F:\AI\External models\ComfyUI\models\loras photomaker: models\photomaker\ style_models: F:\AI\External models\ComfyUI\models\style_models unet: F:\AI\External models\ComfyUI\models\unet upscale_models: F:\AI\External models\ComfyUI\models\upscale_models vae: F:\AI\External models\ComfyUI\models\vae vae_approx: models\vae_approx\ animatediff_models: models\animatediff_models\ animatediff_motion_lora: models\animatediff_motion_lora\ animatediff_video_formats: models\animatediff_video_formats\ ipadapter: F:\AI\External models\ComfyUI\models\ipadapter liveportrait: models\liveportrait\ insightface: F:\AI\External models\ComfyUI\models\insightface layerstyle: models\layerstyle\ LLM: F:\AI\External models\ComfyUI\models\LLM Joy_caption: models\Joy_caption\ sams: F:\AI\External models\ComfyUI\models\sams blip: models\blip\ CogVideo: models\CogVideo\ xlabs: F:\AI\External models\ComfyUI\models\xlabs instantid: F:\AI\External models\ComfyUI\models\instantid CatVTON: F:\AI\External models\ComfyUI\models\CatVTON custom_nodes: custom_nodes/ download_model_base: models base_path: F:\AI\ComfyUI So Why comfy keeps downloading some of the models (like LLM) to it's root folder C:\Users\farey\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\models ...and althoug I have some of the models installed in my default or extra folder it keeps giving me errors that it can't find the model in the root location: Error no file named diffusion_pytorch_model.bin found in directory C:\Users\farey\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\models\CatVTON\sd-vae-ft-mse. I have this issue with the catVTON model. It did not see it in my default location specified during the installation, so I moved the models to "extra folder" and updated the .yaml file and still no result. It started seing the model when I moved it to it's root file but now it is screaming because it can't find .vae file in the same location... Why is this happening? Is there any way to keep everything simple and tidy??? All I wanted is to be able to keep all the files in my default location: F:\AI\ComfyUI and all common models that I could share with other apps in F:\AI\External models\ComfyUI\models How do I solve it? How do I stop comfy from downloading some of the models and looking for the models in the root installation folder? ┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-747-feat-Add-base-directory-argument-for-ComfyUI-1896d73d36508193a055cc4949e23f4e) by [Unito](https://www.unito.io)
bsakaguchi 2026-10-31 22:10:15 +00:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 28, 2025):

To resolve the issue of ComfyUI downloading models to the root installation folder and not recognizing models in your specified directories, you need to ensure that your configuration file is correctly set up. Here are some steps you can take:

  1. Verify Configuration Paths: Make sure that all paths in your configuration file are correctly specified and point to the intended directories. It seems like you have already done this, but double-check for any typos or incorrect paths.

  2. Set Base Paths Correctly: Ensure that the base_path and download_model_base are set to your desired default location. For example:

    comfyui_desktop:
      base_path: F:\AI\ComfyUI
      download_model_base: F:\AI\ComfyUI\models
    
  3. Check for Conflicting Settings: Ensure there are no conflicting settings in other configuration files that might override your specified paths.

  4. Update Model Paths: If you have moved models to a new location, make sure to update any references to these models in the configuration file. This includes ensuring that the paths for specific models like CatVTON are correctly set.

  5. Prevent Downloads to Root: To prevent ComfyUI from downloading models to the root folder, ensure that the download_model_base is set to your desired directory. If ComfyUI still downloads to the root, there might be a default setting or fallback mechanism causing this behavior.

  6. Check for Errors: Look for any error messages in the logs that might indicate why ComfyUI is not recognizing the models in your specified paths. This can provide clues on what might be going wrong.

  7. Test with a Minimal Setup: Temporarily simplify your configuration to test if the issue persists. For example, set all paths to a single directory and see if ComfyUI behaves as expected. This can help identify if the issue is with specific paths or a broader configuration problem.

By ensuring that all paths are correctly set and there are no conflicting settings, you should be able to keep your models organized in your specified directories. If the issue persists, it might be worth checking for any updates or patches to ComfyUI that address this behavior.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

<!-- gh-comment-id:2619286087 --> @dosubot[bot] commented on GitHub (Jan 28, 2025): <!-- Answer --> To resolve the issue of ComfyUI downloading models to the root installation folder and not recognizing models in your specified directories, you need to ensure that your configuration file is correctly set up. Here are some steps you can take: 1. **Verify Configuration Paths**: Make sure that all paths in your configuration file are correctly specified and point to the intended directories. It seems like you have already done this, but double-check for any typos or incorrect paths. 2. **Set Base Paths Correctly**: Ensure that the `base_path` and `download_model_base` are set to your desired default location. For example: ```yaml comfyui_desktop: base_path: F:\AI\ComfyUI download_model_base: F:\AI\ComfyUI\models ``` 3. **Check for Conflicting Settings**: Ensure there are no conflicting settings in other configuration files that might override your specified paths. 4. **Update Model Paths**: If you have moved models to a new location, make sure to update any references to these models in the configuration file. This includes ensuring that the paths for specific models like `CatVTON` are correctly set. 5. **Prevent Downloads to Root**: To prevent ComfyUI from downloading models to the root folder, ensure that the `download_model_base` is set to your desired directory. If ComfyUI still downloads to the root, there might be a default setting or fallback mechanism causing this behavior. 6. **Check for Errors**: Look for any error messages in the logs that might indicate why ComfyUI is not recognizing the models in your specified paths. This can provide clues on what might be going wrong. 7. **Test with a Minimal Setup**: Temporarily simplify your configuration to test if the issue persists. For example, set all paths to a single directory and see if ComfyUI behaves as expected. This can help identify if the issue is with specific paths or a broader configuration problem. By ensuring that all paths are correctly set and there are no conflicting settings, you should be able to keep your models organized in your specified directories. If the issue persists, it might be worth checking for any updates or patches to ComfyUI that address this behavior. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/ba711d39-5cbd-4065-8640-3c5aa1f76ced?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/ba711d39-5cbd-4065-8640-3c5aa1f76ced?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/ba711d39-5cbd-4065-8640-3c5aa1f76ced?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/ba711d39-5cbd-4065-8640-3c5aa1f76ced?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ba711d39-5cbd-4065-8640-3c5aa1f76ced?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/ba711d39-5cbd-4065-8640-3c5aa1f76ced?feedback_type=other)</sup>
Author
Owner

@JaFarey commented on GitHub (Jan 28, 2025):

I also noticed that if I use help/open folder/open extra_model_paths.yaml from inerface it actually opens "extra_models_config.yaml" in C:\Users\farey\AppData\Roaming\ComfyUI, and the "extra_model_paths.yaml" file is set as .exaple file is in other directory: C:\Users\farey\AppData\Local\Programs@comfyorgcomfyui-electron\resources\ComfyUI

Why is that? Which one should I update then?
Are you planning to simplify it? ....and how to set these files properly to avoid 4 different locations mismatch:
Can you implement ui based feature in where would be possible simply pick extra locations folder and all the other models would be stored and downloaded automaticaly to the location selected during the installation?

<!-- gh-comment-id:2619421718 --> @JaFarey commented on GitHub (Jan 28, 2025): I also noticed that if I use help/open folder/open extra_model_paths.yaml from inerface it actually opens "extra_models_config.yaml" in C:\Users\farey\AppData\Roaming\ComfyUI, and the "extra_model_paths.yaml" file is set as .exaple file is in other directory: C:\Users\farey\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI Why is that? Which one should I update then? Are you planning to simplify it? ....and how to set these files properly to avoid 4 different locations mismatch: Can you implement ui based feature in where would be possible simply pick extra locations folder and all the other models would be stored and downloaded automaticaly to the location selected during the installation?
Author
Owner

@webfiltered commented on GitHub (Jan 28, 2025):

Hi there, just wanted to let you know that this is a priority for us. With the desktop app right now, things are a bit more complex, due in part to the way this has organically grown from its original state.

Please edit the file: extra_models_config.yaml in %APPDATA%\ComfyUI. You can find more details in the ComfyUI Desktop User Guide.

We have a lot of improvements planned in this area - including a UI to make this less troublesome.

I'll leave this issue open until it's resolved, if you don't mind; it helps give visibility into the actual issues that people are facing.

<!-- gh-comment-id:2619529456 --> @webfiltered commented on GitHub (Jan 28, 2025): Hi there, just wanted to let you know that this is a priority for us. With the desktop app right now, things are a bit more complex, due in part to the way this has organically grown from its original state. Please edit the file: `extra_models_config.yaml` in `%APPDATA%\ComfyUI`. You can find more details in the [ComfyUI Desktop User Guide](https://comfyorg.notion.site/ComfyUI-Desktop-User-Guide-1146d73d365080a49058e8d629772f0a#1836d73d365080c6a62dc493274f1f43). We have a lot of improvements planned in this area - including a UI to make this less troublesome. I'll leave this issue open until it's resolved, if you don't mind; it helps give visibility into the actual issues that people are facing.
Author
Owner

@JaFarey commented on GitHub (Jan 28, 2025):

Sure. We can keep it open.
Maybe it will be helpful to the others too.
Thank you.

<!-- gh-comment-id:2619918433 --> @JaFarey commented on GitHub (Jan 28, 2025): Sure. We can keep it open. Maybe it will be helpful to the others too. Thank you.
Author
Owner

@JaFarey commented on GitHub (Jan 28, 2025):

Well. I do not know why it is happening, but although I have updated my extra_model_paths file with this path to CatVTON model:
CatVTON: F:\AI\External models\ComfyUI\models\CatVTON, I am still getting the error that the model is not in the root directory.
Other models like checkpoints or loras are being detected there with no issues...

Image

<!-- gh-comment-id:2619941528 --> @JaFarey commented on GitHub (Jan 28, 2025): Well. I do not know why it is happening, but although I have updated my extra_model_paths file with this path to CatVTON model: CatVTON: F:\AI\External models\ComfyUI\models\CatVTON, I am still getting the error that the model is not in the root directory. Other models like checkpoints or loras are being detected there with no issues... ![Image](https://github.com/user-attachments/assets/8c97ebda-19e1-4237-bf56-e976363003cf)
Author
Owner

@webfiltered commented on GitHub (Jan 28, 2025):

It is very likely that the custom node pack looking for this model was been written to look for it in a hard-coded location. Do you know which extension is providing that node?

<!-- gh-comment-id:2619986814 --> @webfiltered commented on GitHub (Jan 28, 2025): It is very likely that the custom node pack looking for this model was been written to look for it in a hard-coded location. Do you know which extension is providing that node?
Author
Owner

@JaFarey commented on GitHub (Jan 28, 2025):

https://github.com/chflame163/ComfyUI_CatVTON_Wrapper

<!-- gh-comment-id:2620014488 --> @JaFarey commented on GitHub (Jan 28, 2025): https://github.com/chflame163/ComfyUI_CatVTON_Wrapper
Author
Owner

@JaFarey commented on GitHub (Jan 28, 2025):

It stubbornly looking for this file where it is not supposed to.
It could either look for it in my defined places.
How do I change it.?

Image

<!-- gh-comment-id:2620057093 --> @JaFarey commented on GitHub (Jan 28, 2025): It stubbornly looking for this file where it is not supposed to. It could either look for it in my defined places. How do I change it.? ![Image](https://github.com/user-attachments/assets/01f8f022-b9a9-41bc-9cce-907d3846f322)
Author
Owner

@webfiltered commented on GitHub (Jan 28, 2025):

The only way to do this right now is to edit some code:

github.com/chflame163/ComfyUI_CatVTON_Wrapper@e2ae9b62c5/py/cat_vton.py (L38C37-L38C60)

This is saying "look in the models directory next to ComfyUI's main.py". You could simply change it to point wherever you please.

We have an update already in progress that will resolve this issue, but depending on testing, it may be a few days before it is released.

<!-- gh-comment-id:2620111159 --> @webfiltered commented on GitHub (Jan 28, 2025): The only way to do this right now is to edit some code: https://github.com/chflame163/ComfyUI_CatVTON_Wrapper/blob/e2ae9b62c53a7c2e009f2448975c6909c83f73b5/py/cat_vton.py#L38C37-L38C60 This is saying "look in the models directory next to ComfyUI's main.py". You could simply change it to point wherever you please. We have an update already in progress that will resolve this issue, but depending on testing, it may be a few days before it is released.
Author
Owner

@JaFarey commented on GitHub (Jan 29, 2025):

Thank you.
I appreciate your help.

<!-- gh-comment-id:2620320587 --> @JaFarey commented on GitHub (Jan 29, 2025): Thank you. I appreciate your help.
Author
Owner

@robinjhuang commented on GitHub (Jan 29, 2025):

@webfiltered This PR adds the latest ComfyUI to desktop, so we can make the change to add the base_path cli-arg now :)

https://github.com/Comfy-Org/desktop/pull/771

<!-- gh-comment-id:2622876541 --> @robinjhuang commented on GitHub (Jan 29, 2025): @webfiltered This PR adds the latest ComfyUI to desktop, so we can make the change to add the base_path cli-arg now :) https://github.com/Comfy-Org/desktop/pull/771
Author
Owner

@JaFarey commented on GitHub (Jan 30, 2025):

I just noticed that it is doing the same with Florence2 LLM models. Keeps downloading them to the root although I have changed download models and LLM models location :(

<!-- gh-comment-id:2623348094 --> @JaFarey commented on GitHub (Jan 30, 2025): I just noticed that it is doing the same with Florence2 LLM models. Keeps downloading them to the root although I have changed download models and LLM models location :(
Author
Owner

@robinjhuang commented on GitHub (Feb 5, 2025):

We have merged this PR that addresses this and will make a release soon!
github.com/Comfy-Org/desktop@1fe0ee6e6d

<!-- gh-comment-id:2637970786 --> @robinjhuang commented on GitHub (Feb 5, 2025): We have merged this PR that addresses this and will make a release soon! https://github.com/Comfy-Org/desktop/commit/1fe0ee6e6d1fb6f35481cc63c2910aff6c522b2e
Author
Owner

@robinjhuang commented on GitHub (Feb 9, 2025):

Can you try the latest 0.4.18! Should have fixed this issue

<!-- gh-comment-id:2646067359 --> @robinjhuang commented on GitHub (Feb 9, 2025): Can you try the latest 0.4.18! Should have fixed this issue
Author
Owner

@JaFarey commented on GitHub (Feb 9, 2025):

Image

Image

Still does not see the models in this location...

<!-- gh-comment-id:2646300051 --> @JaFarey commented on GitHub (Feb 9, 2025): ![Image](https://github.com/user-attachments/assets/f7c60378-5273-4ae1-b417-defe30021204) ![Image](https://github.com/user-attachments/assets/7cc1a0b4-c390-4f99-a984-bb79f93dae95) Still does not see the models in this location...
Author
Owner

@webfiltered commented on GitHub (Feb 9, 2025):

github.com/kijai/ComfyUI-Florence2@dffd12506d/nodes.py (L152)

That custom node is explicitly reading one single directory. In your config, it will only ever read the models from F:\AI\ComfyUI\models\LLM.

<!-- gh-comment-id:2646440187 --> @webfiltered commented on GitHub (Feb 9, 2025): https://github.com/kijai/ComfyUI-Florence2/blob/dffd12506d50f0540b8a7f4b36a05d4fb5fed2de/nodes.py#L152 That custom node is explicitly reading one single directory. In your config, it will only ever read the models from `F:\AI\ComfyUI\models\LLM`.
Author
Owner

@dosubot[bot] commented on GitHub (May 11, 2025):

Hi, @JaFarey. I'm Dosu, and I'm helping the desktop team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You requested a feature to specify a base directory for model storage using a --base-directory argument.
  • Active discussion included my detailed configuration steps and webfiltered's confirmation of planned UI improvements.
  • You encountered issues with models not being recognized, attributed to hard-coded paths in custom nodes.
  • Robinjhuang mentioned a PR addressing these issues, and a new release (0.4.18) was suggested as a potential fix.
  • Despite the new release, you reported continued difficulties.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the desktop repository by commenting here.
  • If no updates are provided, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:2869954309 --> @dosubot[bot] commented on GitHub (May 11, 2025): Hi, @JaFarey. I'm [Dosu](https://dosu.dev), and I'm helping the desktop team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You requested a feature to specify a base directory for model storage using a `--base-directory` argument. - Active discussion included my detailed configuration steps and webfiltered's confirmation of planned UI improvements. - You encountered issues with models not being recognized, attributed to hard-coded paths in custom nodes. - Robinjhuang mentioned a PR addressing these issues, and a new release (0.4.18) was suggested as a potential fix. - Despite the new release, you reported continued difficulties. **Next Steps:** - Please let us know if this issue is still relevant to the latest version of the desktop repository by commenting here. - If no updates are provided, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/desktop#221
No description provided.