{"record":{"id":"9224ec0427f1f095","repo":"Comfy-Org/ComfyUI","slug":"unknown-strategy-strategy","errorCode":null,"errorMessage":"Unknown strategy: {strategy}","messagePattern":"Unknown strategy: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_dataset.py","lineNumber":1266,"sourceCode":"            return io.NodeOutput(\n                video.as_trimmed(0.0, num_frames / fps, strict_duration=False)\n            )\n        if strategy == \"tail\":\n            start_t = (total_frames - num_frames) / fps\n            return io.NodeOutput(\n                video.as_trimmed(start_t, num_frames / fps, strict_duration=False)\n            )\n\n        if strategy == \"uniform\":\n            if num_frames == 1:\n                indices = [total_frames // 2]\n            else:\n                indices = [round(i * (total_frames - 1) / (num_frames - 1)) for i in range(num_frames)]\n        elif strategy == \"random\":\n            rng = np.random.RandomState(seed % (2**32 - 1))\n            indices = sorted(rng.choice(total_frames, size=num_frames, replace=False).tolist())\n        else:\n            raise ValueError(f\"Unknown strategy: {strategy}\")\n\n        return io.NodeOutput(_decode_selected_frames(video, indices))\n\n\nclass VideoTemporalCropNode(io.ComfyNode):\n    \"\"\"Crop a continuous range of frames from a video (fully lazy).\"\"\"\n\n    @classmethod\n    def define_schema(cls):\n        return io.Schema(\n            node_id=\"VideoTemporalCrop\",\n            search_aliases=[\"crop\", \"crop video\", \"temporal crop\", \"truncate video\"],\n            display_name=\"Crop Video (Temporal)\",\n            category=\"video/transform\",\n            description=\"Crop a continuous range of frames from a video.\",\n            is_experimental=True,\n            inputs=[\n                io.Video.Input(\"video\", tooltip=\"Input video.\"),","sourceCodeStart":1248,"sourceCodeEnd":1284,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_dataset.py#L1248-L1284","documentation":"Thrown by the video frame-sampling node when the 'strategy' input is neither 'uniform' nor 'random'. The node dispatches on an if/elif chain over the strategy string and treats anything else as a programming/validation error. In practice only a mismatched frontend enum, a hand-edited workflow JSON, or a custom node sending a raw string reaches it.","triggerScenarios":"Calling the node with strategy set to a value outside {'uniform','random'}: e.g. a workflow file saved with 'evenly', 'stride', or a typo like 'unifrom', or a script constructing the prompt dict with an arbitrary strategy string.","commonSituations":"Hand-edited or LLM-generated workflow JSON with a wrong enum value; workflows migrated from another sampler node whose strategy names differ ('first', 'last', 'evenly'); custom frontends that do not enforce the combo options.","solutions":["Set strategy to 'uniform' (evenly spaced frames) or 'random' (seeded random selection).","Open the node in the ComfyUI UI and re-pick the strategy from the dropdown, then re-save the workflow.","If you are generating the prompt programmatically, validate strategy against ['uniform','random'] before queueing."],"exampleFix":"// before (workflow JSON)\n\"inputs\": { \"strategy\": \"evenly\", ... }\n// after\n\"inputs\": { \"strategy\": \"uniform\", ... }","handlingStrategy":"validation","validationCode":"VALID_STRATEGIES = {'uniform', 'random'}\nassert strategy in VALID_STRATEGIES, f'strategy must be one of {sorted(VALID_STRATEGIES)}, got {strategy!r}'","typeGuard":"def is_valid_strategy(s: str) -> bool:\n    return s in {'uniform', 'random'}","tryCatchPattern":null,"preventionTips":["Always pick enum inputs from the node dropdown rather than typing them into workflow JSON.","When generating prompts programmatically, validate enum fields against the node's advertised options before queueing.","Avoid hand-porting strategy names from other sampler nodes."],"tags":["comfyui","node-input","enum-validation","video"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}