Comfy-Org/ComfyUI · error · ValueError

Spreading images across the clip needs an explicit…

Error message

Spreading {len(images)} images across the clip needs an explicit duration: set duration, or place the images yourself with 'at times'.

What it means

The FLUX.3 keyframe node spreads 3+ keyframes evenly between the first and last frame, which requires a known clip length. When duration is 'auto' the API cannot compute even spacing, so the node raises this before uploading anything.

Solutions

  1. Set the duration widget to an explicit value (e.g. '5s' or whatever the combo offers) so spread math has a clip length.
  2. Or switch placement to 'at times' and give explicit timestamps for each keyframe via _flux3_parse_times.
  3. Or reduce to 2 keyframes, which use first/last frame positions and work with 'auto'.

Example fix

// before
placement = {'placement': 'spread', 'times': ''}
duration = 'auto'
// after
placement = {'placement': 'spread', 'times': ''}
duration = '5s'
Defensive patterns

Strategy: validation

Validate before calling

n = len(collected_keyframes)
if n >= 3 and placement['placement'] != 'at times' and duration == 'auto':
    raise UserError('Set an explicit duration, or use at-times placement, before running.')

Prevention

When it happens

Trigger: Keyframes Autogrow has >= 3 images, placement mode is the default 'spread', and the duration widget is left on 'auto' (fields['duration'] == 'auto').

Common situations: User chains several keyframes assuming the model picks its own length; duration widget forgotten after copying a 2-keyframe workflow that worked (2 images map to first/last frames and are exempt).

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/64e7361f09032d92. Report an issue: GitHub.

Appendix: source

Thrown at comfy_api_nodes/nodes_bfl.py:1333

        keyframes: IO.Autogrow.Type,
        placement: dict,
        aspect_ratio: str,
        duration: str,
        resolution: str,
        generate_audio: bool,
        safety_tolerance: int,
        seed: int,
    ) -> IO.NodeOutput:
        fields = cls.common_fields(prompt, aspect_ratio, duration, resolution, generate_audio, safety_tolerance)
        images = _flux3_collect_images(keyframes, "keyframes")
        if not images:
            raise ValueError("Connect at least one keyframe image.")
        times = None
        if placement["placement"] == "at times":
            times = _flux3_parse_times(placement["times"], len(images), fields["duration"])
        elif len(images) >= 3 and fields["duration"] == "auto":
            # spread images land evenly between the first and last, which needs a known length
            raise ValueError(
                f"Spreading {len(images)} images across the clip needs an explicit duration: "
                "set duration, or place the images yourself with 'at times'."
            )
        urls = await upload_images_to_comfyapi(
            cls, images, max_images=_FLUX3_MAX_IMAGES, wait_label="Uploading keyframes"
        )
        request = Flux3ImageToVideoRequest(
            keyframes=list(zip(times, urls)) if times is not None else urls,
            **fields,
        )
        return await _flux3_execute(cls, request)


class Flux3VideoContinuationNode(Flux3VideoNodeBase):
    RATE_HD = 0.5863
    RATE_FHD = 0.7579

    @classmethod

View on GitHub (pinned to 1c6d8d45b3)