Comfy-Org/ComfyUI · error · ValueError

Astra 2 is limited to {AST2_MAX_FRAMES} input frames; video

Error message

Astra 2 is limited to {AST2_MAX_FRAMES} input frames; video has {n_frames}.

What it means

Topaz Astra 2 has a hard input frame cap (AST2_MAX_FRAMES) even without a prompt. The V2 video enhance execute calls video.get_frame_count() and raises ValueError when the count exceeds the constant, before any upload happens. This mirrors the provider-side model limit.

Source

Thrown at comfy_api_nodes/nodes_topaz.py:1065

            model_id = UPSCALER_MODELS_MAP[upscaler_choice]
            if model_id == "slc-1":
                filters.append(
                    VideoEnhancementFilter(
                        model=model_id,
                        creativity=upscaler_model["creativity"],
                        isOptimizedMode=True,
                    )
                )
            elif model_id == "ast-2":
                n_frames = video.get_frame_count()
                ast2_prompt = (upscaler_model["prompt"] or "").strip()
                if ast2_prompt and n_frames > AST2_MAX_FRAMES_WITH_PROMPT:
                    raise ValueError(
                        f"Astra 2 with a prompt is limited to {AST2_MAX_FRAMES_WITH_PROMPT} input frames "
                        f"(~15s @ 30fps); video has {n_frames}. Clear the prompt or shorten the clip."
                    )
                if n_frames > AST2_MAX_FRAMES:
                    raise ValueError(f"Astra 2 is limited to {AST2_MAX_FRAMES} input frames; video has {n_frames}.")
                realism = upscaler_model["realism"]
                filters.append(
                    VideoEnhancementFilter(
                        model=model_id,
                        creativity=upscaler_model["creativity"],
                        prompt=(ast2_prompt or None),
                        sharp=upscaler_model["sharp"],
                        realism=(realism if realism > 0 else None),
                    )
                )
            else:
                filters.append(VideoEnhancementFilter(model=model_id))
        if interpolation_choice != "Disabled":
            target_frame_rate = interpolation_model["interpolation_frame_rate"]
            filters.append(
                VideoFrameInterpolationFilter(
                    model=interpolation_choice,
                    slowmo=interpolation_model["interpolation_slowmo"],

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Trim or split the video so frame count <= AST2_MAX_FRAMES (remember: 60 fps hits the cap in half the seconds).
  2. Switch to a model without the frame cap (e.g. slc-1 or the default models) for long-form content.
  3. Reduce source frame rate before the node if the content allows it.
Defensive patterns

Strategy: validation

Validate before calling

if upscaler_model["upscaler_model"] == "ast-2" and video.get_frame_count() > AST2_MAX_FRAMES:
    raise ValueError("clip too long for ast-2; split it or pick another model")

Prevention

When it happens

Trigger: ast-2 selected as the upscaler model with a video longer than AST2_MAX_FRAMES (with an empty prompt).

Common situations: Enhancing minute-plus footage with Astra 2; 60 fps clips hitting the frame cap in half the wall-clock time expected; users who assume the limit is duration-based rather than frame-based.

Related errors


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