The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Video: multi-shot, Seedance draft mode, Extend and Reframe studios
Claude221ff3a745a8
diff --git a/docs/research/comfyui-oss-2.json b/docs/research/comfyui-oss-2.jsonindex c99d26b0..26ca1183 100644--- a/docs/research/comfyui-oss-2.json+++ b/docs/research/comfyui-oss-2.json@@ -13904,7 +13904,7 @@],"vramGB": 4,"license": "MIT",- "notes": "Outputs: node 7 = transparent .webm (SaveWEBM: 'RGBA images are saved with their alpha channel as transparency (vp9 codec only)', reported under ui.images with animated preview), node 10 = black/white matte .mp4 for compositing. RemoveBackground returns foreground=1; InvertMask is required because JoinImageWithAlpha stores 1-mask as alpha (same as the library's bg-remove-birefnet). fps on SaveWEBM is a literal (bind source fps). Edge flicker is possible on hair; Comfy-Org/BiRefNet also ships lucida.safetensors (0.88 GB) usable in the same loader.",+ "notes": "Outputs: node 7 = transparent .webm (SaveWEBM: 'RGBA images are saved with their alpha channel as transparency (vp9 codec only)', reported under ui.images with animated preview), node 10 = black/white matte .mp4 for compositing. RemoveBackground returns foreground=1; InvertMask is required because JoinImageWithAlpha stores 1-mask as alpha (same as the library's bg-remove-birefnet). fps on SaveWEBM is a literal (bind source fps). Edge flicker is possible on hair; Comfy-Org/BiRefNet also ships lucida.safetensors (0.88 GB); the core loader only accepts BiRefNet-architecture keys (comfy/bg_removal_model.py), so whether lucida loads is unverified.","inferred": ["temporal stability (BiRefNet is per-frame)"],diff --git a/docs/research/comfyui-oss-2.md b/docs/research/comfyui-oss-2.mdnew file mode 100644index 00000000..2128710b--- /dev/null+++ b/docs/research/comfyui-oss-2.md@@ -0,0 +1,375 @@+# Fuobe research #2: open-weight ComfyUI approaches for the remaining Higgsfield gaps++_As of 2026-10-16. Machine-readable companion: [`comfyui-oss-2.json`](comfyui-oss-2.json), which has the full API-format graphs, bindings, live `/object_info` node specs, model URLs and sizes, and validation results. This file builds on [`comfyui-oss.md`](comfyui-oss.md) (capability rankings) and [`comfyui-workflow-library.md`](comfyui-workflow-library.md) (the existing workflow library)._++## How this was produced and what "verified" means++* **Source read, pinned commits:** ComfyUI core `fc04da91` (v0.41.0-7, the same commit as the library), Comfy-Org/workflow_templates `04a508b` (2026-10-16, 707 templates), and these packs: ComfyUI-KJNodes `17195fcf`, ComfyUI-WanVideoWrapper `088128b2`, ComfyUI_Fill-ChatterBox `f7d7a161`, ComfyUI-IndexTTS2 `5b33e02b`, TTS-Audio-Suite `3f3832a0` (v5.10.3), ComfyUI-VibeVoice (wildminder) `de6ee6bf`, SeedVC-ComfyUI `10731e18`, ComfyUI-LTXVideo `44c8a36b`, ai-toolkit `dcebc744`, ComfyUI-FluxTrainer `09fef403`, ComfyUI-Video-Depth-Anything `a0db08e6`. Every pack's `ref` is listed in the JSON.+* **Live validation:** a CPU ComfyUI at `fc04da91` was started in a scratch directory with KJNodes, Fill-ChatterBox, VibeVoice and Video-Depth-Anything installed. Every graph that has `validation.postPrompt: true` was accepted by `POST /prompt` (HTTP 200, a `prompt_id`, no `node_errors`) with zero-byte placeholder weights and uploaded fixtures. A KJNodes `Sleep` blocker held the worker, so nothing ran. This is the same method as `scripts/comfy/validate-workflows.mjs`. A negative test (a renamed input, and a STRING wired into TRACKS) was rejected, which shows the check is real. The `nodes` arrays in the JSON were dumped from that server's `/object_info`, so input names, types, defaults and options match what the server accepts.+* **Validation does not prove quality.** No model was run. Settings, VRAM and quality notes come from the templates, model cards and source. Anything that could only be inferred is listed under `inferred` on each option and marked _(inferred)_ below.+* **Not validated live:** IndexTTS-2 and Seed-VC. Their dependencies (pynini/WeTextProcessing, and an old pinned stack) could not be installed on the CPU box. Their graphs were transcribed from `INPUT_TYPES` in their source.++**Result: the JSON has 24 graphs. 22 passed live `/prompt` validation; the other 2 (IndexTTS-2, Seed-VC) were checked against source only.**++## Summary: recommendation per gap++| Gap | Capability id | Recommended | Nodes | License | VRAM | Download | Live-validated |+|---|---|---|---|---|---|---|---|+| 1 TTS clone | `tts-clone` | **Chatterbox Multilingual** (`FL_ChatterboxMultilingualTTS`, 23 languages); #2 **IndexTTS-2** | Fill-ChatterBox | MIT weights | ~6 GB | 3.2 GB (auto) | yes / source-only |+| 1 Dialogue | `tts-dialogue` | **Chatterbox Dialog** (`FL_ChatterboxDialogTTS`, up to 4 speakers); quality option **VibeVoice** | Fill-ChatterBox / VibeVoice | MIT / MIT, card says research use only | ~6 / ~10 GB | 3.2 / 5.4 GB | yes / yes |+| 2 Voice change | `voice-change` | **Chatterbox VC** (`FL_ChatterboxVC`) | Fill-ChatterBox | MIT weights | ~3 GB | 1.1 GB | yes |+| 3 Extend | `video-extend` | **Wan 2.2 Fun VACE A14B** context-frame continuation + `ImageBatchExtendWithOverlap` | core + KJNodes | Apache-2.0 | 24 GB | 44 GB (35 GB new) | yes |+| 4 Reframe | `video-reframe` | **Wan 2.2 Fun VACE A14B outpainting** (`ImagePadForOutpaint` mask on every frame) | core | Apache-2.0 | 24 GB | 44 GB (shared with 3) | yes |+| 5 Relight (image) | `relight` | **Qwen-Image-Edit-2509 + Relight LoRA** (library `qwen-image-edit-2509` + 1 node) | core | Apache-2.0 | 24 GB | +0.24 GB | yes |+| 5 Relight (video) | `video-relight` | **Bernini-R** video edit (`BerniniConditioning`, Wan 2.2 A14B fine-tune) | core | Apache-2.0 | 24 GB | 38.8 GB | yes |+| 6 Draw-to-video | `draw-to-video` | **Wan-Move 14B** (`WanMoveTracksFromCoords` → `WanMoveTrackToVideo`) | core | Apache-2.0 | 24 GB | 25.4 GB (16.4 GB new) | yes |+| 7 Multi-shot | `multi-shot` | **LTX-2.5 native multishot** through the existing `ltx25-t2v`/`ltx25-i2v`; commercially clean fallback: storyboard → Wan per shot → concat graph | core | LTX-2 Community (< US$10M) / Apache | 24 GB | 0 | concat graph yes; prompt syntax _(inferred)_ |+| 8 Soul ID | `character-lora` | **ai-toolkit** headless (YAML job / UI job API), Z-Image Turbo + training adapter | ai-toolkit | MIT tool; LoRA inherits the base model license | 16–24 GB | base models | job schema from source; `TrainLoraNode` alternative yes |+| 9 Storyboard | `storyboard` | **Qwen-Image-Edit-2509 + next-scene LoRA v2**, chained, with the character reference as image2 | core | Apache + MIT | 24 GB | +0.3 GB | yes |+| 10 Video alpha | `video-bg-remove` | **BiRefNet** on every frame (`RemoveBackground`) → RGBA **VP9 WebM** (`SaveWEBM`); SAM 3.1 video tracking for "keep only X" | core | MIT | 4 GB | 0.44 GB | yes |+| 10 Video depth | `video-depth` | **Depth Anything 3 mono-large** (core); temporally stable option: Video Depth Anything Small | core / VDA pack | Apache-2.0 | 4 GB | 1.3 GB | yes / yes |+| 11 Soul HEX | `palette` | **Core `ColorTransfer`** against a palette swatch the app renders, plus **FLUX.2 hex codes** in prompts | core | none (no model) | CPU | 0 | yes |++Adding every recommended option costs **about 85 GB of new non-TTS weights** (Fun VACE 34.7 GB, Bernini-R 31.1 GB, Wan-Move 16.4 GB, DA3 1.3 GB, LoRAs about 1.2 GB), plus about 7.5 GB of TTS weights that the packs auto-download. The UMT5, Wan VAE, CLIP-vision, Qwen-Edit and Wan 2.2 I2V files are already in the library.++### What Fuobe has to add++* **Node packs** (add to `scripts/comfy/install-comfyui.sh` at the commits above): `filliptm/ComfyUI_Fill-ChatterBox` (TTS, dialogue, VC) and optionally `wildminder/ComfyUI-VibeVoice` (also needs `pip install gguf`, which its `requirements.txt` leaves out; without it the pack fails to import) and `yuvraj108c/ComfyUI-Video-Depth-Anything`. KJNodes is already pinned and is used by `video-extend`. Everything else is core ComfyUI.+* **New binding keys.** These are passed through `ProviderInput.extra` and are not yet in `BindingKey`:+ * Audio: `text` (TTS script), `voiceAudio`, `voiceAudio2` (reference clips), `language`, `exaggeration`, `cfgWeight`, `temperature`+ * Video: `tracks` (JSON), `motionStrength`, `contextFrames`, `contextFramesNegative`, `newFrames`, `sourceWidth`, `sourceHeight`, `video2`, `video3`+ * Image/palette: `loraStrength` (already present), `objectIndices`, `resolution`, `method`, `strength`+ * Training: `datasetFolder`, `learningRate`, `rank`++ The existing `pad*` keys are reused by reframe.+* **Upload kinds.** `voiceAudio*` are audio uploads, just like `audio`. `SaveWEBM` reports its file under `ui.images` with `animated: true` (verified in `comfy_api/latest/_ui.py`), so `collectFiles` has to classify `.webm` by extension.++---++## 1. Text-to-speech with voice cloning (`tts-clone`) and dialogue (`tts-dialogue`)++Core ComfyUI still has no local TTS node; the official TTS templates are API partner nodes, except the four **Chatter Box** community templates, which use the Fill-ChatterBox pack.++**Recommendation 1: Chatterbox Multilingual.** Graph: `LoadAudio(voice) → FL_ChatterboxMultilingualTTS(audio_prompt) → SaveAudioMP3`. This matches the official template `audio-chatterbox_tts_multilingual`.++* Inputs (from `/object_info`):+ * `text` STRING+ * `language`: a combo of `"Name (code)"` strings, 23 languages, default `"English (en)"`+ * `exaggeration` 0.5, `cfg_weight` 0.5, `temperature` 0.8, `repetition_penalty` 2.0, `min_p` 0.05, `top_p` 1.0, `seed`+ * Optional: `audio_prompt` AUDIO, `use_cpu`, `keep_model_loaded`+ * Outputs: `(AUDIO, STRING)`+* Bindings: `text → 2.text`, `voiceAudio → 1.audio`, `language`, `seed`, `exaggeration`, `cfgWeight`, `temperature`.+* Models: auto-downloaded from `ResembleAI/chatterbox` into `models/chatterbox/chatterbox_multilingual/` (`t3_mtl23ls_v2.safetensors` 2.14 GB, `s3gen.pt` 1.06 GB, `ve.pt`, tokenizer JSONs, `conds.pt`). The HF repo already has a `t3_mtl23ls_v3` checkpoint that this pack does not use yet; TTS-Audio-Suite exposes v1, v2 and v3.+* About 6 GB VRAM _(inferred)_. Fast: a 0.5B Llama-style T3 plus the S3Gen vocoder.+* English-only variants: `FL_ChatterboxTTS` and `FL_ChatterboxTurboTTS`. Turbo supports paralinguistic tags such as `[laugh]` and `[sigh]` and takes top_k, top_p and repetition_penalty instead of exaggeration and cfg.+* License: weights MIT. The pack repo has no LICENSE file.++**Recommendation 2: IndexTTS-2** (best emotion and timing control, for example when dubbing to an existing lip track). Graph: `LoadAudio → IndexTTS2Simple(audio, text, emotion_control_weight=1.0, [emotion_audio], [emotion_vector], use_fp16, output_gain) → SaveAudioMP3`.++* `IndexTTS2EmotionVector` and `IndexTTS2EmotionFromText` (a Qwen 0.6B emotion model) feed `emotion_vector`.+* TTS-Audio-Suite wraps the same weights (and IndexTTS-2.5) as `IndexTTSEngineNode` → `UnifiedTTSTextNode`, adding `duration_factor` and `language`.+* Models: `IndexTeam/IndexTTS-2` (gpt.pth 3.48 GB, s2mel.pth 1.2 GB, qwen0.6bemo4 1.19 GB, plus w2v-bert, MaskGCT and BigVGAN fetched on first run) go in `custom_nodes/ComfyUI-IndexTTS2/checkpoints`.+* About 8 GB VRAM.+* License: the bilibili Model Use License allows commercial use **unless** you exceed 100M MAU or RMB 1B revenue; it also forbids using the model to improve other models.+* Validated against source only. Its deps (pynini, WeTextProcessing, modelscope) suggest running it in an isolated worker.++**Dialogue: Chatterbox Dialog** (official template `audio-chatterbox_tts_dialog`). Graph: `FL_ChatterboxDialogTTS(dialog_text, speaker_A_Audio, speaker_B_Audio, [speaker_C_Audio, speaker_D_Audio], exaggeration, cfg_weight, temperature, seed)`.++* The script uses `SPEAKER A: …` lines, parsed with `startswith` in `chatterbox_dialog_node.py`.+* Outputs: the mixed `dialog_audio` plus four per-speaker stems. The stems are handy for multi-person InfiniteTalk.+* Uses the English model.++**Dialogue, quality option: VibeVoice** 1.5B (5.4 GB) or 7B (18.7 GB; `quantize_llm_4bit` makes it fit in about 10 GB). Graph: `VibeVoiceTTS(model_name, text "[1] … / [2] …", speaker_1..4_voice, cfg_scale 1.3, inference_steps 10, …)`.++* Validated live after installing `gguf`.+* Most natural long-form turn-taking (up to 90 min, 4 speakers).+* License: weights MIT, but Microsoft's card limits use to **research only**, so it is not a safe commercial default.+* Commercially clean long-dialogue alternative: **MOSS-TTSD 8B** (Apache) through TTS-Audio-Suite.++**Others considered:**++| Model | How to run it | License | Verdict |+|---|---|---|---|+| Qwen3-TTS 1.7B | TTS-Audio-Suite | Apache | Clean clone plus voice design; best #3 |+| Higgs Audio v2 3B | TTS-Audio-Suite `HiggsAudioEngineNode` | Boson community license (free up to 100k annual active users) | Very expressive |+| Higgs Audio v3 | TTS-Audio-Suite | research / non-commercial | Skip |+| F5-TTS | — | CC-BY-NC | Skip |++TTS-Audio-Suite (19 engines, actively maintained) uses an engine-node → `UnifiedTTSTextNode(TTS_engine, text, narrator_voice, seed, opt_narrator)` pattern. If Fuobe wants many engines behind one graph shape, it is the right pack. The trade-off is a heavy install with isolated runtimes.++Risks: consent and watermarking for cloned voices (install `resemble-perth` so Chatterbox's Perth watermark is active), and auto-downloads on first execution (pre-seed `models/chatterbox`).++## 2. Voice conversion (`voice-change`)++**Recommendation: Chatterbox VC** (official template `audio-chatterbox_vc`). Graph: `LoadAudio(source) + LoadAudio(target) → FL_ChatterboxVC(input_audio, target_voice, seed) → SaveAudioMP3`.++* It is zero-shot and keeps the source timing and performance.+* Model: `s3gen.pt` (1.06 GB) + `conds.pt`, about 3 GB VRAM, MIT.+* To re-voice a video in one graph: `GetVideoComponents.audio → FL_ChatterboxVC → CreateVideo(audio=…)`.++**Alternatives:**++* **Seed-VC.** Best timbre similarity and a 44 kHz singing model. GPL-3.0 code and weights; the AIFSH pack has not been updated since 2024-11-14.+ * `SeedVCNode(source, target, diffusion_steps=10 (50–100 best), length_adjust, inference_cfg_rate=0.7)`+ * `SeedVC4SingNode` adds `pitch_shift` and `auto_f0_adjust`.+* **RVC** through TTS-Audio-Suite: `LoadRVCModelNode` + `RVCEngineNode` → `UnifiedVoiceChangerNode`. It needs a trained `.pth` per voice, which the suite can also train. Use it for "my persistent voice".+* **CosyVoice3 VC** (Apache) through TTS-Audio-Suite.++## 3. Video extend (`video-extend`)++**Recommendation: Wan 2.2 Fun VACE A14B context-frame continuation.** Everything is core plus one KJNodes node.++```+LoadVideo → GetVideoComponents → ImageScale(W×H)+ ├─ ImageFromBatch(batch_index=-16, length=16) # last 16 frames = known context+ │ + EmptyImage(gray 0x7F7F7F, newFrames) → BatchImagesNode → control_video+ ├─ EmptyImage(black,16)+EmptyImage(white,newFrames) → BatchImagesNode → ImageToMask(red) → control_masks+ └─ WanVaceToVideo(W,H,length=81) → KSamplerAdvanced high(0→2) → low(2→4) [Fun VACE high/low + T2V lightx2v]+ → TrimVideoLatent(trim_latent) → VAEDecode+ → ImageBatchExtendWithOverlap(source=resized clip, overlap=16, linear_blend) → CreateVideo → SaveVideo+```++* **Verified in source:**+ * `WanVaceToVideo` encodes `inactive = video·(1-mask)` and `reactive = video·mask`, and pads missing frames with gray and mask 1 (`nodes_wan.py`). So mask 0 means "keep" and mask 1 means "generate".+ * `ImageFromBatch` accepts a negative `batch_index`, counted from the end (`nodes_images.py`).+ * `ImageBatchExtendWithOverlap` returns `source[:-n] + blend(source[-n:], new[:n]) + new[n:]` and requires the same H×W (`KJNodes image_nodes.py`).+* **Bindings.** The app computes the derived values: `newFrames = frames − contextFrames` and `contextFramesNegative = −contextFrames`. Each run adds 65 frames (about 4 s at 16 fps). Loop the job to extend further.+* **Models:** Fun VACE high and low fp8 (17.35 GB each), T2V lightx2v LoRAs (1.23 GB each); UMT5 and VAE are shared. 24 GB VRAM, Apache-2.0.+* _(inferred)_ The Wan 2.2 T2V lightx2v LoRAs work with Fun VACE (same A14B T2V base); shift 5, 4 steps and split 2 are copied from the library's wan22 workflows. Resample input clips to 16 fps first.++**Alternatives:**++* **SVI 2.0 Pro (Stable Video Infinity).** Best for very long, many-chunk videos. Graph: `VAEEncode(first frame) → anchor`, `VAEEncode(last 5 frames) → prev_samples`, then `WanImageToVideoSVIPro(positive, negative, length, anchor_samples, prev_samples, motion_latent_count=1)` (KJNodes) feeding Wan 2.2 I2V high/low + the `SVI_v2_PRO_Wan2.2-I2V-A14B_{HIGH,LOW}` LoRAs (1.23 GB each, MIT) + I2V lightx2v. Validated.+ * Verified in source: only latent 0 is masked as known; the motion latent is appended after the anchor.+ * _(inferred)_ Frame bookkeeping: drop the decoded anchor frame, then blend a 4-frame overlap. In real chaining, pass the previous chunk's **sampler latent** as `prev_samples`; the VAE round trip used for the first extension is an approximation.+* **Wan 2.2 I2V with a multi-frame start_image** (library `wan22-i2v-14b-lightx2v`, with LoadImage replaced by the last 5 frames). Validated. `WanImageToVideo` copies `start_image[:length]` into the first frames and masks `((n−1)//4)+1` latents. It is the simplest option but has the weakest continuity.+* **LTX-2.x `LTXVExtendSampler`** (ComfyUI-LTXVideo): `num_new_frames=80`, `frame_overlap=16`, `strength=0.5`. It extends with synchronized audio and is best when the source came from LTX. LTX license applies.+* **MiniMax H3 continuation** (core template). Territory-restricted license, so it does not fit Fuobe.++## 4. Video reframe / outpaint (`video-reframe`)++**Recommendation: Wan 2.2 Fun VACE A14B outpainting.** This is the official `video_wan_vace_outpainting` template re-targeted to Wan 2.2 Fun VACE.++```+LoadVideo → GetVideoComponents → ImageScale(sourceW×sourceH) → ImagePadForOutpaint(l,t,r,b, feathering 0)+ image → control_video ; mask → MaskToImage → RepeatImageBatch(frames) → ImageToMask(red) → control_masks+ → WanVaceToVideo(W=sourceW+l+r, H=sourceH+t+b) → 2-stage Fun VACE sampler → TrimVideoLatent → VAEDecode → SaveVideo+```++* The app picks `sourceWidth` and `sourceHeight` so the padded size hits the target aspect ratio: multiples of 16, with pads in steps of 8 (`ImagePadForOutpaint` step). Example: 9:16 368×640 → 16:9 1136×640 with 384 px left and right.+* Verified: `ImagePadForOutpaint` fills the padding with 0.5 gray and sets mask = 1 there (`nodes.py`).+* `frames` must be ≤ the source frame count. Longer clips need windowing, reusing the video-extend known-frame trick.+* Alternatives:+ * Template-exact **Wan 2.1 VACE 14B + CausVid** (single KSampler, uni_pc, 4 steps, shift 8). Validated; uses the library's VACE files.+ * **LTX-2.3/2.5 Video Outpainting IC-LoRA** (`template_ltx2_3_lora_video_outpainting`, needs LTXVideo, KJNodes, VHS and ComfyMath). Higher resolution and keeps the audio; revenue-gated.++## 5. Relight: image (`relight`) and video (`video-relight`)++**Image: Qwen-Image-Edit-2509 + Relight LoRA** (official template `image_qwen_image_edit_2509_relight`). It is the library's `qwen-image-edit-2509.json` with two added nodes:++* Node `1001` is a `LoraLoaderModelOnly` inserted between `433:89` (the Lightning LoRA) and `433:66`.+* Node `1002` is a `StringConcatenate` that prefixes the trigger `重新照明,` ("relight,") to the user prompt.++Settings and license: 4 steps, cfg 1, the LoRA is 0.24 GB, Apache-2.0. Validated.++**Light from a reference image: Light-Migration LoRA** (template `templates-portrait_light_migration`). The reference image is wired as `image2` of both `TextEncodeQwenImageEditPlus` nodes, and the template's instruction prefix tells the model to use image 2's lighting and tone to relight image 1. Validated.++* IC-Light v2 (FLUX) weights were never released. IC-Light v1 (SD1.5, kijai pack) is legacy and its license is unclear.+* FLUX Kontext relight LoRAs sit on a non-commercial base.+* Bernini-R image editing (core) is another Apache option.++**Video: Bernini-R** (ByteDance, Apache-2.0, a Wan 2.2 A14B fine-tune; core node `BerniniConditioning`; official template `video_bernini_r_video_editing`).++```+LoadVideo → GetVideoComponents.images → BerniniConditioning(source_video, W,H,length)+StringConcatenate(system prompt "…adjust the video's style, lighting, colors…", user prompt) → CLIPTextEncode+UNET high/low (+ lightx2v T2V v2 rank64 @3.0 / @1.5) ; BasicScheduler(6) → SplitSigmas(3) ; SamplerCustom ×2 (res_multistep, cfg 1)+→ VAEDecode → CreateVideo → SaveVideo+```++* This is the template subgraph with its turbo switch on, flattened. With turbo off: 40 steps split at 20, cfg 5, no LoRA.+* Models: 15.6 GB per expert in fp8 (int8_convrot and mxfp8 variants also exist). 24 GB VRAM. Validated.+* This is the only open, native, prompt-driven **video** relight. Wan Animate and SCAIL-2 relight LoRAs only apply inside character replacement.+* _(inferred)_ Relight quality.++## 6. Draw-to-video / trajectory control (`draw-to-video`)++**Recommendation: Wan-Move 14B 480p.** Core nodes since 0.5.0, official template `video_wanmove_480p`, Apache-2.0.++```+LoadImage → ImageScale(832×480) ; PrimitiveStringMultiline(tracks JSON) → WanMoveTracksFromCoords+CLIPVisionEncode(clip_vision_h) ; WanMoveTrackToVideo(tracks, strength, W,H,length, start_image, clip_vision_output)+UNET Wan21-WanMove fp8 (16.4 GB) + lightx2v I2V 480p → ModelSamplingSD3(8) → KSampler(6 steps, cfg 1, er_sde) → VAEDecode → SaveVideo+```++* **Track format, verified in `nodes_wanmove.py`.** `tracks` is a JSON list of tracks. Each track is a list of `{"x": px, "y": px}` with **one point per output frame**, in the pixel space of the resized image, and all tracks have the same length.+* The client resamples each stroke to `frames` points and adds a few parallel tracks per object; `GenerateTracks` shows the spreading pattern. A constant-position track pins the background.+* `track_coords` is `forceInput`, so the binding targets a `PrimitiveStringMultiline` node.+* Without the LoRA: 20 steps, cfg 6. `WanMoveVisualizeTracks` previews the paths.++**Alternatives:**++* **ATI** (native `WanTrackToVideo`, template `video_wan_ati`). `tracks` is a plain STRING widget of tracks with **121 points** each (24 fps samples over 5 s); 20 steps, cfg 3, uni_pc. Validated.+* **Wan 2.2 Time-to-Move** (WanVideoWrapper `WanVideoAddTTMLatents`, example workflow in the pack). Cut-and-drag: the app renders a crude animation of the object moving along the drawn path and TTM makes it realistic at Wan 2.2 quality. Wrapper-only.+* **LTX-2.5 Motion-Track IC-LoRA.** Revenue-gated.++## 7. Multi-shot / multi-scene (`multi-shot`)++**Recommendation: LTX-2.5 native multishot**, using the **existing** `ltx25-t2v` and `ltx25-i2v` workflows, so no new graph is needed.++* The Lightricks model card and the template notes confirm "one generation yields multiple connected shots holding character, environment, lighting, voice, and style across cuts".+* Prompts are written as an ordered shot list with explicit cut cues. Keep 8–20 s at 24 fps (frameStep 8).+* _(inferred)_ The exact prompt syntax: Lightricks' prompting guide at docs.ltx.video returned 403 from this box.+* License: LTX-2 Community, free below US$10M entity revenue.++**Commercially clean alternative: chain the shots.**++1. Make storyboard panels (gap 9).+2. Run one `wan22-i2v-14b-lightx2v` job per shot, or `wan22-flf2v-14b` between panel N and N+1 for match cuts.+3. Join the shots with the validated concat graph `LoadVideo×N → ImageScale → BatchImagesNode(images.image0..N) → CreateVideo → SaveVideo`.++Add sound afterwards with v2a or music.++**Other options:**++| Option | License | Status |+|---|---|---|+| **HoloCine** | **CC-BY-NC-SA-4.0** | No ComfyUI node found; WanVideoWrapper@088128b has no HoloCine code. Skip. |+| **SVI-shot / film-transition LoRAs** | MIT | Wan 2.1 I2V |+| **EchoShot** | — | Wan 2.1 1.3B, portrait only |++`verified: false` because the recommendation depends on prompt syntax that could only be inferred.++## 8. Character LoRA training, Soul ID parity (`character-lora`)++**Recommendation: ostris/ai-toolkit as a headless training worker** (MIT). The JSON's `jobConfigs` has five ready job objects. They are the same structure as the UI's `defaultJobConfig` and the `config/examples` YAMLs; serialize them as YAML for the CLI or send them as JSON to the UI API.++| Job | `model.arch` | Base | Key settings |+|---|---|---|---|+| `zimage-turbo-character` | `zimage:turbo` | `Tongyi-MAI/Z-Image-Turbo` | `assistant_lora_path: ostris/zimage_turbo_training_adapter/zimage_turbo_training_adapter_v2.safetensors` (de-distill adapter, training only); qfloat8; low_vram; rank 16; 2500 steps; samples at 9 steps, cfg 1 |+| `flux3-klein-base-character` | `flux3` | `black-forest-labs/flux-3-image-klein-base` (gated) | convrot8; timestep shift; 28-step samples |+| `flux1-dev-character` | `is_flux: true` | `black-forest-labs/FLUX.1-dev` (NC, gated) | quantize; 2000 steps |+| `qwen-image-2512-character` | `qwen_image:2512` | `Qwen/Qwen-Image-2512` | uint3 + accuracy-recovery adapter; 24 GB |+| `wan22-14b-t2v-character` | `wan22_14b` | `ai-toolkit/Wan2.2-T2V-A14B-Diffusers-bf16` | uint4 + ARA; trains both experts; `switch_boundary_every: 10`; num_frames 1 on stills |++**Verified from source:**++* `model.arch` values like `zimage:turbo` are split at `:` (`toolkit/config_modules.py:775`). The suffix only selects UI defaults (`extensions_built_in/diffusion_models/ui.tsx`).+* CLI: `python run.py <config.yaml> [-n name] [-l log] [-r]`.+* UI on port 8675:+ * Auth: `Authorization: Bearer $AI_TOOLKIT_AUTH`, required only when that env var is set (`ui/src/middleware.ts`).+ * `POST /api/jobs {name, gpu_ids, job_config}` creates a job (409 if the name exists).+ * `GET /api/jobs/<id>/start` queues it.+ * `GET /api/jobs?id=<id>` returns `status`, `step`, `total_steps` and `info`.+ * Also: `GET /api/jobs/<id>/log`, `/files` (lists `.safetensors`), `/stop`, `/samples`.++**Dataset layout:** a folder of jpg/jpeg/png files with same-name `.txt` captions (webp is unsupported). Images are aspect-bucketed and never upscaled. Use `[trigger]` in captions together with `trigger_word`.++Typical values _(inferred)_: 15–30 varied photos, rank 16–32, lr 1e-4, 2000–3000 steps, a save every 500 steps, and a pick by sample review. VRAM is about 16–24 GB with low_vram and quantization (preset targets, not measured).++Output: copy `<training_folder>/<name>/<name>.safetensors` to `models/loras/fuobe/<user>/` and inject it with Fuobe's `injectLoras`. Run training on a separate GPU or worker, because jobs hold the GPU for 20–90 min.++**ComfyUI-native alternative (validated): core `TrainLoraNode`.** Graph: `LoadImageTextDataSetFromFolder(input/<folder>) → MakeTrainingDataset(images, vae, clip, texts) → TrainLoraNode → SaveLoRA`.++* Verified `TrainLoraNode` inputs:+ * Data and model: `model`, `latents`, `positive`+ * Optimisation: `batch_size`, `grad_accumulation_steps`, `steps` 16, `learning_rate` 5e-4, `rank` 8, `optimizer` AdamW/Adam/SGD/RMSprop, `loss_function` MSE/L1/Huber/SmoothL1, `seed`+ * Precision and algorithm: `training_dtype`, `lora_dtype`, `quantized_backward`, `algorithm` LoRA/LoHa/LoKr/OFT+ * Memory and resume: `gradient_checkpointing`, `checkpoint_depth`, `offloading`, `existing_lora`, `bucket_mode`, `bypass_mode`+ * Outputs: `(LORA_MODEL, LOSS_MAP, steps)`+* It is experimental and has no captioning or sampling tooling.+* `SaveLoRA` writes `output/<prefix>_<steps>_steps_<counter>_.safetensors`, so the app must move the file into `models/loras`.+* Training the distilled Turbo model directly, without the adapter, degrades it.++**Other trainers:**++* `kohya-ss/musubi-tuner`: scriptable, strongest for video.+* `kijai/ComfyUI-FluxTrainer`: FLUX.1 only and stale since 2025-04. Nodes: `InitFluxLoRATraining`, `FluxTrainModelSelect`, `TrainDatasetGeneralConfig`, `TrainDatasetAdd`, `OptimizerConfig*`, `FluxTrainLoop`, `FluxTrainAndValidateLoop`, `FluxTrainSave`, `FluxTrainEnd`, `VisualizeLoss`, `ExtractFluxLoRA`.++## 9. Storyboard / consistent sequence, Popcorn parity (`storyboard`)++**Recommendation: chain Qwen-Image-Edit-2509 with the next-scene LoRA v2** (`lovis93/next-scene-qwen-image-lora-2509`, MIT, 0.3 GB, strength 0.7–0.8 per the model card, prompt prefix `Next Scene:`).++* It is the library's `qwen-image-edit-2509` plus three nodes: `LoraLoaderModelOnly` 1001, a `StringConcatenate` prefix (1002), and a second `LoadImage` (1003) wired as `image2` of both text encoders.+* For each panel: `image` = the previous panel, `image2` = the character or product reference (re-injected every panel to stop drift), and the prompt = camera move plus story beat. Validated.+* Start panel 1 from `z-image-turbo-t2i` with the user's character LoRA.++**Alternatives:**++* The library's **`qwen-image-edit-2511-multi`** (3 references; each panel generated independently from the same references, so no drift but less continuity). The next-scene LoRA loads on 2511 (same architecture) but that is untested.+* **`flux2-dev-multiref`**: the strongest multi-reference consistency, but non-commercial.+* Qwen Image 2.1 Next-Scene LoRA (Apache) on a non-commercial base.++## 10. Video background removal / alpha (`video-bg-remove`) and video depth (`video-depth`)++**Alpha: BiRefNet on every frame.**++```+LoadVideo → GetVideoComponents.images → RemoveBackground(LoadBackgroundRemovalModel birefnet)+→ InvertMask → JoinImageWithAlpha → SaveWEBM(codec vp9) # real transparency (yuva420p)+ └→ MaskToImage → CreateVideo → SaveVideo # matte MP4 for compositing+```++* Verified:+ * `comfy/bg_removal_model.py` loops over the image batch.+ * `SaveWEBM` writes alpha when the images are RGBA and the codec is vp9.+ * `JoinImageWithAlpha` stores `1 − mask`, which is why `InvertMask` is needed; the library's `bg-remove-birefnet` does the same.+* MIT, 0.44 GB, about 4 GB VRAM. Validated.+* Per-frame, so hair edges may flicker _(inferred)_. Comfy-Org/BiRefNet also ships `lucida.safetensors` (0.88 GB). The core loader only recognises BiRefNet-architecture keys (`comfy/bg_removal_model.py`), so lucida works only if it is a BiRefNet variant _(unverified)_.++**"Keep only X": SAM 3.1 video tracking** (core, template `utility_video_segment_sam3`).++* Graph: `CheckpointLoaderSimple(sam3.1_multiplex_fp16, 1.75 GB) → CLIPTextEncode("person") → SAM3_VideoTrack(images, model, conditioning, detection_threshold 0.5, max_objects 4, detect_interval 1) → SAM3_TrackToMask(object_indices) → InvertMask → JoinImageWithAlpha → SaveWEBM`. Validated.+* License: the Meta SAM License, royalty-free and commercial use allowed.+* Hard edges; multiply with the BiRefNet matte for hair.++**Depth: Depth Anything 3 mono-large** (core, template `utility_depth_anything3_video_depth_estimation`, Apache; the DA3 Large and Giant variants are NC).++* Graph: `LoadDA3Model → DA3Inference(resolution 504 step 14, mode="mono") → DA3Render(output="depth", "output.normalization"="v2_style") → CreateVideo → SaveVideo`.+* `mode` and `output` are DynamicCombo inputs, written as dotted keys in API format. Validated.+* It is per-frame.++**Temporally stable alternative: Video Depth Anything Small** (Apache; Base and Large are CC-BY-NC) through `yuvraj108c/ComfyUI-Video-Depth-Anything`: `LoadVideoDepthAnythingModel → VideoDepthAnythingProcess(input_size 518, max_res 1280, fp16) → VideoDepthAnythingOutput(gray)`. Validated.++> **Bug found via `/object_info`:** the loader's declared default `video_depth_anything_vits.safetensors` is not in its own option list. Always pass `model` explicitly.++## 11. Color palette control, Soul HEX parity (`palette`)++There is no open "palette-conditioned" diffusion adapter worth adopting. Use two layers instead:++1. **Generation:** FLUX.2 understands hex codes. This is verified in BFL's FLUX.2 prompting guide ("FLUX.2 supports precise color matching using hex codes"; syntax such as `Walls: #C4725A`, and gradients "starting with color #02eb3c and finishing with color #edfa3c"). Palette presets become prompt text on `flux2-dev-t2i` or `flux2-dev-edit` (NC). FLUX.2 klein 4B is Apache, and hex support there is _(inferred)_.+2. **Deterministic lock (recommended graph):** core **`ColorTransfer`**`(image_target, image_ref, method reinhard_lab|mkl_lab|histogram, source_stats per_frame|uniform|target_frame (+target_index), strength)`.+ * `image_ref` is a swatch PNG the app renders from the HEX list, with bands weighted by intended coverage.+ * For video, use `source_stats="uniform"` to avoid flicker.+ * Validated; no model; runs on CPU.+ * A fully client-side equivalent: k-means palette extraction plus LAB histogram matching in WebGL or canvas.++**Alternatives:**++* KJNodes `ColorMatch` (mkl, hm, reinhard, mvgd, hm-mvgd-hm, hm-mkl-hm).+* Qwen-Edit-2511 with the swatch as `image2` (semantic recolor).+* Recraft color control (paid API, the closest closed equivalent).++Risk: histogram matching shifts skin tones. Mask faces with SAM3 or keep strength ≤ 0.8.++---++## Cross-cutting risks++* **Licenses that disqualify options for commercial Fuobe defaults:**++ | Option | License |+ |---|---|+ | HoloCine | CC-BY-NC-SA |+ | F5-TTS | CC-BY-NC |+ | Higgs Audio v3 | research / non-commercial |+ | VibeVoice | card restricts use to research |+ | FLUX.1 / FLUX.2 [dev], Qwen Image 2.1 | non-commercial |+ | Video Depth Anything Large, DA3 Large / Giant | CC-BY-NC |+ | Seed-VC | GPL-3.0 (copyleft weights) |+ | LTX-2.x | revenue-gated |+ | MiniMax H3 | territory-gated |++* **Very new weights:** Bernini-R (2026-06), Wan 2.2 Fun VACE and SVI 2.0 Pro. The graphs are structurally validated but their settings come from templates and community practice, so run a GPU smoke test (one real render per workflow) before exposing them.+* **Auto-downloading packs:** Chatterbox, VibeVoice, IndexTTS-2 and Video-Depth-Anything download weights at execution time. Pre-seed them, otherwise the first job stalls or fails offline.+* **GPU contention:** training and the 24 GB video workflows should not share one GPU queue with interactive image jobs.diff --git a/scripts/gen-cloud-models.py b/scripts/gen-cloud-models.pyindex a3be62aa..c39e9677 100644--- a/scripts/gen-cloud-models.py+++ b/scripts/gen-cloud-models.py@@ -18,6 +18,12 @@ RESEARCH = json.loads((ROOT / "docs/research/paid-model-apis.json").read_text())EPS = {}for e in RESEARCH["endpoints"]:EPS.setdefault((e["provider"], e["endpoint"]), e)+# Part 2 (multi-shot, draft, extend, reframe, audio, training) re-verified some endpoints with more key fields.+RESEARCH_2 = json.loads((ROOT / "docs/research/paid-model-apis-2.json").read_text())+for e in RESEARCH_2["endpoints"]:+ prev = EPS.get((e["provider"], e["endpoint"]))+ # Keep part 1's key fields (aspect ratio mappings etc.) and add part 2's.+ EPS[(e["provider"], e["endpoint"])] = {**e, "keyFields": {**((prev or {}).get("keyFields") or {}), **(e.get("keyFields") or {})}}IMG_AR = ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "21:9", "5:4", "4:5"]IMAGE_SIZE_MAP = {@@ -119,13 +125,16 @@ model("imagen-4", "Imagen 4", "Google", "imagen", "image", "Google's photoreal tmodel("seedance-2-5", "Seedance 2.5", "ByteDance", "seedance", "video","Higgsfield's default — multi-shot cinema with native audio, up to 30s",[("t2v", "bytedance/seedance-2.5/text-to-video"), ("i2v", "bytedance/seedance-2.5/image-to-video", "fal", "+flf2v"),- ("ref2v", "bytedance/seedance-2.5/reference-to-video")],- badges=["top", "audio", "new"], pricing=("second", 0.473, "720p"), defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "720p"})+ ("ref2v", "bytedance/seedance-2.5/reference-to-video"),+ ("extend", "bytedance/seedance-2.5/reference-to-video", "fal", {"fixed": {"task": "extension"}, "videoArray": True}),+ ("finalize", "bytedance/seedance-2.5/draft/complete")],+ badges=["top", "audio", "new"], pricing=("second", 0.473, "720p"), defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "720p"},+ options={"multiShot": {"mode": "prompt", "maxShots": 6}})model("seedance-2-0", "Seedance 2.0", "ByteDance", "seedance", "video","Smooth multi-shot motion with audio",[("t2v", "bytedance/seedance-2.0/text-to-video"), ("i2v", "bytedance/seedance-2.0/image-to-video", "fal", "+flf2v"),("ref2v", "bytedance/seedance-2.0/reference-to-video")],- badges=["audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "720p"})+ badges=["audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "720p"}, options={"multiShot": {"mode": "prompt", "maxShots": 6}})model("seedance-2-0-fast", "Seedance 2.0 Fast", "ByteDance", "seedance", "video","Seedance 2 at draft speed",[("t2v", "bytedance/seedance-2.0/fast/text-to-video"), ("i2v", "bytedance/seedance-2.0/fast/image-to-video", "fal", "+flf2v"),@@ -170,10 +179,12 @@ model("kling-2-5-turbo", "Kling 2.5 Turbo Pro", "Kuaishou", "kling", "video",model("veo-3-1", "Veo 3.1", "Google", "veo", "video","State-of-the-art realism with synchronized sound and dialogue",[("t2v", "fal-ai/veo3.1"), ("i2v", "fal-ai/veo3.1/image-to-video"), ("flf2v", "fal-ai/veo3.1/first-last-frame-to-video"),- ("ref2v", "fal-ai/veo3.1/reference-to-video"), ("t2v", "google/veo-3.1", "replicate"), ("i2v", "google/veo-3.1", "replicate")],+ ("ref2v", "fal-ai/veo3.1/reference-to-video"), ("t2v", "google/veo-3.1", "replicate"), ("i2v", "google/veo-3.1", "replicate"),+ ("extend", "fal-ai/veo3.1/extend-video", "fal", {"note": "fal retires Veo 3.1 extend on 2026-11-17"})],badges=["top", "audio", "hd"], pricing=("second", 0.4, "audio-off-half"), defaults={"aspectRatio": "16:9", "duration": 8, "resolution": "1080p"})model("veo-3-1-fast", "Veo 3.1 Fast", "Google", "veo", "video", "Veo quality at a fraction of the cost",- [("t2v", "fal-ai/veo3.1/fast"), ("i2v", "fal-ai/veo3.1/fast/image-to-video"), ("flf2v", "fal-ai/veo3.1/fast/first-last-frame-to-video")],+ [("t2v", "fal-ai/veo3.1/fast"), ("i2v", "fal-ai/veo3.1/fast/image-to-video"), ("flf2v", "fal-ai/veo3.1/fast/first-last-frame-to-video"),+ ("extend", "fal-ai/veo3.1/fast/extend-video", "fal", {"note": "fal retires Veo 3.1 extend on 2026-11-17"})],badges=["fast", "audio"], pricing=("second", 0.15), defaults={"aspectRatio": "16:9", "duration": 8, "resolution": "1080p"})model("veo-3-1-lite", "Veo 3.1 Lite", "Google", "veo", "video", "Cheapest Veo for drafts and volume",[("t2v", "fal-ai/veo3.1/lite"), ("i2v", "fal-ai/veo3.1/lite/image-to-video")],@@ -195,7 +206,7 @@ model("wan-2-7", "Wan 2.7", "Alibaba Wan", "wan", "video", "Hosted Wan with refebadges=["audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "1080p"})model("wan-2-6", "Wan 2.6", "Alibaba Wan", "wan", "video", "Multi-shot Wan with audio",[("t2v", "wan/v2.6/text-to-video"), ("i2v", "wan/v2.6/image-to-video"), ("ref2v", "wan/v2.6/reference-to-video")],- badges=["audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "1080p"})+ badges=["audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "1080p"}, options={"multiShot": {"mode": "prompt", "maxShots": 6}})model("wan-2-5", "Wan 2.5", "Alibaba Wan", "wan", "video", "Audio-driven video up to 1080p",[("t2v", "fal-ai/wan-25-preview/text-to-video"), ("i2v", "fal-ai/wan-25-preview/image-to-video")],badges=["audio"], pricing=("second", 0.15, "1080p"), defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "1080p"})@@ -203,7 +214,8 @@ model("minimax-h3", "MiniMax H3", "MiniMax", "hailuo", "video", "Expressive char[("t2v", "minimax/h3/text-to-video"), ("i2v", "minimax/h3/image-to-video", "fal", "+flf2v"), ("ref2v", "minimax/h3/reference-to-video")],badges=["new"], defaults={"aspectRatio": "16:9"})model("minimax-h3-max", "MiniMax H3 Max", "MiniMax", "hailuo", "video", "Top-tier MiniMax with extend",- [("t2v", "minimax/h3-max/text-to-video"), ("i2v", "minimax/h3-max/image-to-video", "fal", "+flf2v"), ("ref2v", "minimax/h3-max/reference-to-video")],+ [("t2v", "minimax/h3-max/text-to-video"), ("i2v", "minimax/h3-max/image-to-video", "fal", "+flf2v"), ("ref2v", "minimax/h3-max/reference-to-video"),+ ("extend", "minimax/h3-max/extend-video")],badges=["pro"], defaults={"aspectRatio": "16:9"})model("hailuo-2-3", "MiniMax Hailuo 2.3", "MiniMax", "hailuo", "video", "Expressive characters and dynamic action",[("t2v", "fal-ai/minimax/hailuo-2.3/pro/text-to-video"), ("i2v", "fal-ai/minimax/hailuo-2.3/pro/image-to-video")],@@ -213,20 +225,27 @@ model("hailuo-02", "MiniMax Hailuo 02", "MiniMax", "hailuo", "video", "Physics-hpricing=("second", 0.045), defaults={"duration": 6, "resolution": "768P"}, fixed={"prompt_optimizer": True})model("flux-3-video", "FLUX.3 Video", "Black Forest Labs", "flux", "video", "BFL's video model with keyframes and edits",[("t2v", "blackforestlabs/flux-3/text-to-video"), ("i2v", "blackforestlabs/flux-3/image-to-video"),- ("flf2v", "blackforestlabs/flux-3/first-last-frame-to-video"), ("v2v", "blackforestlabs/flux-3/edit-video")],+ ("flf2v", "blackforestlabs/flux-3/first-last-frame-to-video"), ("v2v", "blackforestlabs/flux-3/edit-video"),+ ("extend", "blackforestlabs/flux-3/extend-video")],badges=["new"], defaults={"aspectRatio": "16:9"})model("ltx-2-5", "LTX 2.5 Pro", "Lightricks", "ltx", "video", "Fast 4K-capable video with audio",[("t2v", "lightricks/ltx-2.5/text-to-video/pro"), ("i2v", "lightricks/ltx-2.5/image-to-video/pro")],badges=["audio"], defaults={"aspectRatio": "16:9"})model("pixverse-v6", "PixVerse V6", "PixVerse", "pixverse", "video", "Stylized social video with transitions",- [("t2v", "fal-ai/pixverse/v6/text-to-video"), ("i2v", "fal-ai/pixverse/v6/image-to-video"), ("flf2v", "fal-ai/pixverse/v6/transition")],+ [("t2v", "fal-ai/pixverse/v6/text-to-video"), ("i2v", "fal-ai/pixverse/v6/image-to-video"), ("flf2v", "fal-ai/pixverse/v6/transition"),+ ("extend", "fal-ai/pixverse/v6/extend")],defaults={"aspectRatio": "16:9"})model("vidu-q3", "Vidu Q3", "Shengshu", "vidu", "video", "Anime-friendly video with references",[("t2v", "fal-ai/vidu/q3/text-to-video"), ("i2v", "fal-ai/vidu/q3/image-to-video"), ("ref2v", "fal-ai/vidu/q3/reference-to-video/mix")],defaults={"aspectRatio": "16:9"})model("luma-ray-3-2", "Luma Ray 3.2", "Luma", "luma", "video", "HDR, physically convincing motion",- [("t2v", "luma/agent/ray/v3.2/text-to-video"), ("i2v", "luma/agent/ray/v3.2/image-to-video"), ("v2v", "luma/agent/ray/v3.2/video-to-video")],+ [("t2v", "luma/agent/ray/v3.2/text-to-video"), ("i2v", "luma/agent/ray/v3.2/image-to-video"), ("v2v", "luma/agent/ray/v3.2/video-to-video"),+ ("reframe", "luma/agent/ray/v3.2/reframe")],defaults={"aspectRatio": "16:9"})+model("ltx-reframe", "LTX Reframe", "Lightricks", "ltx", "video", "Change a clip's aspect ratio — fast, no prompt needed",+ [("reframe", "fal-ai/ltx-2.3/reframe")], defaults={"aspectRatio": "9:16"})+model("wan-vace-reframe", "Wan VACE Reframe (hosted)", "Alibaba Wan", "wan", "video", "Open-weights reframe: outpaints the new edges with a prompt",+ [("reframe", "fal-ai/wan-vace-14b/reframe")], defaults={"aspectRatio": "9:16"})# ----- Avatars & lipsyncmodel("kling-avatar-2", "Kling Avatar 2.0", "Kuaishou", "kling", "video", "Photo + voice → expressive talking video",@@ -289,7 +308,8 @@ def num(v):return None-def build_route(op, ep, provider, m, opts):+def build_route(op, ep, provider, m, opts, ropts=None):+ ropts = ropts or {}e = EPS.get((provider, ep))if not e:warn(f"{m['id']}: endpoint {provider}:{ep} not in research")@@ -305,11 +325,32 @@ def build_route(op, ep, provider, m, opts):fmap["prompt"] = kf["prompt"]else:fmap["prompt"] = False+ # Some APIs call their boolean sound switch "audio" (Wan 3.0); that's generateAudio, not an audio file.+ if "audio" in kf and (inputs.get(kf["audio"]) or {}).get("type") == "boolean":+ kf.setdefault("generateAudio", kf.pop("audio"))for k in ["negativePrompt", "image", "images", "endImage", "mask", "video", "audio", "numOutputs", "seed", "generateAudio"]:if k in kf:if k in ("video", "audio", "image", "endImage", "mask") and (inputs.get(kf[k]) or {}).get("type") == "array":- continue # array-of-media inputs (reference videos/audios) aren't wired yet+ if k == "video" and ropts.get("videoArray"):+ fmap["videoArray"] = kf[k]+ continue # other array-of-media inputs (reference videos/audios) aren't wired yetfmap[k] = kf[k]+ # Multi-shot, draft mode and draft completion (research part 2 key fields).+ if "multiShot" in kf and op in ("t2v", "i2v", "ref2v") and (inputs.get(kf["multiShot"]) or {}).get("type") in ("array", "string"):+ item = (inputs.get(kf["multiShot"]) or {}).get("itemSchema") or {}+ dtype = "string" if (item.get("duration") or {}).get("valueType") == "string" else "number"+ ms = {"key": kf["multiShot"], "durationType": dtype}+ if (inputs.get(kf["multiShot"]) or {}).get("type") == "string":+ ms["json"] = True+ if "shotType" in kf:+ ms["shotType"] = kf["shotType"]+ fmap["multiShot"] = ms+ opts["multiShot"] = {"mode": "native", "maxShots": 6}+ if "draft" in kf and op in ("t2v", "i2v", "ref2v"):+ fmap["draft"] = kf["draft"]+ opts["draft"] = True+ if "draftId" in kf:+ fmap["draftId"] = kf["draftId"]# LTX/others sometimes have image key named differently but keyFields covers it.if "negativePrompt" in fmap:opts["negativePrompt"] = True@@ -353,7 +394,8 @@ def build_route(op, ep, provider, m, opts):fmap["duration"] = {"key": key, "type": dtype, **({"suffix": suffix} if suffix else {})}if len(vals) > 6:pick = [v for v in vals if v in (3, 4, 5, 6, 8, 10, 12, 15, 20, 30)] or vals[:6]- vals = pick[:7]+ # Keep the longest option: multi-shot budgets and the duration picker both need the real maximum.+ vals = pick[:6] + [pick[-1]] if len(pick) > 7 else pickopts["durations"] = union(opts.get("durations", []), vals)else:dtype = "number" if spec.get("type") in ("integer", "number") else "string"@@ -363,6 +405,8 @@ def build_route(op, ep, provider, m, opts):if key.endswith("_ms"):fmap["duration"]["multiplier"] = 1000# Text-to-speech etc. carry the prompt in "text".+ if ropts.get("fixed"):+ m = {**m, "fixed": {**m["fixed"], **ropts["fixed"]}}if m["fixed"]:fmap["fixed"] = {k: v for k, v in m["fixed"].items() if k in inputs}missing = [k for k in m["fixed"] if k not in inputs]@@ -378,7 +422,10 @@ def build_route(op, ep, provider, m, opts):opts["maxImages"] = max(opts.get("maxImages", 1), mx or (10 if op == "edit" else 4))elif "image" in fmap:opts["maxImages"] = max(opts.get("maxImages", 0), 1)- return {"op": op, "provider": provider, "endpoint": ep, "map": fmap}, e+ route = {"op": op, "provider": provider, "endpoint": ep, "map": fmap}+ if ropts.get("note"):+ route["note"] = ropts["note"]+ return route, edef parse_price(e):@@ -398,21 +445,23 @@ for m in M:for r in m["routes"]:op, ep = r[0], r[1]provider = r[2] if len(r) > 2 else "fal"- res = build_route(op, ep, provider, m, opts)+ ropts = r[3] if len(r) > 3 and isinstance(r[3], dict) else {}+ res = build_route(op, ep, provider, m, opts, ropts)if not res:continueroute, e = resfirst_e = first_e or eroutes.append(route)# Edit endpoints that take a mask also get a native inpaint route.- if op == "edit" and "mask" not in route["map"]:+ if op == "edit":inputs = e.get("inputs") or {}- mk = next((k for k in ("mask_url", "mask_image_url", "mask") if k in inputs and inputs[k].get("type") != "array"), None)+ # The mask belongs on the inpaint route only; plain edits never send one.+ mk = route["map"].pop("mask", None) or next((k for k in ("mask_url", "mask_image_url", "mask") if k in inputs and inputs[k].get("type") != "array"), None)if mk:# Ideogram paints black = change; OpenAI's GPT Image uses transparent = change.fmt = "black" if "ideogram" in ep else "alpha" if ("gpt-image" in ep or ep.startswith("openai/")) else Noneroutes.append({**route, "op": "inpaint", "map": {**route["map"], "mask": mk, **({"maskFormat": fmt} if fmt else {})}})- if len(r) > 3 and r[3] == "+flf2v":+ if len(r) > 3 and r[3] == "+flf2v" and not ropts:if "endImage" in route["map"]:routes.append({**route, "op": "flf2v"})else:diff --git a/scripts/gen-higgsfield-models.py b/scripts/gen-higgsfield-models.pyindex 577fa77b..addf4c0b 100644--- a/scripts/gen-higgsfield-models.py+++ b/scripts/gen-higgsfield-models.py@@ -93,6 +93,11 @@ def field_map(op, ep, inputs, opts):elif "sound" in inputs and inputs["sound"].get("enum") == ["on", "off"]:fm["generateAudio"] = {"key": "sound", "on": "on", "off": "off"}opts["audio"] = True+ if "multi_prompt" in inputs and op in ("t2v", "i2v", "flf2v", "ref2v"):+ item = (inputs["multi_prompt"].get("items") or {}).get("fields") or {}+ dtype = "number" if (item.get("duration") or {}).get("type") in ("integer", "number") else "string"+ fm["multiShot"] = {"key": "multi_prompt", "durationType": dtype, **({"flag": "multi_shots"} if "multi_shots" in inputs else {})}+ opts["multiShot"] = {"mode": "native", "maxShots": int(inputs["multi_prompt"].get("maxItems", 6))}if "batch_size" in inputs:b = inputs["batch_size"]if b.get("enum"):diff --git a/src/app/(studio)/extend/page.tsx b/src/app/(studio)/extend/page.tsxnew file mode 100644index 00000000..eb1ba847--- /dev/null+++ b/src/app/(studio)/extend/page.tsx@@ -0,0 +1,9 @@+import type { Metadata } from "next";+import { StudioPage } from "@/components/studio/studio-page";+import { EXTEND_STUDIO } from "@/lib/studios";++export const metadata: Metadata = { title: "Extend video" };++export default function Page() {+ return <StudioPage config={EXTEND_STUDIO} />;+}diff --git a/src/app/(studio)/reframe/page.tsx b/src/app/(studio)/reframe/page.tsxnew file mode 100644index 00000000..f8690c6e--- /dev/null+++ b/src/app/(studio)/reframe/page.tsx@@ -0,0 +1,9 @@+import type { Metadata } from "next";+import { StudioPage } from "@/components/studio/studio-page";+import { REFRAME_STUDIO } from "@/lib/studios";++export const metadata: Metadata = { title: "Reframe" };++export default function Page() {+ return <StudioPage config={REFRAME_STUDIO} />;+}diff --git a/src/app/api/generations/route.ts b/src/app/api/generations/route.tsindex 761ac616..091bb407 100644--- a/src/app/api/generations/route.ts+++ b/src/app/api/generations/route.ts@@ -28,6 +28,10 @@ const RequestSchema = z.object({seed: z.number().int().optional(),generateAudio: z.boolean().optional(),enhancePrompt: z.boolean().optional(),+ shots: z.array(z.object({ prompt: z.string().max(2000), duration: z.number().positive().max(60) })).max(12).optional(),+ multiShot: z.literal("auto").optional(),+ draft: z.boolean().optional(),+ draftId: z.string().max(8192).optional(),extra: z.record(z.string(), z.unknown()).optional(),}).optional(),diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsxindex 2f9e092b..a413bdc5 100644--- a/src/components/app-sidebar.tsx+++ b/src/components/app-sidebar.tsx@@ -6,6 +6,8 @@ import { useTheme } from "next-themes";import { Suspense } from "react";import {AtSign,+ Crop,+ FastForward,Brush,AudioLines,Boxes,@@ -70,6 +72,8 @@ const NAV = [{ href: "/lipsync", label: "Lipsync & avatars", icon: Mic2 },{ href: "/motion-control", label: "Motion control", icon: PersonStanding },{ href: "/video-edit", label: "Edit video", icon: Scissors },+ { href: "/extend", label: "Extend video", icon: FastForward },+ { href: "/reframe", label: "Reframe", icon: Crop },{ href: "/elements", label: "Elements", icon: AtSign },{ href: "/upscale", label: "Upscale", icon: ZoomIn },{ href: "/audio", label: "Audio", icon: AudioLines },diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsxindex 3e0894b0..130a8ae1 100644--- a/src/components/studio/composer.tsx+++ b/src/components/studio/composer.tsx@@ -3,6 +3,7 @@import {ArrowUp,AtSign,+ FileVideo2,Clock,Copy as CopyIcon,Film,@@ -37,6 +38,7 @@ import { ControlsChip, ProviderPresetChip } from "./model-controls";import { ModelPicker } from "./model-picker";import { ELEMENT_ICONS, PromptInput, type PromptInputHandle } from "./prompt-input";import { SketchTools } from "./sketch-tools";+import { MultiShotChip, ShotsEditor } from "./shots-editor";import { useStudio } from "./studio-context";import { nanoid } from "nanoid";@@ -277,7 +279,9 @@ export function Composer({ docked }: { docked: boolean }) {if (next && getModel(next)) setDraft((d) => ({ modelId: next, params: { ...getModel(next)!.defaults, numOutputs: d.params.numOutputs, enhancePrompt: d.params.enhancePrompt } }));}, [engine, model, lockedModel, preset, config.defaultModels, setDraft]);- const rawRequest = buildRequest(config.feature, draft, undefined, config.promptSuffix);+ // Single-purpose studios (Extend, Reframe, Edit video…) pin their operation.+ const studioOp = config.ops.length === 1 && !preset ? config.ops[0] : undefined;+ const rawRequest = buildRequest(config.feature, draft, studioOp, config.promptSuffix);const mentions = model ? applyMentions(rawRequest, model, elements) : { request: rawRequest, mentioned: [], notes: [] };const sketched = model ? applySketch(mentions.request, model) : { request: mentions.request };const request = sketched.request;@@ -297,7 +301,7 @@ export function Composer({ docked }: { docked: boolean }) {if (s.required && !draft.slots[s.key]?.ref) throw new Error(`Add ${s.label.toLowerCase()}`);}if (Object.values(draft.slots).some((v) => v?.uploading) || draft.refs.some((r) => r.uploading)) throw new Error("Uploading…");- if (!config.promptOptional && preset?.userPrompt !== "none" && preset?.userPrompt !== "optional" && !draft.prompt.trim()) {+ if (!config.promptOptional && preset?.userPrompt !== "none" && preset?.userPrompt !== "optional" && !draft.prompt.trim() && !draft.params.shots?.some((s) => s.prompt.trim())) {throw new Error("Write a prompt first");}} catch (e) {@@ -310,7 +314,7 @@ export function Composer({ docked }: { docked: boolean }) {return;}// The server resolves @mentions and drawings itself; only pin the operation when there are none.- create.mutate(buildRequest(config.feature, draft, resolvesOnServer ? undefined : op, config.promptSuffix), {+ create.mutate(buildRequest(config.feature, draft, resolvesOnServer ? studioOp : op, config.promptSuffix), {onSuccess: (items) => {toast.success(items.length > 1 ? `${items.length} jobs queued` : "Queued", { duration: 1500 });},@@ -436,6 +440,9 @@ export function Composer({ docked }: { docked: boolean }) {/>)}+ {/* Multi-shot */}+ {model?.options.multiShot && p.shots && <ShotsEditor model={model} shots={p.shots} onChange={(shots) => setP({ shots })} />}+{/* @mentioned elements */}{mentions.mentioned.length > 0 && (<div className="flex flex-wrap items-center gap-1.5 px-2 pb-2">@@ -540,7 +547,7 @@ export function Composer({ docked }: { docked: boolean }) {{opts.resolutions && opts.resolutions.length > 1 && (<SegmentChip icon={Maximize} label="Quality" options={opts.resolutions} value={p.resolution} onChange={(v) => setP({ resolution: v })} />)}- {opts.durations && opts.durations.length > 1 && (+ {opts.durations && opts.durations.length > 1 && !p.shots && (<SegmentChipicon={Clock}label="Duration"@@ -556,6 +563,17 @@ export function Composer({ docked }: { docked: boolean }) {{config.kind === "video" && op !== "lipsync" && op !== "avatar" && op !== "upscale-video" && (<SegmentChip icon={CopyIcon} label="Videos" options={[1, 2, 3, 4]} value={p.numOutputs ?? 1} onChange={(v) => setP({ numOutputs: v })} format={(v) => `×${v}`} />)}+ {opts.multiShot && model && <MultiShotChip model={model} params={p} onChange={setP} />}+ {opts.draft && (+ <Tooltip>+ <TooltipTrigger asChild>+ <Chip icon={FileVideo2} active={!!p.draft} onClick={() => setP({ draft: !p.draft })}>+ Draft+ </Chip>+ </TooltipTrigger>+ <TooltipContent>{p.draft ? "Cheap 480p take — finish the one you like in 1080p" : "Draft mode: preview at 480p first, then render the keeper in 1080p"}</TooltipContent>+ </Tooltip>+ )}{opts.presets && (<ProviderPresetChipspec={opts.presets}diff --git a/src/components/studio/feed.tsx b/src/components/studio/feed.tsxindex 444a87cf..c4a52bf5 100644--- a/src/components/studio/feed.tsx+++ b/src/components/studio/feed.tsx@@ -16,6 +16,9 @@ import {ZoomIn,Cpu,Cloud,+ Crop,+ FastForward,+ Sparkles,} from "lucide-react";import Link from "next/link";import { useState } from "react";@@ -151,6 +154,16 @@ function FailedTile({ g, ratio, onRetry }: { g: Generation; ratio: number; onRet);}+/** Seedance draft mode: render the chosen 480p take again at 1080p with the same seed and settings. */+export function useFinalizeDraft() {+ const create = useCreateGeneration();+ return (g: Generation, draftId: string) =>+ create.mutate(+ { feature: g.feature, modelId: g.modelId, op: "finalize", prompt: g.request.prompt, params: { draftId, resolution: "1080p", duration: g.request.params?.duration } },+ { onSuccess: () => toast.success("Rendering the final 1080p version"), onError: (e) => toast.error((e as Error).message) },+ );+}+export function GenerationGroup({g,onOpen,@@ -171,6 +184,7 @@ export function GenerationGroup({create.mutate(g.request, {onError: (e) => toast.error((e as Error).message),});+ const finalize = useFinalizeDraft();const p = g.request.params ?? {};const meta = [preset?.name,@@ -272,6 +286,17 @@ export function GenerationGroup({style={{ aspectRatio: o.kind === "audio" ? 1.6 : ratio }}><MediaThumb output={o} />+ {o.draftId && (+ <button+ onClick={(e) => {+ e.stopPropagation();+ finalize(g, o.draftId!);+ }}+ className="absolute top-2 left-2 inline-flex h-7 items-center gap-1 rounded-full bg-black/55 pr-2.5 pl-2 text-[12px] font-medium text-white backdrop-blur transition-colors hover:bg-black/75"+ >+ <Sparkles className="size-3.5" /> Draft · render 1080p+ </button>+ )}{g.favorite && <Heart className="absolute top-2 right-2 size-4 fill-highlight text-highlight drop-shadow" />}{o.kind !== "audio" && (<div className="absolute inset-x-0 bottom-0 flex items-center gap-0.5 bg-gradient-to-t from-black/60 to-transparent p-2 pt-8 opacity-0 transition-opacity duration-100 group-focus-within/tile:opacity-100 group-hover/tile:opacity-100">@@ -298,6 +323,12 @@ export function GenerationGroup({</>) : (<>+ <IconAction label="Extend" href={`/extend?video=${encodeURIComponent(o.url)}`}>+ <FastForward className="size-4" />+ </IconAction>+ <IconAction label="Reframe" href={`/reframe?video=${encodeURIComponent(o.url)}`}>+ <Crop className="size-4" />+ </IconAction><IconAction label="Lipsync" href={`/lipsync?video=${encodeURIComponent(o.url)}`}><Mic2 className="size-4" /></IconAction>diff --git a/src/components/studio/shots-editor.tsx b/src/components/studio/shots-editor.tsxnew file mode 100644index 00000000..b96fcded--- /dev/null+++ b/src/components/studio/shots-editor.tsx@@ -0,0 +1,138 @@+"use client";++import { Clapperboard, FileVideo2, Minus, Plus, X } from "lucide-react";+import { useState } from "react";+import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";+import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";+import type { GenParams, ModelDef } from "@/lib/catalog/types";+import { cn } from "@/lib/utils";++type Shot = NonNullable<GenParams["shots"]>[number];++const chip = "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full px-3 text-[13px] font-medium transition-colors";++/** Off · Auto (the model cuts by itself) · Custom (you write each shot). */+export function MultiShotChip({ model, params, onChange }: { model: ModelDef; params: GenParams; onChange: (p: Partial<GenParams>) => void }) {+ const [open, setOpen] = useState(false);+ const ms = model.options.multiShot!;+ const mode = params.shots ? "custom" : params.multiShot === "auto" ? "auto" : "off";+ const each = Math.max(1, Math.floor((params.duration ?? model.defaults?.duration ?? 6) / 2));+ const options = [+ { id: "off", label: "Off", hint: "One continuous shot" },+ { id: "auto", label: "Auto", hint: "The model plans the cuts" },+ { id: "custom", label: "Custom", hint: `Write up to ${ms.maxShots} shots` },+ ] as const;+ return (+ <Popover open={open} onOpenChange={setOpen}>+ <PopoverTrigger asChild>+ <button type="button" className={cn(chip, mode !== "off" ? "bg-brand-faint text-brand-text hover:bg-brand-faint-hover" : "bg-secondary text-secondary-foreground hover:bg-accent")}>+ <Clapperboard className="size-3.5" />+ {mode === "custom" ? `${params.shots!.length} shots` : mode === "auto" ? "Multi-shot · Auto" : "Multi-shot"}+ </button>+ </PopoverTrigger>+ <PopoverContent className="w-72 p-2" align="start" side="top">+ <p className="px-1 pb-2 text-[13px] font-medium">Multi-shot</p>+ <div className="space-y-1">+ {options.map((o) => (+ <button+ key={o.id}+ onClick={() => {+ if (o.id === "off") onChange({ shots: undefined, multiShot: undefined });+ if (o.id === "auto") onChange({ shots: undefined, multiShot: "auto" });+ if (o.id === "custom" && !params.shots)+ onChange({+ multiShot: undefined,+ shots: [+ { prompt: "", duration: each },+ { prompt: "", duration: each },+ ],+ });+ setOpen(false);+ }}+ className={cn("flex w-full flex-col rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-accent", mode === o.id && "bg-brand-faint")}+ >+ <span className={cn("text-[13px] font-medium", mode === o.id && "text-brand-text")}>{o.label}</span>+ <span className="text-[12px] text-muted-foreground">{o.hint}</span>+ </button>+ ))}+ </div>+ <p className="px-1 pt-2 text-[11px] text-muted-foreground">+ {ms.mode === "native" ? `${model.name} takes each shot as its own prompt.` : `${model.name} follows shots written into the prompt.`}+ </p>+ </PopoverContent>+ </Popover>+ );+}++/** Per-shot prompts and durations, shown under the main prompt in Custom mode. */+export function ShotsEditor({ model, shots, onChange }: { model: ModelDef; shots: Shot[]; onChange: (s: Shot[] | undefined) => void }) {+ const max = Math.max(...(model.options.durations ?? [15]));+ const total = shots.reduce((n, s) => n + s.duration, 0);+ const maxShots = model.options.multiShot?.maxShots ?? 6;+ const set = (i: number, patch: Partial<Shot>) => onChange(shots.map((s, j) => (j === i ? { ...s, ...patch } : s)));+ const starts = shots.map((_, i) => shots.slice(0, i).reduce((n, s) => n + s.duration, 0));+ return (+ <div className="space-y-1.5 px-1.5 pb-2">+ {shots.map((s, i) => {+ const from = starts[i];+ return (+ <div key={i} className="flex items-start gap-2 rounded-xl border bg-muted/40 p-1.5 pl-2.5">+ <span className="mt-1.5 flex shrink-0 flex-col items-center text-[11px] leading-tight font-medium text-muted-foreground">+ <FileVideo2 className="mb-0.5 size-3.5" />+ {i + 1}+ </span>+ <textarea+ value={s.prompt}+ onChange={(e) => set(i, { prompt: e.target.value.slice(0, 512) })}+ rows={1}+ placeholder={i === 0 ? "Shot 1 — e.g. “wide: she steps out of the taxi into the rain”" : `Shot ${i + 1} — e.g. “close-up: she looks up at the neon sign”`}+ className="field-sizing-content max-h-28 min-h-8 flex-1 resize-none bg-transparent py-1 text-[14px] leading-snug outline-none placeholder:text-subtle-foreground"+ />+ <div className="flex shrink-0 items-center gap-0.5 rounded-full bg-background p-0.5 shadow-soft">+ <button onClick={() => set(i, { duration: Math.max(1, s.duration - 1) })} className="grid size-6 place-items-center rounded-full hover:bg-accent" aria-label="Shorter">+ <Minus className="size-3" />+ </button>+ <Tooltip>+ <TooltipTrigger asChild>+ <span className="w-8 text-center font-mono text-[12px] tabular-nums">{s.duration}s</span>+ </TooltipTrigger>+ <TooltipContent>+ {from}–{from + s.duration}s+ </TooltipContent>+ </Tooltip>+ <button+ onClick={() => set(i, { duration: Math.min(15, s.duration + 1) })}+ disabled={total >= max}+ className="grid size-6 place-items-center rounded-full hover:bg-accent disabled:opacity-40"+ aria-label="Longer"+ >+ <Plus className="size-3" />+ </button>+ </div>+ <button+ onClick={() => onChange(shots.length > 1 ? shots.filter((_, j) => j !== i) : undefined)}+ className="mt-0.5 grid size-7 shrink-0 place-items-center rounded-full text-muted-foreground hover:bg-accent hover:text-foreground"+ aria-label={`Remove shot ${i + 1}`}+ >+ <X className="size-3.5" />+ </button>+ </div>+ );+ })}+ <div className="flex items-center gap-3 px-1">+ {shots.length < maxShots && (+ <button+ onClick={() => onChange([...shots, { prompt: "", duration: Math.max(1, Math.min(3, max - total)) }])}+ disabled={total >= max}+ className="inline-flex items-center gap-1 text-[12px] font-medium text-brand-text hover:underline disabled:opacity-40"+ >+ <Plus className="size-3" /> Add shot+ </button>+ )}+ <span className={cn("ml-auto font-mono text-[11px] text-muted-foreground", total > max && "text-destructive")}>+ {total}s of {max}s+ </span>+ </div>+ </div>+ );+}diff --git a/src/components/studio/viewer.tsx b/src/components/studio/viewer.tsxindex eb15c237..2247f9e8 100644--- a/src/components/studio/viewer.tsx+++ b/src/components/studio/viewer.tsx@@ -1,6 +1,6 @@"use client";-import { ChevronLeft, ChevronRight, Clapperboard, Columns2, SlidersHorizontal, Copy, Download, Heart, RotateCcw, Trash2, Wand2, X, ZoomIn } from "lucide-react";+import { ChevronLeft, ChevronRight, Clapperboard, Columns2, Crop, FastForward, SlidersHorizontal, Sparkles, Copy, Download, Heart, RotateCcw, Trash2, Wand2, X, ZoomIn } from "lucide-react";import Link from "next/link";import { useEffect, useState } from "react";import { toast } from "sonner";@@ -13,7 +13,7 @@ import { useGenerationActions } from "@/lib/api";import { formatCost, timeAgo } from "@/lib/format";import { cn } from "@/lib/utils";import { CompareSlider } from "./compare-slider";-import { downloadName } from "./feed";+import { downloadName, useFinalizeDraft } from "./feed";function Row({ label, value, mono }: { label: string; value?: React.ReactNode; mono?: boolean }) {if (value === undefined || value === null || value === "") return null;@@ -49,6 +49,7 @@ export function Viewer({// Edits, inpaints, upscales and app results can be compared with the image they started from.const source = o.kind === "image" && g.op !== "t2i" ? g.request.inputs?.images?.[0] : undefined;const [comparing, setComparing] = useState(false);+ const finalize = useFinalizeDraft();useEffect(() => {const onKey = (e: KeyboardEvent) => {@@ -171,6 +172,25 @@ export function Viewer({</Button></>)}+ {o.draftId && (+ <Button variant="default" size="sm" className="col-span-2" onClick={() => finalize(g, o.draftId!)}>+ <Sparkles /> Render this draft in 1080p+ </Button>+ )}+ {o.kind === "video" && (+ <>+ <Button asChild variant="secondary" size="sm">+ <Link href={`/extend?video=${encodeURIComponent(o.url)}`}>+ <FastForward /> Extend+ </Link>+ </Button>+ <Button asChild variant="secondary" size="sm">+ <Link href={`/reframe?video=${encodeURIComponent(o.url)}`}>+ <Crop /> Reframe+ </Link>+ </Button>+ </>+ )}{(o.kind === "image" || o.kind === "video") && (<Button asChild variant="secondary" size="sm"><Link href={`/color-grade?${o.kind}=${encodeURIComponent(o.url)}`}>diff --git a/src/lib/catalog/cloud-models.generated.ts b/src/lib/catalog/cloud-models.generated.tsindex d3cb0c42..f403ffcb 100644--- a/src/lib/catalog/cloud-models.generated.ts+++ b/src/lib/catalog/cloud-models.generated.ts@@ -1698,6 +1698,7 @@ export const CLOUD_MODELS: ModelDef[] = ["endpoint": "bytedance/seedance-2.5/text-to-video","map": {"generateAudio": "generate_audio",+ "draft": "draft","aspectRatio": "aspect_ratio","resolution": "resolution","duration": {@@ -1714,6 +1715,7 @@ export const CLOUD_MODELS: ModelDef[] = ["image": "image_url","endImage": "end_image_url","generateAudio": "generate_audio",+ "draft": "draft","aspectRatio": "aspect_ratio","resolution": "resolution","duration": {@@ -1730,6 +1732,7 @@ export const CLOUD_MODELS: ModelDef[] = ["image": "image_url","endImage": "end_image_url","generateAudio": "generate_audio",+ "draft": "draft","aspectRatio": "aspect_ratio","resolution": "resolution","duration": {@@ -1746,6 +1749,7 @@ export const CLOUD_MODELS: ModelDef[] = ["images": "image_urls","seed": "seed","generateAudio": "generate_audio",+ "draft": "draft","aspectRatio": "aspect_ratio","resolution": "resolution","duration": {@@ -1753,9 +1757,40 @@ export const CLOUD_MODELS: ModelDef[] = ["type": "string"}}+ },+ {+ "op": "extend",+ "provider": "fal",+ "endpoint": "bytedance/seedance-2.5/reference-to-video",+ "map": {+ "images": "image_urls",+ "videoArray": "video_urls",+ "seed": "seed",+ "generateAudio": "generate_audio",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "string"+ },+ "fixed": {+ "task": "extension"+ }+ }+ },+ {+ "op": "finalize",+ "provider": "fal",+ "endpoint": "bytedance/seedance-2.5/draft/complete",+ "map": {+ "prompt": false,+ "draftId": "draft_id",+ "resolution": "resolution"+ }}],"options": {+ "draft": true,"audio": true,"aspectRatios": ["auto",@@ -1778,11 +1813,15 @@ export const CLOUD_MODELS: ModelDef[] = [8,10,12,- 15+ 30],"endFrame": true,"maxImages": 4,- "seed": true+ "seed": true,+ "multiShot": {+ "mode": "prompt",+ "maxShots": 6+ }},"badges": ["top",@@ -1899,7 +1938,11 @@ export const CLOUD_MODELS: ModelDef[] = [15],"endFrame": true,- "maxImages": 9+ "maxImages": 9,+ "multiShot": {+ "mode": "prompt",+ "maxShots": 6+ }},"badges": ["audio"@@ -2139,6 +2182,11 @@ export const CLOUD_MODELS: ModelDef[] = ["map": {"negativePrompt": "negative_prompt","generateAudio": "generate_audio",+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "string",+ "shotType": "shot_type"+ },"aspectRatio": "aspect_ratio","duration": {"key": "duration",@@ -2155,6 +2203,11 @@ export const CLOUD_MODELS: ModelDef[] = ["image": "start_image_url","endImage": "end_image_url","generateAudio": "generate_audio",+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "string",+ "shotType": "shot_type"+ },"duration": {"key": "duration","type": "string"@@ -2170,6 +2223,11 @@ export const CLOUD_MODELS: ModelDef[] = ["image": "start_image_url","endImage": "end_image_url","generateAudio": "generate_audio",+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "string",+ "shotType": "shot_type"+ },"duration": {"key": "duration","type": "string"@@ -2178,6 +2236,10 @@ export const CLOUD_MODELS: ModelDef[] = [}],"options": {+ "multiShot": {+ "mode": "native",+ "maxShots": 6+ },"negativePrompt": true,"audio": true,"aspectRatios": [@@ -2192,7 +2254,7 @@ export const CLOUD_MODELS: ModelDef[] = [6,8,10,- 12+ 15],"endFrame": true,"maxImages": 1@@ -2227,6 +2289,10 @@ export const CLOUD_MODELS: ModelDef[] = ["provider": "fal","endpoint": "fal-ai/kling-video/v3/turbo/pro/text-to-video","map": {+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "string"+ },"aspectRatio": "aspect_ratio","duration": {"key": "duration",@@ -2248,6 +2314,10 @@ export const CLOUD_MODELS: ModelDef[] = [}],"options": {+ "multiShot": {+ "mode": "native",+ "maxShots": 6+ },"aspectRatios": ["16:9","9:16",@@ -2260,7 +2330,7 @@ export const CLOUD_MODELS: ModelDef[] = [6,8,10,- 12+ 15],"maxImages": 1},@@ -2342,7 +2412,7 @@ export const CLOUD_MODELS: ModelDef[] = [6,8,10,- 12+ 15],"endFrame": true,"maxImages": 1@@ -2372,6 +2442,11 @@ export const CLOUD_MODELS: ModelDef[] = ["endpoint": "fal-ai/kling-video/o3/pro/text-to-video","map": {"generateAudio": "generate_audio",+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "string",+ "shotType": "shot_type"+ },"aspectRatio": "aspect_ratio","duration": {"key": "duration",@@ -2387,6 +2462,11 @@ export const CLOUD_MODELS: ModelDef[] = ["image": "image_url","endImage": "end_image_url","generateAudio": "generate_audio",+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "string",+ "shotType": "shot_type"+ },"duration": {"key": "duration","type": "string"@@ -2401,6 +2481,11 @@ export const CLOUD_MODELS: ModelDef[] = ["image": "image_url","endImage": "end_image_url","generateAudio": "generate_audio",+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "string",+ "shotType": "shot_type"+ },"duration": {"key": "duration","type": "string"@@ -2416,6 +2501,11 @@ export const CLOUD_MODELS: ModelDef[] = ["images": "image_urls","endImage": "end_image_url","generateAudio": "generate_audio",+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "string",+ "shotType": "shot_type"+ },"aspectRatio": "aspect_ratio","duration": {"key": "duration",@@ -2434,6 +2524,10 @@ export const CLOUD_MODELS: ModelDef[] = [}],"options": {+ "multiShot": {+ "mode": "native",+ "maxShots": 6+ },"audio": true,"aspectRatios": ["16:9",@@ -2447,7 +2541,7 @@ export const CLOUD_MODELS: ModelDef[] = [6,8,10,- 12+ 15],"endFrame": true,"maxImages": 4@@ -2878,6 +2972,25 @@ export const CLOUD_MODELS: ModelDef[] = ["type": "number"}}+ },+ {+ "op": "extend",+ "provider": "fal",+ "endpoint": "fal-ai/veo3.1/extend-video",+ "map": {+ "negativePrompt": "negative_prompt",+ "video": "video_url",+ "seed": "seed",+ "generateAudio": "generate_audio",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "string",+ "suffix": "s"+ }+ },+ "note": "fal retires Veo 3.1 extend on 2026-11-17"}],"options": {@@ -2981,6 +3094,25 @@ export const CLOUD_MODELS: ModelDef[] = ["suffix": "s"}}+ },+ {+ "op": "extend",+ "provider": "fal",+ "endpoint": "fal-ai/veo3.1/fast/extend-video",+ "map": {+ "negativePrompt": "negative_prompt",+ "video": "video_url",+ "seed": "seed",+ "generateAudio": "generate_audio",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "string",+ "suffix": "s"+ }+ },+ "note": "fal retires Veo 3.1 extend on 2026-11-17"}],"options": {@@ -3509,7 +3641,7 @@ export const CLOUD_MODELS: ModelDef[] = [6,8,10,- 12+ 15],"endFrame": true,"maxImages": 4@@ -3603,7 +3735,11 @@ export const CLOUD_MODELS: ModelDef[] = [10,15],- "maxImages": 1+ "maxImages": 1,+ "multiShot": {+ "mode": "prompt",+ "maxShots": 6+ }},"badges": ["audio"@@ -3861,6 +3997,21 @@ export const CLOUD_MODELS: ModelDef[] = ["type": "number"}}+ },+ {+ "op": "extend",+ "provider": "fal",+ "endpoint": "minimax/h3-max/extend-video",+ "map": {+ "video": "video_url",+ "seed": "seed",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }}],"options": {@@ -3871,12 +4022,14 @@ export const CLOUD_MODELS: ModelDef[] = ["4:3","1:1","3:4",- "9:16"+ "9:16",+ "auto"],"resolutions": ["480P","768P",- "1080P"+ "1080P",+ "2K"],"endFrame": true,"maxImages": 9@@ -4074,6 +4227,21 @@ export const CLOUD_MODELS: ModelDef[] = ["map": {"video": "video_url"}+ },+ {+ "op": "extend",+ "provider": "fal",+ "endpoint": "blackforestlabs/flux-3/extend-video",+ "map": {+ "video": "video_url",+ "generateAudio": "generate_audio",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "string"+ }+ }}],"options": {@@ -4243,6 +4411,22 @@ export const CLOUD_MODELS: ModelDef[] = ["type": "number"}}+ },+ {+ "op": "extend",+ "provider": "fal",+ "endpoint": "fal-ai/pixverse/v6/extend",+ "map": {+ "negativePrompt": "negative_prompt",+ "video": "video_url",+ "seed": "seed",+ "generateAudio": "generate_audio_switch",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }}],"options": {@@ -4411,6 +4595,21 @@ export const CLOUD_MODELS: ModelDef[] = ["suffix": "s"}}+ },+ {+ "op": "reframe",+ "provider": "fal",+ "endpoint": "luma/agent/ray/v3.2/reframe",+ "map": {+ "video": "video_url",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "string",+ "suffix": "s"+ }+ }}],"options": {@@ -4438,6 +4637,100 @@ export const CLOUD_MODELS: ModelDef[] = ["aspectRatio": "16:9"}},+ {+ "id": "ltx-reframe",+ "name": "LTX Reframe",+ "vendor": "Lightricks",+ "family": "ltx",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Change a clip's aspect ratio \u2014 fast, no prompt needed",+ "routes": [+ {+ "op": "reframe",+ "provider": "fal",+ "endpoint": "fal-ai/ltx-2.3/reframe",+ "map": {+ "prompt": false,+ "video": "video_url",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution"+ }+ }+ ],+ "options": {+ "aspectRatios": [+ "1:1",+ "4:5",+ "5:4",+ "9:16",+ "16:9"+ ],+ "resolutions": [+ "720p",+ "1080p"+ ]+ },+ "defaults": {+ "aspectRatio": "9:16"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.1+ }+ },+ {+ "id": "wan-vace-reframe",+ "name": "Wan VACE Reframe (hosted)",+ "vendor": "Alibaba Wan",+ "family": "wan",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Open-weights reframe: outpaints the new edges with a prompt",+ "routes": [+ {+ "op": "reframe",+ "provider": "fal",+ "endpoint": "fal-ai/wan-vace-14b/reframe",+ "map": {+ "negativePrompt": "negative_prompt",+ "image": "first_frame_url",+ "endImage": "last_frame_url",+ "video": "video_url",+ "seed": "seed",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution"+ }+ }+ ],+ "options": {+ "negativePrompt": true,+ "seed": true,+ "endFrame": true,+ "aspectRatios": [+ "auto",+ "16:9",+ "1:1",+ "9:16"+ ],+ "resolutions": [+ "auto",+ "240p",+ "360p",+ "480p",+ "580p",+ "720p"+ ],+ "maxImages": 1+ },+ "defaults": {+ "aspectRatio": "9:16"+ },+ "pricing": {+ "unit": "video",+ "usd": 0.08+ }+ },{"id": "kling-avatar-2","name": "Kling Avatar 2.0",diff --git a/src/lib/catalog/elements.ts b/src/lib/catalog/elements.tsindex 8c507874..a4381e19 100644--- a/src/lib/catalog/elements.ts+++ b/src/lib/catalog/elements.ts@@ -90,7 +90,9 @@ const ops = (m: ModelDef) => new Set(m.routes.map((r) => r.op));* is mentioned.*/export function applyMentions(req: GenerationRequest, model: ModelDef, elements: StudioElement[]): MentionResolution {- const mentioned = findMentions(req.prompt, elements);+ // Shots (multi-shot) can mention elements too.+ const shots = req.params?.shots;+ const mentioned = findMentions([req.prompt ?? "", ...(shots ?? []).map((s) => s.prompt)].join("\n"), elements);if (!mentioned.length) return { request: req, mentioned, notes: [] };const notes: string[] = [];@@ -155,9 +157,8 @@ export function applyMentions(req: GenerationRequest, model: ModelDef, elements:if (model.kind === "video" && images.length > existing.length) op = "ref2v";// Rewrite the prompt: "@Maya" → "Maya", plus who/what each image is.- let prompt = req.prompt ?? "";const seen = new Set<string>();- prompt = prompt.replace(MENTION, (whole, h: string) => {+ const rewrite = (text: string) => text.replace(MENTION, (whole, h: string) => {const el = mentioned.find((e) => e.handle.toLowerCase() === h.toLowerCase());if (!el) return whole;const first = !seen.has(el.id);@@ -168,6 +169,8 @@ export function applyMentions(req: GenerationRequest, model: ModelDef, elements:if (first && !positions.get(el.id)?.length && !viaLora.has(el.id) && el.description) return `${el.name} (${el.description.replace(/[.\s]+$/, "")})`;return el.name;});+ let prompt = rewrite(req.prompt ?? "");+ const newShots = shots?.map((s) => ({ ...s, prompt: rewrite(s.prompt) }));const legend = mentioned.map((e) => {const pos = positions.get(e.id) ?? [];@@ -181,7 +184,7 @@ export function applyMentions(req: GenerationRequest, model: ModelDef, elements:: `${e.name} is ${noun} in ${which}`;}).filter(Boolean);- if (legend.length) prompt = `${prompt.trim().replace(/[.\s]+$/, "")}. ${legend.join(". ")}.`;+ if (legend.length) prompt = `${prompt.trim().replace(/[.\s]+$/, "")}${prompt.trim() ? ". " : ""}${legend.join(". ")}.`;for (const e of mentioned) {if (viaLora.has(e.id)) continue;@@ -201,7 +204,7 @@ export function applyMentions(req: GenerationRequest, model: ModelDef, elements:prompt,inputs: { ...req.inputs, images: images.length ? images : undefined },loras: loras.length ? loras : undefined,- params: extra !== req.params?.extra ? { ...req.params, extra } : req.params,+ params: extra !== req.params?.extra || newShots ? { ...req.params, extra, ...(newShots ? { shots: newShots } : {}) } : req.params,},mentioned,notes,diff --git a/src/lib/catalog/higgsfield-models.generated.ts b/src/lib/catalog/higgsfield-models.generated.tsindex a7bb1ea9..e2cb6ec8 100644--- a/src/lib/catalog/higgsfield-models.generated.ts+++ b/src/lib/catalog/higgsfield-models.generated.ts@@ -1126,6 +1126,11 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"key": "sound","on": "on","off": "off"+ },+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "number",+ "flag": "multi_shots"}}},@@ -1144,6 +1149,11 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"key": "sound","on": "on","off": "off"+ },+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "number",+ "flag": "multi_shots"}}},@@ -1162,6 +1172,11 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"key": "sound","on": "on","off": "off"+ },+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "number",+ "flag": "multi_shots"}}}@@ -1181,6 +1196,11 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"key": "sound","on": "on","off": "off"+ },+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "number",+ "flag": "multi_shots"}}},@@ -1199,6 +1219,11 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"key": "sound","on": "on","off": "off"+ },+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "number",+ "flag": "multi_shots"}}},@@ -1217,6 +1242,11 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"key": "sound","on": "on","off": "off"+ },+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "number",+ "flag": "multi_shots"}}}@@ -1266,6 +1296,11 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"key": "sound","on": "on","off": "off"+ },+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "number",+ "flag": "multi_shots"}}},@@ -1285,6 +1320,11 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"key": "sound","on": "on","off": "off"+ },+ "multiShot": {+ "key": "multi_prompt",+ "durationType": "number",+ "flag": "multi_shots"}}},diff --git a/src/lib/catalog/payload.ts b/src/lib/catalog/payload.tsindex 3cd5d39c..bac9cdff 100644--- a/src/lib/catalog/payload.ts+++ b/src/lib/catalog/payload.ts@@ -44,6 +44,22 @@ export function buildPayload(map: FieldMap, input: GenInput): Record<string, unkelse out[g.key] = input.generateAudio ? g.on : g.off;}+ // Native multi-shot replaces the single prompt with per-shot prompts.+ if (map.multiShot && (input.shots?.length || input.multiShot === "auto")) {+ const ms = map.multiShot;+ if (input.shots?.length) {+ const shots = input.shots.map((s) => ({ prompt: s.prompt, duration: ms.durationType === "string" ? String(s.duration) : s.duration }));+ out[ms.key] = ms.json ? JSON.stringify(shots) : shots;+ if (map.prompt !== false) delete out[map.prompt ?? "prompt"];+ if (ms.shotType) out[ms.shotType] = "customize";+ } else if (ms.shotType) {+ out[ms.shotType] = "intelligent";+ }+ if (ms.flag) out[ms.flag] = true;+ }+ if (map.draft && input.draft) out[map.draft] = true;+ if (map.draftId && input.draftId) out[map.draftId] = input.draftId;+Object.assign(out, map.fixed ?? {});Object.assign(out, input.extra ?? {});return out;diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.tsindex 77f0d430..c4ae69f9 100644--- a/src/lib/catalog/plan.ts+++ b/src/lib/catalog/plan.ts@@ -21,6 +21,7 @@ export function inferOperation(model: ModelDef, req: Pick<GenerationRequest, "opif (req.inputs?.audio && imgs && has("avatar")) return "avatar";if (req.inputs?.video && imgs && has("motion-transfer")) return "motion-transfer";if (req.inputs?.video && has("v2v")) return "v2v";+ if (req.inputs?.video && has("extend")) return "extend";if (imgs && req.inputs?.endImage && has("flf2v")) return "flf2v";if (imgs > 1 && has("ref2v")) return "ref2v";if (imgs && has("i2v")) return "i2v";@@ -59,6 +60,17 @@ export function composePrompt(.trim();}+/** "Shot 1 [0–3s]: … Shot 2 [3–8s]: …" — the format Seedance, Wan and LTX follow for multi-shot prompts. */+export function composeShots(overall: string, shots: { prompt: string; duration: number }[]): string {+ let t = 0;+ const parts = shots.map((s, i) => {+ const from = t;+ t += s.duration;+ return `Shot ${i + 1} [${from}-${t}s]: ${s.prompt.trim().replace(/[.\s]+$/, "")}.`;+ });+ return [overall.trim() && `${overall.trim().replace(/[.\s]+$/, "")}.`, ...parts].filter(Boolean).join(" ");+}+export function presetRoute(preset: Preset, engine: Engine): PresetRoute | null {return engine === "open" ? preset.open : preset.cloud;}@@ -105,11 +117,29 @@ export function planGeneration(}if (req.loras?.length) loras = [...loras, ...req.loras];++ // Multi-shot: the clip is as long as its shots, and models without per-shot prompts get them written out.+ const shots = params.shots?.filter((s) => s.prompt.trim());+ if (shots?.length) {+ if (!model.options.multiShot) throw new Error(`${model.name} can't do multi-shot — try Kling 3.0, Seedance 2.5 or Wan 2.6`);+ if (shots.length > model.options.multiShot.maxShots) throw new Error(`${model.name} takes up to ${model.options.multiShot.maxShots} shots`);+ const total = shots.reduce((n, s) => n + s.duration, 0);+ const max = Math.max(...(model.options.durations ?? [total]));+ if (total > max) throw new Error(`The shots add up to ${total}s — ${model.name} makes up to ${max}s`);+ // Per-shot prompts carry the overall description (and @element legend) with them.+ const overall = prompt.trim().replace(/[.\s]+$/, "");+ const native = model.options.multiShot.mode === "native";+ params = { ...params, shots: native && overall ? shots.map((s) => ({ ...s, prompt: `${overall}. ${s.prompt.trim()}` })) : shots, duration: total };+ prompt = composeShots(prompt, shots);+ } else if (params.multiShot === "auto" && model.options.multiShot?.mode === "prompt") {+ prompt = `${prompt.replace(/[.\s]+$/, "")}. Multi-shot sequence: tell it in several distinct shots with clean cuts between them.`;+ }op = op ?? inferOperation(model, req);if (!routesFor(model, op).length) {throw new Error(`${model.name} can't do ${op} — try another model`);}- if (!prompt && op !== "upscale-image" && op !== "upscale-video" && op !== "bg-remove" && op !== "interpolate" && op !== "v2a" && op !== "face-swap" && op !== "motion-transfer" && op !== "lipsync" && op !== "avatar") {+ if (op === "finalize" && !params.draftId) throw new Error("Pick a draft to finish");+ if (!prompt && op !== "finalize" && op !== "reframe" && op !== "upscale-image" && op !== "upscale-video" && op !== "bg-remove" && op !== "interpolate" && op !== "v2a" && op !== "face-swap" && op !== "motion-transfer" && op !== "lipsync" && op !== "avatar") {throw new Error("Write a prompt first");}@@ -143,6 +173,7 @@ const NEEDS: Partial<Record<Operation, { images?: number; video?: boolean; audiov2a: { video: true, msg: "Add a video" },interpolate: { video: true, msg: "Add a video" },extend: { video: true, msg: "Add the video to continue" },+ reframe: { video: true, msg: "Add a video to reframe" },};/** Human message for the first missing input of an operation, or null. */diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.tsindex 2b0592a4..dca235d9 100644--- a/src/lib/catalog/types.ts+++ b/src/lib/catalog/types.ts@@ -35,7 +35,9 @@ export type Operation =| "v2a" // video → audio/foley| "interpolate"| "extend" // video → the same clip, continued- | "grade"; // colour grade, rendered in the browser+ | "grade" // colour grade, rendered in the browser+ | "reframe" // video → same video at a new aspect ratio (AI-filled edges)+ | "finalize"; // draft video → full-quality render of the same takeexport const OPERATION_LABELS: Record<Operation, string> = {t2i: "Text to image",@@ -61,6 +63,8 @@ export const OPERATION_LABELS: Record<Operation, string> = {interpolate: "Frame interpolation",extend: "Extend video",grade: "Color grade",+ reframe: "Reframe",+ finalize: "Final render",};export const OPERATION_OUTPUT: Record<Operation, MediaKind> = {@@ -87,6 +91,8 @@ export const OPERATION_OUTPUT: Record<Operation, MediaKind> = {interpolate: "video",extend: "video",grade: "image",+ reframe: "video",+ finalize: "video",};export type ProviderId = "fal" | "replicate" | "higgsfield" | "openai" | "google" | "comfyui" | "mock" | "local";@@ -134,6 +140,12 @@ export interface FieldMap {seedRange?: [number, number];/** Boolean field, or an on/off enum such as Kling's `sound: "on" | "off"`. */generateAudio?: string | { key: string; on: unknown; off: unknown };+ /** Native multi-shot: an array of {prompt, duration} (Kling's `multi_prompt`). */+ multiShot?: { key: string; durationType: "string" | "number"; json?: boolean; shotType?: string; flag?: string };+ /** Boolean draft switch (Seedance 2.5 renders a cheap 480p take and returns a draft id). */+ draft?: string;+ /** Field that takes the draft id to finish. */+ draftId?: string;/** Static fields always sent (e.g. safety checker switches). */fixed?: Record<string, unknown>;}@@ -163,6 +175,10 @@ export interface ModelOptions {/** true = optional toggle, "always" = native audio always on. */audio?: boolean | "always";endFrame?: boolean;+ /** Multi-shot support: "native" sends per-shot prompts, "prompt" writes the shots into one prompt. */+ multiShot?: { mode: "native" | "prompt"; maxShots: number };+ /** Draft mode (cheap preview, then a full render of the take you like). */+ draft?: boolean;/** A style/template list fetched from the provider (Soul styles, Genjutsu looks, Marketing Studio templates). */presets?: { source: string; param: string; label: string; required?: boolean };/** Extra enum settings sent as-is (Cinema Studio's genre, lens, light, grade, camera move…). */@@ -203,6 +219,13 @@ export interface GenParams {seed?: number;generateAudio?: boolean;enhancePrompt?: boolean;+ /** Multi-shot: shots in order (empty/undefined = one shot). "auto" lets the model cut by itself. */+ shots?: { prompt: string; duration: number }[];+ multiShot?: "auto";+ /** Render a cheap draft first (Seedance 2.5 draft mode). */+ draft?: boolean;+ /** Finish this draft at full quality (op "finalize"). */+ draftId?: string;/** Free-form advanced params forwarded to the provider payload. */extra?: Record<string, unknown>;}@@ -257,6 +280,8 @@ export type GenerationStatus = "queued" | "running" | "succeeded" | "failed" | "export interface OutputFile {url: string;+ /** Draft renders: the id to finish this take at full quality. */+ draftId?: string;kind: MediaKind;contentType?: string;width?: number;diff --git a/src/lib/studios.ts b/src/lib/studios.tsindex b5163275..adeb7de4 100644--- a/src/lib/studios.ts+++ b/src/lib/studios.ts@@ -203,3 +203,31 @@ export const VIDEO_EDIT_STUDIO: StudioConfig = {multiRef: { label: "Add ref", max: 4 },defaultModels: { cloud: "kling-o3", open: "oss-wan22-fun-control" },};++export const EXTEND_STUDIO: StudioConfig = {+ feature: "extend",+ title: "Extend video",+ hero: "What happens next?",+ subtitle: "Continues the clip from its last frames — same look, same characters.",+ placeholder: "Describe what happens next… e.g. “the camera keeps tracking as she runs into the crowd”",+ kind: "video",+ ops: ["extend"],+ feed: { features: ["extend"] },+ slots: [{ key: "video", label: "Video", accept: "video", required: true }],+ defaultModels: { cloud: "seedance-2-5", open: "" },+ suggestions: ["The camera pulls back to reveal the whole city", "She turns and smiles at the camera", "A storm rolls in and lightning hits"],+};++export const REFRAME_STUDIO: StudioConfig = {+ feature: "reframe",+ title: "Reframe",+ hero: "Same shot, new shape",+ subtitle: "Turn a 16:9 clip into 9:16 (or any ratio) — the model invents what was outside the frame.",+ placeholder: "Optional: what should fill the new space? e.g. “more of the crowd and the night sky”",+ kind: "video",+ ops: ["reframe"],+ feed: { features: ["reframe"] },+ slots: [{ key: "video", label: "Video", accept: "video", required: true }],+ defaultModels: { cloud: "luma-ray-3-2", open: "" },+ promptOptional: true,+};diff --git a/src/server/generations.ts b/src/server/generations.tsindex 2a1e01bb..ccc3c6cb 100644--- a/src/server/generations.ts+++ b/src/server/generations.ts@@ -352,7 +352,7 @@ async function pollOne(r: Row): Promise<void> {try {outputs.push(await persistOutput(o, r.id));} catch (e) {- outputs.push({ url: o.url, kind: o.kind ?? r.kind });+ outputs.push({ url: o.url, kind: o.kind ?? r.kind, ...(o.draftId ? { draftId: o.draftId } : {}) });console.warn(`[fuobe] could not save output for ${r.id}: ${(e as Error).message}`);}}@@ -384,7 +384,7 @@ async function persistOutput(o: RemoteOutput, generationId: string): Promise<OutcontentType ??= header && header !== "application/octet-stream" ? header : contentTypeFor(new URL(o.url).searchParams.get("filename") ?? o.url);}const asset = saveFile({ data, contentType: contentType!, source: "generation", generationId });- return { url: asset.url, kind: asset.kind, contentType: asset.contentType, assetId: asset.id };+ return { url: asset.url, kind: asset.kind, contentType: asset.contentType, assetId: asset.id, ...(o.draftId ? { draftId: o.draftId } : {}) };}export async function cancelGeneration(id: string): Promise<void> {diff --git a/src/server/providers/fal.ts b/src/server/providers/fal.tsindex 254718b3..708d379e 100644--- a/src/server/providers/fal.ts+++ b/src/server/providers/fal.ts@@ -91,7 +91,9 @@ export const falProvider: ProviderAdapter = {const result = await falFetch(meta.responseUrl as string);const outputs = extractMedia(result);if (!outputs.length) return { state: "failed", error: `No media in response: ${JSON.stringify(result).slice(0, 300)}` };- return { state: "succeeded", outputs };+ // Seedance draft mode: keep the id that finishes this take at 1080p.+ const draftId = /"draft_id"\s*:\s*"([^"]+)"/.exec(JSON.stringify(result))?.[1];+ return { state: "succeeded", outputs: draftId ? outputs.map((o) => ({ ...o, draftId })) : outputs };} catch (e) {return { state: "failed", error: (e as Error).message };}diff --git a/src/server/providers/mock.ts b/src/server/providers/mock.tsindex 5e8aee32..8372f21b 100644--- a/src/server/providers/mock.ts+++ b/src/server/providers/mock.ts@@ -110,6 +110,8 @@ export const mockProvider: ProviderAdapter = {prompt: input.prompt ?? route.op,aspectRatio: input.aspectRatio ?? "1:1",count: Math.max(1, Math.min(4, input.numOutputs ?? 1)),+ // Let draft mode be tried end to end in demo mode.+ draft: !!(input.draft && route.map?.draft),},payload: { demo: true, ...input },};@@ -136,7 +138,10 @@ export const mockProvider: ProviderAdapter = {}const ar = String(meta.aspectRatio);const sample = ar === "9:16" || ar === "3:4" || ar === "2:3" ? "demo-portrait.mp4" : ar === "1:1" ? "demo-square.mp4" : "demo-landscape.mp4";- return { state: "succeeded", outputs: [{ url: `sample:${sample}`, kind: "video", contentType: "video/mp4" }] };+ return {+ state: "succeeded",+ outputs: [{ url: `sample:${sample}`, kind: "video", contentType: "video/mp4", ...(meta.draft ? { draftId: `demo_draft_${nanoid(8)}` } : {}) }],+ };},async test() {diff --git a/src/server/providers/types.ts b/src/server/providers/types.tsindex 864bd5c6..c12efd29 100644--- a/src/server/providers/types.ts+++ b/src/server/providers/types.ts@@ -17,6 +17,7 @@ export interface SubmitResult {export interface RemoteOutput {url: string;+ draftId?: string;kind?: MediaKind;contentType?: string;/** Extra headers needed to download (e.g. auth for a private ComfyUI). */diff --git a/tests/catalog.test.ts b/tests/catalog.test.tsindex 1fb890f3..a7c1fcad 100644--- a/tests/catalog.test.ts+++ b/tests/catalog.test.ts@@ -19,7 +19,8 @@ describe("catalog integrity", () => {const d = m.defaults ?? {};if (d.aspectRatio && m.options.aspectRatios) expect(m.options.aspectRatios, `${m.id} aspect`).toContain(d.aspectRatio);if (d.resolution && m.options.resolutions) expect(m.options.resolutions, `${m.id} resolution`).toContain(d.resolution);- for (const r of m.routes) expect(r.provider === "comfyui" ? m.engine : "cloud", `${m.id} engine/provider`).toBe(m.engine);+ // ComfyUI and browser-only tools are the open engine; every API provider is cloud.+ for (const r of m.routes) expect(r.provider === "comfyui" || r.provider === "local" ? "open" : "cloud", `${m.id} engine/provider`).toBe(m.engine);}});diff --git a/tests/video-features.test.ts b/tests/video-features.test.tsnew file mode 100644index 00000000..2ec7a039--- /dev/null+++ b/tests/video-features.test.ts@@ -0,0 +1,66 @@+import { describe, expect, it } from "vitest";+import { getModel, getPreset } from "@/lib/catalog";+import { buildPayload } from "@/lib/catalog/payload";+import { composeShots, planGeneration } from "@/lib/catalog/plan";++const shots = [+ { prompt: "wide: she steps out of the taxi", duration: 3 },+ { prompt: "close-up: she looks up at the sign", duration: 4 },+];++describe("multi-shot", () => {+ it("sends Kling 3.0 native per-shot prompts with string durations, carrying the overall prompt", () => {+ const plan = planGeneration({ feature: "video", modelId: "kling-3", prompt: "Rainy Tokyo night", params: { shots } }, getModel, getPreset);+ expect(plan.params.duration).toBe(7);+ const route = getModel("kling-3")!.routes.find((r) => r.op === "t2v" && r.provider === "fal")!;+ const payload = buildPayload(route.map!, { ...plan.params, prompt: plan.prompt });+ expect(payload.multi_prompt).toEqual([+ { prompt: "Rainy Tokyo night. wide: she steps out of the taxi", duration: "3" },+ { prompt: "Rainy Tokyo night. close-up: she looks up at the sign", duration: "4" },+ ]);+ expect(payload.prompt).toBeUndefined();+ expect(payload.shot_type).toBe("customize");+ expect(payload.duration).toBe("7");+ });++ it("writes shots into the prompt for prompt-driven models (Seedance)", () => {+ const plan = planGeneration({ feature: "video", modelId: "seedance-2-5", prompt: "", params: { shots } }, getModel, getPreset);+ expect(plan.prompt).toBe("Shot 1 [0-3s]: wide: she steps out of the taxi. Shot 2 [3-7s]: close-up: she looks up at the sign.");+ expect(composeShots("Noir.", shots.slice(0, 1))).toBe("Noir. Shot 1 [0-3s]: wide: she steps out of the taxi.");+ });++ it("lets Kling cut by itself in Auto mode, and rejects models without multi-shot", () => {+ const route = getModel("kling-3")!.routes.find((r) => r.op === "t2v" && r.provider === "fal")!;+ expect(buildPayload(route.map!, { prompt: "x", multiShot: "auto" }).shot_type).toBe("intelligent");+ expect(() => planGeneration({ feature: "v", modelId: "kling-2-5-turbo", prompt: "x", params: { shots } }, getModel, getPreset)).toThrow(/multi-shot/);+ expect(() =>+ planGeneration({ feature: "v", modelId: "kling-3", prompt: "x", params: { shots: [...shots, { prompt: "y", duration: 15 }] } }, getModel, getPreset),+ ).toThrow(/add up to 22s/);+ });+});++describe("draft mode, extend and reframe", () => {+ it("drafts on Seedance 2.5 and finishes the draft by id", () => {+ const m = getModel("seedance-2-5")!;+ expect(m.options.draft).toBe(true);+ const t2v = m.routes.find((r) => r.op === "t2v" && r.provider === "fal")!;+ expect(buildPayload(t2v.map!, { prompt: "x", draft: true }).draft).toBe(true);+ const plan = planGeneration({ feature: "video", modelId: m.id, op: "finalize", params: { draftId: "d1" } }, getModel, getPreset);+ const fin = m.routes.find((r) => r.op === "finalize")!;+ expect(buildPayload(fin.map!, { ...plan.params })).toMatchObject({ draft_id: "d1" });+ expect(() => planGeneration({ feature: "video", modelId: m.id, op: "finalize" }, getModel, getPreset)).toThrow(/draft/);+ });++ it("extends Seedance through reference-to-video in extension mode", () => {+ const r = getModel("seedance-2-5")!.routes.find((x) => x.op === "extend" && x.provider === "fal")!;+ expect(buildPayload(r.map!, { prompt: "next", video: "https://v.mp4" })).toMatchObject({ task: "extension", video_urls: ["https://v.mp4"], prompt: "next" });+ expect(planGeneration({ feature: "extend", modelId: "minimax-h3-max", prompt: "next", inputs: { video: "/v.mp4" } }, getModel, getPreset).op).toBe("extend");+ });++ it("reframes with a target aspect ratio and no prompt", () => {+ const plan = planGeneration({ feature: "reframe", modelId: "ltx-reframe", inputs: { video: "/v.mp4" }, params: { aspectRatio: "9:16" } }, getModel, getPreset);+ expect(plan.op).toBe("reframe");+ const r = getModel("ltx-reframe")!.routes[0];+ expect(buildPayload(r.map!, { video: "https://v.mp4", aspectRatio: "9:16" })).toMatchObject({ video_url: "https://v.mp4", aspect_ratio: "9:16" });+ });+});