Spaces:
Paused
Paused
File size: 493 Bytes
3cc1e25 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import os
from typing import List
from toolkit.paths import COMFY_MODELS_PATH
def get_comfy_path(comfy_files: List[str]) -> str:
"""
Get the path to the first existing file in the COMFY_MODELS_PATH.
"""
if COMFY_MODELS_PATH is not None and comfy_files is not None and len(comfy_files) > 0:
for file in comfy_files:
file_path = os.path.join(COMFY_MODELS_PATH, file)
if os.path.exists(file_path):
return file_path
return None |