Reverse-engineer any video, shot by shot: filmed, AI-generated or coded, and how to remake it. Breakdowns in the open VIDEO.md format. 逆向一切视频,逐个镜头看是拍的、AI 生成的还是代码做的,再告诉你怎么复刻;拆解结果按 VIDEO.md 格式输出。
Python agent-skillsai-videoaigc-detectionclaude-codecodexffmpegprompt-engineeringremotionreverse-engineeringshort-videoshot-detectionsubtitlesvideo-analysisvideo-breakdownvideo-editingvideo-generationvideomdvlm
Align model limits with vendor docs
junea124acd4a02b
diff --git a/rea_video/capabilities/MATRIX.md b/rea_video/capabilities/MATRIX.mdindex f2c419f..855ea47 100644--- a/rea_video/capabilities/MATRIX.md+++ b/rea_video/capabilities/MATRIX.md@@ -23,18 +23,18 @@| `image.text_render` | 画内文字渲染 | ◐ `flux-3`、● `gpt-image-2.5`、◐ `gpt-image-2.6`、○ `ideogram-4.5`、◐ `mai-image-2.6`、◐ `minimax-h3-image`、◐ `nano-banana-2.1`、◐ `qwen-image-2.1`、◐ `qwen-image-3.0`、◐ `qwen-image-3.0-pro`、◐ `seedream-5.0`、◐ `seedream-5.5` || `image.storyboard_series` | 分镜组图 | ◐ `kling-o3-image`、◐ `seedream-5.0` || `image.tryon` | 虚拟试穿 | ◐ `fashn-tryon-max`、◐ `fashn-v1.6`、◐ `kling-kolors-tryon`、◐ `kling-virtual-tryon-3`、◐ `qwen-image-2.1` |-| `video.t2v` | 文生视频 | ◐ `flux-3-video`、○ `flux-3-video-max`、◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、○ `grok-imagine-video-1.5-lite`、◐ `hailuo-2.3`、○ `happyhorse-1.0`、◐ `heygen-video-1`、◐ `hunyuanvideo-1.5`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、◐ `ltx-2.5`、○ `luma-ray3.2`、◐ `minimax-h3`、◐ `minimax-h3-max`、○ `p-video-2-pro`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `runway-gen-4.5`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、○ `skyreels-v4`、○ `utopai-x`、◐ `veo-3.1`、◐ `vidu-q3`、● `wan-2.2`、◐ `wan-3.0` |-| `video.i2v_first_frame` | 图生视频(首帧) | ◐ `flux-3-video`、○ `flux-3-video-max`、◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、○ `grok-imagine-video-1.5-lite`、◐ `hailuo-2.3`、○ `happyhorse-1.0`、◐ `heygen-video-1`、◐ `hunyuanvideo-1.5`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、◐ `ltx-2.5`、○ `luma-ray3.2`、◐ `minimax-h3`、◐ `minimax-h3-max`、○ `p-video-2-pro`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `runway-gen-4.5`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、○ `skyreels-v4`、◐ `veo-3.1`、◐ `vidu-q3`、◐ `vidu-q4-preview`、● `wan-2.2`、◐ `wan-3.0`、◐ `wan-vace` |-| `video.i2v_first_last` | 首尾帧生成 | ◐ `flux-3-video`、○ `flux-3-video-max`、◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、◐ `heygen-video-1`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-o3`、◐ `minimax-h3`、◐ `minimax-h3-max`、○ `p-video-2-pro`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、◐ `veo-3.1`、◐ `wan-3.0` |+| `video.t2v` | 文生视频 | ◐ `flux-3-video`、○ `flux-3-video-max`、◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、○ `grok-imagine-video-1.5-lite`、◐ `hailuo-2.3`、○ `happyhorse-1.0`、◐ `heygen-video-1`、◐ `hunyuanvideo-1.5`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、◐ `ltx-2.5`、○ `luma-ray3.2`、● `minimax-h3`、◐ `minimax-h3-max`、○ `p-video-2-pro`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `runway-gen-4.5`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、○ `skyreels-v4`、○ `utopai-x`、◐ `veo-3.1`、◐ `vidu-q3`、● `wan-2.2`、◐ `wan-3.0` |+| `video.i2v_first_frame` | 图生视频(首帧) | ◐ `flux-3-video`、○ `flux-3-video-max`、◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、○ `grok-imagine-video-1.5-lite`、◐ `hailuo-2.3`、○ `happyhorse-1.0`、◐ `heygen-video-1`、◐ `hunyuanvideo-1.5`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、◐ `ltx-2.5`、○ `luma-ray3.2`、● `minimax-h3`、◐ `minimax-h3-max`、○ `p-video-2-pro`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `runway-gen-4.5`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、○ `skyreels-v4`、◐ `veo-3.1`、◐ `vidu-q3`、◐ `vidu-q4-preview`、● `wan-2.2`、◐ `wan-3.0`、◐ `wan-vace` |+| `video.i2v_first_last` | 首尾帧生成 | ◐ `flux-3-video`、○ `flux-3-video-max`、◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、◐ `heygen-video-1`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-o3`、● `minimax-h3`、◐ `minimax-h3-max`、○ `p-video-2-pro`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、◐ `veo-3.1`、◐ `wan-3.0` || `video.keyframes` | 多关键帧控制 | ◐ `flux-3-video`、○ `flux-3-video-max`、◐ `grok-imagine-video-1.5`、◐ `kling-4.0`、◐ `runway-gen-4.5` |-| `video.multi_reference` | 多参考生视频(主体一致) | ◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、○ `happyhorse-1.0`、◐ `heygen-video-1`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、◐ `minimax-h3`、◐ `minimax-h3-max`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、◐ `veo-3.1`、◐ `vidu-q3`、◐ `vidu-q4-preview`、◐ `wan-3.0` |-| `video.reference_video` | 参考视频生成(动作/运镜/特效迁移) | ◐ `gemini-omni-flash`、◐ `heygen-video-1`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、◐ `minimax-h3-max`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、○ `skyreels-v4`、◐ `wan-3.0` |-| `video.reference_audio` | 参考音频生成 | ◐ `grok-imagine-video-1.5`、◐ `heygen-video-1`、◐ `kling-4.0-flash`、◐ `ltx-2.5`、◐ `minimax-h3-max`、◐ `pika-h3-flex`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、◐ `vidu-q4-preview`、◐ `wan-3.0` |-| `video.multi_shot` | 单次多镜头 | ◐ `flux-3-video`、◐ `gemini-omni-flash`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、◐ `ltx-2.5`、◐ `minimax-h3`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `seedance-2.0`、● `seedance-2.5`、◐ `veo-3.1`、◐ `vidu-q4-preview`、◐ `wan-3.0` |+| `video.multi_reference` | 多参考生视频(主体一致) | ◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、○ `happyhorse-1.0`、◐ `heygen-video-1`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、● `minimax-h3`、◐ `minimax-h3-max`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、◐ `veo-3.1`、◐ `vidu-q3`、◐ `vidu-q4-preview`、◐ `wan-3.0` |+| `video.reference_video` | 参考视频生成(动作/运镜/特效迁移) | ◐ `gemini-omni-flash`、◐ `heygen-video-1`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、● `minimax-h3`、◐ `minimax-h3-max`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、○ `skyreels-v4`、◐ `wan-3.0` |+| `video.reference_audio` | 参考音频生成 | ◐ `grok-imagine-video-1.5`、◐ `heygen-video-1`、◐ `kling-4.0-flash`、◐ `ltx-2.5`、● `minimax-h3`、◐ `minimax-h3-max`、◐ `pika-h3-flex`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、◐ `vidu-q4-preview`、◐ `wan-3.0` |+| `video.multi_shot` | 单次多镜头 | ◐ `flux-3-video`、◐ `gemini-omni-flash`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `kling-o3`、◐ `ltx-2.5`、● `minimax-h3`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `seedance-2.0`、● `seedance-2.5`、◐ `veo-3.1`、◐ `vidu-q4-preview`、◐ `wan-3.0` || `video.extend` | 续写延长 | ◐ `flux-3-video`、◐ `gemini-omni-flash`、● `seedance-2.5`、◐ `veo-3.1` || `video.edit_v2v` | 视频编辑(保留运动) | ◐ `flux-3-video`、◐ `gemini-omni-flash`、○ `happyhorse-1.0`、○ `higgsfield-genjutsu`、◐ `kling-4.0`、◐ `kling-o3`、◐ `ltx-2.5`、○ `luma-ray3.2`、◐ `pika-h3-flex`、○ `runway-aleph-2`、◐ `runway-gen-4.5`、◐ `seedance-2.0`、● `seedance-2.5`、○ `skyreels-v4`、◐ `viggle-animate`、◐ `wan-2.2-animate`、○ `wan-2.7-edit`、◐ `wan-vace` || `video.camera_control` | 运镜与镜头参数控制 | ◐ `gemini-omni-flash`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `pixverse-v6`、○ `runway-aleph-2`、◐ `runway-gen-4.5`、● `seedance-2.5` |-| `video.native_audio` | 音画同出 | ◐ `flux-3-video`、○ `flux-3-video-max`、◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、○ `grok-imagine-video-1.5-lite`、◐ `heygen-video-1`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `ltx-2.5`、○ `luma-ray3.2`、◐ `minimax-h3`、◐ `minimax-h3-max`、○ `p-video-2-pro`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `runway-gen-4.5`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、○ `skyreels-v4`、○ `utopai-x`、◐ `veo-3.1`、◐ `vidu-q3`、◐ `vidu-q4-preview`、◐ `wan-3.0` |+| `video.native_audio` | 音画同出 | ◐ `flux-3-video`、○ `flux-3-video-max`、◐ `gemini-omni-flash`、◐ `grok-imagine-video-1.5`、○ `grok-imagine-video-1.5-lite`、◐ `heygen-video-1`、◐ `kling-3.0`、◐ `kling-4.0`、◐ `kling-4.0-flash`、◐ `ltx-2.5`、○ `luma-ray3.2`、● `minimax-h3`、◐ `minimax-h3-max`、○ `p-video-2-pro`、◐ `pika-h3-flex`、◐ `pixverse-v6`、◐ `runway-gen-4.5`、◐ `seedance-2.0`、● `seedance-2.5`、○ `seedance-2.5-flash`、○ `skyreels-v4`、○ `utopai-x`、◐ `veo-3.1`、◐ `vidu-q3`、◐ `vidu-q4-preview`、◐ `wan-3.0` || `video.control_video` | 控制视频驱动生成 | ◐ `wan-vace` || `motion.transfer` | 动作迁移 | ○ `dreamactor-m2.0`、○ `higgsfield-genjutsu`、◐ `kling-motion-control`、◐ `runway-gen-4.5`、◐ `viggle-animate`、◐ `viggle-v4`、◐ `wan-2.2-animate`、◐ `wan-animate-2` || `avatar.audio_driven` | 音频驱动数字人 | ○ `creatify-aurora`、○ `hedra-omnia`、◐ `heygen-avatar-v`、◐ `kling-avatar-v2`、◐ `longcat-video-avatar-1.5`、◐ `ltx-2.3-lipsync`、◐ `ltx-2.5`、◐ `mirage-avatar-x`、◐ `omnihuman-2.0`、◐ `sync-3`、◐ `synthesia-express-3`、○ `veed-fabric-1.0` |@@ -157,7 +157,7 @@| Kling O3(Omni) | Kuaishou | video | ga | 15 | 否 | 是 | third-party 2026-10-29 || LTX-2.5(开源) | Lightricks | video | ga | | 是 | 有条件 | third-party 2026-11-12 || Luma Ray3.2 / Modify | Luma AI | video | ga | 10 | 是 | 是 | vendor 2026-11-12 |-| MiniMax H3 / H3 Max | MiniMax | video | ga | 15 | 是 | 有条件 | third-party 2026-10-29 |+| MiniMax H3 / H3 Max | MiniMax | video | ga | 15 | 是 | 有条件 | vendor 2026-11-22 || MiniMax H3 Max | MiniMax | video | ga | 15 | 是 | 有条件 | vendor 2026-11-12 || P-Video-2-Pro | Pruna AI | video | ga | 15 | 是 | 有条件 | third-party 2026-11-12 || Pika H3 Flex | Pika | video | ga | 15 | 是 | 有条件 | vendor 2026-11-12 |diff --git a/rea_video/capabilities/models/video.yaml b/rea_video/capabilities/models/video.yamlindex 82b1ce1..955669e 100644--- a/rea_video/capabilities/models/video.yaml+++ b/rea_video/capabilities/models/video.yaml@@ -13,7 +13,7 @@ models:primitives: [video.t2v, video.i2v_first_frame, video.i2v_first_last, video.multi_reference, video.reference_video, video.reference_audio, video.multi_shot, video.extend, video.edit_v2v, video.camera_control, video.native_audio]limits:duration_s: {max: 30}- resolutions: [480p, 720p, 1080p]+ resolutions: [480p, 720p, 1080p, 4K]refs: {image: 30, video: 10, audio: 10}# 首帧 / 首尾帧 和 参考图 / 参考视频 / 参考音频 不能放在同一个请求里(多家接口文档一致;即梦 App 的「全能参考」可用 @图片 作为首帧)exclusive_inputs: [[video.i2v_first_frame, video.i2v_first_last], [video.multi_reference, video.reference_video, video.reference_audio]]@@ -30,6 +30,7 @@ models:note: 实测参考:OiiOii 复刻 50 秒电商视频约 40 元(480p 生成后超分到 1080p)license: {commercial: true, note: 以平台条款为准}sources:+ - https://docs.volcengine.com/docs/82379/1520757- https://seed.bytedance.com/en/blog/one-take-creation-flexible-referencing-introducing-seedance-2-5- https://github.com/hypit-ai/hypit/blob/main/packages/provider-hypihub/README.md- https://docs.byteplus.com/docs/en/modelark/seedance-2-5.md@@ -75,7 +76,7 @@ models:primitives: [video.t2v, video.i2v_first_frame, video.i2v_first_last, video.multi_reference, video.reference_video, video.reference_audio, video.multi_shot, video.native_audio, video.edit_v2v]limits:duration_s: {min: 4, max: 15}- resolutions: [720p, 1080p]+ resolutions: [480p, 720p, 1080p, 4K]refs: {image: 9, video: 3, audio: 3}ref_video_s: {max: 15} # 参考视频总长# 首帧 / 首尾帧 和 参考素材 不能放在同一个请求里;即梦 App 的「全能参考」可用 @图片 作为首帧@@ -89,6 +90,7 @@ models:cost: {usd_per_s: 0.15, note: "第三方列价约 9.07 美元/分钟"}license: {commercial: true, note: 以平台条款为准}sources:+ - https://docs.volcengine.com/docs/82379/1520757- https://tech-insider.org/best-ai-video-generator-2026/- https://en.wikipedia.org/wiki/Seedance_2.0- https://github.com/hypit-ai/hypit@@ -418,20 +420,24 @@ models:release: 2026-07status: gaaccess: [api, api-aggregator, open-weights]- primitives: [video.t2v, video.i2v_first_frame, video.i2v_first_last, video.multi_reference, video.multi_shot, video.native_audio]+ primitives: [video.t2v, video.i2v_first_frame, video.i2v_first_last, video.multi_reference, video.reference_video, video.reference_audio, video.multi_shot, video.native_audio]limits:duration_s: {min: 4, max: 15}- resolutions: [768p, 1080p, 2K]+ resolutions: [768p, 2K]+ refs: {image: 9, video: 3, audio: 3}+ ref_video_s: {min: 2, max: 15}# 首帧 / 首尾帧 和 参考素材 不能放在同一个请求里- exclusive_inputs: [[video.i2v_first_frame, video.i2v_first_last], [video.multi_reference]]+ exclusive_inputs: [[video.i2v_first_frame, video.i2v_first_last], [video.multi_reference, video.reference_video, video.reference_audio]]audio: {native: true}+ # 复刻方案默认的排法,不改变上面的模型上限+ planning: {strategy: keyframes, images: 4}strengths:- 第三方榜单前三(H3 Max Elo 约 1227),且列价最低- 权重开放(H3-Base 可在本地跑 768p)- Hypit 与 video-replicate-studio 均已接入- 一次可出多个镜头:提示词里按 [Shot N] 加切镜时间点写weaknesses:- - 企业配套弱;1080p 下时长受限+ - 企业配套弱- 2K 需要托管模块cost: {usd_per_s: 0.04, note: "H3 Max 约 2.40 美元/分钟;H3 约 7.80 美元/分钟"}license: {commercial: conditional, note: MiniMax H3 Community License}@@ -441,8 +447,8 @@ models:- https://huggingface.co/MiniMaxAI/MiniMax-H3/raw/main/docs/VIDEO_PROMPT_WRITING_GUIDE_base_en.md- https://platform.minimax.io/docs/api-reference/video-generation-v2-create- https://minimax.io/blog/minimax-h3- verified: {date: 2026-10-29, basis: third-party}- confidence: medium+ verified: {date: 2026-11-22, basis: vendor}+ confidence: highnotes: 官方博客 2026-07-31 发布;开源权重 2026-08-03,只有 768p 基础版,2K 模块只走 API;同一接口还有 H3 Highspeed、H3 Lite 两档,H3 Max 单独成条- id: minimax-h3-maxdiff --git a/rea_video/capabilities/schema.json b/rea_video/capabilities/schema.jsonindex df76e7f..4403927 100644--- a/rea_video/capabilities/schema.json+++ b/rea_video/capabilities/schema.json@@ -59,6 +59,7 @@}},"confidence": {"enum": ["high", "medium", "low"]},+ "planning": {"type": "object", "additionalProperties": false, "description": "How remake plans use this model by default, when that is narrower than its limits", "properties": {"strategy": {"enum": ["remix", "keyframes", "frames", "text"]}, "images": {"type": "integer", "minimum": 1}}},"probe_scores": {"type": "object"},"notes": {"type": "string"}},diff --git a/rea_video/generation.py b/rea_video/generation.pyindex 4cfd0b4..a6d7ef1 100644--- a/rea_video/generation.py+++ b/rea_video/generation.py@@ -107,20 +107,26 @@ def spec_of(model: dict | None) -> dict:d, refs = lim.get("duration_s") or {}, lim.get("refs") or {}rv = (lim.get("ref_video_s") or {}).get("max")multi_ref = "video.multi_reference" in prim+ plan = m.get("planning") or {}return {"max": float(d.get("max") or 10), "min": float(d.get("min") or 0),"multi_shot": "video.multi_shot" in prim, "shots": int(lim.get("shots_per_generation") or 0) or None,"ref_video": "video.reference_video" in prim, "ref_videos": int(refs.get("video") or 1),"ref_total": float(rv) if rv else REF_CLIP_S * max(1, int(refs.get("video") or 1)),"multi_ref": multi_ref, "images": int(refs.get("image") or (UNKNOWN_IMAGES if multi_ref else 0)),- "images_stated": bool(refs.get("image")),+ "images_stated": bool(refs.get("image")), "prefer": plan.get("strategy"), "plan_images": plan.get("images"),"first": "video.i2v_first_frame" in prim, "last": "video.i2v_first_last" in prim,"exclusive": bool(lim.get("exclusive_inputs")), "native_audio": bool((m.get("audio") or {}).get("native"))}+def planned_images(spec: dict) -> int:+ """Images a plan uses per call: the model's limit, or the narrower default its capability entry sets."""+ return min(spec["images"], spec.get("plan_images") or spec["images"])++def choose_strategy(spec: dict, n_own: int) -> str:- if spec["ref_video"]:+ if spec["ref_video"] and spec.get("prefer") in (None, "remix"):return "remix"- if spec["multi_shot"] and spec["multi_ref"] and spec["images"] >= n_own + 2:+ if spec["multi_shot"] and spec["multi_ref"] and planned_images(spec) >= n_own + 2:return "keyframes"if spec["first"]:return "frames"@@ -304,7 +310,7 @@ def build_unit(seg: list[dict], k: int, strategy: str, spec: dict, own: list[dicelif strategy == "keyframes":# image slots left after the user's own: when they run short, the longest shots keep their source frame and the# rest get their framing in words (a call kept whole beats a frame for every shot when subjects have no image)- room = max(0, spec["images"] - len(refs))+ room = max(0, planned_images(spec) - len(refs))framed = {r["index"] for r in sorted(seg, key=lambda r: -r["duration"])[:room]}for r in seg:if r["index"] not in framed:@@ -374,7 +380,7 @@ def plan_generation(b: dict, model: dict | None, intent: dict, new_scene: set[in# a swapped-in subject with no image is held only by its description: every extra call is another chance for it# to come out different, so keep calls whole and let some shots go without a source frametext_only = any(not s.get("image") for s in intent.get("swaps") or [])- max_s, max_shots = spec["max"], (spec["shots"] if text_only else min(x for x in (spec["shots"], spec["images"] - len(own)) if x))+ max_s, max_shots = spec["max"], (spec["shots"] if text_only else min(x for x in (spec["shots"], planned_images(spec) - len(own)) if x))elif strategy == "text" and spec["multi_shot"]:max_s, max_shots = spec["max"], spec["shots"]else: