Comfy-Org/ComfyUI · error · ValueError

Keyframe times must increase; got {times}.

Error message

Keyframe times must increase; got {times}.

What it means

Keyframe times define the order images appear in the FLUX 3 clip and must be strictly increasing. zip(times, times[1:]) checks every adjacent pair; equal or decreasing times desynchronize image-to-time mapping and are rejected.

Source

Thrown at comfy_api_nodes/nodes_bfl.py:1070

        _flux3_validate_image(tensor)
    return flat


def _flux3_parse_times(value: str, image_count: int, duration: int | str) -> list[float]:
    """Parse one keyframe time in seconds per image: increasing, inside the clip."""
    parts = [part.strip() for part in value.split(",") if part.strip()]
    if len(parts) != image_count:
        raise ValueError(
            f"Give one time per keyframe image: got {len(parts)} time(s) for {image_count} image(s)."
        )
    try:
        times = [float(part) for part in parts]
    except ValueError as exc:
        raise ValueError(f"Keyframe times must be numbers in seconds, comma-separated; got '{value}'.") from exc
    if not all(math.isfinite(time) for time in times):
        raise ValueError(f"Keyframe times must be finite numbers in seconds; got '{value}'.")
    if any(later <= earlier for earlier, later in zip(times, times[1:])):
        raise ValueError(f"Keyframe times must increase; got {times}.")
    if times[0] < 0:
        raise ValueError(f"Keyframe times cannot be negative; got {times[0]}.")
    cap = _FLUX3_MAX_DURATION if duration == "auto" else int(duration)
    if times[-1] > cap:
        raise ValueError(f"Keyframe time {times[-1]}s is past the end of a {cap}s clip.")
    return times


class Flux3VideoNodeBase(IO.ComfyNode):
    """Shared widgets, request plumbing and polling for the FLUX 3 generation modes."""

    RATE_HD: float
    RATE_FHD: float

    @classmethod
    def common_inputs(cls) -> list:
        return [
            IO.Combo.Input(

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Sort and deduplicate: times = sorted(set(times)).
  2. Space them intentionally, e.g. evenly: [i * cap / (n - 1) for i in range(n)].
  3. Double-check hand-edited strings for duplicated values.

Example fix

# before
keyframe_times = "5, 2, 8"  # ValueError: not increasing

# after
times = sorted({5, 2, 8})  # [2, 5, 8]
keyframe_times = ", ".join(str(t) for t in times)
Defensive patterns

Strategy: validation

Validate before calling

times = sorted(set(float(p) for p in value.split(",")))
assert all(b > a for a, b in zip(times, times[1:])), "times must strictly increase"

Type guard

def times_strictly_increasing(times: list[float]) -> bool:
    return all(b > a for a, b in zip(times, times[1:]))

Prevention

When it happens

Trigger: Passing duplicate times ('2, 2, 5'), unsorted times ('5, 2, 8'), or times generated without sorting.

Common situations: Copying a repeated default value for every image; building times from a dict or set whose iteration order is not sorted.

Related errors


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