comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
53.13k stars 5.62k forks source link

Unable to use Comfy UI and invoke AI together #1633

Open Void2258 opened 1 year ago

Void2258 commented 1 year ago

While comfy has the extra_model_paths.yaml, the way it expects the files to be organized is incompatible with the way Invoke organizes files. For example, invoke maintains 2 different model locations: one for automatically downloaded items (ie SDXL base models) and one for manually downloaded models (ie from civit AI), not necessarily even in the same folder tree. Same for other file types. Comfy seems to assume everything is under one overarching master folder (Base Path). Also, a number of files like vaes are handled silently by Invoke, so their location isn't even something most users know about. The extra model settings seem to be set up to accommodate A1111 exclusively.

jn-jairo commented 1 year ago

I am curious, why does ComfyUI need to adapt to other softwares standard and not the other way around?

42lux commented 1 year ago

You can set folders yourself... look for extra folder paths.

Void2258 commented 1 year ago

The current extra_model_paths.yaml is explicitly set up to work with A1111. If there is a special compatibility file for A1111, it's not unreasonable to see if either it can be generalized to work with other programs too or we can have one for Invoke as well.

comfyanonymous commented 1 year ago

You don't have to set a base_path you can set absolute paths like this for example:

checkpoints: /mnt/fast_ssd/share/models/

Assuming the other UI has folders with checkpoints/etc.. in them it should be easy to point the config to them like that.

The reason the example config is for a1111 is because that's what people have and I don't know the folder structure of other UIs.

Void2258 commented 1 year ago

I don't actually use the invoke internal structure. I have everything in an external folder (this way it is safe from accidentally being deleted whenever I need to reinstall Invoke), including inputs and outputs. Invoke can set these folders in the UI and use things it finds there.

I was trying to find something similar in Comfy, either in the settings or using the yaml file. I have now been able to get it to work somewhat (models, vaes and such now being found), but there seems to not be a way to do all of it (inputs and outputs are command options that have to passed every time you start the program rather than a setting). Below is the relevant part of the yaml so you can see what I mean.

So the folder structure is clear, H:\ComfyUI_windows_portable is comfy's folder, and H:\Invoke_AI is invoke's folder. Invoke outputs go to H:\Invoke_AI_outputs and I want comfy outputs to go to H:\ComfyUI_outputs. All the folders below for checkpoints, etc. are shared by both programs (though invoke does have some it comes with like SD1.5 base that are inside the folder).

other_ui:  <--- NOTE: it is not clear that this line must be uncommented or the startup will fail. Filed a bug here to find that out.
#    base_path: path/to/ui
    checkpoints: H:\Stable_diffusion_files\Stable_diffusion_models
    vae: H:\Stable_diffusion_files\VAE
    loras: H:\Stable_diffusion_files\loras
    embeddings: H:\Stable_diffusion_files\embeddings
    controlnet: H:\Stable_diffusion_files\controlnet
    #--output-directory: H:\ComfyUI_outputs #must be changed in call
#    gligen: models/gligen
#    custom_nodes: path/custom_nodes <--- not sure how to use this 

Note that ideally it would also be possible to have a second folder not shared between the programs for extra copies of the items invoke comes with, so invoke won''t find the same file twice (ie SDXL base model being both inside invoke directory and in models for comfy to find).

I hope this clarifies what I meant.