WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.1k stars 162 forks source link

Text Parse A1111 Embeddings doesn't find embeddings in extra_model_paths.yaml #130

Open AntitrustEnthusiast opened 1 year ago

AntitrustEnthusiast commented 1 year ago

ComfyUI has a very useful feature to share model directories with A1111, saving huge amounts of disk space for large model collections.

example extra_model_paths.yaml placed in the root ComfyUI directory.

a111:
    base_path: ~/dev/stable-diffusion-webui

    checkpoints: models/Stable-diffusion
    configs: models/Stable-diffusion
    vae: models/VAE
    loras: |
         models/Lora
         models/LyCORIS
    upscale_models: |
                  models/ESRGAN
                  models/RealESRGAN
                  models/SwinIR
    embeddings: embeddings
    hypernetworks: models/hypernetworks
    controlnet: models/ControlNet

When you do this, ComfyUI will properly find embeddings in the stable-diffusion-webui directory. But the Text Parse A1111 Embeddings node doesn't seem to find them. It only works if I manually copy the embedding to the ComfyUI/models/embeddings directory.

If possible, please support this extra config option to avoid having to duplicate/hardlink embedding directories. Thanks!

Steps to reproduce:

  1. Add above yaml file in ComfyUI root directory as extra_model_paths.yaml, with correct value for base_path
  2. Add 1 embedding to stable-diffusion-webui/embeddings, and a different embedding to ComfyUI/models/embeddings
  3. Add both embedding names to Text Parse A1111 Embeddings
  4. Generate

Expected Results:

  1. Text Parse A1111 Embeddings finds the embeddings in ComfyUI/models/embeddings and stable-diffusion-webui/embeddings

Actual Results:

  1. Text Parse A1111 Embeddings only finds embeddings in ComfyUI/models/embeddings
WASasquatch commented 1 year ago

See patch: https://github.com/WASasquatch/was-node-suite-comfyui/commit/796ae04dcd526d5301d6908defb0a4df75fa9004

AntitrustEnthusiast commented 1 year ago

Thanks for the quick fix! Confirmed working for embeddings in the root stable-diffusion-webui/embeddings folder.

There is one minor issue, not sure I'd even call it a bug. And it may not be worth the complexity required to fix it.

Basically: the built-in ComfyUI text encoder will find embedding:laugh512 whether it's in either of these folders:

But Text Parse A1111 Embeddings only seems to check the root directory. Possibly true of the ComfyUI/models/embeddings folder too, but I haven't checked. If fixed, it would mean fully compatible prompts between A1111 and ComfyUI outside LORAs.

No worries if it's out of scope, this issue can be closed if so!

WASasquatch commented 1 year ago

I'll probably have to write out the logic myself. Comfy is lazy on adding useful tools for developers.