Comfy-Org/ComfyUI · error · ValueError
Unsupported resize type: {selected_type}
Error message
Unsupported resize type: {selected_type} What it means
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.
Source
Thrown at comfy_extras/nodes_post_processing.py:512
if selected_type == ResizeType.SCALE_BY:
return io.NodeOutput(scale_by(input, resize_type["multiplier"], scale_method))
elif selected_type == ResizeType.SCALE_DIMENSIONS:
return io.NodeOutput(scale_dimensions(input, resize_type["width"], resize_type["height"], scale_method, resize_type["crop"]))
elif selected_type == ResizeType.SCALE_LONGER_DIMENSION:
return io.NodeOutput(scale_longer_dimension(input, resize_type["longer_size"], scale_method))
elif selected_type == ResizeType.SCALE_SHORTER_DIMENSION:
return io.NodeOutput(scale_shorter_dimension(input, resize_type["shorter_size"], scale_method))
elif selected_type == ResizeType.SCALE_WIDTH:
return io.NodeOutput(scale_dimensions(input, resize_type["width"], 0, scale_method))
elif selected_type == ResizeType.SCALE_HEIGHT:
return io.NodeOutput(scale_dimensions(input, 0, resize_type["height"], scale_method))
elif selected_type == ResizeType.SCALE_TOTAL_PIXELS:
return io.NodeOutput(scale_total_pixels(input, resize_type["megapixels"], scale_method))
elif selected_type == ResizeType.MATCH_SIZE:
return io.NodeOutput(scale_match_size(input, resize_type["match"], scale_method, resize_type["crop"]))
elif selected_type == ResizeType.SCALE_TO_MULTIPLE:
return io.NodeOutput(scale_to_multiple_cover(input, resize_type["multiple"], scale_method))
raise ValueError(f"Unsupported resize type: {selected_type}")
def batch_images(images: list[torch.Tensor]) -> torch.Tensor | None:
if len(images) == 0:
return None
# first, get the max channels count
max_channels = max(image.shape[-1] for image in images)
# then, pad all images to have the same channels count
padded_images: list[torch.Tensor] = []
for image in images:
if image.shape[-1] < max_channels:
padded_images.append(torch.nn.functional.pad(image, (0,1), mode='constant', value=1.0))
else:
padded_images.append(image)
# resize all images to be the same size as the first image
resized_images: list[torch.Tensor] = []
first_image_shape = padded_images[0].shape
for image in padded_images:
if image.shape[1:] != first_image_shape[1:]:View on GitHub (pinned to 1c6d8d45b3)
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.
Defensive patterns
Strategy: validation
Validate before calling
# In API scripts, validate against the node's advertised options
info = requests.get('http://127.0.0.1:8188/object_info/ImageResize').json()
allowed = info['ImageResize']['input']['required']['resize_type'][0]
assert selected_type in allowed Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unknown context_schedule '{context_schedule}'.
- Unknown fuse_method '{fuse_method}'.
- {cls.__name__} does not have a NONE member to map None to
- Invalid {cls.__name__} string: '{value}'. Valid values are:
- Cannot convert type {type(value).__name__} to {cls.__name__}
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/da95e0f713982223.
Report an issue: GitHub.