{"record":{"id":"da95e0f713982223","repo":"Comfy-Org/ComfyUI","slug":"unsupported-resize-type-selected-type","errorCode":null,"errorMessage":"Unsupported resize type: {selected_type}","messagePattern":"Unsupported resize type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_post_processing.py","lineNumber":512,"sourceCode":"        if selected_type == ResizeType.SCALE_BY:\n            return io.NodeOutput(scale_by(input, resize_type[\"multiplier\"], scale_method))\n        elif selected_type == ResizeType.SCALE_DIMENSIONS:\n            return io.NodeOutput(scale_dimensions(input, resize_type[\"width\"], resize_type[\"height\"], scale_method, resize_type[\"crop\"]))\n        elif selected_type == ResizeType.SCALE_LONGER_DIMENSION:\n            return io.NodeOutput(scale_longer_dimension(input, resize_type[\"longer_size\"], scale_method))\n        elif selected_type == ResizeType.SCALE_SHORTER_DIMENSION:\n            return io.NodeOutput(scale_shorter_dimension(input, resize_type[\"shorter_size\"], scale_method))\n        elif selected_type == ResizeType.SCALE_WIDTH:\n            return io.NodeOutput(scale_dimensions(input, resize_type[\"width\"], 0, scale_method))\n        elif selected_type == ResizeType.SCALE_HEIGHT:\n            return io.NodeOutput(scale_dimensions(input, 0, resize_type[\"height\"], scale_method))\n        elif selected_type == ResizeType.SCALE_TOTAL_PIXELS:\n            return io.NodeOutput(scale_total_pixels(input, resize_type[\"megapixels\"], scale_method))\n        elif selected_type == ResizeType.MATCH_SIZE:\n            return io.NodeOutput(scale_match_size(input, resize_type[\"match\"], scale_method, resize_type[\"crop\"]))\n        elif selected_type == ResizeType.SCALE_TO_MULTIPLE:\n            return io.NodeOutput(scale_to_multiple_cover(input, resize_type[\"multiple\"], scale_method))\n        raise ValueError(f\"Unsupported resize type: {selected_type}\")\n\ndef batch_images(images: list[torch.Tensor]) -> torch.Tensor | None:\n    if len(images) == 0:\n        return None\n    # first, get the max channels count\n    max_channels = max(image.shape[-1] for image in images)\n    # then, pad all images to have the same channels count\n    padded_images: list[torch.Tensor] = []\n    for image in images:\n        if image.shape[-1] < max_channels:\n            padded_images.append(torch.nn.functional.pad(image, (0,1), mode='constant', value=1.0))\n        else:\n            padded_images.append(image)\n    # resize all images to be the same size as the first image\n    resized_images: list[torch.Tensor] = []\n    first_image_shape = padded_images[0].shape\n    for image in padded_images:\n        if image.shape[1:] != first_image_shape[1:]:","sourceCodeStart":494,"sourceCodeEnd":530,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_post_processing.py#L494-L530","documentation":"Raised by the Resize image node when selected_type (a ResizeType enum) matches none of the handled resize strategies. Because selected_type is an enum value derived from the combo, this raise is effectively unreachable through the normal UI and only fires if the enum is extended without updating execute, or a crafted prompt supplies an unknown value.","triggerScenarios":"A workflow/API prompt supplying a resize type string that maps to no ResizeType member handled in execute; or a future ComfyUI version adds a ResizeType member without a branch here and an old/new node mismatch sends it through.","commonSituations":"Version-skew between frontend node definitions and backend executor; manually constructed enum values in JSON prompts; forks that add resize modes without patching the dispatch chain.","solutions":["Use a standard resize type from the node's combo (crop/resize/scale variants listed in /object_info).","Regenerate the workflow in the current UI version so enum values match the installed backend.","If maintaining a fork that adds a ResizeType member, add the matching elif branch."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# In API scripts, validate against the node's advertised options\ninfo = requests.get('http://127.0.0.1:8188/object_info/ImageResize').json()\nallowed = info['ImageResize']['input']['required']['resize_type'][0]\nassert selected_type in allowed","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-save workflows in the current ComfyUI version after upgrades to refresh enum values.","When forking and adding resize modes, always extend both the combo and the execute dispatch."],"tags":["resize","image-processing","enum","version-skew"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}