Comfy-Org/ComfyUI · error · ValueError

Astra 2 with a prompt is limited to {AST2_MAX_FRAMES_WITH_PR

Error message

Astra 2 with a prompt is limited to {AST2_MAX_FRAMES_WITH_PROMPT} input frames (~15s @ 30fps); video has {n_frames}. Clear the prompt or shorten the clip.

What it means

Topaz Astra 2 (ast-2) accepts an optional text prompt, but with a prompt the input video is capped at AST2_MAX_FRAMES_WITH_PROMPT frames (~15 s at 30 fps). The node reads the frame count via video.get_frame_count() and raises ValueError when the prompt is non-empty and the cap is exceeded, so users must drop the prompt or trim the clip.

Source

Thrown at comfy_api_nodes/nodes_topaz.py:1060

                    target_width = int(target_height * ar)
            if target_width % 2 != 0:
                target_width += 1
            if target_height % 2 != 0:
                target_height += 1
            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":

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Trim the video to <= AST2_MAX_FRAMES_WITH_PROMPT frames (~15 s @ 30 fps) before the node.
  2. Clear the prompt in the Astra 2 model loader to use the higher AST2_MAX_FRAMES limit.
  3. For long clips that need a prompt, cut into <= 15 s segments, enhance each, and concatenate.

Example fix

// before: 30 s clip with prompt
upscaler = topaz_video_upscaler_model(upscaler_model="ast-2", prompt="cinematic")
// after: clear the prompt for long clips
upscaler = topaz_video_upscaler_model(upscaler_model="ast-2", prompt="")
Defensive patterns

Strategy: validation

Validate before calling

n = video.get_frame_count()
if upscaler_model["upscaler_model"] == "ast-2":
    prompt = (upscaler_model["prompt"] or "").strip()
    if prompt and n > AST2_MAX_FRAMES_WITH_PROMPT:
        upscaler_model = {**upscaler_model, "prompt": ""}  # or trim the clip

Prevention

When it happens

Trigger: Selecting ast-2 in the V2 upscaler loader, providing a non-empty prompt, and feeding a video whose frame count exceeds AST2_MAX_FRAMES_WITH_PROMPT.

Common situations: Prompt-guided enhancement of full clips (30+ seconds) instead of short shots; mixing up workflow defaults where a prompt field is pre-filled; not realizing the prompt mode has a much tighter frame budget than the no-prompt mode.

Related errors


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