From 20815cbb565ffeeae25d9b8a79bd4770a1bd2bc9 Mon Sep 17 00:00:00 2001 From: christian-byrne Date: Fri, 19 Jul 2024 15:18:01 -0700 Subject: [PATCH] Annotate content_types as Literal["image", "video", "audio"] --- folder_paths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folder_paths.py b/folder_paths.py index fd59a88ba..5c16f0d28 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -2,7 +2,7 @@ import os import time import mimetypes import logging -from typing import Set, List, Dict, Tuple +from typing import Set, List, Dict, Tuple, Literal supported_pt_extensions: Set[str] = set(['.ckpt', '.pt', '.bin', '.pth', '.safetensors', '.pkl']) @@ -89,7 +89,7 @@ def get_directory_by_type(type_name): return get_input_directory() return None -def filter_files_content_types(files: List[str], content_types: List[str]) -> List[str]: +def filter_files_content_types(files: List[str], content_types: Literal["image", "video", "audio"]) -> List[str]: """ Example: files = os.listdir(folder_paths.get_input_directory())