{"record":{"id":"6fd809b0866fb48e","repo":"Comfy-Org/ComfyUI","slug":"astra-2-with-a-prompt-is-limited-to-ast2-max-fram","errorCode":null,"errorMessage":"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.","messagePattern":"Astra 2 with a prompt is limited to (.+?) input frames \\(~15s @ 30fps\\); video has (.+?)\\. Clear the prompt or shorten the clip\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_topaz.py","lineNumber":1060,"sourceCode":"                    target_width = int(target_height * ar)\n            if target_width % 2 != 0:\n                target_width += 1\n            if target_height % 2 != 0:\n                target_height += 1\n            model_id = UPSCALER_MODELS_MAP[upscaler_choice]\n            if model_id == \"slc-1\":\n                filters.append(\n                    VideoEnhancementFilter(\n                        model=model_id,\n                        creativity=upscaler_model[\"creativity\"],\n                        isOptimizedMode=True,\n                    )\n                )\n            elif model_id == \"ast-2\":\n                n_frames = video.get_frame_count()\n                ast2_prompt = (upscaler_model[\"prompt\"] or \"\").strip()\n                if ast2_prompt and n_frames > AST2_MAX_FRAMES_WITH_PROMPT:\n                    raise ValueError(\n                        f\"Astra 2 with a prompt is limited to {AST2_MAX_FRAMES_WITH_PROMPT} input frames \"\n                        f\"(~15s @ 30fps); video has {n_frames}. Clear the prompt or shorten the clip.\"\n                    )\n                if n_frames > AST2_MAX_FRAMES:\n                    raise ValueError(f\"Astra 2 is limited to {AST2_MAX_FRAMES} input frames; video has {n_frames}.\")\n                realism = upscaler_model[\"realism\"]\n                filters.append(\n                    VideoEnhancementFilter(\n                        model=model_id,\n                        creativity=upscaler_model[\"creativity\"],\n                        prompt=(ast2_prompt or None),\n                        sharp=upscaler_model[\"sharp\"],\n                        realism=(realism if realism > 0 else None),\n                    )\n                )\n            else:\n                filters.append(VideoEnhancementFilter(model=model_id))\n        if interpolation_choice != \"Disabled\":","sourceCodeStart":1042,"sourceCodeEnd":1078,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_topaz.py#L1042-L1078","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Trim the video to <= AST2_MAX_FRAMES_WITH_PROMPT frames (~15 s @ 30 fps) before the node.","Clear the prompt in the Astra 2 model loader to use the higher AST2_MAX_FRAMES limit.","For long clips that need a prompt, cut into <= 15 s segments, enhance each, and concatenate."],"exampleFix":"// before: 30 s clip with prompt\nupscaler = topaz_video_upscaler_model(upscaler_model=\"ast-2\", prompt=\"cinematic\")\n// after: clear the prompt for long clips\nupscaler = topaz_video_upscaler_model(upscaler_model=\"ast-2\", prompt=\"\")","handlingStrategy":"validation","validationCode":"n = video.get_frame_count()\nif upscaler_model[\"upscaler_model\"] == \"ast-2\":\n    prompt = (upscaler_model[\"prompt\"] or \"\").strip()\n    if prompt and n > AST2_MAX_FRAMES_WITH_PROMPT:\n        upscaler_model = {**upscaler_model, \"prompt\": \"\"}  # or trim the clip","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a prompt-vs-length table for Astra 2 handy: ~15 s with prompt, AST2_MAX_FRAMES without.","Compute frame count (not seconds) when validating clips — the cap is frame-based."],"tags":["topaz","video","frame-limit","astra-2","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}