ComfyUIのモデルの参照ディレクトリを別のディレクトリに変更する

ComfyUIのモデルの参照ディレクトリを別のディレクトリに変更する手順を紹介します。

はじめに

こちらの記事でComfyUIのインストールをしました。通常の手順では、モデルファイルをダウンロードして、 ComfyUIのモデルディレクトリに配置しますが、すでに Stable Diffusion Web UIがインストールされており、 モデルがダウンロードされている場合は、Stable Diffusion Web UIのモデルディレクトリを参照したい場合があります。

この記事では、ComfyUIのモデルの参照ディレクトリを別のディレクトリ(Stable Diffusion Web UIのディレクトリ)に変更する 手順を紹介します。

手順

extra_model_paths.yaml.sample ファイルを変更し、extra_model_paths.yaml ファイルとして保存します。

extra_model_paths.yaml.sampleの場所

extra_model_paths.yaml.sampleファイルは以下の位置にあります。

Protable版の場合
(ComfyUIの配置ディレクトリ)\ComfyUI\extra_model_paths.yaml.example
デスクトップアプリ版の場合
デフォルトのパスでインストールした場合は以下になります。
C:\Users\(ユーザー名)\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\extra_model_paths.yaml.example

ComfyUIのモデルの参照ディレクトリを別のディレクトリに変更する:画像1

extra_model_paths.yaml の編集

extra_model_paths.yaml.sample (変更前)
#Rename this to extra_model_paths.yaml and ComfyUI will load it


#config for a1111 ui
#all you have to do is change the base_path to where yours is installed
a111:
    base_path: path/to/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

#config for comfyui
#your base path should be either an existing comfy install or a central folder where you store all of your models, loras, etc.

#comfyui:
#     base_path: path/to/comfyui/
#     # You can use is_default to mark that these folders should be listed first, and used as the default dirs for eg downloads
#     #is_default: true
#     checkpoints: models/checkpoints/
#     clip: models/clip/
#     clip_vision: models/clip_vision/
#     configs: models/configs/
#     controlnet: models/controlnet/
#     diffusion_models: |
#                  models/diffusion_models
#                  models/unet
#     embeddings: models/embeddings/
#     loras: models/loras/
#     upscale_models: models/upscale_models/
#     vae: models/vae/

#other_ui:
#    base_path: path/to/ui
#    checkpoints: models/checkpoints
#    gligen: models/gligen
#    custom_nodes: path/custom_nodes


変更後の例です。base_path 部分をStable Diffusion WebUIの配置ディレクトリに変更します。

extra_model_paths.yaml (変更後の例)
#config for a1111 ui
#all you have to do is change the base_path to where yours is installed
a111:
    base_path: D:\Image-Gen\stable-diffusion-webui-master-sdxl\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


ComfyUIのモデルの参照ディレクトリを別のディレクトリに変更する:画像2


変更後、ComfyUIを再起動します。モデルの一覧等でStable Diffusion Web UIのモデルと同じものが表示されれば、正しく設定できています。

ComfyUIのモデルの参照ディレクトリを別のディレクトリに変更する:画像3

AuthorPortraitAlt
著者
iPentecのメインデザイナー
Webページ、Webクリエイティブのデザインを担当。PhotoshopやIllustratorの作業もする。 最近は生成AIの画像生成の沼に沈んでいる。
作成日: 2024-05-01
Copyright © 1995–2025 iPentec all rights reserverd.