ComfyUI, Stable-diffusion-webui 각각 모델 파일을 사용한다면 하드 용량을 많이 차지 하기 때문에 하나로 모아서 쓰는 방법을 찾아보고 여기 정리해 둡니다. (webui 기반 다른툴은 그냥 세팅에서 같은 경로 입력하면 적용됨)
1.폴더구조
![폴더구조](https://linsoo.pe.kr/wp-content/uploads/2024/12/스크린샷-2024-12-23-205026.png)
폴더 구조는 위와 같습니다. (이 구조를 유지하는 이유는 나중에 OS 재설치시 AI 폴더 통째로 백업&복원을 하면 바로 사용이 가능해서 그렇습니다)
2. 설정
ComfyUI 폴더에 보면 extra_model_paths.yaml.example 파일이 있습니다. 이 파일을 복사 후 extra_model_paths.yaml 으로 파일명 변경을 합니다.
#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
파일 내용은 위와 같은데 여기서 밑에 주석(#) 처리된 부분은 신경 쓸거 없고
#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: ../stable-diffusion-webui-amdgpu/ 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
이렇게 변경 해 줍니다. (혹시 폴더 이름이 다르다면 본인 경로에 맞게)
상대 경로로 해줘야 최상위 폴더명이 ai가 아니라 다른걸로 해도 잘 작동하게 됩니다.
3. 덤…
set COMMANDLINE_ARGS=--output-directory "%parent_path%outputs"
결과 폴더 지정은 실행배치파일 arg 값으로 바꿀 수 있습니다.
ComfyUI를 8845hs에서 굴리는 글도 조만간 올려보겠습니다.
답글 남기기