mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-02-01 03:19:46 +00:00
15 lines
493 B
Python
15 lines
493 B
Python
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 |