INNER CODE UNIT · Python

validate_workflow_models

runpod-workers/worker-comfyui · handler.py:566

def validate_workflow_models(workflow):
    """
    Pre-flight check that every model file referenced by the workflow exists.

    Walks the workflow graph and, for every known model loader node, verifies
    the referenced filename against what ComfyUI actually has registered
    (/object_info). This surfaces every missing model in one clear error
    *before* the workflow is submitted, instead of ComfyUI's cryptic
    'Value not in list' validation crash after the cold start.

    If /object_info can't be fetched, validation is skipped (fail open): a
    transient error must not block a valid workflow, and queue_workflow's
    400 handling remains as the backstop.

    Args:
        workflow (dict): The workflow graph ({node_id: {class_type, inputs}}).

    Returns:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…