1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Add a way for nodes to validate their own inputs.

This commit is contained in:
comfyanonymous
2023-04-23 16:03:26 -04:00
parent f7a8218814
commit ccad603b2e
4 changed files with 38 additions and 23 deletions

View File

@@ -71,7 +71,7 @@ def get_directory_by_type(type_name):
# determine base_dir rely on annotation if name is 'filename.ext [annotation]' format
# otherwise use default_path as base_dir
def touch_annotated_filepath(name):
def annotated_filepath(name):
if name.endswith("[output]"):
base_dir = get_output_directory()
name = name[:-9]
@@ -88,7 +88,7 @@ def touch_annotated_filepath(name):
def get_annotated_filepath(name, default_dir=None):
name, base_dir = touch_annotated_filepath(name)
name, base_dir = annotated_filepath(name)
if base_dir is None:
if default_dir is not None:
@@ -100,7 +100,7 @@ def get_annotated_filepath(name, default_dir=None):
def exists_annotated_filepath(name):
name, base_dir = touch_annotated_filepath(name)
name, base_dir = annotated_filepath(name)
if base_dir is None:
base_dir = get_input_directory() # fallback path