Skip to content

armgit / fuobe

Public Imported from GitHub
0

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.

Merge keyframe animation, Idol 3D, full songs, Remove a person, Clean up dialogue and more

Adarshef936d26c971
diff --cc CREDITS.md
index 4a1be859,4fa4bec7..effcf9c2
--- a/CREDITS.md
+++ b/CREDITS.md
@@@ -21,8 -20,7 +21,9 @@@ Some licences ask the app that runs the
- [BS-RoFormer, copyright (c) 2023 Phil Wang](https://github.com/lucidrains/BS-RoFormer). MIT. For dialogue, music and effects separation.
- [Music-Source-Separation-Training, copyright (c) 2024 Roman Solovyev (ZFTurbo)](https://github.com/ZFTurbo/Music-Source-Separation-Training). MIT. For dialogue, music and effects separation.
- [TIGER / Look2Hear, copyright (c) 2026 Kai Li](https://github.com/JusperLee/TIGER). MIT. For dialogue, music and effects separation.
+- [RE-USE speech enhancement model, copyright (c) 2026 NVIDIA Corporation](https://huggingface.co/nvidia/NVIDIA-NemotronLabs-RE-USE). OpenMDW-1.1. For clean up voice. Trained in part on WSJ (LDC) and an internal NVIDIA set (model card). The older nvidia/RE-USE repository is non-commercial (NSCLv1); Fuobe uses only the NemotronLabs repositories.
+- [Openjutsu, copyright (c) 2026 D3voz: the graphs Fuobe sends to your GPU, the settings code Fuobe ported from it, the SolarRenderer long-clip patch and the 17 light looks' wording](https://github.com/D3voz/openjutsu). MIT. For genjutsu: Group swap, Scene edit, From picture, Fix faces and Fix colours.
+ - [Adapted from MOSS-Image's prompt-enhancer skill and its layout reference (commit 2b46b1e), copyright OpenMOSS](https://github.com/OpenMOSS/MOSS-Image). Apache-2.0. For the Layout Poster skill and Plan layout.
## Open model licences
diff --cc docs/research/fuobe-originals-recipes-5.json
index 45afe712,20df77d7..247e4db9
--- a/docs/research/fuobe-originals-recipes-5.json
+++ b/docs/research/fuobe-originals-recipes-5.json
@@@ -24660,6 -24638,53 +24660,53 @@@
"base": "qwen-image-2.1",
"download": "direct",
"checked": "2026-11-02"
+ },
+ {
+ "key": "anisora-3-2-i2v-high",
+ "name": "AniSora 3.2 for Wan 2.2 I2V A14B, high-noise expert (bilibili Index-AniSora, extracted by Kijai)",
+ "url": "https://huggingface.co/Kijai/WanVideo_comfy/resolve/main/LoRAs/AniSora/Wan2_2_I2V_AniSora_3_2_HIGH_rank_64_fp16.safetensors",
+ "page": "https://huggingface.co/Kijai/WanVideo_comfy/tree/main/LoRAs/AniSora",
+ "file": "Wan2_2_I2V_AniSora_3_2_HIGH_rank_64_fp16.safetensors",
+ "strength": 1.0,
+ "base": "wan2.2-i2v-a14b",
+ "target": "high",
+ "licence": "Apache-2.0 (bilibili's Index-AniSora weights: GitHub bilibili/Index-anisora LICENSE and the HF card IndexTeam/Index-anisora, V3.2 released 2025-09-23); Kijai's rank-64 extraction repository states no licence of its own",
+ "commercial": true,
+ "hostedOk": true,
+ "download": "direct",
+ "released": "2025-09-27",
+ "revision": "8260d429d19fd7a72304cad059160b95d843913f",
+ "sha256": "bdc68451d6bccd6efb70f6eb916ede7cc470e3b6dacd0273da528246334095da",
+ "sizeBytes": 630695648,
+ "checked": "2026-11-02",
+ "usedBy": [
+ "fuobe-animation (keyframe in-betweening, the high-noise expert)"
+ ],
+ "hostedEndpoint": "fal-ai/wan/v2.2-a14b/image-to-video/lora (transformer=high, end_image_url, num_frames 17-161)",
- "notes": "The difference between bilibili's AniSora V3.2 (anime motion trained on Wan 2.2 I2V A14B) and the base high-noise expert, extracted at rank 64 by Kijai (file last changed in commit f32501d0, 2025-09-27). The source of the file the owner's 'Keyframes to Full Character Animation' graph loads at strength 1.0 on the high-noise expert, with the lightx2v 4-step LoRA on the low-noise expert, 4 steps at CFG 1 (high 0-2, low 2-end), shift 5. Only a high-noise file exists."
++ "notes": "The difference between bilibili's AniSora V3.2 (anime motion trained on Wan 2.2 I2V A14B) and the base high-noise expert, extracted at rank 64 by Kijai (file last changed in commit f32501d0, 2025-09-27). The source of the file the 'Keyframes to Full Character Animation' graph loads at strength 1.0 on the high-noise expert, with the lightx2v 4-step LoRA on the low-noise expert, 4 steps at CFG 1 (high 0-2, low 2-end), shift 5. Only a high-noise file exists."
+ },
+ {
+ "key": "wan22-i2v-lightx2v-4step-low",
+ "name": "Lightx2v 4-step for Wan 2.2 I2V A14B, low-noise expert (Comfy-Org repack)",
+ "url": "https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/loras/wan2.2_i2v_lightx2v_4steps_lora_v1_low_noise.safetensors",
+ "page": "https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged",
+ "file": "wan2.2_i2v_lightx2v_4steps_lora_v1_low_noise.safetensors",
+ "strength": 1.0,
+ "base": "wan2.2-i2v-a14b",
+ "target": "low",
+ "licence": "Apache-2.0 (the Comfy-Org repack's card; LightX2V's Wan2.2-Lightning is Apache-2.0)",
+ "commercial": true,
+ "hostedOk": true,
+ "download": "direct",
+ "released": "2025-08-07",
+ "revision": "ee6f4a40737a995bf5818954cfce6d59443b0f04",
+ "sha256": "024f21de095bc8fad9809ded3e9e49a2e170dcf27075da8145ba7d60d8aab7f9",
+ "sizeBytes": 1226977424,
+ "checked": "2026-11-02",
+ "usedBy": [
+ "fuobe-animation (keyframe in-betweening, the low-noise expert on your GPU)"
+ ],
+ "notes": "The repository now answers as Comfy-Org/Wan-2.2 (Hugging Face redirects the old name). The open graph loads it on the low-noise expert so the in-betweens take 4 steps; in the cloud fal's own acceleration takes its place (fal's endpoint runs its own step count), so it is never sent there."
}
]
}
diff --cc docs/research/idol-9.json
index c640a2f0,043dac31..5896235a
--- a/docs/research/idol-9.json
+++ b/docs/research/idol-9.json
@@@ -689,8 -696,8 +696,8 @@@
}
],
"hostedSummary": {
- "idolHosted": false,
- "cloudRoute": "none; open engine only, no substitute",
+ "idolHosted": true,
- "cloudRoute": "fal speridlabs/idol ($0.10) since 2026-10-30, built as idol-3d in idol-1 (corrected 2026-11-02; the 2026-10-30 check predates fal's listing)",
++ "cloudRoute": "fal speridlabs/idol ($0.10) since 2026-10-30, built as idol-3d (corrected 2026-11-02; the 2026-10-30 check predates fal's listing)",
"existingCloudSplat": "triposplat (fal tripo3d/triposplat, <= 262,144 Gaussians, $0.05; cloud-models.generated.ts L15265-15307) stays as it is and is never labelled Idol"
},
"fuobeToday": {
diff --cc docs/research/idol-9.md
index ec979720,0780b42e..8feb6f0a
--- a/docs/research/idol-9.md
+++ b/docs/research/idol-9.md
@@@ -15,7 -15,7 +15,7 @@@ _As of 2026-10-30. Machine-readable twi
- **The quality lead is the vendor's own and small.** On Speridlabs' benchmark Idol beats TripoSplat by +0.014 SSIM, +0.002 IoU and +0.038 DINOv2 similarity. There is no paper, no named test set and no independent check. The weights really are different from TripoSplat's (sampled cosine 0.02–0.26 in the denoiser), so a real difference is plausible (§2.3, §3).
- **The raw output is hazy.** About half the Gaussians are nearly transparent and show as a fuzzy halo. Core ComfyUI can hide it in the orbit video (RenderSplat's opacity threshold) but cannot remove it from the saved file. The pack's `Idol Prune Splat` node can (§2.4, §5).
- **Licences are clean.** Idol's weights are Apache-2.0 and not gated. The pack is Apache-2.0 with no Python dependencies. The DINOv3 encoder brings its "Built with DINOv3" notice, which Fuobe already shows for TripoSplat (§4).
- - **No cloud route.** Idol is not on fal or Replicate. fal's `tripo3d/triposplat` is a different model and must not be labelled Idol. Idol is open engine only, with no substitute (§6).
-- **Cloud route (corrected 2026-11-02).** On 2026-10-30 Idol was not on fal or Replicate. Since later that day fal hosts it as `speridlabs/idol` ($0.10 per generation), so idol-1 added a cloud half labelled Idol 3D (§6). fal's `tripo3d/triposplat` is a different model and must not be labelled Idol.
++- **Cloud route (corrected 2026-11-02).** On 2026-10-30 Idol was not on fal or Replicate. Since later that day fal hosts it as `speridlabs/idol` ($0.10 per generation), so Fuobe added a cloud half labelled Idol 3D (§6). fal's `tripo3d/triposplat` is a different model and must not be labelled Idol.
- **My verdict.** Idol is not as good as the pitch: not 2 s, not low-VRAM, and its quality edge is unproven. It is still **worth adding, cheaply**: a second open splat model in Image to 3D → Splat, built from a copy of a graph Fuobe already ships, Apache-2.0, 1.32 GB of new weights. Make TripoSplat or Idol the default only after a blind A/B. The build plan has nine packages; one is P0 (§9).
## 2. What Idol is
@@@ -176,7 -176,7 +176,7 @@@ A copy of `image-to-splat-triposplat.js
| 75 | `RenderSplat` | **`opacity_threshold` 0.05** (the orbit video drops the haze; the saved file keeps it) |
| 88:96 | `ComfySwitchNode` | both inputs are the same `UNETLoader` in the TripoSplat file; keep it as is, or wire 88:16 straight into 88:6 |
- **The photo crop with core nodes** (my analysis, not run). `TripoSplatPreprocessImage` at 1024 gives the object at 1/1.2 of the frame. Scaling that to 720 px and centring it on a black 1024 canvas puts the object at 720 / 1.2 = 600 px, where Idol's `real` mode puts it at 1024 / 1.7 ≈ 602 px. The background is black in both, the erosion is the same 1 px at 1024 scale, and the source detail is the same (both crop at the 1024 scale). Only the resampling differs. `ComfySwitchNode`'s inputs are lazy (`comfy_extras/nodes_logic.py` L98–111), so the branch not taken does not run. Check it against `IdolPreprocessImage` `real` before shipping (idol-1, "verify here").
-**The photo crop with core nodes** (my analysis, not run). `TripoSplatPreprocessImage` at 1024 gives the object at 1/1.2 of the frame. Scaling that to 720 px and centring it on a black 1024 canvas puts the object at 720 / 1.2 = 600 px, where Idol's `real` mode puts it at 1024 / 1.7 ≈ 602 px. The background is black in both, the erosion is the same 1 px at 1024 scale, and the source detail is the same (both crop at the 1024 scale). Only the resampling differs. `ComfySwitchNode`'s inputs are lazy (`comfy_extras/nodes_logic.py` L98–111), so the branch not taken does not run. Check it against `IdolPreprocessImage` `real` before shipping (idol-1, "verify here"). **idol-1 (2026-11-02):** shipped behind "It's a photo (looser crop)" and `/prompt`-validated on the CPU server only; the comparison with `IdolPreprocessImage` `real` is still to be done by the owner (the pack was not installed, by rule). idol-2 replaces the branch with `IdolPreprocessImage` where the pack is installed.
++**The photo crop with core nodes** (my analysis, not run). `TripoSplatPreprocessImage` at 1024 gives the object at 1/1.2 of the frame. Scaling that to 720 px and centring it on a black 1024 canvas puts the object at 720 / 1.2 = 600 px, where Idol's `real` mode puts it at 1024 / 1.7 ≈ 602 px. The background is black in both, the erosion is the same 1 px at 1024 scale, and the source detail is the same (both crop at the 1024 scale). Only the resampling differs. `ComfySwitchNode`'s inputs are lazy (`comfy_extras/nodes_logic.py` L98–111), so the branch not taken does not run. Check it against `IdolPreprocessImage` `real` before shipping (idol-1, "verify here"). **idol-1 (2026-11-02):** shipped behind "It's a photo (looser crop)" and `/prompt`-validated on the CPU server only; the comparison with `IdolPreprocessImage` `real` is still to be done (the pack is not installed here). idol-2 replaces the branch with `IdolPreprocessImage` where the pack is installed.
**Bindings** (the TripoSplat set plus two): `image` 99.image; `cutout` 88:35.switch; `photoCrop` 88:104.switch (new key); `numGaussians` 88:55.num_gaussians; `steps`, `cfg` 88:6; **`sampler` 88:6.sampler_name** (new key); `seed` 88:6.seed and 88:55.seed; `splatFormat` 92.format; `orbitFrames` 75.frames; `filenamePrefix` 51 and 42. Outputs: 51 model3d role `splat`; 42 video role `turntable`.
@@@ -208,7 -208,15 +208,15 @@@ The provider runs the clean graph when
## 6. Cloud routes
- **None.** Idol is not hosted on fal or Replicate, so under the owner's rule it is open engine only, with no substitute recipe.
-**Correction (2026-11-02, package idol-1).** The check below (2026-10-30) was right that day, but fal published `speridlabs/idol` the same evening (catalog date 2026-10-30T20:19Z, status active; research #10 §5). Re-read at the primary source on 2026-11-02 (`https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=speridlabs/idol`, `api.fal.ai/v1/models`, the model page's billing): category image-to-3d, **$0.10 per generation**, licence type commercial.
++**Correction (2026-11-02).** The check below (2026-10-30) was right that day, but fal published `speridlabs/idol` the same evening (catalog date 2026-10-30T20:19Z, status active; new-models-10 §5). Re-read at the primary source on 2026-11-02 (`https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=speridlabs/idol`, `api.fal.ai/v1/models`, the model page's billing): category image-to-3d, **$0.10 per generation**, licence type commercial.
+
+ - **Inputs:** `image_url` (required); `image_type` `synthetic` (default, tight crop) | `real` (photos, looser crop); `num_gaussians` 32,768–1,048,576 (default 262,144); `num_inference_steps` 1–50 (default 50); `guidance_scale` 0–10 (default 3, Idol's own weight, i.e. ComfyUI cfg 4); `seed`; `enable_safety_checker` (default true). No sampler and no output-format choice.
+ - **Outputs:** `model_mesh` (the splat, `.ply`), `model_glb` (a coloured point cloud of the splat centres), `preprocessed_image` (the cut-out it saw), `camera` (yaw, pitch, radius, fov), `num_gaussians`, `seed`, `timings`.
+ - `fal-ai/idol` answers the same schema but has no catalog entry; Fuobe uses `speridlabs/idol`.
+
-So Idol now has a cloud half under the owner's rule: Fuobe's cloud model `idol-3d` ("Idol 3D", research record in `new-models-10.json` `endpointRecords`, FieldMap generated by `scripts/gen-cloud-models.py`). Best / Quick look map to `num_inference_steps` 50 / 20 and `num_gaussians` 262,144 / 65,536 (the sampler stays fal's), and "It's a photo" maps to `image_type` `real`. The open engine keeps what fal lacks: the `.spz` file, the orbit video and the sampler choice. Replicate still has no Idol (not re-checked with a token).
++So Idol now has a cloud half: Fuobe's cloud model `idol-3d` ("Idol 3D", research record in `new-models-10.json` `endpointRecords`, FieldMap generated by `scripts/gen-cloud-models.py`). Best / Quick look map to `num_inference_steps` 50 / 20 and `num_gaussians` 262,144 / 65,536 (the sampler stays fal's), and "It's a photo" maps to `image_type` `real`. The open engine keeps what fal lacks: the `.spz` file, the orbit video and the sampler choice. Replicate still has no Idol (not re-checked with a token).
+
+ The original check of 2026-10-30:
| Where | What I checked | Result |
|---|---|---|
@@@ -251,7 -259,7 +259,7 @@@ At Idol's reference settings it sample
## 8. Where it goes in Fuobe and why
- Idol goes where people already make 3D, on the open engine only.
-Idol goes where people already make 3D. (Written when Idol had no cloud route; idol-1 added fal's `speridlabs/idol` as the cloud half of the first row, see §6. The other rows stay open-engine work.)
++Idol goes where people already make 3D. (Written when Idol had no cloud route; Fuobe added fal's `speridlabs/idol` as the cloud half of the first row, see §6. The other rows stay open-engine work.)
| Where | What the user gets | Open engine | Cloud engine | Why | Priority (package) |
|---|---|---|---|---|---|
diff --cc docs/research/new-models-10.json
index d6a51a3f,84788f6a..a13a8b99
--- a/docs/research/new-models-10.json
+++ b/docs/research/new-models-10.json
@@@ -478,7 -526,8 +526,8 @@@
"released": "2026-10-13",
"url": "https://comfyui-wiki.com/en/news/2026-10-13-lightvae",
"inFuobe": false,
- "confirmed": false
+ "confirmed": false,
- "note": "Not built: Sol-H3-VAE loads with the core VAELoader on the new pin, so no alternative was needed (nm10-h3-any-gpu)."
++ "note": "Not built: Sol-H3-VAE loads with the core VAELoader on the new pin, so no alternative was needed."
},
{
"name": "Spark-H3 / Veda sparse attention",
@@@ -490,7 -539,8 +539,8 @@@
"released": "2026-10-03 / 2026-10-11",
"url": "https://comfyui-wiki.com/en/news/2026-10-11-spark-h3",
"inFuobe": false,
- "confirmed": true
+ "confirmed": true,
- "note": "Not built (nm10-h3-any-gpu): both are custom node packs not installed on the validation server; an \"Experimental speed\" switch waits for them. The FastH3 graphs already use the core BlockSparseAttention (vsa)."
++ "note": "Not built: both are custom node packs not installed on the validation server; an \"Experimental speed\" switch waits for them. The FastH3 graphs already use the core BlockSparseAttention (vsa)."
},
{
"name": "FLUX 3 Image Klein (+ Base, prompt upsampler)",
diff --cc docs/research/new-models-10.md
index 271bd076,08070273..c0c2d5c5
--- a/docs/research/new-models-10.md
+++ b/docs/research/new-models-10.md
@@@ -204,7 -204,8 +204,8 @@@ The build order in §6.1 groups these b
|---|---|---|
| `n7-3-regenerate-2k` (and `n7-4`, `n7-10`) | ComfyUI core merged MiniMax H3 latent upscalers (PR #17412) and a Sol-H3-VAE loader (PR #17411) on 2026-10-28 (master, not v0.43.1). Sol-H3-VAE decodes 2K in 0.89 s instead of 14.5 s on a GB200. | After a pin bump (done in `nm10-h3-any-gpu`), use the core upscaler instead of installing the LBH pack, and test Sol-H3-VAE as the decoder. The rdh pack is still needed for the refine recipe. |
| (n7-3 as built, 2026-11-01) | The CPU ComfyUI here is 0.41.0 (`fc04da91`): its `/object_info` has no core H3 latent upscaler and no Sol-H3-VAE loader. rdh9616's `OpenH3RegenUpscale` looks up LBH's `MinimaxH3LatentUpscaler3D` class by name (`__init__.py` L415-418) and raises without it, so the core upscaler alone would not serve the rdh graph. | n7-3 installs both packs (`OPEN_H3_REGEN=1`). Dropping the LBH pack needs the core upscaler in the pin and a change to the rdh node (or a graph on core nodes): revisit with `nm10-h3-any-gpu`'s pin bump. |
-| (nm10-h3-any-gpu, 2026-11-02) | Read at the source: #17412 adds core `MiniMaxH3LatentUpscaleWithModel` (model/latent/minimax) and teaches core `LatentUpscaleModelLoader` the H3 upscaler's state dict; #17411 teaches the core `VAELoader` the Sol decoder (no new node). Open-H3-Regenerate's `vae_fast/fast_h3_vae_noncausal_24l.safetensors` is byte-identical to Sol-H3-VAE's `sol_h3_vae.safetensors` (SHA-256 `8658f1e8…`, 6.47 GB); Comfy-Org repacks it as `minimax_h3_sol_vae_int8_convrot` (1.99 GB) and `_fp16` (3.6 GB) at `912b6e38`. Both PRs are on master only (v0.43.2 lacks them; master's `comfyui_version.py` still reads 0.43.0). | `install-comfyui.sh` keeps `fc04da91` as its default and names master `17ff1dcc` (2026-11-01, has both PRs) as an opt-in `COMFYUI_REF`: the library is not yet re-validated on it (the running CPU server here is still `fc04da91`), so the default moves, and Fast decode is offered, only after a session validates the whole library there. The LBH pack is unnecessary only for a graph built on the core nodes (`LatentUpscaleModelLoader` → `MiniMaxH3LatentUpscaleWithModel`) with the upscaler file Regenerate already pins (`minimax_h3_latent_upscaler_3d_conv_v1_bf16`, the same bytes as LBH's; its header has the three keys the core loader looks for, read 2026-11-02); rdh9616's `OpenH3RegenUpscale` still calls LBH's class by name, so `video-regenerate-h3` keeps both packs until its upscale step moves to the core nodes. Regenerate's fast decoder could move to the core `VAELoader` on the new pin (same file). |
-| `idol-1` … `idol-9` | `speridlabs/idol` is **hosted on fal** (active since 2026-10-30). idol-1 says "Idol is not on fal or Replicate (§6). Do not add a cloud half". | Under the owner's rule Idol now qualifies for a cloud route: fetch the schema and add the cloud half to idol-1 (or a small follow-up), labelled as Idol. |
++| (2026-11-02) | Read at the source: #17412 adds core `MiniMaxH3LatentUpscaleWithModel` (model/latent/minimax) and teaches core `LatentUpscaleModelLoader` the H3 upscaler's state dict; #17411 teaches the core `VAELoader` the Sol decoder (no new node). Open-H3-Regenerate's `vae_fast/fast_h3_vae_noncausal_24l.safetensors` is byte-identical to Sol-H3-VAE's `sol_h3_vae.safetensors` (SHA-256 `8658f1e8…`, 6.47 GB); Comfy-Org repacks it as `minimax_h3_sol_vae_int8_convrot` (1.99 GB) and `_fp16` (3.6 GB) at `912b6e38`. Both PRs are on master only (v0.43.2 lacks them; master's `comfyui_version.py` still reads 0.43.0). | `install-comfyui.sh` keeps `fc04da91` as its default and names master `17ff1dcc` (2026-11-01, has both PRs) as an opt-in `COMFYUI_REF`: the library is not yet re-validated on it (the running CPU server here is still `fc04da91`), so the default moves, and Fast decode is offered, only after a session validates the whole library there. The LBH pack is unnecessary only for a graph built on the core nodes (`LatentUpscaleModelLoader` → `MiniMaxH3LatentUpscaleWithModel`) with the upscaler file Regenerate already pins (`minimax_h3_latent_upscaler_3d_conv_v1_bf16`, the same bytes as LBH's; its header has the three keys the core loader looks for, read 2026-11-02); rdh9616's `OpenH3RegenUpscale` still calls LBH's class by name, so `video-regenerate-h3` keeps both packs until its upscale step moves to the core nodes. Regenerate's fast decoder could move to the core `VAELoader` on the new pin (same file). |
+| `idol-1` … `idol-9` | `speridlabs/idol` is **hosted on fal** (active since 2026-10-30). idol-1 says "Idol is not on fal or Replicate (§6). Do not add a cloud half". | Idol now qualifies for a cloud route: fetch the schema and add the cloud half to idol-1 (or a small follow-up), labelled as Idol. |
| `qma-angles` | akhaliq's Qwen-Image-2.1 Multiple-Angles LoRA (72 framings; Apache-2.0 per comfyui-wiki), AnyAngle (MIT, renders from a splat or GLB), Krea 2 Anygles and Fisher Pose appeared. Speed LoRAs (`nm10-qwen21-fast`) can cut QMA's 30 steps. | Keep QMA (the owner's pick); record the alternatives; try the 4-step Lightning LoRA with QMA as an optional fast preview. |
| `blockout-film` | fal `minimax/h3-max/3d-to-video` (09-16) turns a Blender / 3D proxy animation (≤ 15 s, ≤ 32 shots) plus references into a finished video; SolarRenderer (H3 LoRAs, 10-13) renders grey boxes, semantic maps or SMPL meshes in 4 steps on the open engine. | Both are the same task as the brief: offer H3 Max 3D-to-video as a cloud model under its own name next to Seedance 2.5, and record SolarRenderer as the open route to test. |
| `inbetweening` | Pika H3 Flex FL2VA (first + last frame, 6 steps, with sound) and TaoMate-H3-FL2VA. | Optional H3 in-between route once `nm10-pika-flex` lands; Wan 2.2 FLF2V stays the default. |
diff --cc scripts/comfy/build-library.mjs
index 45155fac,eaf5d855..366bcaa1
--- a/scripts/comfy/build-library.mjs
+++ b/scripts/comfy/build-library.mjs
@@@ -134,10 -128,14 +134,14 @@@ export const BINDING_KEYS = new Set(
'gridPrompt', 'sheetPrompt',
// av-tools (Wave B, see library.spec.mjs header)
'frameIndex',
- // nm10-music3 (see library.spec.mjs header)
++ // Full songs (see library.spec.mjs header)
+ 'tiledDecode',
// comfyui-oss-4 additions (see library.spec.mjs header)
'maskPrompt', 'maskGrow', 'skipPass2', 'supersample', 'zoomStart', 'zoomEnd', 'panStartX', 'panStartY', 'panEndX', 'panEndY',
'easeInOut', 'chunkFrames', 'crossfade', 'headroomDb', 'fadeCurve', 'format', 'profile', 'peakNits', 'resolutionLevel', 'fovX',
'decimation', 'cutout', 'numGaussians', 'splatFormat', 'orbitFrames', 'frameWidth',
- // idol-1 (docs/research/idol-9.md §5.5): Idol 3D's looser photo crop (the sampler key is MOSS-Image's)
++ // Idol 3D (docs/research/idol-9.md §5.5): Idol 3D's looser photo crop (the sampler key is MOSS-Image's)
+ 'photoCrop',
// round 4 (engine seams, see library.spec.mjs header)
'curveMode', 'filterSpeckle', 'colorPrecision',
// remove-object package (round 4)
@@@ -166,9 -164,11 +170,11 @@@
'takeStart', 'maskStart', 'takeX', 'takeY', 'regionWidth', 'regionHeight', 'regenWidth', 'regenHeight', 'regenX', 'regenY', 'trimX', 'trimY', 'feather',
// Clean up voice (ComfyUI-RE-USE): the RE-USE file, the rate it runs at, room tone, level and the music & effects bed's level
'reuseModel', 'rate', 'roomToneDb', 'level', 'bedDb',
+ // Clean up dialogue (DBS graph C, docs/research/dbs-separation-7.md §4.4): each stem's level in the remix
+ 'voiceDb', 'musicDb', 'effectsDb',
// Blockout to film: a near = dark depth pass (Blender's mist) inverted before VACE reads it
'invertDepth',
- // Design a voice (nm10-voice-design): the voice in words, and what a voice sample says (Qwen3-TTS / VoxCPM2 clones)
+ // Design a voice: the voice in words, and what a voice sample says (Qwen3-TTS / VoxCPM2 clones)
'voiceDescription', 'voiceTranscript',
// VoxCPM2's device combo (cuda | mps | cpu): the server's first torch device
'device',
diff --cc scripts/comfy/library.spec.mjs
index 60e6c4a7,fd41a48f..a931dd9f
--- a/scripts/comfy/library.spec.mjs
+++ b/scripts/comfy/library.spec.mjs
@@@ -56,6 -56,8 +56,8 @@@
// gridPrompt, sheetPrompt (contact-sheet / turnaround framing text placed before the prompt)
// Keys added with the nm10-flux3-klein workflows (research #10 §6.3):
// image5 … image10 (further reference images: FLUX 3 Image Klein's edit takes up to 10)
-// Keys added with the nm10-music3 workflows (research #10 §6.6). * = the provider fills it from the canonical request:
++// Keys added with the full-song workflows (new-models-10 §6.6). * = the provider fills it from the canonical request:
+ // tiledDecode* (MiniMax Music 3: decode the song in tiles, less VRAM; on for songs over 2 minutes)
// Keys added with the av-tools workflows (Wave B):
// frameIndex (Extract frame: which frame of the Trim Video window, -1 = its last, 0 = its first)
// Keys added with the comfyui-oss-4 workflows (docs/research/comfyui-oss-4.md). * = the provider fills it from the
@@@ -267,6 -237,13 +272,13 @@@ export const PACK_CLASSES =
// Model download locations for files that the source workflow does not annotate
// (UI templates usually carry node.properties.models; custom-node examples do not).
export const KNOWN_MODELS = {
- // nm10-music3: MiniMax Music 3 and YuE2 as Comfy-Org repacked them (the files the core templates audio_minimax_music_3,
++ // MiniMax Music 3 and YuE2 as Comfy-Org repacked them (the files the core templates audio_minimax_music_3,
+ // audio_yue2_text2music and audio_yue2_music_cover load), pinned in model-pins.json at the revisions read on 2026-11-01.
+ 'minimax_music3_dit_int8_convrot.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/Comfy-Org/MiniMax-Music-3/resolve/main/diffusion_models/minimax_music3_dit_int8_convrot.safetensors' },
+ 'minimax_music3_text_encoder_pruned_int8_convrot.safetensors': { folder: 'text_encoders', url: 'https://huggingface.co/Comfy-Org/MiniMax-Music-3/resolve/main/text_encoders/minimax_music3_text_encoder_pruned_int8_convrot.safetensors' },
+ 'minimax_music3_dav.safetensors': { folder: 'vae', url: 'https://huggingface.co/Comfy-Org/MiniMax-Music-3/resolve/main/vae/minimax_music3_dav.safetensors' },
+ 'yue2_3b_int8_convrot.safetensors': { folder: 'checkpoints', url: 'https://huggingface.co/Comfy-Org/YuE2/resolve/main/checkpoints/yue2_3b_int8_convrot.safetensors' },
+ 'sheetsage2_bf16.safetensors': { folder: 'audio_encoders', url: 'https://huggingface.co/Comfy-Org/YuE2/resolve/main/audio_encoders/sheetsage2_bf16.safetensors' },
// archive-restore: Lightricks' Detail Refine IC-LoRA (stage 2 of Restore & colourise), gated, at the researched commit.
'ltx-2.5-22b-ic-lora-refine-details-1.0.safetensors': { folder: 'loras', url: 'https://huggingface.co/Lightricks/LTX-2.5-22b-IC-LoRA-Refine-Details/resolve/4912c478b35dd96b6cdcc5f7c7ff9d72c2c57929/ltx-2.5-22b-ic-lora-refine-details-1.0.safetensors' },
// Live edit: linoyts' 2-step DMD2 LoRA for Qwen-Image 2.1 (pytorch_lora_weights.safetensors upstream, kept under a
@@@ -342,12 -321,17 +360,23 @@@
'minimax_h3_video_vae_int8_convrot.safetensors': { folder: 'vae', url: 'https://huggingface.co/Kijai/MiniMax-H3-experimental/resolve/f5c3b1d5a63e008a691fca1b6096fd57a5307536/minimax_h3_video_vae_int8_convrot.safetensors' },
'minimax_h3_turbo_v4_step600_ema.safetensors': { folder: 'loras', url: 'https://huggingface.co/larryvrh/MiniMax-H3-Turbo-Lora/resolve/43a74557ac3f6539db8e0f2a959d03feb7a81480/minimax_h3_turbo_v4_step600_ema.safetensors' },
'minimax_h3_flf2v_lora_v1.safetensors': { folder: 'loras', url: 'https://huggingface.co/pablodawson/MiniMax-H3-360-Orbit-LoRA/resolve/5ddbc2dbbe95edbbdaf5017c3e934b1d01791697/minimax_h3_flf2v_lora_v1.safetensors' },
- // MiniMax H3 on 8-31 GB cards (nm10-h3-any-gpu, research #10 §6.4): FastVideo's FastH3 V2 (8-step DMD2, int8 22.1 GB or
+ // Genjutsu's Openjutsu modes: Kijai's rank-39 DMAD 4-step LoRA (from ZhengmingYu/DMAD), mdevoz's rank-64 SolarRenderer
+ // pair (same speed and VRAM as rank 384, a sixth of the size) and BFL's int8 FLUX 3 prompt upsampler, at pinned revisions.
+ 'minimax_h3_DMAD_4step_full_lora_avg_rank_39_bf16.safetensors': { folder: 'loras', url: 'https://huggingface.co/Kijai/MiniMax-H3-experimental/resolve/f5c3b1d5a63e008a691fca1b6096fd57a5307536/loras/minimax_h3_DMAD_4step_full_lora_avg_rank_39_bf16.safetensors' },
+ 'solarrenderer_4step_lora_rank64.safetensors': { folder: 'loras', url: 'https://huggingface.co/mdevoz/SolarRendererRank64/resolve/984a10b7c167bbb94614f9644d5fedbb93a8c6e6/solarrenderer_4step_lora_rank64.safetensors' },
+ 'solarrenderer_control_lora_rank64.safetensors': { folder: 'loras', url: 'https://huggingface.co/mdevoz/SolarRendererRank64/resolve/984a10b7c167bbb94614f9644d5fedbb93a8c6e6/solarrenderer_control_lora_rank64.safetensors' },
+ 'qwen3.5_9b_flux3_prompt_upsampler_int8_convrot.safetensors': { folder: 'text_encoders', url: 'https://huggingface.co/black-forest-labs/flux-3-image-klein-comfy/resolve/feef60b0aaf63a4773ace96636ebbcf43b881312/text_encoders/qwen3.5_9b_flux3_prompt_upsampler_int8_convrot.safetensors' },
++ // MiniMax H3 on 8-31 GB cards (new-models-10 §6.4): FastVideo's FastH3 V2 (8-step DMD2, int8 22.1 GB or
+ // NVFP4 13.6 GB for Blackwell) and FastH3 Trim (42 of 50 blocks, experimental; NVFP4 11.9 / fp8 19.7 / int8 ConvRot 18.9 GB),
+ // each at the revision read on 2026-11-02. MiniMax H3 Community License (the repos' cards).
+ 'fastvideo_fasth3_8step_v2_pruned_int8_convrot.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/FastVideo/FastVideo-FastH3-Comfy/resolve/ec1e3aa374a91c57b0b94a1623b7e657c0498cf2/diffusion_models/fastvideo_fasth3_8step_v2_pruned_int8_convrot.safetensors' },
+ 'fastvideo_fasth3_8step_v2_pruned_nvfp4.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/FastVideo/FastVideo-FastH3-8-Step-V2-NVFP4-Comfy/resolve/994a40beb8c8f15739e4f0fad96aec101bb7123c/diffusion_models/fastvideo_fasth3_8step_v2_pruned_nvfp4.safetensors' },
+ 'fastvideo_fasth3_trim_8step_int8_convrot.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/FastVideo/FastVideo-FastH3-Trim-Comfy/resolve/f66c13dc17391dd4da99242a407918b92bf7d5fc/diffusion_models/fastvideo_fasth3_trim_8step_int8_convrot.safetensors' },
+ 'fastvideo_fasth3_trim_8step_fp8.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/FastVideo/FastVideo-FastH3-Trim-Comfy/resolve/f66c13dc17391dd4da99242a407918b92bf7d5fc/diffusion_models/fastvideo_fasth3_trim_8step_fp8.safetensors' },
+ 'fastvideo_fasth3_trim_8step_nvfp4.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/FastVideo/FastVideo-FastH3-Trim-Comfy/resolve/f66c13dc17391dd4da99242a407918b92bf7d5fc/diffusion_models/fastvideo_fasth3_trim_8step_nvfp4.safetensors' },
+ // Fast decode: Sol-H3-VAE (Efficient-Large-Model, distilled from the H3 VAE decoder; weights under the MiniMax H3 licence per
+ // its card, code Apache-2.0) as Comfy-Org repacked it for the core loader (ComfyUI #17411, master from 2026-10-28).
+ 'minimax_h3_sol_vae_int8_convrot.safetensors': { folder: 'vae', url: 'https://huggingface.co/Comfy-Org/MiniMax-H3/resolve/912b6e38b2092ec4d2e86d24183e0d59ea059d48/vae/minimax_h3_sol_vae_int8_convrot.safetensors' },
'depth_anything_3_mono_large.safetensors': { folder: 'geometry_estimation', url: 'https://huggingface.co/Comfy-Org/Depth-Anything-3/resolve/main/geometry_estimation/depth_anything_3_mono_large.safetensors' },
// comfyui-oss-3 additions (docs/research/comfyui-oss-3.json, sizes from the Hugging Face tree API)
// MOSS-Image (research #7 §4.4): Comfy-Org's int8 / w4a8 set (the Comfy template's) at a pinned commit, and Spectrallic's SFT with the
@@@ -415,9 -399,14 +444,17 @@@
'dino_v3_vit_h.safetensors': { folder: 'clip_vision', url: 'https://huggingface.co/VAST-AI/TripoSplat/resolve/main/clip_vision/dino_v3_vit_h.safetensors' },
'triposplat_vae_decoder_fp16.safetensors': { folder: 'vae', url: 'https://huggingface.co/VAST-AI/TripoSplat/resolve/main/vae/triposplat_vae_decoder_fp16.safetensors' },
'triposplat_fp16.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/VAST-AI/TripoSplat/resolve/main/diffusion_models/triposplat_fp16.safetensors' },
- // idol-1 (docs/research/idol-9.md §4.1): Speridlabs' Idol for the core TripoSplat nodes. A third-party conversion (ComfyUI-Idol
+ // Any Angle: lilylilith's AnyAngle LoRA for Qwen-Image 2.1 (Apache-2.0, rank 24, ComfyUI keys), at the revision whose file
+ // was measured (119,590,312 bytes).
+ 'QI2.1_AnyAngle.safetensors': { folder: 'loras', url: 'https://huggingface.co/lilylilith/QI_2.1_AnyAngle/resolve/5c8b4c8e05ba6328d54bf8d34ec724fef5a414ae/QI2.1_AnyAngle.safetensors' },
++ // Idol 3D (docs/research/idol-9.md §4.1): Speridlabs' Idol for the core TripoSplat nodes. A third-party conversion (ComfyUI-Idol
+ // scripts/convert.py at 4d3a4f6) of speridlabs/idol @ 2731c229 (Apache-2.0): pos_pe dropped (ComfyUI recomputes it), cast to fp16,
+ // the two decoders merged under octree./gs., and spot-checked as faithful on 10 tensor prefixes (idol-9 §3, §4.1). Pinned to
+ // nynxz/Idol @ c718f2b1: idol_fp16 741,107,210 B, sha256 cf452146f78e23a0d34be8f9f79bcde642b9a40ef493046c8e9d5f79096f6dd0;
+ // idol_decoder_fp16 576,148,658 B, sha256 c511d99eb668ec4b06d883cb6e43770bc35e3864e16e7058e8d6211ba5c509aa. dino_v3_vit_h,
+ // flux2-vae and birefnet are shared with TripoSplat, so 1.32 GB is new.
+ 'idol_fp16.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/nynxz/Idol/resolve/c718f2b1b95b353edd07d17e845719fc10880a44/diffusion_models/idol_fp16.safetensors' },
+ 'idol_decoder_fp16.safetensors': { folder: 'vae', url: 'https://huggingface.co/nynxz/Idol/resolve/c718f2b1b95b353edd07d17e845719fc10880a44/vae/idol_decoder_fp16.safetensors' },
// round 4 (r4/video-finish): the chunked SeedVR2 graph is hand-built, so its files are named here (same files as the template).
'seedvr2_3b_int8_convrot.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/Comfy-Org/SeedVR2/resolve/main/diffusion_models/seedvr2_3b_int8_convrot.safetensors' },
'seedvr2_ema_vae_fp16.safetensors': { folder: 'vae', url: 'https://huggingface.co/Comfy-Org/SeedVR2/resolve/main/vae/seedvr2_ema_vae_fp16.safetensors' },
@@@ -516,7 -505,23 +553,23 @@@ const H3_NOTES_LAYOUT
const H3_NOTES_FILES =
'Files: fl2va pruned int8 (20.97 GB), the Qwen3-VL 32B NVFP4 text encoder (15.69 GB; native on compute capability 10+), the int8 video VAE (3.17 GB) ' +
'and the audio VAE (0.61 GB).';
- const H3_NOTES_COMMON = `${H3_NOTES_CANVAS} ${H3_NOTES_LAYOUT} ${H3_NOTES_FILES}`;
-// Options → Decoder "Fast decode" (nm10-h3-any-gpu): Sol-H3-VAE in the decode loader (136, binding vae); the stock VAE
++// Options → Decoder "Fast decode": Sol-H3-VAE in the decode loader (136, binding vae); the stock VAE
+ // still encodes the frames. Needs ComfyUI master from 2026-10-28 (#17411); not loadable by an older core.
+ const H3_SOL_VAE = 'minimax_h3_sol_vae_int8_convrot.safetensors';
+ const H3_NOTES_SOL =
+ 'Fast decode (vae = minimax_h3_sol_vae_int8_convrot, 1.99 GB, optional): Sol-H3-VAE, a 24-layer whole-clip decoder distilled from the H3 VAE ' +
+ '(its card: 12.5 s -> 5.0 s for a 5 s 768p clip on an RTX 5090, 45.4 dB PSNR against the stock decoder); the core VAELoader reads it from ComfyUI master ' +
+ '0df1646a (2026-10-28, #17411) on, and its memory grows with the clip (about 24 GiB at 720p for 5 s, the card).';
+ // Sol-H3-VAE's licence as recorded (the full graphs carry it as an optional file): its model page has no licence tag.
+ const H3_LICENSE_SOL =
+ ' · Sol-H3-VAE (Efficient-Large-Model; the optional fast decoder): licence unconfirmed, no licence tag on its model page; its card says code Apache-2.0 ' +
+ 'and weights under the MiniMax H3 Community License';
-// The FastH3 tiers (nm10-h3-any-gpu): FastVideo's distills carry the MiniMax H3 Community License (their cards).
++// The FastH3 tiers: FastVideo's distills carry the MiniMax H3 Community License (their cards).
+ const H3_LICENSE_FASTH3 = `${H3_LICENSE} · FastH3 V2 and FastH3 Trim (FastVideo): MiniMax H3 Community License`;
+ const H3_NOTES_FASTH3_FILES =
+ 'Files: the FastH3 diffusion file, the Qwen3-VL 32B NVFP4-AWQ text encoder (15.69 GB; every FastH3 template pairs it with every diffusion file; offloaded ' +
+ 'after encoding), the int8 video VAE (3.17 GB) and the audio VAE (0.61 GB).';
+ const H3_NOTES_COMMON = `${H3_NOTES_CANVAS} ${H3_NOTES_LAYOUT} ${H3_NOTES_FILES} ${H3_NOTES_SOL}`;
const H3_NOTES_TIME = 'With the turbo v4 LoRA (0.78 GB). Tested on an RTX 5090 (32 GB): about 2-3 min for a 124-frame clip at 1024x768.';
const WAN_NEG_EN =
@@@ -1320,6 -1318,36 +1373,36 @@@ export const SPEC =
vramGb: 24,
notes: 'Uses the Wan 2.2 I2V high/low experts. High->low switch at step 10 (end_at_step of node 84 / start_at_step of node 87, not a binding). Start and end images should share the output aspect ratio.',
},
+ {
- // Keyframe animation (package inbetweening): Fuobe Animation on your GPU. The library file holds two keyframes (one pass);
++ // Keyframe animation: Fuobe Animation on your GPU. The library file holds two keyframes (one pass);
+ // the provider rewrites it for 2-10 keyframes (expand: 'keyframes', src/lib/av/inbetween-graph.ts), all passes on one set of loaders.
+ id: 'wan22-inbetween-anisora',
+ title: 'Keyframe animation: Wan 2.2 14B first/last-frame in-betweens with AniSora 3.2, every Nth frame per gap, one video',
+ capability: 'keyframes',
+ handBuilt: 'hand-built/wan22-inbetween-anisora.json',
+ bindings: {
+ prompt: [b('p1', 'text')],
+ negativePrompt: [b('9', 'text')],
+ image: [b('k1', 'image')],
+ endImage: [b('k2', 'image')],
+ width: [b('f1', 'width')],
+ height: [b('f1', 'height')],
+ frames: [b('f1', 'length')],
+ fps: [b('video', 'fps')],
+ seed: [b('h1', 'noise_seed')],
+ shift: [b('3', 'shift'), b('6', 'shift')],
+ },
+ outputs: [{ node: 'save', kind: 'video' }],
+ limits: { maxWidth: 1280, maxHeight: 1280, maxFrames: 81, dimensionMultiple: 16, frameStep: 4 },
+ expand: 'keyframes',
+ vramGb: 24,
+ license: 'Apache-2.0 (Wan 2.2 I2V A14B, lightx2v 4-step LoRA, bilibili Index-AniSora V3.2; Kijai\'s AniSora extraction states no licence of its own)',
+ notes:
+ 'One Wan 2.2 FLF2V pass per pair of neighbouring keyframes, all sharing one set of loaders: the high-noise expert with AniSora 3.2 (strength 1) and the low-noise expert with the lightx2v 4-step LoRA (strength 1), ModelSamplingSD3 shift 5 on both, ' +
+ 'KSamplerAdvanced 4 steps at CFG 1, euler / simple, high 0-2 with leftover noise, low 2-end; umt5 fp8, Wan 2.1 VAE, Wan\'s standard negative words. Each pass has its own length (4n + 1, 17-81 frames), words and seed. ' +
+ 'VHS_SelectEveryNthImage keeps every Nth frame (1-4) counted back from the next keyframe (skip_first_images = ((length - 2) mod N) + 1), so each pose is on screen and no joint shows a frame twice; keyframe 1 (ImageFromBatch of pass 1) goes in front; ' +
+ 'BatchImagesNode joins them in order and CreateVideo plays them at 24 fps (snappier, the passes are made at 16 fps) or 16 fps (true time). About 24 GB of VRAM at 720p; RAM for the decoded frames grows with the total length.',
+ },
{
id: 'wan22-fun-camera-14b',
title: 'Wan 2.2 14B Fun Camera Control (image to video)',
@@@ -1754,6 -1794,68 +1849,68 @@@
'one frozen instant, the camera in one continuous 360-degree orbit, everything holding its place, camera parallax the only movement. The LoRA was trained ' +
`without sound; the graph still decodes H3's audio. ${H3_NOTES_FIRST_FRAME} ${H3_NOTES_SIZE} ${H3_NOTES_FILES} With the Orbit LoRA (0.16 GB).`,
},
- // ---- MiniMax H3 on 8-31 GB cards (nm10-h3-any-gpu, research #10 §6.4): Comfy-Org's "FastVideo FastH3" templates
++ // ---- MiniMax H3 on 8-31 GB cards (new-models-10 §6.4): Comfy-Org's "FastVideo FastH3" templates
+ // (workflow_templates video_fastvideo_fasth3_t2v / _i2v, the "First Last Frame to Video (FastVideo FastH3)" subgraph) as
+ // API graphs. src/lib/gpu/h3-tier.ts picks the tier and binds `unet` to the card's file (NVFP4 on Blackwell, else int8, or
+ // Trim's fp8 on a PyTorch without CUDA 13). Trim has text to video only: FastVideo's Trim cards name eight-step text-to-video.
+ ...[
+ ['minimax-h3-fast-t2v', 't2v', 'Text to Video', false, false],
+ ['minimax-h3-fast-i2v', 'i2v', 'Image to Video', true, false],
+ ['minimax-h3-fast-flf2v', 'flf2v', 'Start + End Frame to Video', true, true],
+ ].map(([id, capability, what, first, last]) => ({
+ id,
+ title: `MiniMax H3 ${what} + Audio on a 16 GB GPU (FastH3 V2, 8 steps)`,
+ capability,
+ handBuilt: `hand-built/${id}.json`,
+ bindings: {
+ prompt: [b('131', 'prompt')],
+ ...(first && { image: [b('138', 'image')] }),
+ ...(last && { endImage: [b('140', 'image')] }),
+ width: [b('131', 'width')], height: [b('131', 'height')], frames: [b('131', 'length')],
+ seed: [b('129', 'noise_seed')], steps: [b('124', 'steps')], unet: [b('127', 'unet_name')],
+ filenamePrefix: [b('174', 'filename_prefix')],
+ },
+ outputs: [{ node: '174', kind: 'video' }],
+ defaults: { width: 1344, height: 768, frames: 124, fps: 24, steps: 8 },
+ limits: { maxFrames: 362, dimensionMultiple: 32 },
+ vramGb: 16,
+ optionalModels: ['fastvideo_fasth3_8step_v2_pruned_nvfp4.safetensors'],
+ license: H3_LICENSE_FASTH3,
+ notes:
+ `${what} with sound on FastVideo's FastH3 8-Step V2 (DMD2, step 1300; FastVideo/FastVideo-FastH3-Comfy @ ec1e3aa3), as Comfy-Org's FastH3 template: ` +
+ 'MiniMaxH3ImageToVideo' + (first ? (last ? ' with first_frame and last_frame' : ' with first_frame') : ' with no frames') + ', UNETLoader (unet: the pruned int8 ConvRot file, ' +
+ '22.13 GB, or the NVFP4 file, 13.61 GB, for Blackwell) -> MiniMaxH3SigmaShift 10 / 3 -> ModelAttentionBackend "comfy kitchen attention" (INT8 attention, ' +
+ 'listed on NVIDIA and AMD GPUs only, so a CPU ComfyUI refuses the value) -> BlockSparseAttention vsa 10% from 20% of the steps, BasicScheduler simple 8 steps, ' +
+ 'KSamplerSelect res_multistep, CFG 1; core nodes only (ComfyUI 0.36 or later). FastVideo: fits 16 GB, not 12 GB, in its tests; the int8 file is partly ' +
+ 'offloaded under 24 GB. ' + (first ? 'FastVideo\'s card says FL2VA was not distilled; Comfy-Org\'s image-to-video template runs it, so a start frame is followed less closely than on minimax-h3-i2v. ' + H3_NOTES_FIRST_FRAME + ' ' : '') +
+ `${H3_NOTES_CANVAS} ${H3_NOTES_LAYOUT} ${H3_NOTES_FASTH3_FILES}`,
+ })),
+ {
+ id: 'minimax-h3-trim-t2v',
+ title: 'MiniMax H3 Text to Video + Audio on an 8-12 GB GPU (FastH3 Trim, 8 steps, experimental)',
+ capability: 't2v',
+ handBuilt: 'hand-built/minimax-h3-trim-t2v.json',
+ bindings: {
+ prompt: [b('131', 'prompt')],
+ width: [b('131', 'width')], height: [b('131', 'height')], frames: [b('131', 'length')],
+ seed: [b('129', 'noise_seed')], steps: [b('124', 'steps')], unet: [b('127', 'unet_name')],
+ filenamePrefix: [b('174', 'filename_prefix')],
+ },
+ outputs: [{ node: '174', kind: 'video' }],
+ defaults: { width: 1344, height: 768, frames: 124, fps: 24, steps: 8 },
+ limits: { maxFrames: 362, dimensionMultiple: 32 },
+ vramGb: 12,
+ optionalModels: ['fastvideo_fasth3_trim_8step_fp8.safetensors', 'fastvideo_fasth3_trim_8step_nvfp4.safetensors'],
+ license: H3_LICENSE_FASTH3,
+ notes:
+ "Text to video with sound on FastVideo's FastH3 Trim (FastVideo/FastVideo-FastH3-Trim-Comfy @ f66c13dc, 2026-10-06): 42 of H3's 50 blocks with a shared " +
+ 'rank-16 timestep basis, 8-step DMD2 (checkpoint 300), experimental and below FastH3 V2 in quality. The FastH3 template\'s graph with unet = the Trim file: ' +
+ 'int8 ConvRot (18.92 GB, the default, any recent NVIDIA card), fp8 (19.68 GB, Ada and newer, for a PyTorch without CUDA 13) or NVFP4 (11.89 GB, Blackwell); ' +
+ 'MiniMaxH3SigmaShift 10 / 3, Comfy Kitchen attention, BlockSparseAttention vsa 10%, BasicScheduler simple 8 steps, res_multistep, CFG 1. vramGb 12 is the ' +
+ 'int8 / fp8 file partly offloaded; the 8 GB figure is FastVideo\'s test with the NVFP4 file and memory capped at 8 GB on an RTX 4090 (82 s for 5 s at 480p). ' +
+ 'FastVideo\'s timings (5 s with sound): RTX 5090 13.4 s at 480p, 35.4 s at 768p; RTX 4090 43.9 s / 132.8 s; none measured here. Text to video only: the Trim ' +
+ `cards name eight-step text-to-video and no frame conditioning. ${H3_NOTES_CANVAS} ${H3_NOTES_LAYOUT} ${H3_NOTES_FASTH3_FILES}`,
+ },
{
id: 'infinitetalk-native',
title: 'InfiniteTalk Lip-sync (native, single speaker, ~6 s)',
@@@ -1926,6 -2028,8 +2083,8 @@@
{ op: 'set', node: '94', input: 'bpm', value: 120 },
{ op: 'set', node: '94', input: 'duration', value: 60 },
{ op: 'set', node: '98', input: 'seconds', value: 60 },
- // nm10-music3: a song with no words is an instrumental (the template's sample lyrics are never sung).
++ // A song with no words is an instrumental (the template's sample lyrics are never sung).
+ { op: 'set', node: '94', input: 'lyrics', value: '[Instrumental]' },
],
bindings: {
tags: [b('94', 'tags')],
@@@ -1938,7 -2042,82 +2097,82 @@@
outputs: [{ node: '106', kind: 'audio' }],
limits: { maxDurationSec: 240 },
vramGb: 8,
- notes: 'Turbo AIO checkpoint (8 steps). tags = style description, lyrics with [Verse]/[Chorus] markers ("[Instrumental]" or empty for instrumental). Output MP3 V0 (changed from FLAC). Defaults changed to 60 s / 120 bpm. Language/keyscale/timesignature stay at template values (en, E minor, 4).',
+ notes: 'Turbo AIO checkpoint (8 steps). tags = style description, lyrics with [Verse]/[Chorus] markers; "[Instrumental]" when there are no words (in place of the template sample lyrics). Output MP3 V0 (changed from FLAC). Defaults changed to 60 s / 120 bpm. Language/keyscale/timesignature stay at template values (en, E minor, 4).',
+ },
- // nm10-music3 (research #10 §6.6): full songs on core nodes. MiniMax Music 3 from the template audio_minimax_music_3
++ // (new-models-10 §6.6) full songs on core nodes. MiniMax Music 3 from the template audio_minimax_music_3
+ // (Comfy-Org's int8 DiT in place of its fp16 one, as the template's own note offers for low VRAM; its Tiled decode switch
+ // kept, turned on by the provider for songs over 2 minutes); YuE2 from audio_yue2_text2music (ABC planning on, "full") and
+ // audio_yue2_music_cover (SheetSage2 reads the song's melody, "melody" mode). The templates' PreviewAny pass-throughs are left out.
+ {
+ id: 'music-minimax-3',
+ title: 'MiniMax Music 3: full songs with vocals up to 5 minutes (caption + lyrics)',
+ capability: 'music',
+ handBuilt: 'hand-built/music-minimax-3.json',
+ bindings: {
+ tags: [b('4', 'caption')],
+ lyrics: [b('4', 'lyrics')],
+ duration: [b('4', 'max_duration')],
+ seed: [b('4', 'seed'), b('7', 'seed')],
+ steps: [b('7', 'steps')],
+ tiledDecode: [b('10', 'switch')],
+ },
+ outputs: [{ node: '11', kind: 'audio' }],
+ defaults: { duration: 120, tiledDecode: false },
+ limits: { maxDurationSec: 300 },
+ vramGb: 24,
+ license: 'MiniMax-Music3 Community License (MiniMaxAI/MiniMax-Music3 @ 1b525ccb: MIT-style grant with the notice kept and an Acceptable Use Policy; a commercial product must show "MiniMax-Music3" in its interface; MiniMax\'s written authorisation above US$20M yearly revenue); the Comfy-Org repack @ 9e364ccd is tagged Apache-2.0',
+ notes:
+ 'From the core template audio_minimax_music_3 from comfyui-workflow-templates 0.11.86 (comfyui_workflow_templates_json 0.1.112), hand-transcribed: int8 DiT, MP3 V0. tags = the caption (style, mood, vocals, arrangement; the template suggests Global Metadata, Vocal Details and Arrangement), lyrics with section tags on lines of their own ' +
+ '([Intro] [Verse] [Pre-Chorus] [Chorus] [Post-Chorus] [Bridge] [Instrumental] [Solo] [Outro]); "[Instrumental]" when there are no words. duration = max_duration, an upper bound ' +
+ '(the model can end the song earlier; 9,000 acoustic frames at 25 fps = 5 min). KSampler 30 steps, cfg 1.7, euler / simple and the encoder\'s cfg_scale 1.7 / top_k 50, as the template. ' +
+ '32 kHz stereo. The template\'s Tiled decode switch (VAEDecodeAudioTiled 1536 / 64): less VRAM for long songs, a small risk of seams; tiledDecode true for songs over 120 s. ' +
+ 'VRAM 24 GB, the card\'s figure: under 24 GB at full precision and about 22 GB with CPU offload; its 8 GB figure streams the language model layer by layer (diffusers group offload), ' +
+ 'which the core node does not do (ComfyUI\'s own partial loading may still fit smaller cards). Files: DiT int8 2.5 GB (fp16 4.91, fp32 9.83), pruned int8 encoder 9.2 GB ' +
+ '(pruned bf16 16.71, full bf16 18.47), DAV VAE 0.22 GB.',
+ },
+ {
+ id: 'music-yue2-song',
+ title: 'YuE2 3B: lyrics to song (style + lyrics, ABC planning)',
+ capability: 'music',
+ handBuilt: 'hand-built/music-yue2-song.json',
+ bindings: {
+ tags: [b('2', 'style'), b('3', 'style')],
+ lyrics: [b('2', 'lyrics'), b('3', 'lyrics')],
+ duration: [b('3', 'max_duration')],
+ seed: [b('2', 'seed'), b('3', 'seed'), b('6', 'seed')],
+ steps: [b('6', 'steps')],
+ },
+ outputs: [{ node: '8', kind: 'audio' }],
+ defaults: { duration: 120 },
+ limits: { maxDurationSec: 300 },
+ vramGb: 12,
+ license: 'CC-BY-NC-4.0 (m-a-p/YuE2-3B @ 8f24312f weights; the Comfy-Org/YuE2 repack @ 2f76ca75 is tagged the same)',
+ notes:
+ 'From the core template audio_yue2_text2music from comfyui-workflow-templates 0.11.86 (comfyui_workflow_templates_json 0.1.112), hand-transcribed: MP3 V0. tags = the style (language, genre, vocal, tempo, instruments), lyrics with section tags ([Verse] [Chorus] [Bridge] [Outro]); only the words to be sung. YuE2 Generate ABC plans ' +
+ 'melody and chords ("full") before the song; YuE2 Generate Music makes the tokens and the seconds the empty latent takes. duration = max_duration, an upper bound reduced for long prompts. ' +
+ 'KSampler 32 steps, cfg 1, dpm_2 / sgm_uniform, as the template. Checkpoint int8 3.96 GB (bf16 7.8 GB). VRAM is not published: 12 GB is Fuobe\'s estimate for the int8 checkpoint.',
+ },
+ {
+ id: 'music-yue2-cover',
+ title: 'YuE2 3B: a cover of a song (its melody, new style and lyrics)',
+ capability: 'music',
+ handBuilt: 'hand-built/music-yue2-cover.json',
+ bindings: {
+ audio: [b('9', 'audio')],
+ tags: [b('3', 'style')],
+ lyrics: [b('3', 'lyrics')],
+ duration: [b('3', 'max_duration')],
+ seed: [b('3', 'seed'), b('6', 'seed')],
+ steps: [b('6', 'steps')],
+ },
+ outputs: [{ node: '8', kind: 'audio' }],
+ defaults: { duration: 300 },
+ limits: { maxDurationSec: 300 },
+ vramGb: 12,
+ license: 'CC-BY-NC-4.0 (m-a-p/YuE2-3B @ 8f24312f and m-a-p/SheetSage2 @ b83c3d79 weights; the Comfy-Org/YuE2 repack @ 2f76ca75 is tagged the same)',
+ notes:
+ 'From the core template audio_yue2_music_cover from comfyui-workflow-templates 0.11.86 (comfyui_workflow_templates_json 0.1.112), hand-transcribed: MP3 V0. audio = the song to cover (LoadAudio). SheetSage2 transcribes its melody to ABC ("melody" mode, the template\'s), which YuE2 sings with the new style and lyrics: lyrics close to the ' +
+ 'original\'s phrasing and syllable count fit the melody best. The source audio is not YuE2\'s conditioning, only its melody. SheetSage2 bf16 1.39 GB. VRAM is not published: 12 GB is Fuobe\'s estimate for the int8 checkpoint and SheetSage2.',
},
{
id: 'v2a-mmaudio',
@@@ -4335,7 -4503,29 +4601,29 @@@
notes:
'H3 Relay\'s toolkit H3-Person-Removal.api.json at e2a7665b (Akatz Labs\' tool ships the same file). Changed: the clean first frame goes through an ImageScale (centre crop) to the video\'s exact size, so an edit that came back a little larger or smaller still fits; SAM 3.1\'s words default to "person"; the save prefix. ' +
'video = the part already fitted to 24 fps on the 32-pixel grid (oss-fit-clip), image = the clean first frame (the app makes it with Qwen-Image-Edit from the part\'s first frame). 22-frame windows with 18 of history, 12 steps, er_sde / simple, CFG 1, LoRA 1.0, mask grown 5 px, seed 904234 by default (Akatz\'s settings). The output is silent: the app puts the clip\'s sound back. ' +
- 'Needs the h3-relay pack (H3_RELAY=1) and FFmpeg.',
+ 'Needs the h3-relay pack (H3_RELAY=1) and FFmpeg. ' +
- 'windowControls = H3 Relay\'s Review Windows controls (originals o/person-remover-plus): {config_key, windows: {index: {seed, locked, record_id}}}; locked windows come back exactly from the checkpoints the Relay keeps in ComfyUI\'s output/__h3_removal_cache, the first unlocked one is drawn again with its seed (Redo from here). The provider reads the run\'s window previews from /h3_relay/removal/previews.',
++ 'windowControls = H3 Relay\'s Review Windows controls: {config_key, windows: {index: {seed, locked, record_id}}}; locked windows come back exactly from the checkpoints the Relay keeps in ComfyUI\'s output/__h3_removal_cache, the first unlocked one is drawn again with its seed (Redo from here). The provider reads the run\'s window previews from /h3_relay/removal/previews.',
+ },
- // Remove object's mask first (originals o/person-remover-plus): the removal graph's own SAM 3.1 chain on the first seconds
++ // Remove object's mask first: the removal graph's own SAM 3.1 chain on the first seconds
+ // of the fitted part, the person filled green exactly as the removal will see it (the model card: "check the saved
+ // green-mask preview before running the full removal"). Native ComfyUI nodes only.
+ {
+ id: 'video-person-remove-h3-mask',
+ title: 'Remove a person, mask first: SAM 3.1 finds who you name, thresholds and grows the mask and fills it green over the clip, as H3 Person Removal sees it (core nodes)',
+ capability: 'person-mask',
+ handBuilt: 'hand-built/video-person-remove-h3-mask.json',
+ modelUrls: { 'sam3.1_multiplex_fp16.safetensors': 'https://huggingface.co/Comfy-Org/sam3.1/resolve/7bb8374780a725b4353ed31f3a9395c9742b5621/checkpoints/sam3.1_multiplex_fp16.safetensors' },
+ bindings: {
+ video: [b('source', 'file')], maskPrompt: [b('subject', 'text')], maskGrow: [b('grow_mask', 'expand')], filenamePrefix: [b('save', 'filename_prefix')],
+ },
+ outputs: [{ node: 'save', kind: 'video' }],
+ defaults: { maskPrompt: 'person', maskGrow: 5 },
+ limits: { maxDurationSec: 10, maxFrames: 240 },
+ vramGb: 6,
+ license: 'SAM 3.1 under Meta\'s SAM License (commercial use allowed under its terms); the chain is H3 Relay\'s Person Removal example (GPL-3.0 repository)',
+ notes:
+ 'The SAM 3.1 part of video-person-remove-h3-relay, node for node (detect 0.4 with 2 refinements, track 0.5 with 1 object and detection every 12 frames, threshold 0.5, grow maskGrow px, green 0x00FF00), saved as a video instead of sampled. ' +
+ 'video = the first seconds of the part, fitted to 24 fps on the 32-pixel grid like the removal (oss-fit-clip). Needs nothing but SAM 3.1.',
},
// Character Swap Studio (o/h3-studio; docs/research/openjutsu-6.md §4.2): Akatz Labs' H3 Character Swap workbench for whole
@@@ -4659,62 -4849,34 +4947,91 @@@
'3.78 GB of weights (TripoSplat 0.74, DINOv3 ViT-H 1.68, TripoSplat VAE decoder 0.58, FLUX.2 VAE 0.34, BiRefNet 0.44).',
},
{
- // idol-1 (docs/research/idol-9.md §5.5): Speridlabs' Idol, TripoSplat's architecture retrained, on the same core nodes.
+ // Any Angle (app-any-angle): the 3D view of one photo, built once and saved. Measured on an RTX 5090 (any-angle GPU test).
+ id: 'any-angle-3d',
+ title: 'Any Angle: a photo to a 3D view of its subject (TripoSplat), with a turntable, the sweep its front view is measured on and a GLB',
+ capability: 'splat',
+ handBuilt: 'hand-built/any-angle-3d.json',
+ bindings: {
+ // Only the photo: the seeds, the Gaussians and the 48 frames stay as the graph has them (the same photo, the same view).
+ image: [b('1', 'image')],
+ },
+ outputs: [
+ { node: '16', kind: 'model3d', role: 'splat' },
+ { node: '83', kind: 'video', role: 'turntable' },
+ { node: '85', kind: 'image', role: 'sweep' },
+ { node: '88', kind: 'image', role: 'sweep-mask' },
+ { node: '21', kind: 'image', role: 'matte' },
+ { node: '91', kind: 'model3d', role: 'mesh' },
+ ],
+ defaults: {},
+ vramGb: 8,
+ license:
+ 'MIT (VAST-AI/TripoSplat weights); the dino_v3_vit_h image encoder is under the DINOv3 License (royalty-free, commercial use allowed, trade-control limits; the app must show a "Built with DINOv3" notice); FLUX.2 VAE Apache-2.0; BiRefNet MIT',
+ notes:
+ 'Step 1 of Any Angle, run once per photo (the server keeps the result by the photo\'s sha256; feature any-angle-step, out of Library). image-to-splat-triposplat\'s chain with the cut-out always on ' +
+ '(without it a turned camera shows the photo as a flat card with black wedges), seeds fixed at 46 for the sampler and the decoder (the same photo gives the same 3D view), 20 steps, cfg 3, dpmpp_2m, 262,144 Gaussians. ' +
+ 'Outputs: the splat as .spz (role splat, about 3 MB: every angle reloads it), a 48-frame turntable from yaw 0 at pitch 10, distance 2, fov 33, 512 px, 12 fps (role turntable, shown while picking), ' +
+ 'the same frames at 192 px as lossless animated WebP, colour (role sweep) and RenderSplat\'s coverage mask (role sweep-mask), the BiRefNet cut-out (role matte) and a GLB from core SplatToMesh at 256 (role mesh, the desktop drag view). ' +
+ 'The server compares the sweep with the cut-out photo (silhouette overlap and colour correlation, the GPU test\'s measure) to find the photo\'s front yaw and distance: ' +
+ 'TripoSplat drops its own camera estimate and puts each subject in a pose of its own (the test found yaw 125, 75 and 90 on three photos). ' +
+ 'GPU test (RTX 5090): cut-out 0.8-1.3 s, TripoSplat 1.0 + 18-19.4 + 0.4 s, .spz save under 0.05 s, 48 frames at 512 px 20-37 s, mesh 0.4-0.5 s; about 8.7 GiB peak.',
+ },
+ {
+ // Any Angle (app-any-angle): one angle from the saved 3D view, painted back into a photo by Qwen-Image 2.1 + the AnyAngle LoRA.
+ id: 'any-angle-shot',
+ title: 'Any Angle: one camera angle of a photo, the 3D view rendered there and repainted by Qwen-Image 2.1 + the AnyAngle LoRA',
+ capability: 'edit',
+ handBuilt: 'hand-built/any-angle-shot.json',
+ bindings: {
+ image: [b('1', 'image')], splatFile: [b('2', 'model_file')],
+ cameraYaw: [b('20', 'mode.yaw')], cameraPitch: [b('20', 'mode.pitch')], cameraDistance: [b('20', 'mode.distance')], cameraFov: [b('20', 'fov')],
+ targetX: [b('20', 'target_x')], targetY: [b('20', 'target_y')], targetZ: [b('20', 'target_z')],
+ width: [b('30', 'width')], height: [b('30', 'height')], seed: [b('56', 'seed')], steps: [b('56', 'steps')], cfg: [b('56', 'cfg')],
+ },
+ outputs: [{ node: '58', kind: 'image' }],
+ defaults: { steps: 25, cfg: 1 },
+ limits: { maxWidth: 2048, maxHeight: 2048, dimensionMultiple: 8 },
+ vramGb: 32,
+ license:
+ 'Qwen Research License Agreement (Qwen-Image 2.1, Qwen3-VL 8B encoder, VAE): NON-COMMERCIAL, research and evaluation only; the AnyAngle LoRA (lilylilith/QI_2.1_AnyAngle) Apache-2.0',
+ notes:
+ 'Step 2 of Any Angle, one job per angle. The saved .spz goes in like any input (splatFile) and Load3D reads it without the browser: its image entry points at the photo (the provider fills it), ' +
+ 'then File3DToSplat. CreateCameraInfo orbit takes the camera Fuobe works out (the photo\'s measured front view plus the preset\'s turn, height and distance; a close-up aims at the face\'s height), ' +
+ 'RenderSplat renders it at the photo\'s shape (up to 2048 px, black background). Qwen-Image 2.1 int8 + the AnyAngle LoRA at 1.0, loaded here (one model loader, so no request LoRA lands on another), ' +
+ 'TextEncodeQwenImage21 with the LoRA\'s own prompt "Change the camera angle from <image2> to <image1>.", image 1 the original photo, image 2 the render, resolution 1024 (about 1 MP out: 1184x896 from a 1536x1152 photo), ' +
+ 'KSampler 25 steps, cfg 1, euler, simple, seed 46. GPU test (RTX 5090): reload + render 2.3 s (a rebuild would be about 20 s), text encode 5.4 s, sampler 22.6 s, about 30 s an angle, peak 28.4-29.2 GiB (card total, with the desktop): vramGb 32, since a 24 GB card has no room to spare. ' +
+ 'Tested against the alternatives: the other image order gives back the original angle, cfg 3 is 5x slower and no better, bf16 is 2x slower, the photo behind the render adds a ghost second person, grey is no better than black.',
+ },
++ {
++ // Idol 3D (docs/research/idol-9.md §5.5): Speridlabs' Idol, TripoSplat's architecture retrained, on the same core nodes.
+ id: 'image-to-splat-idol',
+ title: 'Image to a Gaussian splat of one object (Idol on the TripoSplat core nodes) + an orbit video',
+ capability: 'splat',
+ handBuilt: 'hand-built/image-to-splat-idol.json',
+ bindings: {
+ image: [b('99', 'image')], cutout: [b('88:35', 'switch')], numGaussians: [b('88:55', 'num_gaussians')], steps: [b('88:6', 'steps')], cfg: [b('88:6', 'cfg')],
+ sampler: [b('88:6', 'sampler_name')], photoCrop: [b('88:104', 'switch')],
+ seed: [b('88:6', 'seed'), b('88:55', 'seed')], splatFormat: [b('92', 'format')], orbitFrames: [b('75', 'frames')],
+ },
+ outputs: [{ node: '51', kind: 'model3d', role: 'splat' }, { node: '42', kind: 'video', role: 'turntable' }],
+ defaults: { splatFormat: 'spz', cutout: true, photoCrop: false },
+ limits: { maxGaussians: 1048576 },
+ vramGb: 8,
+ license:
+ 'Apache-2.0 (speridlabs/idol weights; the ComfyUI files are nynxz/Idol\'s conversion, Apache-2.0); Idol is VAST-AI-Research\'s TripoSplat architecture (MIT, code and weights); ' +
+ 'the dino_v3_vit_h image encoder is under the DINOv3 License (royalty-free, commercial use allowed, trade-control limits; ' +
+ 'the app must show a "Built with DINOv3" notice); FLUX.2 VAE Apache-2.0; BiRefNet MIT',
+ notes:
+ 'Idol 3D (Speridlabs): one object from one picture -> a Gaussian splat (role splat) + a 75-frame orbit video (role turntable). A copy of image-to-splat-triposplat with the same node ids. ' +
+ 'Reference settings (idol-sdk sampler.py L43-70): 50 Euler steps, simple schedule; Idol\'s CFG weight 3 in its (1+w)cond - w*uncond form is ComfyUI cfg 4.0, and its rescale_t 3 is TripoSplat\'s built-in shift 3 (comfy/supported_models.py), so no ModelSamplingSD3. ' +
+ 'Quick look (set by the page as params.extra): 20 dpmpp_2m steps, cfg 4, 65,536 Gaussians, the ComfyUI-Idol README\'s "faster trade-off" and "fast preview"; quality unmeasured. ' +
+ 'Photo crop (photoCrop, default false): TripoSplatPreprocessImage is Idol\'s "synthetic" 1.2 crop; scaled to 720 and centred on a black 1024 canvas (88:101-103) the object spans 600 px, where Idol\'s "real" 1.7 crop gives 602 px. ' +
+ 'ComfySwitchNode 88:104 picks it; its inputs are lazy, so the branch not taken does not run. Not yet compared with IdolPreprocessImage "real". ' +
+ 'About half the Gaussians are near-transparent: RenderSplat thresholds 0.05; the saved file is not pruned without the ComfyUI-Idol pack. ' +
+ '1.32 GB of new weights (idol_fp16 0.74, idol_decoder_fp16 0.58) plus the shared 2.46 GB (DINOv3 ViT-H 1.68, FLUX.2 VAE 0.34, BiRefNet 0.44). ' +
+ 'VRAM: vendor peak 7.2 GB in the SDK; unmeasured in ComfyUI.',
+ },
{
// N7-5: Cinema's "Film this path" on the open engine (docs/research/new-models-7.md §3.6, the wan21-i2v-uni3c-path table).
id: 'wan21-i2v-uni3c-path',
diff --cc scripts/eval/cases/animation.json
index 00000000,f8454701..0a126724
mode 000000,100644..100644
--- a/scripts/eval/cases/animation.json
+++ b/scripts/eval/cases/animation.json
@@@ -1,0 -1,242 +1,242 @@@
+ {
+ "$schema": "./case.schema.json",
+ "suite": "animation",
+ "title": "Fuobe Animation · keyframes in, the in-betweens drawn, one animation",
- "description": "Keyframe in-betweening (package inbetweening): your keyframes of one drawn character in local/animation/ (key1.png … key5.png: the same character in five poses, one shape, a plain background). On your GPU Fuobe Animation runs every gap in one graph on one set of Wan 2.2 I2V 14B fp8 loaders: AniSora 3.2 on the high-noise expert, the lightx2v 4-step LoRA on the low-noise expert, 4 steps at CFG 1, shift 5, each gap's own length (4n + 1, 17-81 frames) and every-Nth selection, played at 24 fps (or 16 fps, true time). In the cloud each gap is one fal Wan 2.2 A14B image-to-video clip with an end frame and AniSora on the high-noise expert, every frame kept at 16 fps, joined. Hardware: Wan 2.2 14B fp8 with two experts needs about 24 GB of VRAM at 720p (the manifest's vramGb); each pass holds its own frames, and system RAM for the decoded frames grows with the total length (the workflow's 116 made frames at 1280x720 are about 1 GB of float frames). Demo mode returns the demo provider's clip. Metrics: temporal steadiness, identity of the drawn character against key1 (expected lower than for photos), CLIP against the words. The words are Fuobe's own.",
++ "description": "Keyframe in-betweening: your keyframes of one drawn character in local/animation/ (key1.png … key5.png: the same character in five poses, one shape, a plain background). On your GPU Fuobe Animation runs every gap in one graph on one set of Wan 2.2 I2V 14B fp8 loaders: AniSora 3.2 on the high-noise expert, the lightx2v 4-step LoRA on the low-noise expert, 4 steps at CFG 1, shift 5, each gap's own length (4n + 1, 17-81 frames) and every-Nth selection, played at 24 fps (or 16 fps, true time). In the cloud each gap is one fal Wan 2.2 A14B image-to-video clip with an end frame and AniSora on the high-noise expert, every frame kept at 16 fps, joined. Hardware: Wan 2.2 14B fp8 with two experts needs about 24 GB of VRAM at 720p (the manifest's vramGb); each pass holds its own frames, and system RAM for the decoded frames grows with the total length (the workflow's 116 made frames at 1280x720 are about 1 GB of float frames). Demo mode returns the demo provider's clip. Metrics: temporal steadiness, identity of the drawn character against key1 (expected lower than for photos), CLIP against the words. The words are Fuobe's own.",
+ "original": "fuobe-animation",
+ "kind": "video",
+ "targets": {
+ "open": {
+ "models": [
+ "fuobe-animation"
+ ]
+ },
+ "cloud": {
+ "models": [
+ "fuobe-animation"
+ ]
+ },
+ "demo": {
+ "models": [
+ "fuobe-animation"
+ ]
+ }
+ },
+ "defaults": {
+ "seeds": [
+ 42
+ ],
+ "metrics": [
+ "temporal",
+ "clip"
+ ],
+ "timeoutSeconds": 5400,
+ "candidate": "recipe"
+ },
+ "variants": {
+ "recipe": {
+ "description": "Fuobe Animation with the case's timing, mouth still",
+ "extra": {
+ "stillMouth": true
+ }
+ },
+ "plain-chain": {
+ "description": "Today's Frames mode on your GPU: Wan 2.2 14B start/end-frame clips per pair, no AniSora, joined (the same keyframe times)",
+ "engines": [
+ "open"
+ ],
+ "models": {
+ "open": [
+ "oss-wan22-14b"
+ ]
+ }
+ }
+ },
+ "cases": [
+ {
+ "id": "animation/five-poses",
+ "title": "Five poses of one drawn character, the workflow's own timing",
+ "op": "keyframes",
+ "inputs": {
+ "images": [
+ "local/animation/key1.png",
+ "local/animation/key2.png",
+ "local/animation/key3.png",
+ "local/animation/key4.png",
+ "local/animation/key5.png"
+ ]
+ },
+ "demoInputs": {
+ "images": [
+ "fixtures/character/drawn-face-1.png",
+ "fixtures/character/drawn-face-2.png",
+ "fixtures/character/drawn-face-3.png",
+ "fixtures/character/drawn-face-1.png",
+ "fixtures/character/drawn-face-2.png"
+ ]
+ },
+ "prompts": [
+ {
+ "id": "poses",
+ "text": "An anime character moves smoothly from pose to pose, clean line art, flat colours"
+ }
+ ],
+ "params": {
+ "aspectRatio": "16:9",
+ "resolution": "720p",
+ "keyframeTimes": [
+ 0,
+ 1.5,
+ 1.75,
+ 1.917,
+ 3.75
+ ]
+ },
+ "references": [
+ "local/animation/key1.png"
+ ],
+ "metrics": [
+ "temporal",
+ "identity",
+ "clip"
+ ],
+ "engines": [
+ "open",
+ "demo"
+ ],
+ "extra": {
+ "inbetween": {
+ "gaps": [
+ {
+ "frames": 37,
+ "speed": 1
+ },
+ {
+ "frames": 17,
+ "speed": 3
+ },
+ {
+ "frames": 17,
+ "speed": 4
+ },
+ {
+ "frames": 45,
+ "speed": 1
+ }
+ ],
+ "fps": 24
+ }
+ },
+ "note": "The GPU's speeds and 24 fps: the cloud runs the true-time case."
+ },
+ {
+ "id": "animation/five-poses-true-time",
+ "title": "Five poses, every frame kept at 16 fps (both engines)",
+ "op": "keyframes",
+ "inputs": {
+ "images": [
+ "local/animation/key1.png",
+ "local/animation/key2.png",
+ "local/animation/key3.png",
+ "local/animation/key4.png",
+ "local/animation/key5.png"
+ ]
+ },
+ "demoInputs": {
+ "images": [
+ "fixtures/character/drawn-face-1.png",
+ "fixtures/character/drawn-face-2.png",
+ "fixtures/character/drawn-face-3.png",
+ "fixtures/character/drawn-face-1.png",
+ "fixtures/character/drawn-face-2.png"
+ ]
+ },
+ "prompts": [
+ {
+ "id": "poses",
+ "text": "An anime character moves smoothly from pose to pose, clean line art, flat colours"
+ }
+ ],
+ "params": {
+ "aspectRatio": "16:9",
+ "resolution": "720p",
+ "keyframeTimes": [
+ 0,
+ 2.25,
+ 3.25,
+ 4.25,
+ 7
+ ]
+ },
+ "references": [
+ "local/animation/key1.png"
+ ],
+ "metrics": [
+ "temporal",
+ "identity",
+ "clip"
+ ],
+ "extra": {
+ "inbetween": {
+ "gaps": [
+ {
+ "frames": 37,
+ "speed": 1
+ },
+ {
+ "frames": 17,
+ "speed": 1
+ },
+ {
+ "frames": 17,
+ "speed": 1
+ },
+ {
+ "frames": 45,
+ "speed": 1
+ }
+ ],
+ "fps": 16
+ }
+ }
+ },
+ {
+ "id": "animation/two-poses",
+ "title": "Two poses, one gap: the shortest animation",
+ "op": "keyframes",
+ "inputs": {
+ "images": [
+ "local/animation/key1.png",
+ "local/animation/key2.png"
+ ]
+ },
+ "demoInputs": {
+ "images": [
+ "fixtures/character/drawn-face-1.png",
+ "fixtures/character/drawn-face-2.png"
+ ]
+ },
+ "prompts": [
+ {
+ "id": "turn",
+ "text": "The character turns her head and smiles, clean line art"
+ }
+ ],
+ "params": {
+ "aspectRatio": "16:9",
+ "resolution": "720p"
+ },
+ "extra": {
+ "inbetween": {
+ "gaps": [
+ {
+ "frames": 33,
+ "speed": 1
+ }
+ ]
+ }
+ },
+ "note": "No playback rate: each engine plays at its own (24 fps on your GPU, 16 in the cloud)."
+ }
+ ]
+ }
diff --cc scripts/fetch-hosted-schemas.py
index 63138786,72854ab6..e8976088
--- a/scripts/fetch-hosted-schemas.py
+++ b/scripts/fetch-hosted-schemas.py
@@@ -200,16 -204,140 +204,140 @@@ NEW10 =
"blackforestlabs/flux-3/klein/base/text-to-image/lora": ("t2i", {**KLEIN_T2I, "loras": "loras"}, "FLUX 3 Klein Base LoRA", "FLUX 3 Klein Base Text to Image LoRA"),
"blackforestlabs/flux-3/klein/base/edit-image/lora": ("edit", {**KLEIN_EDIT, "loras": "loras"}, "FLUX 3 Klein Base LoRA", "FLUX 3 Klein Base Edit LoRA"),
}
-# Research #10 §5 (package idol-1): Speridlabs' Idol is hosted on fal since 2026-10-30 (speridlabs/idol; fal-ai/idol answers the same
++# new-models-10 §5: Speridlabs' Idol is hosted on fal since 2026-10-30 (speridlabs/idol; fal-ai/idol answers the same
+ # schema but has no catalog entry). One picture of one object -> a .ply splat (model_mesh), a point-cloud GLB preview (model_glb) and the
+ # cut-out it saw (preprocessed_image). image_type "real" is Idol's looser photo crop (1.7), "synthetic" its default (1.2).
+ NEW10_SPLATS = {
+ "speridlabs/idol": {
+ "family": "idol", "model": "Idol", "title": "Sperid Labs Idol", "vendor": "Speridlabs",
+ "keyFields": {"image": "image_url", "numGaussians": "num_gaussians", "steps": "num_inference_steps", "cfg": "guidance_scale", "seed": "seed", "imageType": "image_type"},
+ "license": "Apache-2.0 (speridlabs/idol weights); TripoSplat's architecture (MIT); DINOv3 image encoder under the DINOv3 License (\"Built with DINOv3\")",
+ "notes": ("Idol (TripoSplat's architecture, retrained by Speridlabs): one image of one object -> model_mesh, a 3D Gaussian splat (.ply), "
+ "model_glb (a coloured point cloud of the splat centres, for standard 3D viewers), preprocessed_image (the cut-out it saw) and the "
+ "predicted camera. num_inference_steps 1-50 (default 50), num_gaussians 32,768-1,048,576 (default 262,144), guidance_scale 0-10 "
+ "(default 3, Idol's own weight: ComfyUI cfg 4), image_type synthetic | real. No sampler choice and no output format choice."),
+ },
+ }
NEW10_TRAINERS = {
"blackforestlabs/flux-3/klein/base/trainer": ("FLUX 3 Klein base", "Soul ID on FLUX 3 Image Klein (nm10-flux3-klein; FLUX Kommunity licence, shown as information)"),
"blackforestlabs/flux-3/klein/base/trainer/edit": ("FLUX 3 Klein base", "Edit LoRAs from before / after pairs on FLUX 3 Image Klein (recorded; Soul ID trains subjects with the plain trainer)"),
}
- def get(url):
-# Research #10 (build package nm10-music3): full songs in the cloud, read with --music into new-models-10.json endpointRecords.
++# Research #10: full songs in the cloud, read with --music into new-models-10.json endpointRecords.
+ # MiniMax Music 3 is the same open model the open engine runs (its weights' own licence and the Comfy-Org repack's tag are
+ # both recorded); Mureka, ElevenLabs and Lyria are proprietary APIs. Mureka's song tools take a song_id from one of its own
+ # answers or an id from its files/upload (purpose "audio" / "remix"); its stems take a plain URL and answer with a zip.
+ MM3_LICENCE = ("MiniMax-Music3 Community License (MiniMaxAI/MiniMax-Music3 @ 1b525ccb, LICENSE read 2026-11-01): an MIT-style grant with the notice "
+ "kept, use within the law and its Acceptable Use Policy (Exhibit A); commercial products show \"MiniMax-Music3\" in their interface and "
+ "need MiniMax's written authorisation above US$20M yearly revenue; a hosted service keeps safeguards against infringing outputs. "
+ "The Comfy-Org repack (Comfy-Org/MiniMax-Music-3 @ 9e364ccd) is tagged Apache-2.0 on Hugging Face; the weights' own licence is the one above")
+ MUREKA_NOTE = "Proprietary hosted API (Mureka on fal); songs come back with a song_id the song tools (extend, remix, edit) take"
+ MUSIC10 = {
+ # endpoint: (op, keyFields, family, model, vendor, licence or note)
+ "minimax/music-3": ("music", {"prompt": "prompt", "lyrics": "lyrics", "duration": "duration", "seed": "seed"}, "minimax-music", "MiniMax Music 3", "MiniMax", MM3_LICENCE),
+ "mureka/v9.5/generate/song": ("music", {"prompt": "prompt", "lyrics": "lyrics", "duration": "duration"}, "mureka", "Mureka 9.5", "Mureka", MUREKA_NOTE),
+ "mureka/v9/generate/song": ("music", {"prompt": "prompt", "lyrics": "lyrics"}, "mureka", "Mureka 9", "Mureka", MUREKA_NOTE),
+ "mureka/v9.5/generate/instrumental": ("music", {"prompt": "prompt"}, "mureka", "Mureka 9.5 Instrumental", "Mureka", MUREKA_NOTE),
+ "mureka/v9/generate/instrumental": ("music", {"prompt": "prompt"}, "mureka", "Mureka 9 Instrumental", "Mureka", MUREKA_NOTE),
+ # Recorded: a soundtrack reads a picture or a clip by an id from mureka/api/files/upload (purpose "soundtrack").
+ "mureka/v9.5/generate/soundtrack": ("v2a", {"prompt": "prompt"}, "mureka", "Mureka 9.5 Soundtrack", "Mureka", MUREKA_NOTE),
+ "mureka/v9/generate/soundtrack": ("v2a", {"prompt": "prompt"}, "mureka", "Mureka 9 Soundtrack", "Mureka", MUREKA_NOTE),
+ "mureka/v8/song/extend": ("song-extend", {"lyrics": "lyrics", "songId": "song_id", "uploadId": "upload_audio_id", "extendAt": "extend_at"}, "mureka", "Mureka 8 Extend", "Mureka", MUREKA_NOTE),
+ "mureka/v8/song/remix": ("song-remix", {"prompt": "prompt", "lyrics": "lyrics", "songId": "song_id", "uploadId": "upload_audio_id"}, "mureka", "Mureka 8 Remix", "Mureka", MUREKA_NOTE),
+ "mureka/api/song/stem": ("song-stems", {"audio": "audio_url"}, "mureka", "Mureka stems", "Mureka", MUREKA_NOTE),
+ "mureka/api/files/upload": ("upload", {"file": "file_url", "purpose": "purpose"}, "mureka", "Mureka file upload", "Mureka", MUREKA_NOTE),
+ # Recorded only: an edit of a region's words, voice cloning ($5 a voice) and the lyrics writer.
+ "mureka/api/song/edit": ("song-edit", {"lyrics": "lyrics", "songId": "song_id", "uploadId": "upload_audio_id"}, "mureka", "Mureka song edit", "Mureka", MUREKA_NOTE),
+ "mureka/api/voice/clone": ("voice-clone", {"audio": "audio_url"}, "mureka", "Mureka voice clone", "Mureka", MUREKA_NOTE),
+ "mureka/api/generate/lyrics": ("write", {"prompt": "prompt"}, "mureka", "Mureka lyrics", "Mureka", MUREKA_NOTE),
+ # The route Fuobe called before (a version field; 9.5's duration); fal's catalog lists it with no metadata now.
+ "mureka/api/generate/song": ("music", {"prompt": "prompt", "lyrics": "lyrics", "duration": "duration"}, "mureka", "Mureka song (versioned)", "Mureka", MUREKA_NOTE),
+ "elevenlabs/music/v2.5": ("music", {"prompt": "prompt", "duration": "music_length_ms"}, "elevenlabs", "ElevenLabs Music v2.5", "ElevenLabs",
+ "Proprietary hosted API; billed per output minute, rounded up; lyrics go in a composition plan of timed chunks (recorded, not sent)"),
+ "google/lyria-3.5": ("music", {"prompt": "prompt", "image": "image_url", "lyricsInPrompt": "prompt"}, "lyria", "Lyria 3.5", "Google",
+ "Proprietary hosted API; lyrics and section timings go in the prompt (its description says so)"),
+ }
+
+
+ def music10(ids):
+ """Research #10's music records (MUSIC10) in new-models-10.json endpointRecords; only those named in `ids` when it names any."""
+ path = ROOT / "docs/research/new-models-10.json"
+ data = json.loads(path.read_text(encoding="utf-8"))
+ records = {e["endpoint"]: e for e in data.get("endpointRecords") or []}
+ for ep, (op, kf, family, model, vendor, licence) in MUSIC10.items():
+ if ids and ep not in ids:
+ continue
+ inputs = fal(ep)
+ missing = [f for f in kf.values() if f not in inputs]
+ if missing:
+ sys.exit(f"{ep}: keyFields {missing} are not inputs")
+ root = json.loads(get(f"https://fal.ai/api/openapi/queue/openapi.json?endpoint_id={ep}"))
+ result = root["paths"][f"/{ep}/requests/{{request_id}}"]["get"]["responses"]["200"]["content"]["application/json"]["schema"]
+ outputs = list(resolve(result, root).get("properties") or {})
+ price = llms_price(ep)
+ records[ep] = {
+ "family": family, "model": model, "title": model, "vendor": vendor, "operation": op, "provider": "fal", "endpoint": ep,
+ "falCategory": "text-to-audio", "status": fal_catalog_status(ep), "keyFields": kf, "inputs": inputs,
+ "output": "zip_url" if "zip_url" in outputs else ("id" if op == "upload" else "audio.url"), "outputFields": outputs,
+ "price": price, "license": licence, "verified": True, "sourceUrl": f"https://fal.ai/models/{ep}",
+ "schemaUrl": f"https://fal.ai/api/openapi/queue/openapi.json?endpoint_id={ep}", "capability": op, "fetched": TODAY,
+ }
+ print(f"{ep}: {records[ep]['status']}, {len(inputs)} inputs, out {outputs}, {price}")
+ data["endpointRecords"] = list(records.values())
+ path.write_text(json.dumps(data, indent=1, ensure_ascii=False) + "\n", encoding="utf-8")
+
+
-# Hosted catch-up (build package nm10-hosted-catchup): fal's September-October MiniMax H3 Max tools (lip sync, relight, insert,
++# Hosted catch-up: fal's September-October MiniMax H3 Max tools (lip sync, relight, insert,
+ # five looks), H3 Max Turbo, Vidu Q4, Meshy retexture and Tripo P2, and Replicate's H3 Lite and HighSpeed, read with --catchup
+ # into docs/research/new-models-10.json endpointRecords (part 4's record shape; gen-cloud-models.py merges them last).
+ # Values: (operation, keyFields, vendor, model, notes).
+ H3_STYLE = {"prompt": "prompt", "image": "image_url", "duration": "duration", "aspectRatio": "aspect_ratio", "seed": "seed"}
+ H3_TURBO = {"prompt": "prompt", "duration": "duration", "resolution": "resolution", "seed": "seed"}
+ H3_REPLICATE = {"prompt": "prompt", "image": "first_frame_image", "endImage": "last_frame_image", "images": "reference_image_urls",
+ "video": "reference_video_urls", "audio": "reference_audio_urls", "duration": "duration", "aspectRatio": "ratio"}
+ CATCHUP = {
+ "minimax/h3-max/lip-sync/image-to-video": ("avatar", {"image": "image_url", "audio": "audio_url", "resolution": "resolution", "seed": "seed"},
+ "MiniMax", "MiniMax H3 Max Lip Sync", "Image (aspect 0.4-2.5) + 5 s to 15 min of audio; the video is as long as the audio. Billed per second, x1.2 over 15 s."),
+ "minimax/h3-max/relight": ("relight-video", {"video": "video_url", "image": "reference_image_url", "resolution": "resolution", "aspectRatio": "aspect_ratio", "seed": "seed"},
+ "MiniMax", "MiniMax H3 Max Relight", "reference_image_url is a render of a lit sphere showing the target light (Fuobe draws it in the browser from its light presets). Source up to 15 s, resampled to 24 fps and trimmed to 17n+5 frames, at least 56."),
+ "minimax/h3-max/insert-video": ("insert-moment", {"prompt": "prompt", "video": "video_url", "images": "reference_image_urls", "videos": "reference_video_urls",
+ "startTime": "start_time", "endTime": "resume_time", "duration": "duration", "resolution": "resolution", "seed": "seed"},
+ "MiniMax", "MiniMax H3 Max Insert Video", "A new scene of `duration` seconds generated between start_time and resume_time of the clip (both within 60 s, start at least 1.625 s); only the new scene is billed."),
+ **{f"minimax/h3-max/styles/{s}": ("t2v+i2v", {**H3_STYLE, **({"damageLevel": "damage_level"} if s == "vhs" else {})}, "MiniMax", f"MiniMax H3 Max {t}",
+ "Text or a first frame to a 5-15 s clip in the look, with sound; generation, not a restyle of a clip.")
+ for s, t in (("16bit-pixel", "16-bit Pixel"), ("hand-drawn", "Hand-drawn"), ("low-poly", "Low Poly"), ("retro-toon-70s", "Retro Toon 70s"), ("vhs", "VHS"))},
+ "minimax/h3-max-turbo/text-to-video": ("t2v", {**H3_TURBO, "aspectRatio": "aspect_ratio"}, "MiniMax", "MiniMax H3 Max Turbo", None),
+ "minimax/h3-max-turbo/image-to-video": ("i2v", {**H3_TURBO, "image": "image_url", "endImage": "end_image_url"}, "MiniMax", "MiniMax H3 Max Turbo", None),
+ "minimax/h3-max-turbo/reference-to-video": ("ref2v", {**H3_TURBO, "aspectRatio": "aspect_ratio", "images": "reference_image_urls", "video": "reference_video_urls",
+ "audio": "reference_audio_urls"}, "MiniMax", "MiniMax H3 Max Turbo",
+ "Billed at H3 Max's own rates ($0.05-0.16/s), not Turbo's; references (images, clips, audio) add up to 12 files."),
+ "minimax/h3-max-turbo/extend-video": ("extend", {"prompt": "prompt", "video": "video_url", "audio": "reference_audio_urls", "duration": "duration", "resolution": "resolution",
+ "aspectRatio": "aspect_ratio", "seed": "seed"}, "MiniMax", "MiniMax H3 Max Turbo",
+ "Source 1.625-60 s, up to 50 MB; duration is the seconds added, and only they are billed."),
+ "fal-ai/vidu/q4/image-to-video": ("i2v", {"prompt": "prompt", "image": "image_url", "duration": "duration", "resolution": "resolution", "seed": "seed"}, "Shengshu", "Vidu Q4", None),
+ "fal-ai/vidu/q4/reference-to-video": ("ref2v", {"prompt": "prompt", "images": "reference_image_urls", "audios": "reference_audio_urls", "duration": "duration",
+ "aspectRatio": "aspect_ratio", "resolution": "resolution", "generateAudio": "audio", "seed": "seed"}, "Shengshu", "Vidu Q4",
+ "fal exposes up to 12 reference images and 3 mp3 voice clips (3-12 s), sound on request; Vidu's own 15 images and 4K references are not all in fal's schema."),
+ "meshy/v7/retexture": ("retexture-3d", {"model3d": "model_url", "prompt": "text_style_prompt", "image": "image_style_url"}, "Meshy", "Meshy 7 Retexture", None),
+ "meshy/v6/retexture": ("retexture-3d", {"model3d": "model_url", "prompt": "text_style_prompt", "image": "image_style_url"}, "Meshy", "Meshy 6 Retexture", None),
+ "tripo3d/p2/image-to-3d": ("image-to-3d", {"image": "image_url"}, "Tripo", "Tripo P2", None),
+ "replicate:minimax/h3-lite": ("t2v+i2v+flf2v+ref2v", {**H3_REPLICATE, "resolution": "resolution"}, "MiniMax", "MiniMax H3 Lite", None),
+ "replicate:minimax/h3-highspeed": ("t2v+i2v+flf2v+ref2v", H3_REPLICATE, "MiniMax", "MiniMax H3 HighSpeed", None),
+ }
+
+
+ def get(url, tries=5):
req = urllib.request.Request(url, headers={"User-Agent": "fuobe-research/1.0"})
- with urllib.request.urlopen(req, timeout=60) as r:
- return r.read().decode("utf-8")
+ try:
+ with urllib.request.urlopen(req, timeout=60) as r:
+ return r.read().decode("utf-8")
+ except urllib.error.HTTPError as e:
+ # fal's catalog API answers 429 to a burst of reads: wait and try again.
+ if e.code != 429 or tries <= 1:
+ raise
+ time.sleep(15)
+ return get(url, tries - 1)
def resolve(schema, root):
diff --cc scripts/gen-cloud-models.py
index a80335ff,20540f30..ee547dfd
--- a/scripts/gen-cloud-models.py
+++ b/scripts/gen-cloud-models.py
@@@ -595,6 -597,82 +597,82 @@@ model("minimax-h3-max-3d", "MiniMax H3
[("v2v", "minimax/h3-max/3d-to-video")], hidden=True, defaults={"resolution": "768P"},
pricing=("second", 0.08, "768P; 480P $0.05, 1080P $0.16; at least 5 s a shot; + $0.50 processing a request; + $0.10 for each reference it draws when given none (up to 2)",
{"byResolution": {"480P": 0.05, "768P": 0.08, "1080P": 0.16}, "minSeconds": 5, "perRequest": 0.5, "generatedRefs": {"usd": 0.1, "count": 2}}))
-# ----- Hosted catch-up (package nm10-hosted-catchup; research new-models-10.json endpointRecords, read 2026-11-02 with
++# ----- Hosted catch-up (research new-models-10.json endpointRecords, read 2026-11-02 with
+ # scripts/fetch-hosted-schemas.py --catchup). Closed models on fal and Replicate: cloud only; the open engine keeps its own tools.
+ H3_RES = {"480P": 0.05, "768P": 0.08, "1080P": 0.16, "2K": 0.32}
+ # H3 Max lip sync: a portrait (0.4-2.5 wide) and 5 s to 15 min of audio; the video is as long as the audio, billed per second by
+ # resolution and 1.2 times over for a video over 15 s (fal's page: 30 s at 768P costs $2.88).
+ model("minimax-h3-max-lipsync", "MiniMax H3 Max Lip Sync · up to 15 min", "MiniMax", "hailuo", "video",
+ "A portrait speaks your audio: 5 seconds to 15 minutes, as long as the voice, 480P to 2K",
+ [("avatar", "minimax/h3-max/lip-sync/image-to-video")], badges=["new"], defaults={"resolution": "768P"},
+ pricing=("second", 0.08, "768P; 480P $0.05, 1080P $0.16, 2K $0.32; 1.2× for audio over 15 s", {"byResolution": H3_RES, "longFactor": {"over": 15, "factor": 1.2}}))
+ # H3 Max relight: the clip (up to 15 s, resampled to 24 fps) relit to match a lit sphere, which Fuobe draws in the browser from a
+ # light preset (ModelOptions.lightSphere). The result keeps the clip's shape ("adaptive") and is billed on its length.
+ model("minimax-h3-max-relight", "MiniMax H3 Max Relight", "MiniMax", "hailuo", "video",
+ "Real footage relit to a light you pick — direction, colour and softness — up to 15 s",
+ [("relight-video", "minimax/h3-max/relight", "fal", {"drop": ["aspectRatio"]})], badges=["new"], defaults={"resolution": "768P"},
+ fixed={"aspect_ratio": "adaptive"}, options={"lightSphere": True, "promptOptional": True},
+ pricing=("second", 0.08, "768P; 480P $0.05, 1080P $0.16, 2K $0.32; billed on the clip's length", {"byResolution": H3_RES}))
+ # H3 Max insert: a new scene of `duration` seconds generated between params.startTime and params.endTime (resume_time) of the clip;
+ # only the new scene is billed (references past fal's first 4,096 tokens add $0.02 per 1,000, not counted here).
+ model("minimax-h3-max-insert", "MiniMax H3 Max Insert a moment", "MiniMax", "hailuo", "video",
+ "A new 5–13 s moment generated inside your clip, between two points you mark",
+ [("insert-moment", "minimax/h3-max/insert-video")], badges=["new"], defaults={"resolution": "768p", "duration": 5}, ranged_durations=True,
+ options={"promptOptional": True}, prompt_max=True,
+ pricing=("second", 0.06, "768p; 480p $0.05; only the new moment is billed; references past the first 4,096 tokens add $0.02 per 1,000",
+ {"byResolution": {"480p": 0.05, "768p": 0.06}}))
+ # H3 Max looks: words or a first frame to a 5-15 s clip in the look, with sound. Generation, not a restyle of a clip.
+ for _slug, _id, _name, _tag in (("16bit-pixel", "pixel", "16-bit Pixel", "16-bit pixel art in motion"),
+ ("hand-drawn", "hand-drawn", "Hand-drawn", "a hand-drawn animation"),
+ ("low-poly", "low-poly", "Low Poly", "low-poly 3D"),
+ ("retro-toon-70s", "retro-toon", "Retro Toon 70s", "a 1970s cartoon"),
+ ("vhs", "vhs", "VHS", "a worn VHS tape, with the tape damage you pick")):
+ _ep = f"minimax/h3-max/styles/{_slug}"
+ model(f"minimax-h3-max-look-{_id}", f"MiniMax H3 Max · {_name} look", "MiniMax", "hailuo", "video",
+ f"A new 5–15 s clip with sound, made as {_tag}, from words or a first frame (it doesn't restyle a clip)",
+ [("t2v", _ep), ("i2v", _ep)], badges=["new", "audio"], defaults={"aspectRatio": "16:9", "duration": 5}, ranged_durations=True,
+ controls=[("damage_level", "Tape wear")] if _slug == "vhs" else None,
+ pricing=("second", 0.08, "768p, sound included"))
+ # H3 Max Turbo: words, a start frame or start and end frames, 1-15 s with sound. fal's November rate runs to 2026-11-15 (30% off),
+ # then the list rates. Its reference and extend routes are billed differently, so they are models of their own.
+ model("minimax-h3-max-turbo", "MiniMax H3 Max Turbo", "MiniMax", "hailuo", "video",
+ "Fast, cheap H3 Max with sound — drafts and quick takes from words or frames, 1–15 s",
+ [("t2v", "minimax/h3-max-turbo/text-to-video"), ("i2v", "minimax/h3-max-turbo/image-to-video", "fal", "+flf2v")],
+ badges=["new", "fast", "audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "768P"}, ranged_durations=True,
+ pricing=("second", 0.04, "768P; 480P $0.025, 1080P $0.08 — $0.028 (480P $0.0175, 1080P $0.056) until 2026-11-15",
+ {"byResolution": {"480P": 0.025, "768P": 0.04, "1080P": 0.08},
+ "promo": {"until": "2026-11-15", "usd": 0.028, "byResolution": {"480P": 0.0175, "768P": 0.028, "1080P": 0.056}}}))
+ model("minimax-h3-max-turbo-refs", "MiniMax H3 Max Turbo · references", "MiniMax", "hailuo", "video",
+ "Turbo with up to 12 references — pictures, clips and sound together (Image 1, Video 1, Audio 1 in the prompt)",
+ [("ref2v", "minimax/h3-max-turbo/reference-to-video")], badges=["new", "audio"], fit_values=True, options={"maxReferences": 12},
+ defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "768P"}, ranged_durations=True,
+ pricing=("second", 0.08, "768P; 480P $0.05, 1080P $0.16; references past the first 4,096 tokens add $0.016 per 1,000",
+ {"byResolution": {"480P": 0.05, "768P": 0.08, "1080P": 0.16}}))
+ # The extend keeps the clip's shape (its aspect ratio left out: fal's "auto") and bills only the seconds added.
+ model("minimax-h3-max-turbo-extend", "MiniMax H3 Max Turbo · extend", "MiniMax", "hailuo", "video",
+ "Continue a 1.6–60 s clip with up to 15 s more, sound and all; only the new seconds are billed",
+ [("extend", "minimax/h3-max-turbo/extend-video", "fal", {"drop": ["aspectRatio"]})], badges=["new", "audio"],
+ defaults={"duration": 5, "resolution": "768P"}, ranged_durations=True,
+ pricing=("second", 0.04, "768P; 480P $0.025, 1080P $0.08, 2K $0.16; only the new seconds", {"byResolution": {"480P": 0.025, "768P": 0.04, "1080P": 0.08, "2K": 0.16}}))
+ # One Replicate model takes every input; each route sends only its own (a start frame is never also a reference picture).
+ # HighSpeed's ratio is "adaptive" from a frame (its schema: "adaptive for image-to-video"); Lite ignores the ratio then.
+ def H3_REPLICATE_ROUTES(ep, adaptive=False):
+ refs = ["images", "video", "audio"]
+ frame = {"drop": ["aspectRatio"], "fixed": {"ratio": "adaptive"}} if adaptive else {}
+ return [("t2v", ep, "replicate", {"drop": ["image", "endImage", *refs]}), ("i2v", ep, "replicate", {**frame, "drop": ["endImage", *refs, *frame.get("drop", [])]}),
+ ("flf2v", ep, "replicate", {**frame, "drop": [*refs, *frame.get("drop", [])]}), ("ref2v", ep, "replicate", {"drop": ["image", "endImage"]})]
+
+
+ # Replicate's H3 Lite (480P / 768P) and HighSpeed (one rate): words, a first frame, first and last frames, or references, 4-15 s.
+ model("minimax-h3-lite", "MiniMax H3 Lite", "MiniMax", "hailuo", "video",
+ "The lightest H3 with sound: words, frames or references, 4–15 s at 480P or 768P",
+ H3_REPLICATE_ROUTES("minimax/h3-lite"),
+ badges=["new", "audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "768P"}, fit_values=True, options={"maxImages": 9},
+ pricing=("second", 0.04, "768P; 480P $0.025", {"byResolution": {"480P": 0.025, "768P": 0.04}}))
+ model("minimax-h3-highspeed", "MiniMax H3 HighSpeed", "MiniMax", "hailuo", "video",
+ "H3 tuned for speed, with sound: words, frames or references, 4–15 s",
+ H3_REPLICATE_ROUTES("minimax/h3-highspeed", adaptive=True),
+ badges=["new", "audio", "fast"], defaults={"aspectRatio": "16:9", "duration": 5}, fit_values=True, options={"maxImages": 9}, pricing=("second", 0.06))
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")],
pricing=("video", 0.49), defaults={"duration": 6}, fixed={"prompt_optimizer": True})
@@@ -652,6 -730,18 +730,18 @@@ model("fuobe-dop-ltx", "Fuobe DoP · LT
original=True, api_defaults={"enable_prompt_expansion": False},
pricing=("second", 0.036, "$0.001605 per megapixel of video: about $0.18 for 5 s at 720p ($0.20 with LoRAs)", {"withLoras": 0.04}),
options={"durations": [3, 5]}, defaults={"aspectRatio": "auto", "duration": 5, "generateAudio": False}, frame_step=8)
-# ----- Fuobe Animation (package inbetweening): keyframe in-betweening's cloud half. fal's Wan 2.2 A14B image-to-video
++# ----- Fuobe Animation: keyframe in-betweening's cloud half. fal's Wan 2.2 A14B image-to-video
+ # takes an end frame, 17–161 frames and LoRAs per expert (schema read 2026-11-02): one hosted clip per gap with AniSora
+ # 3.2 on the high-noise expert (models.ts sends it, options.loras), joined. fal makes every frame and plays it as made
+ # (16 fps, interpolation off): the every-Nth speeds and 24 fps playback are the GPU graph's (src/lib/inbetween.ts).
+ ANIMATION_FAL = {"interpolator_model": "none", "frames_per_second": 16}
+ model("fuobe-animation", "Fuobe Animation", "Fuobe Original", "fuobe-animation", "video",
+ "Keyframes in, the in-betweens drawn, one finished animation, with timing per gap: Wan 2.2 + AniSora",
+ [("i2v", "fal-ai/wan/v2.2-a14b/image-to-video", "fal", {"loraEndpoint": "fal-ai/wan/v2.2-a14b/image-to-video/lora", "fixed": ANIMATION_FAL, "flf2v": True})],
+ original=True,
+ pricing=("second", 0.08, "720p on fal; 580p $0.06/s, 480p $0.04/s; with LoRAs $0.10/s, per gap's clip",
+ {"byResolution": {"720p": 0.08, "580p": 0.06, "480p": 0.04}, "withLoras": 0.1}),
+ defaults={"aspectRatio": "auto", "duration": 5, "resolution": "720p"}, frame_step=4, fit_values=True)
# ----- Originals (O6): Fuobe Cinema's cloud half, Cinema Studio's Director on LTX-2.3 22B (research §8 cinema-studio →
# studios[cinema-studio].original). Prompt expansion off so the compiled Director prompt is what runs; sound follows the
# toggle; up to 481 frames at 24 fps (20 s; Cinema adds the rest with one extend); exact sizes per tier in multiples of
@@@ -842,6 -932,13 +932,13 @@@ model("pixverse-v6", "PixVerse V6", "Pi
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"})
-# Vidu Q4 on fal (package nm10-hosted-catchup): a start frame, or up to 12 reference pictures and 3 voice clips (mp3, 3-12 s) with
++# Vidu Q4 on fal: a start frame, or up to 12 reference pictures and 3 voice clips (mp3, 3-12 s) with
+ # sound on request, 3-16 s up to 4K. Vidu's own API takes more references than fal's schema exposes; Fuobe sends what fal takes.
+ model("vidu-q4", "Vidu Q4", "Shengshu", "vidu", "video", "Vidu's newest: a start frame or up to 12 references and 3 voices, 3–16 s, up to 4K",
+ [("i2v", "fal-ai/vidu/q4/image-to-video"), ("ref2v", "fal-ai/vidu/q4/reference-to-video")], badges=["new", "4k", "audio"], ranged_durations=True,
+ defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "720p"}, options={"maxImages": 12, "referenceAudio": "mp3"}, prompt_max=True, fit_values=True,
+ pricing=("second", 0.0665, "720p; 540p $0.0315, 1080p $0.084, 2K $0.133, 4K $0.273; sound costs nothing extra",
+ {"byResolution": {"540p": 0.0315, "720p": 0.0665, "1080p": 0.084, "2K": 0.133, "4K": 0.273}}))
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"),
("reframe", "luma/agent/ray/v3.2/reframe")],
@@@ -1011,10 -1108,58 +1108,58 @@@ model("minimax-music-2-5", "MiniMax Mus
[("music", "fal-ai/minimax-music/v2.5")], fixed={"lyrics_optimizer": True})
model("stable-audio-3-music", "Stable Audio 3 Music", "Stability AI", "stable-audio", "audio", "Quick loops and beds up to 2 minutes",
[("music", "fal-ai/stable-audio-3/small/music/text-to-audio")], badges=["fast"], defaults={"duration": 30}, options={"durations": [10, 30, 60, 120]})
- model("mureka-song", "Mureka 9.5", "Mureka", "mureka", "audio", "Full songs with vocals in many genres",
- [("music", "mureka/api/generate/song")], pricing=("request", 0.75, "prompt-to-song on mureka-9.5; with lyrics $0.225"),
- # Its vocal gender only applies to lyrics-to-song, which Fuobe doesn't send yet.
- controls=[("model", "Version")])
-# Full songs (nm10-music3, research #10 endpointRecords): lyrics go in params.extra.lyrics with Fuobe's section tags
++# Full songs (new-models-10 endpointRecords): lyrics go in params.extra.lyrics with Fuobe's section tags
+ # (src/lib/lyrics.ts); FieldMap.lyrics sends them in the API's own field. Mureka 9.5 moved from the versioned route
+ # (mureka/api/generate/song, whose fal catalog entry lost its metadata) to its own; a past run's Version (params.extra.model)
+ # is no field there, so it's left out (a saved run on another version moves to the model that runs it: replaced.ts
+ # murekaVersion). Mureka prices a song by whether lyrics come with it (Pricing.withLyrics). Its songs sing words: an
+ # instrumental is its own model (ModelOptions.lyrics.instrumentalModel).
+ model("mureka-song", "Mureka 9.5", "Mureka", "mureka", "audio", "Full songs with vocals in many genres, 2 to 5 minutes",
+ [("music", "mureka/v9.5/generate/song", "fal", {"ignore": ["model"]})],
+ pricing=("request", 0.50, "a song from a prompt; with your lyrics $0.15", {"withLyrics": 0.15}),
+ defaults={"duration": 180}, options={"durations": [120, 180, 240, 300], "lyrics": {"instrumentalModel": "mureka-9-5-instrumental"}})
+ model("mureka-9", "Mureka 9", "Mureka", "mureka", "audio", "Songs with vocals at a lower price, sung from your lyrics or written for you",
+ [("music", "mureka/v9/generate/song")], badges=["new"], pricing=("request", 0.30, "a song from a prompt; with your lyrics $0.045", {"withLyrics": 0.045}),
+ options={"lyrics": {"instrumentalModel": "mureka-9-instrumental"}})
+ model("mureka-9-5-instrumental", "Mureka 9.5 Instrumental", "Mureka", "mureka", "audio", "Mureka's newest instrumental tracks and beds, no vocals",
+ [("music", "mureka/v9.5/generate/instrumental")], badges=["new"], pricing=("request", 0.15))
+ model("mureka-9-instrumental", "Mureka 9 Instrumental", "Mureka", "mureka", "audio", "Instrumental tracks and beds, no vocals",
+ [("music", "mureka/v9/generate/instrumental")], badges=["new"], pricing=("request", 0.045))
+ # Mureka's earlier versions stay on the versioned route (fal serves 7.6, O2 and 8 there; 9 and 9.5 have routes of their own).
+ # Its duration is a 9.5 field only, and its Version is always sent (the route's own default is 9.5). With lyrics 7.6 costs
+ # $0.03, O2 and 8 $0.045; from a prompt all three $0.30.
+ model("mureka-8", "Mureka 8", "Mureka", "mureka", "audio", "Mureka's earlier versions (8, O2, 7.6), for songs made with them",
+ [("music", "mureka/api/generate/song", "fal", {"drop": ["duration"]})],
+ pricing=("request", 0.30, "a song from a prompt; with your lyrics $0.045 ($0.03 on 7.6)", {"withLyrics": 0.045}),
+ options={"controls": [{"param": "model", "label": "Version", "values": ["mureka-8", "mureka-o2", "mureka-7.6"], "default": "mureka-8",
+ "labels": {"mureka-8": "Mureka 8", "mureka-o2": "Mureka O2", "mureka-7.6": "Mureka 7.6"}}],
+ "lyrics": {"instrumentalModel": "mureka-9-instrumental"}},
+ api_defaults={"model": "mureka-8"})
+ # MiniMax Music 3 is the open model the open engine runs too (oss-minimax-music-3): the same weights, hosted. Its lyrics are
+ # required: a run with none asks for an instrumental.
+ model("minimax-music-3", "MiniMax Music 3 · both engines", "MiniMax", "minimax-music", "audio", "Full songs with expressive vocals up to 5 minutes, from your lyrics and a style",
+ [("music", "minimax/music-3")], badges=["new", "top"], defaults={"duration": 120}, options={"durations": [30, 60, 120, 180, 240, 300], "seed": True},
+ api_defaults={"lyrics": "[instrumental]"},
+ licence={"licence": "MiniMax-Music3 Community License", "commercial": True,
+ "note": "MIT-style grant with notice and an Acceptable Use Policy; commercial products show \"MiniMax-Music3\" in their interface; "
+ "above US$20M yearly revenue needs MiniMax's written authorisation. The Comfy-Org repack is tagged Apache-2.0.", "checked": "2026-11-01"})
+ # Its seed only goes with a composition plan (its schema says so), which Fuobe doesn't send: a prompt and a length.
+ model("elevenlabs-music-2-5", "ElevenLabs Music v2.5", "ElevenLabs", "elevenlabs", "audio", "Studio-quality songs and scores up to 10 minutes",
+ [("music", "elevenlabs/music/v2.5", "fal", {"drop": ["seed"]})], badges=["new"], pricing=("minute", 0.6, "billed per started minute", {"roundUp": True}),
+ defaults={"duration": 60}, options={"durations": [15, 30, 60, 120, 180, 300, 600]})
+ # Mureka's song tools (Audio → Extend & remix, and a music result's Extend, Remix and Stems): the song is one of Mureka's own
+ # (params.extra.songId, kept on its results) or a file sent first through Mureka's files/upload ($0.01, Pricing.uploadUsd).
+ model("mureka-extend", "Mureka Extend", "Mureka", "mureka", "audio", "Makes a song longer with new lyrics, after its end or before its start",
+ [("song-extend", "mureka/v8/song/extend")], badges=["new"], pricing=("request", 0.004, "plus $0.01 to send a song Mureka didn't make", {"uploadUsd": 0.01}),
+ controls=[("extend_type", "Where", {"tail": "After the end", "head": "Before the start"})])
+ model("mureka-remix", "Mureka Remix", "Mureka", "mureka", "audio", "A new arrangement of a song in the style you describe, with its lyrics",
+ [("song-remix", "mureka/v8/song/remix")], badges=["new"], pricing=("request", 0.20, "plus $0.01 to send a song Mureka didn't make", {"uploadUsd": 0.01}))
+ # Its stems come back as a zip (zip_url): the fal provider opens it and keeps each track as a result of its own.
+ model("mureka-stems", "Mureka Stems", "Mureka", "mureka", "audio", "A song split into its vocal and instrument tracks",
+ [("song-stems", "mureka/api/song/stem")], badges=["new"], pricing=("request", 0.20, "audio-separation-3, the default"))
+ # "Negative prompting is not supported by Lyria 3.5" (its schema): no negative prompt.
+ model("lyria-3-5", "Lyria 3.5", "Google", "lyria", "audio", "Google DeepMind's newest music model: full songs from words or a picture",
+ [("music", "google/lyria-3.5", "fal", {"drop": ["negativePrompt"]})], badges=["new"])
model("stable-audio-2-5", "Stable Audio 2.5", "Stability AI", "stable-audio", "audio", "Sound design and music beds up to 3 minutes",
[("sfx", "fal-ai/stable-audio-25/text-to-audio"), ("music", "fal-ai/stable-audio-25/text-to-audio"),
("sfx", "stability-ai/stable-audio-2.5", "replicate"), ("music", "stability-ai/stable-audio-2.5", "replicate")],
@@@ -1101,6 -1246,18 +1246,18 @@@ model("extract-soundtrack", "Extract so
[("separate-audio", "fal-ai/workflow-utilities/extract-audio")], pricing=("second", 0.0002, "billed by compute time"), hidden=True)
model("elevenlabs-voice-isolation", "ElevenLabs Voice Isolation", "ElevenLabs", "elevenlabs", "audio", "Clean speech from a video or recording — music and noise removed",
[("separate-audio", "fal-ai/elevenlabs/audio-isolation")], pricing=("minute", 0.1))
+ # Clean up dialogue in the cloud (DBS D5, docs/research/dbs-separation-7.md §6): hosted speech cleaners under their own
-# names (DBS isn't hosted, and the owner hasn't allowed SAM Audio in its place). VEED Clean Audio takes a video's file too
++# names (DBS isn't hosted, and SAM Audio isn't used in its place). VEED Clean Audio takes a video's file too
+ # (its audio_url reads the soundtrack) and bills whole minutes of input, at least one; FLAC keeps its 48 kHz output
+ # lossless. DeepFilterNet 3 takes audio only (a video's soundtrack goes in through extract-soundtrack).
+ model("veed-clean-audio", "VEED Clean Audio", "VEED", "veed", "audio", "Removes background noise from speech and levels it, keeping quiet and distant words",
+ [("enhance-voice", "veed/clean-audio", "fal", {"keys": {"video": "audio_url"}})], fixed={"output_format": "flac"},
+ sliders=[("strength", "Strength", 0.01)],
+ pricing=("minute", 0.0125, "per minute of input, rounded up to whole minutes, at least 1", {"roundUp": True}))
+ DFN_REC = EPS[("fal", "fal-ai/deepfilternet3")]
+ model("deepfilternet3", "DeepFilterNet 3", "DeepFilterNet", "deepfilternet", "audio", "Open-source speech denoiser: steady noise, hiss and hum out of a voice",
+ [("enhance-voice", "fal-ai/deepfilternet3")], fixed={"audio_format": "flac"}, pricing=("second", 0.001, "per second of audio"),
+ licence={"licence": "MIT OR Apache-2.0", "commercial": True, "note": DFN_REC["license"], "checked": DFN_REC["checked"]})
# ----- Image to 3D (research part 3; product spins, 3D blocking)
model("hunyuan-3d-3-1-pro", "Hunyuan3D 3.1 Pro", "Tencent Hunyuan", "hunyuan-3d", "model3d", "Textured, game-ready 3D models from a product photo",
@@@ -1255,6 -1412,15 +1412,15 @@@ model("florence-2-ocr", "Florence-2 OCR
# ----- 3D: splats, objects in place, text to 3D, multi-view and rigging
model("triposplat", "TripoSplat", "Tripo", "tripo", "model3d", "A Gaussian splat of the subject in one photo (background removed)",
[("splat", "tripo3d/triposplat")], badges=["new"], fixed={"output_format": "ply"}, sliders=[("num_gaussians", "Gaussians")])
-# Idol 3D (package idol-1; research #10 §5, idol-9.md): Speridlabs' Idol, hosted on fal since 2026-10-30. Its own label, never
++# Idol 3D (new-models-10 §5, idol-9.md): Speridlabs' Idol, hosted on fal since 2026-10-30. Its own label, never
+ # TripoSplat's. The splat is a .ply (model_mesh); model_glb, a point-cloud preview of the splat's centres, rides along in meta.formats.
+ # image_type "real" is Idol's looser photo crop; the page sends it with its Best / Quick look steps and Gaussians as params.extra.
+ IDOL_FAL = next(e for e in NEW_MODELS_10["endpointRecords"] if e["endpoint"] == "speridlabs/idol")
+ model("idol-3d", "Idol 3D", "Speridlabs", "idol", "model3d", "A Gaussian splat (.ply) of one object from one picture · TripoSplat's architecture, retrained",
+ [("splat", "speridlabs/idol")], badges=["new"], sliders=[("num_gaussians", "Gaussians", 32768), ("num_inference_steps", "Steps")],
+ controls=[("image_type", "Picture", {"synthetic": "A render or generated image", "real": "A photo"})],
+ licence={"licence": "Apache-2.0", "commercial": True,
+ "note": f"{IDOL_FAL['license']}. fal's safety checker reads the input image", "checked": IDOL_FAL["fetched"]})
# Its prompt defaults to "car" at the API, so Fuobe always asks for one.
model("sam-3d-objects", "SAM 3D Objects", "Meta", "sam", "model3d", "The objects you name, rebuilt in 3D where they stand in the photo",
# export_textured_glb defaults to false (a grey mesh): the viewer shows the textured one.
@@@ -1268,6 -1434,20 +1434,20 @@@ model("meshy-7-1-multi", "Meshy 7.1 Mul
controls=[("topology", "Topology")], options={"minImages": 2})
model("meshy-rigging", "Meshy Rigging", "Meshy", "meshy", "model3d", "Rig a humanoid GLB with a skeleton, walk and run cycles, or an animation preset",
[("rig-3d", "fal-ai/meshy/rigging")], badges=["new"], pricing=("request", 0.2, "+$0.12 with an animation preset", {"animationUsd": 0.12}))
-# Retexture a 3D model (package nm10-hosted-catchup): Meshy 7 or 6 paints new textures on a GLB from words or a style picture (the
++# Retexture a 3D model: Meshy 7 or 6 paints new textures on a GLB from words or a style picture (the
+ # picture wins when both go). $0.30 a model at 2K or 4K textures, $0.45 at 8K.
+ for _v in ("7", "6"):
+ model(f"meshy-{_v}-retexture", f"Meshy {_v} Retexture", "Meshy", "meshy", "model3d", "New textures on a 3D model, from words or a style picture",
+ [("retexture-3d", f"meshy/v{_v}/retexture")], badges=["new"], prompt_max=True, controls=[("texture_resolution", "Texture size")],
+ options={"promptOptional": True}, fixed={"enable_pbr": True},
+ pricing=("request", 0.3, "2K or 4K textures; 8K $0.45; realistic surface detail included", {"factors": [{"param": "texture_resolution", "values": {"8k": 1.5}}]}))
+ # Tripo P2: Tripo's production tier. $1.10 a model with fast or standard textures, $1.20 detailed, $1.30 extreme ($1.00 untextured).
+ # Its "fast" textures need texture version v3.5-20260815 (fal's schema), the newest, which every quality takes: it always goes.
+ model("tripo-p2", "Tripo P2", "Tripo", "tripo", "model3d", "Tripo's production tier: detailed 3D models with realistic textures",
+ [("image-to-3d", "tripo3d/p2/image-to-3d")], badges=["new", "pro"], controls=[("texture_quality", "Texture")],
+ fixed={"texture_version": "v3.5-20260815"},
+ pricing=("request", 1.1, "standard textures; detailed $1.20, extreme $1.30",
+ {"factors": [{"param": "texture_quality", "values": {"detailed": 1.2 / 1.1, "extreme": 1.3 / 1.1}}]}))
# Cinema Studio's "Create 3D scene" on the cloud (part 4 §8): a depth map of the whole frame, which the browser
# turns into a point cloud with the photo's colours. So scene-3d answers with an image on this model.
model("marigold-depth", "Marigold V2 Depth", "Marigold", "marigold", "image", "A depth map of the whole frame, for the 3D scene your browser builds",
@@@ -2126,9 -2306,41 +2306,41 @@@ def build_route(op, ep, provider, m, op
fmap["duration"]["suffix"] = "s"
lo, hi = num(spec.get("minimum")), num(spec.get("maximum"))
if m.get("ranged_durations") and lo is not None and hi is not None:
- opts["durations"] = union(opts.get("durations", []), [v for v in NICE_DURATIONS if lo <= v <= hi] or [lo])
+ picks = [v for v in NICE_DURATIONS if lo <= v <= hi] or [lo]
+ # The longest whole second the API takes is always one of them (Vidu Q4's 16 s, H3 Max insert's 13 s).
+ if hi == int(hi) and hi not in picks and hi <= max(NICE_DURATIONS):
+ picks.append(int(hi))
+ opts["durations"] = union(opts.get("durations", []), picks)
if key.endswith("_ms"):
fmap["duration"]["multiplier"] = 1000
- # Song lyrics (params.extra.lyrics, nm10-music3): the API's lyrics field and the most characters it takes, or after the
++ # Song lyrics (params.extra.lyrics): the API's lyrics field and the most characters it takes, or after the
+ # prompt for an API that reads them there (Lyria 3.5); the composer's lyrics editor follows ModelOptions.lyrics.
+ if op in ("music", "song-extend", "song-remix") and "lyrics" in kf and (inputs.get(kf["lyrics"]) or {}).get("type") == "string":
+ spec = inputs.get(kf["lyrics"]) or {}
+ most = num(spec.get("maxLength"))
+ # An API with an instrumental switch (MiniMax Music 2.5's is_instrumental) gets it for lyrics that are only
+ # [Instrumental], with its own lyrics writer (lyrics_optimizer) off.
+ fmap["lyrics"] = {"key": kf["lyrics"], **({"max": most} if most else {}),
+ **({"instrumental": kf["instrumental"]} if kf.get("instrumental") in inputs else {}),
+ **({"autoLyrics": kf["autoLyrics"]} if kf.get("autoLyrics") in inputs else {})}
+ # Required by the API with no fallback of Fuobe's (MiniMax Music 3 asks for an instrumental when there are none).
+ needed = spec.get("required") and kf["lyrics"] not in (m.get("api_defaults") or {})
+ opts["lyrics"] = {**({"max": most} if most else {}), **({"required": True} if needed else {})}
+ # A song tool's source (Mureka): its own song by id, else the file sent first through the provider's files/upload with
+ # the purpose the id field names ("Audio ID returned by /files/upload with purpose='audio'").
+ if op in ("song-extend", "song-remix") and "songId" in kf and "uploadId" in kf:
+ purpose = re.search(r"purpose='([\w-]+)'", (inputs.get(kf["uploadId"]) or {}).get("desc") or "")
+ upload = next((ep2 for (p2, ep2) in EPS if p2 == provider and ep2.startswith(ep.split("/")[0] + "/") and ep2.endswith("/files/upload")), None)
+ if purpose and upload:
+ fmap["songSource"] = {"songId": kf["songId"], "uploadId": kf["uploadId"], "upload": {"endpoint": upload, "purpose": purpose.group(1)}}
+ else:
+ warn(f"{m['id']}: {ep} has no upload route or purpose for its song")
+ if "extendAt" in kf:
+ fmap["startTime"] = {"key": kf["extendAt"], "type": "number", "multiplier": 1000}
+ elif op == "music" and "lyricsInPrompt" in kf:
+ most = num((inputs.get(kf["lyricsInPrompt"]) or {}).get("maxLength"))
+ fmap["lyrics"] = {"inPrompt": True, **({"max": most} if most else {})}
+ opts["lyrics"] = {"inPrompt": True, **({"max": most} if most else {})}
part4_ranges(op, inputs, fmap)
# Text-to-speech etc. carry the prompt in "text".
if ropts.get("fixed"):
diff --cc src/app/api/fly-around/route.ts
index 00000000,44eb17b4..0b6b2ef8
mode 000000,100644..100644
--- a/src/app/api/fly-around/route.ts
+++ b/src/app/api/fly-around/route.ts
@@@ -1,0 -1,22 +1,22 @@@
+ import { body, handle, once } from "@/server/shorts-schemas";
+ import { createFlyAround, FlyAroundSchema, previewFlyAround } from "@/server/fly-around";
+ import { priceAs } from "@/server/visitor";
+
+ /**
- * Fly around (build plan N7-7): a still filmed along an exact camera path (an orbit's numbers, a preset or keys), on either
++ * Fly around: a still filmed along an exact camera path (an orbit's numbers, a preset or keys), on either
+ * engine. `?preview=1` plans and prices it without running it. Fuobe DoP, Image to 3D, Canvas and Assist call it.
+ */
+ async function post(request: Request) {
+ return handle(async () => {
+ const { requestId, ...input } = await body(request, FlyAroundSchema, "Pick the engine, the still and the path");
+ if (new URL(request.url).searchParams.get("preview")) return Response.json(previewFlyAround(input));
+ // A plan that can't run (FlyAroundError) is a 422 with its reason, as any planner's error is.
+ const result = await once("fly-around", requestId, () => createFlyAround(input));
+ return Response.json(result, { status: 201 });
+ }, request);
+ }
+
+ /** A visitor (public sign-up) gets the price of its run on its own GPU, never a demo (src/server/visitor.ts). */
+ export async function POST(request: Request) {
+ return priceAs(request, () => post(request));
+ }
diff --cc src/components/assist/schedule-skill.tsx
index 00000000,f45fb903..9fbbab9a
mode 000000,100644..100644
--- a/src/components/assist/schedule-skill.tsx
+++ b/src/components/assist/schedule-skill.tsx
@@@ -1,0 -1,317 +1,317 @@@
+ "use client";
+
+ import { keepPreviousData, useQuery } from "@tanstack/react-query";
+ import { AlertTriangle, Cloud, Cpu } from "lucide-react";
+ import Link from "next/link";
+ import { useEffect, useId, useState } from "react";
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
+ import { Skeleton } from "@/components/ui/skeleton";
+ import { EngineSwitch } from "@/components/studio/engine-switch";
+ import { MediaSlot, type SlotValue } from "@/components/studio/media-slot";
+ import { radioKeys, radioTab } from "@/components/studio/radio-keys";
+ import type { SkillSummary } from "@/lib/assist";
+ import type { ScheduleSkill } from "@/lib/assist-schedule";
+ import type { Engine } from "@/lib/catalog/types";
+ import { formatCost } from "@/lib/format";
+ import { checkValues, isMediaType, type RecipeEstimate, type RecipeParam, type RecipeView } from "@/lib/recipe";
+ import { cn } from "@/lib/utils";
+ import { useRecipeActions } from "./hooks";
+ import { RecipeField } from "./run-skill-dialog";
+ import { SkillIcon } from "./skill-icon";
+
+ /**
- * The schedule dialog's "A skill" (Skills W4): a skill that runs by itself, one set of values from its Run form, and
++ * The schedule dialog's "A skill": a skill that runs by itself, one set of values from its Run form, and
+ * for each file input a picked file or the newest upload of that kind, read when the run starts.
+ */
+
+ /** Where a file input comes from: the newest upload when it runs, one picked file, or none (the skill's default, if it has one). */
+ type Source = "newest" | "file" | "none";
+
+ /** What the form holds: values as typed (a picked file's URL too), the file slots, and where each file input comes from. */
+ export interface SkillInputs {
+ values: Record<string, string | number | undefined>;
+ slots: Record<string, SlotValue | null>;
+ sources: Record<string, Source>;
+ }
+
+ /** The form for a saved task's skill, or an empty one. */
+ export const inputsFrom = (skill?: ScheduleSkill | null): SkillInputs => ({
+ values: { ...(skill?.values ?? {}) },
+ slots: {},
+ sources: Object.fromEntries(Object.keys(skill?.sources ?? {}).map((id) => [id, "newest" as const])),
+ });
+
+ type FileParam = RecipeParam & { type: "image" | "video" | "audio" };
+
+ /** An input the skill can't run without: required, with no default of its own. */
+ const needed = (p: RecipeParam) => p.required && p.default === undefined;
+
+ /**
+ * Where a file input comes from. One that holds a file keeps it. Otherwise an input the skill needs takes the newest
+ * upload (only the first needed input of each kind, so two don't read the same file), and one it can do without, or
+ * that has a default of its own, takes none.
+ */
+ function sourceOf(p: RecipeParam, inputs: SkillInputs, params: RecipeParam[]): Source {
+ const set = inputs.sources[p.id];
+ if (set) return set;
+ if (typeof inputs.values[p.id] === "string" && inputs.values[p.id]) return "file";
+ if (!needed(p)) return "none";
+ return params.find((q) => q.type === p.type && needed(q))?.id === p.id ? "newest" : "file";
+ }
+
+ const slotOf = (p: FileParam, inputs: SkillInputs): SlotValue | null => {
+ if (p.id in inputs.slots) return inputs.slots[p.id];
+ const v = inputs.values[p.id];
+ return typeof v === "string" && v ? { ref: v, preview: v, kind: p.type } : null;
+ };
+
+ /** Stands in for a newest upload while the form is checked and priced (the real file is read when it runs). */
+ const NEWEST = { image: "/api/files/uploads/estimate/newest.png", video: "/api/files/uploads/estimate/newest.mp4", audio: "/api/files/uploads/estimate/newest.wav" } as const;
+
+ /** The task as it's saved, what's wrong with it per input, and the values it's priced with. */
+ export function skillTask(view: RecipeView, inputs: SkillInputs): { task: ScheduleSkill; errors: Record<string, string>; ok: boolean; uploading: boolean; priced: Record<string, string> } {
+ const values: Record<string, string> = {};
+ const sources: Record<string, "newest"> = {};
+ const priced: Record<string, string> = {};
+ let uploading = false;
+ for (const p of view.recipe.params) {
+ if (isMediaType(p.type)) {
+ const source = sourceOf(p, inputs, view.recipe.params);
+ if (source === "newest") {
+ sources[p.id] = "newest";
+ priced[p.id] = NEWEST[p.type];
+ continue;
+ }
+ if (source === "none") continue;
+ const slot = slotOf(p as FileParam, inputs);
+ if (slot?.uploading) uploading = true;
+ else if (slot?.ref) values[p.id] = priced[p.id] = slot.ref;
+ continue;
+ }
+ const v = inputs.values[p.id];
+ if (v !== undefined && String(v).trim() !== "") values[p.id] = priced[p.id] = String(v);
+ }
+ const checked = checkValues(view.recipe, priced);
+ return { task: { name: view.name, values, ...(Object.keys(sources).length && { sources }) }, errors: checked.errors, ok: !!checked.values && !uploading, uploading, priced };
+ }
+
+ function useDebounced<T>(value: T, ms: number): T {
+ const [v, setV] = useState(value);
+ useEffect(() => {
+ const t = setTimeout(() => setV(value), ms);
+ return () => clearTimeout(t);
+ }, [value, ms]);
+ return v;
+ }
+
+ /** "About $0.62 a run on Cloud", "Free on your GPU", "Free: a demo run". */
+ function priceText(e: RecipeEstimate): string {
+ if (e.demo) return "Free: a demo run, since nothing is connected for these steps yet";
+ if (e.total === null) return "Some prices vary";
+ const where = e.engine === "open" ? "on your GPU" : "on Cloud";
+ return e.total === 0 ? `Free ${where}` : `About ${formatCost(e.total)} a run ${where}`;
+ }
+
+ export function SkillTaskFields({
+ skills,
+ name,
+ onName,
+ view,
+ failed,
+ inputs,
+ onInputs,
+ engine,
+ onEngine,
+ tried,
+ }: {
+ /** The skills that run by themselves (null: still loading). */
+ skills: SkillSummary[] | null;
+ name: string | null;
+ onName: (name: string) => void;
+ /** The picked skill's recipe, once it's loaded. */
+ view: RecipeView | undefined;
+ /** Why the skill's recipe didn't load. */
+ failed?: string;
+ inputs: SkillInputs;
+ onInputs: (next: SkillInputs) => void;
+ /** The engine it runs on (one its steps run on). */
+ engine: Engine;
+ onEngine: (e: Engine) => void;
+ tried: boolean;
+ }) {
+ const pickId = useId();
+ const actions = useRecipeActions();
+ const t = view ? skillTask(view, inputs) : null;
+ const body = t ? JSON.stringify({ values: t.priced, engine }) : "";
+ const key = useDebounced(body, 400);
+ const price = useQuery({
+ queryKey: ["assist-recipe-estimate", name, "schedule", key],
+ enabled: !!view && !!t?.ok && key === body && view.engines.includes(engine),
+ retry: false,
+ placeholderData: keepPreviousData,
+ queryFn: () => actions.estimate(view!.name, JSON.parse(key)),
+ });
+ const est = t?.ok ? price.data : undefined;
+ const estError = t?.ok ? (price.error ? (price.error as Error).message : (est?.errors[0] ?? est?.runs.flatMap((r) => r.errors)[0])) : undefined;
+ const listed = !!name && !!skills?.some((s) => s.name === name);
+ const set = (patch: Partial<SkillInputs>) => onInputs({ ...inputs, ...patch });
+
+ return (
+ <div className="space-y-4">
+ <div className="space-y-2">
+ <label htmlFor={pickId} className="text-sm font-medium">
+ Skill
+ </label>
+ {skills === null ? (
+ <Skeleton className="h-9 w-full" />
+ ) : skills.length === 0 ? (
+ <p className="rounded-xl bg-muted/60 px-3.5 py-2.5 text-[13px] text-muted-foreground">
+ No skills that run by themselves yet. Make one from a result you like (its ⋯ menu → Make a skill), or save a chat as a skill, then schedule it here.{" "}
+ <Link href="/assist/skills" className="font-medium text-brand-text underline-offset-2 hover:underline">
+ Open Skills
+ </Link>
+ </p>
+ ) : (
+ <Select value={listed ? name! : undefined} onValueChange={onName}>
+ <SelectTrigger id={pickId} className="w-full">
+ <SelectValue placeholder="Pick a skill" />
+ </SelectTrigger>
+ <SelectContent>
+ {skills.map((s) => (
+ <SelectItem key={s.name} value={s.name}>
+ <SkillIcon name={s.name} icon={s.icon} size="sm" /> {s.title} <span className="text-muted-foreground">/{s.name}</span>
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ )}
+ {name && skills && !listed && (
+ <p role="alert" className="flex items-start gap-1.5 text-[12px] text-amber-700 dark:text-amber-300">
+ <AlertTriangle className="mt-0.5 size-3.5 shrink-0" /> /{name} is switched off or doesn&apos;t run by itself any more — pick another skill.
+ </p>
+ )}
+ </div>
+
+ {listed && !view && (failed ? <p className="text-[13px] text-destructive">{failed}</p> : <Skeleton className="h-32 w-full" />)}
+
+ {listed && view && (
+ <>
+ <p className="text-[12px] text-muted-foreground">No AI model plans these runs: each one starts {view.title}&apos;s saved steps with the inputs below.</p>
+ {view.recipe.params.length === 0 && <p className="text-[13px] text-muted-foreground">It takes no inputs: each run makes the same steps.</p>}
+ {view.recipe.params.map((p) =>
+ isMediaType(p.type) ? (
+ <FileInput
+ key={p.id}
+ p={p as FileParam}
+ source={sourceOf(p, inputs, view.recipe.params)}
+ onSource={(s) => set({ sources: { ...inputs.sources, [p.id]: s } })}
+ slot={slotOf(p as FileParam, inputs)}
+ onSlot={(v) => set({ slots: { ...inputs.slots, [p.id]: v } })}
+ error={tried ? t?.errors[p.id] : undefined}
+ />
+ ) : (
+ <RecipeField
+ key={p.id}
+ p={p}
+ value={inputs.values[p.id] ?? p.default}
+ onChange={(v) => set({ values: { ...inputs.values, [p.id]: v } })}
+ slot={null}
+ onSlot={() => {}}
+ error={tried ? t?.errors[p.id] : undefined}
+ />
+ ),
+ )}
+ <div className="flex flex-wrap items-center gap-2">
+ {view.engines.length > 1 ? (
+ <EngineSwitch value={engine} onChange={onEngine} size="sm" compact={false} />
+ ) : (
+ view.engines.length === 1 && (
+ <span className="inline-flex h-8 items-center gap-1.5 rounded-full bg-muted px-3 text-[12px] font-medium text-muted-foreground">
+ {view.engines[0] === "open" ? <Cpu className="size-3.5" /> : <Cloud className="size-3.5" />}
+ {view.engines[0] === "open" ? "Runs on your GPU · open source" : "Runs in the cloud"}
+ </span>
+ )
+ )}
+ <p className={cn("min-w-0 text-[13px] break-words", estError ? "text-destructive" : "text-muted-foreground")} aria-live="polite">
+ {!view.engines.length
+ ? (view.why ?? "This skill can't run here as it is.")
+ : !t?.ok
+ ? t?.uploading
+ ? "Uploading…"
+ : "Fill in the inputs to see the price"
+ : (estError ?? (est && !price.isFetching && key === body ? priceText(est) : "Pricing…"))}
+ </p>
+ </div>
+ </>
+ )}
+ </div>
+ );
+ }
+
+ /** A file input: the newest upload of its kind when the run starts, or one file picked now. */
+ function FileInput({
+ p,
+ source,
+ onSource,
+ slot,
+ onSlot,
+ error,
+ }: {
+ p: FileParam;
+ source: Source;
+ onSource: (s: Source) => void;
+ slot: SlotValue | null;
+ onSlot: (v: SlotValue | null) => void;
+ error?: string;
+ }) {
+ const labelId = useId();
+ const options: { id: Source; label: string }[] = [
+ { id: "newest", label: "Newest upload (when it runs)" },
+ { id: "file", label: "This file" },
+ // An input the skill can do without: leave it out, or use the file the skill comes with.
+ ...(needed(p) ? [] : [{ id: "none" as const, label: p.default !== undefined ? "The skill's own" : "None" }]),
+ ];
+ const kind = p.type === "image" ? "image" : p.type === "video" ? "video" : "audio file";
+ return (
+ <div className="space-y-2">
+ <p id={labelId} className="text-sm font-medium">
+ {p.label}
+ {p.required && p.default === undefined ? "" : <span className="font-normal text-muted-foreground"> · optional</span>}
+ </p>
+ <div role="radiogroup" aria-labelledby={labelId} onKeyDown={radioKeys} className="flex w-fit max-w-full flex-wrap gap-1 rounded-2xl bg-muted p-0.5">
+ {options.map((o) => (
+ <button
+ key={o.id}
+ type="button"
+ role="radio"
+ aria-checked={source === o.id}
+ tabIndex={radioTab(source === o.id)}
+ onClick={() => onSource(o.id)}
+ className={cn("h-8 rounded-full px-3 text-[13px] font-medium text-muted-foreground transition-colors", source === o.id && "bg-background text-foreground shadow-soft")}
+ >
+ {o.label}
+ </button>
+ ))}
+ </div>
+ {source === "newest" ? (
+ <p className="text-[12px] text-muted-foreground">
+ Each run takes the newest {kind} in <span className="font-medium text-foreground">Library → Uploads</span> at that moment, whatever put it there: upload a new one
+ before it runs, and that&apos;s the one it takes.
+ {needed(p) ? "" : p.default !== undefined ? ` With no ${kind} there yet, it uses the skill's own.` : ` With no ${kind} there yet, the run goes ahead without one.`}
+ </p>
+ ) : source === "none" ? (
+ <p className="text-[12px] text-muted-foreground">{p.default !== undefined ? `Every run uses the skill's own ${kind}.` : "Every run goes without one."}</p>
+ ) : (
+ <div className="flex items-center gap-3">
+ <MediaSlot label={p.label} kind={p.type} value={slot} onChange={onSlot} required={p.required} />
+ <p className="min-w-0 flex-1 text-[12px] text-muted-foreground">Every run uses this {p.type === "image" ? "picture" : p.type === "video" ? "clip" : "sound file"}. Upload one, or pick it from your Library.</p>
+ </div>
+ )}
+ {error && (
+ <p role="alert" className="text-[12px] text-destructive">
+ {error}
+ </p>
+ )}
+ </div>
+ );
+ }
diff --cc src/components/audio-tools/split-tool.tsx
index e27cc1dc,cb73f78f..ae0f92ee
--- a/src/components/audio-tools/split-tool.tsx
+++ b/src/components/audio-tools/split-tool.tsx
@@@ -749,11 -771,11 +771,11 @@@ export function SplitSoundtrackTool()
const stems = useMemo(() => (g?.status === "succeeded" ? stemsOf(g.outputs) : []), [g]);
return (
- <ToolShell title="Audio" tabs={tabs} selfHostedOnly>
+ <ToolShell title="Audio" selfHostedOnly>
{!source && (
<ToolHero
- title="Split any soundtrack"
- subtitle="Dialogue, music and effects from a song, podcast, film clip or video, with a free live mixer."
+ title={goal === "clean" ? "Clean up dialogue" : "Split any soundtrack"}
+ subtitle={goal === "clean" ? "Clear speech from a noisy or musical recording or video: the music and effects out from under it, or kept quietly." : "Dialogue, music and effects from a song, podcast, film clip or video, with a free live mixer."}
>
{visitor && <SelfHostNote className="mt-3 max-w-xl">{SELF_HOSTED}.</SelfHostNote>}
</ToolHero>
diff --cc src/components/canvas/canvas-context.tsx
index 40cc8b40,131909af..e7a31e6a
--- a/src/components/canvas/canvas-context.tsx
+++ b/src/components/canvas/canvas-context.tsx
@@@ -78,6 -82,9 +82,9 @@@ export const ICONS: Record<string, Luci
UserRound,
Languages,
Table,
- // Camera path and Fly around (N7-7)
++ // Camera path and Fly around
+ Orbit,
+ Rotate3d,
// Blockout to film
Box,
// Effects 2.0 chains (src/lib/catalog/canvas.ts EFFECT_CHAINS)
diff --cc src/components/canvas/nodes.tsx
index 69389312,22d52bf5..772b2614
--- a/src/components/canvas/nodes.tsx
+++ b/src/components/canvas/nodes.tsx
@@@ -1183,6 -1194,55 +1194,55 @@@ const PromptNode = memo(function Prompt
);
}, sameNodeProps);
+ /** "Exact orbit" in the Camera path node's move list: the orbit set by its numbers. */
+ const EXACT_PICK = "exact";
+
+ /** A Camera path's move: a preset, or an exact orbit by its numbers (the board's node and the phone's card). */
+ export function CameraPathFields({ data, onChange, disabled, label }: { data: CanvasNodeData; onChange: (patch: Partial<CanvasNodeData>) => void; disabled?: boolean; label: string }) {
+ const pick = data.orbit ? EXACT_PICK : (data.pathPreset ?? "orbit_360");
+ const { keys } = cameraPathOf(data.orbit ? { data } : { data: { pathPreset: pick } });
+ return (
+ <div className="grid gap-2">
+ <Select
+ value={pick}
+ disabled={disabled}
+ onValueChange={(v) => onChange(v === EXACT_PICK ? { orbit: data.orbit ?? exactDefaults("motion-360-orbit"), pathPreset: undefined, keys: undefined } : { pathPreset: v, orbit: undefined, keys: undefined })}
+ >
+ <SelectTrigger size="sm" className="w-full text-[13px]" aria-label={`Move of ${label}`}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {PATH_PRESETS.map((p) => (
+ <SelectItem key={p.id} value={p.id}>
+ {p.name}
+ </SelectItem>
+ ))}
+ <SelectItem value={EXACT_PICK}>Exact orbit…</SelectItem>
+ </SelectContent>
+ </Select>
+ {data.orbit ? (
+ <ExactOrbitControls compact value={data.orbit} defaults={exactDefaults("motion-360-orbit")} onChange={(orbit) => onChange(orbit ? { orbit } : { orbit: undefined, pathPreset: "orbit_360" })} className="border-0 bg-muted/50 p-2.5" />
+ ) : (
+ <p className="text-[12px] text-muted-foreground">{PATH_PRESETS.find((p) => p.id === pick)?.description}</p>
+ )}
+ <p className="text-[11.5px] text-subtle-foreground">{keys.length} keyframes</p>
+ </div>
+ );
+ }
+
-/** Camera path (N7-7): a preset move, or an exact orbit by its numbers, for Fly around nodes to follow. */
++/** Camera path: a preset move, or an exact orbit by its numbers, for Fly around nodes to follow. */
+ const CameraPathNode = memo(function CameraPathNode({ id, type, data, selected }: NodeProps<FlowNode>) {
+ const actions = useEditorActions();
+ const { readOnly } = useEditorGlobals();
+ return (
+ <NodeShell id={id} type={type as CanvasNodeType} data={data} selected={!!selected} out="path" width={300}>
+ <div className={cn("p-3", NO_DRAG)}>
+ <CameraPathFields data={data} disabled={readOnly} label={data.label || "Camera path"} onChange={(patch) => actions.update(id, patch)} />
+ </div>
+ </NodeShell>
+ );
+ }, sameNodeProps);
+
const KIND_OF: Partial<Record<CanvasNodeType, "image" | "video" | "audio">> = { "image-input": "image", "video-input": "video", "audio-input": "audio" };
function LibraryGrid({ kind, onPick }: { kind: MediaKind; onPick: (url: string, name?: string) => void }) {
diff --cc src/components/cinema/draft.ts
index 1df27744,cba05564..f94508fd
--- a/src/components/cinema/draft.ts
+++ b/src/components/cinema/draft.ts
@@@ -35,6 -41,8 +41,8 @@@ export interface CinemaDraft
imageTool: "still" | "grid";
prompt: string;
moves: string[];
- /** The first move as an exact orbit (N7-7): its numbers while the Exact switch is on. */
++ /** The first move as an exact orbit: its numbers while the Exact switch is on. */
+ exact?: ExactOrbit | null;
refs: RefItem[];
/** Model picked per mode and engine ("video:cloud" → "kling-3"). */
models: Partial<Record<`${CinemaMode}:${Engine}`, string>>;
diff --cc src/components/exact-orbit-controls.tsx
index 00000000,41a39d18..ccc48a4d
mode 000000,100644..100644
--- a/src/components/exact-orbit-controls.tsx
+++ b/src/components/exact-orbit-controls.tsx
@@@ -1,0 -1,119 +1,119 @@@
+ "use client";
+
+ import { useId, type ReactNode } from "react";
+ import { Label } from "@/components/ui/label";
+ import { Slider } from "@/components/ui/slider";
+ import { Switch } from "@/components/ui/switch";
+ import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
+ import { DIRECTION_NAMES, EXACT_LIMITS, exactSummary, normalizeExact, type ExactOrbit } from "@/lib/exact-orbit";
+ import type { Engine } from "@/lib/catalog/types";
+ import { cn } from "@/lib/utils";
+
+ /** What each engine does with an exact orbit, said under the switch. */
+ export const EXACT_ENGINE_LINE: Record<Engine, string> = {
+ open: "On your GPU: the still's depth is measured and the camera follows your numbers exactly · about 5 s · needs a large GPU",
+ cloud: "In the cloud: MiniMax H3 Max follows your numbers as camera keyframes",
+ };
+
+ /**
- * The "Exact" switch on an orbit move (build plan N7-7): off, the move follows its LoRA's or the prompt's idea of an
++ * The "Exact" switch on an orbit move: off, the move follows its LoRA's or the prompt's idea of an
+ * orbit ("Loose"); on, the camera follows the numbers: degrees, direction seen from above, a height tilt and a radius pulse.
+ */
+ export function ExactOrbitControls({
+ value,
+ defaults,
+ onChange,
+ engine,
+ className,
+ compact,
+ footer,
+ }: {
+ /** null: the switch is off. */
+ value: ExactOrbit | null;
+ defaults: ExactOrbit;
+ onChange: (v: ExactOrbit | null) => void;
+ engine?: Engine;
+ className?: string;
+ compact?: boolean;
+ /** Under the controls while the switch is on: the price, or what is still needed. */
+ footer?: ReactNode;
+ }) {
+ const id = useId();
+ const on = !!value;
+ const o = normalizeExact(value ?? defaults, defaults);
+ const set = (patch: Partial<ExactOrbit>) => onChange(normalizeExact({ ...o, ...patch }, defaults));
+ return (
+ <div className={cn("min-w-0 rounded-xl border bg-card p-3", className)} data-testid="exact-orbit">
+ <div className="flex items-center justify-between gap-3">
+ <div className="min-w-0">
+ <Label htmlFor={`${id}-switch`} className="text-[13px] font-medium">
+ Exact orbit
+ </Label>
+ <p className="truncate text-[12px] text-muted-foreground">{on ? exactSummary(o) : "Off: the move keeps its own style of orbit"}</p>
+ </div>
+ <Switch id={`${id}-switch`} checked={on} onCheckedChange={(c) => onChange(c ? o : null)} aria-label="Exact orbit" />
+ </div>
+ {on && (
+ <div className={cn("mt-3 grid gap-3", !compact && "sm:grid-cols-2")}>
+ <div className="min-w-0">
+ <div className="mb-1.5 flex justify-between text-[12px]">
+ <span id={`${id}-deg`}>Degrees</span>
+ <span className="text-muted-foreground tabular-nums">{o.degrees}°</span>
+ </div>
+ <Slider
+ aria-labelledby={`${id}-deg`}
+ aria-valuetext={`${o.degrees} degrees`}
+ min={EXACT_LIMITS.degrees.min}
+ max={EXACT_LIMITS.degrees.max}
+ step={EXACT_LIMITS.degrees.step}
+ value={[o.degrees]}
+ onValueChange={([v]) => set({ degrees: v })}
+ />
+ </div>
+ <div className="min-w-0">
+ <div className="mb-1.5 flex justify-between text-[12px]">
+ <span id={`${id}-tilt`}>Height tilt</span>
+ <span className="text-muted-foreground tabular-nums">{o.tilt}°</span>
+ </div>
+ <Slider
+ aria-labelledby={`${id}-tilt`}
+ aria-valuetext={`${o.tilt} degrees`}
+ min={EXACT_LIMITS.tilt.min}
+ max={EXACT_LIMITS.tilt.max}
+ step={EXACT_LIMITS.tilt.step}
+ value={[o.tilt]}
+ onValueChange={([v]) => set({ tilt: v })}
+ />
+ </div>
+ <div className="min-w-0">
+ <p className="mb-1.5 text-[12px]" id={`${id}-dir`}>
+ Direction (seen from above)
+ </p>
+ <ToggleGroup type="single" variant="outline" size="sm" aria-labelledby={`${id}-dir`} value={o.direction} onValueChange={(v) => v && set({ direction: v as ExactOrbit["direction"] })} className="w-full">
+ {(["cw", "ccw"] as const).map((d) => (
+ <ToggleGroupItem key={d} value={d} className="flex-1 text-[12px]">
+ {DIRECTION_NAMES[d]}
+ </ToggleGroupItem>
+ ))}
+ </ToggleGroup>
+ </div>
+ <div className="min-w-0">
+ <p className="mb-1.5 text-[12px]" id={`${id}-pulse`}>
+ Radius pulse
+ </p>
+ <ToggleGroup type="single" variant="outline" size="sm" aria-labelledby={`${id}-pulse`} value={String(o.pulse)} onValueChange={(v) => v && set({ pulse: Number(v) })} className="w-full">
+ <ToggleGroupItem value="0" className="flex-1 text-[12px]">
+ None
+ </ToggleGroupItem>
+ <ToggleGroupItem value="0.25" className="flex-1 text-[12px]">
+ In and out 25%
+ </ToggleGroupItem>
+ </ToggleGroup>
+ </div>
+ </div>
+ )}
+ {on && engine && <p className="mt-2.5 text-[11.5px] text-muted-foreground">{EXACT_ENGINE_LINE[engine]}</p>}
+ {on && footer && <div className="mt-1.5 text-[12px] font-medium">{footer}</div>}
+ </div>
+ );
+ }
diff --cc src/components/fashion/character-sheet.tsx
index e6ee73d8,78b1ac39..c1c605e8
--- a/src/components/fashion/character-sheet.tsx
+++ b/src/components/fashion/character-sheet.tsx
@@@ -17,8 -16,8 +17,9 @@@ import { radioKeys, radioTab } from "@/
import { useRun, useRunPreview } from "@/components/photodump/hooks";
import { ResultsGrid } from "@/components/photodump/results";
import { RunLine } from "@/components/photodump/steps";
+ import { AnimatePosesButton } from "@/components/turnaround/animate-poses";
import { TurnaroundButton } from "@/components/turnaround/turnaround-dialog";
+import { HandoffImage } from "@/components/nav/next-steps";
import { useElements, useEngine, useGenerations, useLikelyVisitor, useSaveElement } from "@/lib/api";
import { castFieldVisible, castNameFor, randomCast, SHEET_MAX_REFS, type CastAnswers, type CastFieldData } from "@/lib/catalog/packs";
import { sheetPictures } from "@/lib/catalog/turnaround";
diff --cc src/components/model3d/model-card.tsx
index 1d2fa3c2,f881b322..646c1995
--- a/src/components/model3d/model-card.tsx
+++ b/src/components/model3d/model-card.tsx
@@@ -1,33 -1,26 +1,36 @@@
"use client";
- import { Box, Clapperboard, Download, ImageIcon, Loader2, Pause, PersonStanding, Play, Rotate3d, Sparkles, Video } from "lucide-react";
+ import { Box, Camera, Clapperboard, Download, ImageIcon, Loader2, Paintbrush, Pause, PersonStanding, Play, Rotate3d, Sparkles, Video } from "lucide-react";
import Link from "next/link";
- import { createElement, useCallback, useEffect, useRef, useState, useSyncExternalStore } from "react";
+ import { createElement, useCallback, useEffect, useEffectEvent, useRef, useState, useSyncExternalStore } from "react";
import { toast } from "sonner";
import { Button } from "@/components/ui/button";
- import { uploadFile, useHydrated } from "@/lib/api";
- import { animateSpinHref, animationName, model3dView, stillOf, type Model3dView } from "@/lib/av/model3d";
+ import { uploadFile, useEngine, useHydrated } from "@/lib/api";
+ import { animateSpinHref, animationName, model3dView, photorealAngle, photorealBody, stillOf, type Model3dView } from "@/lib/av/model3d";
+import { anyAngleHref } from "@/lib/catalog/any-angle";
+ import { PATH_FPS, PATH_FRAMES } from "@/lib/camera-path";
+ import { useFlyAround } from "@/components/fly-around-run";
import type { Generation } from "@/lib/catalog/types";
import { cn } from "@/lib/utils";
import { toastError } from "@/lib/refusals";
import { loadModelViewer, TURNTABLE_BACKDROP, useViewerSrc, viewerLook } from "./model-viewer";
-import type { Model3dInfo } from "./model3d-studio";
+ import { RetextureDialog } from "./retexture-dialog";
import { RigDialog } from "./rig-dialog";
import { PlaceholderChip } from "@/components/demo-mode";
+import { NextSteps } from "@/components/nav/next-steps";
import { recordableType, recordTurntable } from "./turntable";
+/**
+ * Left out of the card's next steps: its own Animate the spin button is that step (and knows a turntable recorded
+ * here), and a rigged character has none.
+ */
+const SPIN_STEPS = ["animate-spin"] as const;
+
+/** The model file among a result's outputs (its turntable and poster ride along as other outputs); -1 without one. */
+const modelAt = (g: Generation) => g.outputs.findIndex((o) => o.kind === "model3d");
+
/** Downloads besides the main file, by the name the provider gave them. */
- const FORMAT_LABEL: Record<string, string> = { rigged: "Rigged .glb", walking: "Walk .glb", running: "Run .glb", fbx: ".fbx", splat: "Splat" };
+ const FORMAT_LABEL: Record<string, string> = { rigged: "Rigged .glb", walking: "Walk .glb", running: "Run .glb", fbx: ".fbx", splat: "Splat", points: "Points .glb" };
const formatLabel = (k: string) => FORMAT_LABEL[k] ?? `.${k}`;
/** What the viewer shows of a rig: the result itself, or one of Meshy's walk and run cycles. */
@@@ -97,6 -91,33 +101,33 @@@ export function ModelCard({ g, cloudAll
// From words on the open engine: the Z-Image still the model was built from (a helper step the page hides).
const drawn = stillOf(g);
const name = (g.modelName ?? "model").replace(/[^\w .-]+/g, "");
- // "Film it photoreal" (N7-7): the photo filmed going round the model. Cloud: from the photo along the orbit. Your GPU:
++ // "Film it photoreal": the photo filmed going round the model. Cloud: from the photo along the orbit. Your GPU:
+ // the model recorded here along the same orbit guides the camera (a splat hands its own orbit video).
+ const [engine] = useEngine();
+ const [filming, setFilming] = useState<number | null>(null);
+ const pendingFilm = useRef(false);
+ const photorealStand = engine === "open" ? "/api/files/placeholder.mp4" : undefined;
+ const photoreal = photorealBody(view, engine, photorealStand, drawn);
+ const fly = useFlyAround(photoreal && !view.rigged && (view.glb || view.turntable) ? photoreal : null);
+ const photoSrc = view.photo ?? drawn;
+ const recordFilm = async (el: HTMLElement) => {
+ setFilming(0);
+ try {
+ const blob = await recordTurntable(el as Parameters<typeof recordTurntable>[0], { onProgress: setFilming, frames: PATH_FRAMES, fps: PATH_FPS, angle: (i) => photorealAngle(i) });
+ const asset = await uploadFile(new File([blob], `${name} orbit render.webm`, { type: "video/webm" }));
+ const body = photorealBody({ photo: photoSrc }, "open", asset.url);
+ if (body) {
+ await fly.run.mutateAsync(body);
+ toast.success("Filming the photoreal orbit — it shows up with your 3D models");
+ }
+ } catch (e) {
+ toastError(e);
+ } finally {
+ setFilming(null);
+ }
+ };
+ // The viewer's load listener starts the latest one.
+ const startFilm = useEffectEvent((el: HTMLElement) => void recordFilm(el));
const label = g.modelName ?? "3D";
// Behind the viewer: the studio sweep the server's turntable and poster are on, so opening 3D doesn't jump.
const backdrop = view.material ? TURNTABLE_BACKDROP : undefined;
@@@ -153,7 -178,20 +188,19 @@@
pendingRecord.current = true;
setShow("3d");
};
+ const film = () => {
+ if (engine === "cloud" || !view.glb) {
+ const body = photorealBody(view, engine, engine === "open" ? view.turntable : undefined, drawn);
+ if (body) fly.run.mutate(body, { onSuccess: () => void toast.success("Filming the photoreal orbit — it shows up with your 3D models") });
+ return;
+ }
+ if (viewer && loaded) return void recordFilm(viewer);
+ pendingFilm.current = true;
+ setShow("3d");
+ };
+ const canFilm = !!photoreal && !view.rigged && (engine === "cloud" || (view.glb ? canRecord && !failed : !!view.turntable));
+ const filmBusy = filming !== null || fly.run.isPending;
const spin = view.rigged ? null : animateSpinHref(view, recorded?.saved);
- const notices = info[g.modelId]?.notices ?? [];
// A rigged result rigs its source model again with another animation.
const rigSource = view.rigged ? (g.request.inputs?.model3d ?? view.glb) : view.glb;
// The radio buttons in the corner: the preview and the 3D view, a rig's clips, or a splat's video and picture.
@@@ -345,13 -373,25 +392,32 @@@
<PersonStanding className="size-3.5" /> {view.rigged ? "Another animation" : "Rig & animate"}
</Button>
)}
+ {view.splat && view.photo && (
+ <Button asChild variant="outline" size="sm" className="rounded-full">
+ <Link href={anyAngleHref(view.photo)} prefetch={false}>
+ <Rotate3d className="size-3.5" /> Shoot it from any angle
+ </Link>
+ </Button>
+ )}
+ {view.glb && !view.rigged && !view.splat && g.op !== "splat" && (
+ <Button variant="outline" size="sm" className="rounded-full" onClick={() => setRetexturing(true)}>
+ <Paintbrush className="size-3.5" /> Retexture
+ </Button>
+ )}
+ {canFilm && (
+ <Button
+ variant="outline"
+ size="sm"
+ className="rounded-full"
+ onClick={film}
+ disabled={filmBusy || !!fly.preview.data?.blocker}
+ title={fly.preview.data?.blocker ?? (engine === "open" ? "The photo filmed going round the model, on your GPU" : "The photo filmed going round the model, in the cloud")}
+ >
+ {filmBusy ? <Loader2 className="size-3.5 animate-spin" /> : <Camera className="size-3.5" />}
+ {filming !== null ? `Recording the orbit… ${Math.round(filming * 100)}%` : "Film it photoreal"}
+ {filming === null && fly.price && <span className="text-muted-foreground">· {fly.price}</span>}
+ </Button>
+ )}
{spin && (
<Button asChild size="sm" className="rounded-full">
<Link href={spin} prefetch={false}>
@@@ -360,10 -400,10 +426,11 @@@
</Button>
)}
</div>
- {notices.length > 0 && <p className="text-[11px] text-muted-foreground">{notices.join(" · ")}</p>}
+ {/* Where the model goes next: an ad, a sharper still (its own Animate the spin button is above). */}
+ {modelAt(g) >= 0 && <NextSteps g={g} index={modelAt(g)} variant="row" max={3} skip={SPIN_STEPS} className="pt-1" />}
</div>
{rigSource && rigging && g.op !== "splat" && <RigDialog glb={rigSource} open={rigging} onOpenChange={setRigging} cloudAllowed={cloudAllowed} />}
+ {view.glb && retexturing && <RetextureDialog glb={view.glb} open={retexturing} onOpenChange={setRetexturing} cloudAllowed={cloudAllowed} />}
</article>
);
}
diff --cc src/components/model3d/model3d-studio.tsx
index 576ec271,92169f94..d9d07049
--- a/src/components/model3d/model3d-studio.tsx
+++ b/src/components/model3d/model3d-studio.tsx
@@@ -16,12 -16,12 +17,14 @@@ import { MediaSlot, type SlotValue } fr
import { MediaDrop } from "@/components/av/media-drop";
import { Panel, ToolHero, ToolShell } from "@/components/av/tool-shell";
import { SelfHostNote } from "@/components/self-host-note";
+import { HandoffImage } from "@/components/nav/next-steps";
+import { ExampleRow } from "@/components/studio/example-row";
import { useCreateGeneration, useEngine, useGenerations, useHydrated, useLikelyVisitor, useModelAccess, useStatus } from "@/lib/api";
import {
+ IDOL_QUALITIES,
MAX_3D_PROMPT,
MODEL3D_FEATURE,
+ MODEL3D_FILM_FEATURE,
MODEL3D_MODES,
MODELS_3D,
RIG_MODEL,
@@@ -324,7 -399,10 +408,8 @@@ export function Model3dStudio({ info, e
</SelectContent>
</Select>
<p className="text-[12px] text-muted-foreground">{choices.find((m) => m.id === modelId)?.note}</p>
- {!licence && info[modelId]?.notices.length > 0 && <p className="text-[12px] font-medium">{info[modelId].notices.join(" · ")}</p>}
- {licence && licence.notices.length > 0 && <p className="text-[12px] text-muted-foreground">{licence.notices.join(" · ")}</p>}
</div>
+ {idol && <IdolSettings quality={idolQuality} onQuality={setIdolQuality} photo={idolPhoto} onPhoto={setIdolPhoto} />}
<Button size="lg" className={cn("mt-4 w-full rounded-full", blocker && "bg-muted text-muted-foreground hover:bg-muted")} onClick={go} disabled={create.isPending || visitor}>
{create.isPending ? <Loader2 className="size-4 animate-spin" /> : <Box className="size-4" />} {mode === "splat" ? "Make the splat" : "Make it 3D"}
</Button>
@@@ -381,5 -462,23 +470,23 @@@ function ResultCard({ g, cloudAllowed }
const create = useCreateGeneration();
if (g.status === "queued" || g.status === "running") return <PendingTile g={g} ratio={4 / 3} />;
if (g.status !== "succeeded") return <FailedTile g={g} ratio={4 / 3} onRetry={() => create.mutate(retryOf(g), { onError: (e) => toastError(e) })} />;
+ if (g.kind === "video") return <FilmCard g={g} />;
- return <ModelCard g={g} info={info} cloudAllowed={cloudAllowed} />;
+ return <ModelCard g={g} cloudAllowed={cloudAllowed} />;
}
+
+ /** A photoreal orbit filmed from a model ("Film it photoreal"): the clip, to watch and download. */
+ function FilmCard({ g }: { g: Generation }) {
+ const video = g.outputs.find((o) => o.kind === "video");
+ if (!video) return null;
+ return (
+ <article className="overflow-hidden rounded-2xl border bg-card">
+ <video src={video.url} controls playsInline preload="metadata" className="aspect-[4/3] w-full bg-muted object-contain" aria-label="Photoreal orbit" />
+ <div className="flex items-center justify-between gap-2 p-3">
+ <p className="min-w-0 truncate text-[13px] font-medium">Photoreal orbit</p>
+ <a href={video.url} download="photoreal orbit.mp4" className="shrink-0 text-[12px] text-muted-foreground underline underline-offset-2 hover:text-foreground">
+ Download
+ </a>
+ </div>
+ </article>
+ );
+ }
diff --cc src/components/remove-object/remove-object-tool.tsx
index 3ae01fb9,ceca880f..92c918fb
--- a/src/components/remove-object/remove-object-tool.tsx
+++ b/src/components/remove-object/remove-object-tool.tsx
@@@ -70,7 -75,14 +75,14 @@@ interface Run
* result with a before / after wipe. Long clips are cut into pieces or windows, erased and joined with their
* own sound (src/lib/catalog/remove-object.ts).
*/
- export function RemoveObjectTool() {
+ /** The open eraser "Remove a person" picks: H3 Person Removal (MiniMax H3 with Akatz Labs' Person Remover). */
+ export const PERSON_ERASER = "oss-h3-person-remove";
+
+ const noSubscribe = () => () => {};
+ /** ?person=1: a result's "Remove a person" link. */
+ const personInUrl = () => new URLSearchParams(window.location.search).get("person") === "1";
+
-export function RemoveObjectTool({ tabs, person = false }: { tabs?: React.ReactNode; person?: boolean }) {
++export function RemoveObjectTool({ person = false }: { person?: boolean } = {}) {
const [engine, setEngine, engineMode] = useEngine();
// Removing an object doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front,
// and the upload, the mask preview and Remove are off, instead of a run the server refuses.
@@@ -239,11 -273,15 +273,15 @@@
const preview = useGeneration(previewOf?.id ?? null).data;
return (
- <ToolShell title="Video tools" tabs={tabs} wide selfHostedOnly>
+ <ToolShell title="Video tools" wide selfHostedOnly>
{!clip && (
<ToolHero
- title="Remove anything from a video"
- subtitle={`Type what goes, click it, or paint over it — the gap is filled frame by frame and the sound stays${visitor ? "." : ", free on your own ComfyUI."}`}
+ title={personAsked ? "Remove a person from a video" : "Remove anything from a video"}
+ subtitle={
+ personAsked
+ ? `Name who goes, check their green mask, and the scene is rebuilt behind them — redo any part that comes out weak${visitor ? "." : ", free on your own ComfyUI."}`
+ : `Type what goes, click it, or paint over it — the gap is filled frame by frame and the sound stays${visitor ? "." : ", free on your own ComfyUI."}`
+ }
>
{visitor && <SelfHostNote className="mt-3 max-w-xl">Remove object isn&apos;t available here.</SelfHostNote>}
</ToolHero>
diff --cc src/components/storyboard-view.tsx
index 04541120,a95c748b..87728575
--- a/src/components/storyboard-view.tsx
+++ b/src/components/storyboard-view.tsx
@@@ -24,9 -24,9 +24,10 @@@ import { lookCard } from "@/lib/catalog
import type { Engine, Generation } from "@/lib/catalog/types";
import { timeAgo } from "@/lib/format";
import { BOARD_TITLES_KEY, boardTitle, filmReady, rememberTitle } from "@/lib/storyboard-board";
+ import { animateHref, MAX_KEYS } from "@/lib/inbetween";
import { cn } from "@/lib/utils";
import { responseError, toastError } from "@/lib/refusals";
+import { BoardExample, hasBoardExample } from "@/components/empty-examples";
const ASPECTS: readonly string[] = STORYBOARD_ASPECTS;
diff --cc src/components/studio/build-request.ts
index 720767f7,00000000..ffca64e4
mode 100644,000000..100644
--- a/src/components/studio/build-request.ts
+++ b/src/components/studio/build-request.ts
@@@ -1,73 -1,0 +1,87 @@@
+/**
+ * The run a composer's draft asks for (what Generate sends): its own module, so a test can build the run an example's
+ * draft makes (tests/examples-catalog.test.ts) the way the composer does.
+ */
- import type { Engine, GenerationRequest, MediaKind, Operation } from "@/lib/catalog/types";
++import type { Engine, GenerationRequest, GenParams, MediaKind, Operation } from "@/lib/catalog/types";
+import type { FrameSupport } from "@/lib/catalog/keyframes";
+import { framesRequest, layoutRequest } from "@/lib/composer";
++import type { InbetweenTiming } from "@/lib/inbetween";
+import type { SlotValue } from "./media-slot";
+import type { Draft } from "./studio-context";
+
+/** Frames mode, as the request needs it: what the model does with frames, the clip's length, and whether it's the open chain. */
+export interface FramesContext {
+ support: FrameSupport;
+ duration: number;
+ chained: boolean;
++ /** Keyframe animation (Fuobe Animation): each gap's timing, fitted to the frames and the engine. */
++ animation?: { timing: InbetweenTiming };
++}
++
++/**
++ * The draft's keyframe-animation settings (params.extra.inbetween, stillMouth) go only with an animation: after Animation
++ * is turned off or another model is picked they stay in the draft (to come back to) but are not sent to that model.
++ */
++function withoutAnimation(params: GenParams, animating: boolean): GenParams {
++ const extra = params.extra;
++ if (animating || !extra || !("inbetween" in extra || "stillMouth" in extra)) return params;
++ const { inbetween: _i, stillMouth: _s, ...rest } = extra;
++ return { ...params, extra: Object.keys(rest).length ? rest : undefined };
+}
+
+export function buildRequest(
+ feature: string,
+ draft: Pick<Draft, "slots" | "refs" | "presetId" | "modelId" | "prompt" | "negativePrompt" | "params" | "presetOptions" | "presetStrength" | "mix" | "frames" | "layout">,
+ op: Operation | undefined,
+ promptSuffix?: string,
+ refKind: MediaKind = "image",
+ frames?: FramesContext,
+ /**
+ * The model's needs: a Fuobe Original (runs on both engines) names the engine switched to; a model that takes
+ * looks (Fuobe Soul) takes the look's strength with its default look too (no presetId).
+ */
+ target: { engine?: Engine; looks?: boolean } = {},
+): GenerationRequest {
+ const s = draft.slots;
+ const refs = draft.refs.filter((x) => !!x?.ref).map((x) => x.ref);
+ let images = [s.image, s.image2, s.image3].filter((x): x is SlotValue => !!x?.ref).map((x) => x.ref).concat(refKind === "image" ? refs : []);
+ const videos = refKind === "video" ? refs : [];
+ let endImage = s.endImage?.ref || undefined;
- let params = draft.params;
++ let params = withoutAnimation(draft.params, !!(draft.frames && frames?.animation));
+ let pinned = op;
+ // Frames mode: the stills in order at their times (or the first and last as start and end frame), at the strip's length.
+ if (draft.frames && frames) {
+ const sent = framesRequest(draft.frames, frames);
+ images = sent.images;
+ endImage = sent.endImage;
- params = { ...params, ...sent.params };
++ params = { ...params, ...sent.params, ...(frames.animation && { extra: { ...params.extra, inbetween: frames.animation.timing } }) };
+ pinned = op ?? sent.op;
+ }
+ // Layout mode: the boxes ride as params.extra.layout, captioned with the prompt; the plan compiles them for the model.
+ if (draft.layout) params = layoutRequest(draft.layout, draft.prompt, params).params;
+ return {
+ feature,
+ presetId: draft.presetId,
+ modelId: draft.modelId,
+ op: pinned,
+ prompt: promptSuffix && draft.prompt.trim() ? `${draft.prompt.trim().replace(/[.\s]+$/, "")}. ${promptSuffix}` : draft.prompt,
+ negativePrompt: draft.negativePrompt || undefined,
+ inputs: {
+ images: images.length ? images : undefined,
+ endImage,
+ mask: s.mask?.ref || undefined,
+ sketch: s.sketch?.ref || undefined,
+ voiceAudio: s.voiceAudio?.ref || undefined,
+ voiceAudio2: s.voiceAudio2?.ref || undefined,
+ video: s.video?.ref || undefined,
+ audio: s.audio?.ref || undefined,
+ videos: videos.length && !draft.frames ? videos : undefined,
+ },
+ params,
+ presetOptions: draft.presetOptions,
+ ...((draft.presetId || target.looks) && draft.presetStrength !== undefined && draft.presetStrength < 1 && { presetStrength: draft.presetStrength }),
+ ...(draft.presetId && draft.mix && { mix: draft.mix }),
+ ...(target.engine && { engine: target.engine }),
+ };
+}
+
diff --cc src/components/studio/composer.tsx
index ec26e63d,97e69626..a1707ced
--- a/src/components/studio/composer.tsx
+++ b/src/components/studio/composer.tsx
@@@ -13,7 -13,8 +13,8 @@@ import { Kbd } from "@/components/ui/kb
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { useToday } from "@/hooks/use-today";
import { estimateCost, imageLimit, layoutCanvas, planGeneration, routesFor, type Plan } from "@/lib/catalog/plan";
- import type { Engine, MediaKind, ModelDef, Operation, Preset, PresetRoute, VideoFormat } from "@/lib/catalog/types";
-import type { Engine, GenerationRequest, GenParams, InputSlot, MediaKind, ModelDef, Operation, Preset, PresetRoute, VideoFormat } from "@/lib/catalog/types";
++import type { Engine, InputSlot, MediaKind, ModelDef, Operation, Preset, PresetRoute, VideoFormat } from "@/lib/catalog/types";
+ import { LYRICS_PARAM, SONG_ID_PARAM, songFormat, songToolProblem, withSongId } from "@/lib/lyrics";
import { dualEngine } from "@/lib/catalog/engines";
import { locksByDefault } from "@/lib/catalog/palettes";
import { DEFAULT_LOOK, lookCard } from "@/lib/catalog/soul-cards";
@@@ -36,7 -40,9 +40,8 @@@ import
keyframeChain,
moveFrameAt,
OPEN_MIN_GAP,
- type FrameSupport,
} from "@/lib/catalog/keyframes";
+ import { timingFor, timingFromTimes, timingProblem, type InbetweenTiming } from "@/lib/inbetween";
import { appModels, presetGpuKey, presetRoutes, recipeRoute } from "@/lib/catalog/preset-recipe-routes";
import {
appRoute,
@@@ -280,6 -386,14 +308,14 @@@ export function Composer({ docked }: {
const takesLook = !!model?.options.looks;
const preset: Preset | undefined = draft.presetId && !takesLook ? catalog.getPreset(draft.presetId) : config.preset;
const lockedModel = preset?.type === "app";
- // Fuobe DoP's orbit moves (N7-7): the Exact switch films the orbit by its numbers through /api/fly-around.
++ // Fuobe DoP's orbit moves: the Exact switch films the orbit by its numbers through /api/fly-around.
+ // It starts with a 3D depth step and runs on the studio's own GPU: the owner's for now.
+ const owner = useIsOwner();
+ const exactId = owner && preset?.type === "motion" && takesExact(preset.id) ? preset.id : undefined;
+ const [exactBy, setExactBy] = useState<{ id: string; orbit: ExactOrbit } | null>(null);
+ const exact = exactId && exactBy?.id === exactId ? exactBy.orbit : null;
+ const exactImage = draft.slots.image?.ref;
+ const fly = useFlyAround(exact ? { engine, image: exactImage, orbit: exact, prompt: draft.prompt.trim() || undefined, feature: config.feature } : null);
const presetLoading = !!draft.presetId && !takesLook && !preset && !catalog.complete;
// The models the viewer's catalog has (the studio's slice, or the full catalog once it's loaded), and the ones this
// viewer can run now: offered in Settings → Models & licences, and a key for its provider when it's an account's paid run.
@@@ -781,7 -946,9 +868,9 @@@
const missingKey = needsKey(model, status)?.[0];
const ownPayerText = payer && cost ? ` · ${billedTo(payer)}` : missingKey ? ` · ${addKeyLabel(missingKey).toLowerCase()}` : "";
// On this studio's GPUs: the quote's words (none from the server: free, as the open engine always is).
- const costText = poolPrice ? (priceUnavailable ? "Price unavailable" : hostedQuote?.text || ownCostText) : ownCostText;
- // An exact orbit runs as a fly-around: its own price (N7-7).
++ // An exact orbit runs as a fly-around: its own price.
+ const exactPrice = exact ? fly.price : "";
+ const costText = exactPrice || (poolPrice ? (priceUnavailable ? "Price unavailable" : hostedQuote?.text || ownCostText) : ownCostText);
const payerText = poolPrice ? "" : ownPayerText;
// Attachments: only when something is attached, a required slot is still empty, or none of a "one of these" group is filled (U8).
@@@ -1207,6 -1401,22 +1323,22 @@@
/>
)}
- {/* Fuobe DoP's orbit moves: the Exact switch and its numbers (N7-7). */}
++ {/* Fuobe DoP's orbit moves: the Exact switch and its numbers. */}
+ {exactId && !collapsed && (
+ <ExactOrbitControls
+ className="mx-2 mb-2"
+ engine={engine}
+ value={exact}
+ defaults={exactDefaults(exactId)}
+ onChange={(orbit) => setExactBy(orbit ? { id: exactId, orbit } : null)}
+ footer={exact && exactImage && fly.preview.data?.blocker ? <span>{fly.preview.data.blocker}</span> : undefined}
+ />
+ )}
+
+ {model?.options.lyrics && (effectiveOp ? SUNG_OPS.has(effectiveOp) : model.routes.some((r) => SUNG_OPS.has(r.op))) && !collapsed && (
+ <LyricsEditor model={model} value={draft.lyrics ?? ""} onChange={(lyrics) => setDraft({ lyrics })} idea={draft.prompt} seconds={p.duration ?? model.defaults?.duration} />
+ )}
+
{model && effectiveOp === "dialogue" && <DialogueEditor model={model} lines={p.dialogue ?? defaultLines(model)} onChange={(dialogue) => setP({ dialogue })} />}
{model?.options.multiShot && p.shots && <ShotsEditor model={model} shots={p.shots} onChange={(shots) => setP({ shots })} />}
diff --cc src/components/studio/draft.ts
index 5adbb747,00000000..dc7f16e6
mode 100644,000000..100644
--- a/src/components/studio/draft.ts
+++ b/src/components/studio/draft.ts
@@@ -1,179 -1,0 +1,197 @@@
+/**
+ * A studio's draft, built: what a page starts from (its link's hand-off), what Reuse brings back from a past run, and an
+ * example a page loads into its composer. Plain functions, shared by the studio page and its tests.
+ */
+import { nanoid } from "nanoid";
+import type { Generation, GenerationRequest, MediaKind, ModelDef, Preset } from "@/lib/catalog/types";
- import { presetModel, presetParams, routeParams, withoutLayout } from "@/lib/composer";
++import { handoffFrames, presetModel, presetParams, routeParams, withoutLayout } from "@/lib/composer";
+import { presetRoutes } from "@/lib/catalog/preset-recipe-routes";
- import { positionsFrom } from "@/lib/catalog/keyframes";
++import { positionsFrom, spread } from "@/lib/catalog/keyframes";
++import { songFromRun } from "@/lib/lyrics";
+import { reuseSignature, withSignatureWords } from "@/lib/catalog/palettes";
+import { movedAppRequest } from "@/lib/catalog/plan";
+import { currentModelId, migrateRequest } from "@/lib/catalog/replaced";
+import { matchSpokenLanguage } from "@/lib/speech-languages";
+import type { ExampleRequest } from "@/lib/examples/types";
+import type { SlotValue } from "./media-slot";
+import type { Draft, StudioConfig } from "./studio-context";
+
+export function kindOfUrl(url: string): MediaKind {
+ if (/\.(mp4|webm|mov)(\?|$)/i.test(url)) return "video";
+ if (/\.(mp3|wav|ogg|flac|m4a)(\?|$)/i.test(url)) return "audio";
+ return "image";
+}
+
+/** A slot holding a file by its URL (its own preview), with an id of its own. */
+export const slot = (url: string | null | undefined, preview?: string): SlotValue | null =>
+ url ? { ref: url, preview: preview ?? url, kind: kindOfUrl(url), id: nanoid(6) } : null;
+
+export function initialDraft(
+ config: StudioConfig,
+ sp: URLSearchParams,
+ engine: "cloud" | "open",
+ lookup: { getModel: (id: string) => ModelDef | undefined; getPreset: (id: string) => Preset | undefined },
+): Draft {
+ const preset = sp.get("preset") ? lookup.getPreset(sp.get("preset")!) : config.preset;
+ // A link or Assist hand-off that names a model Fuobe retired opens on the one that replaced it (replaced.ts).
+ const requested = sp.get("model") && currentModelId(sp.get("model")!);
+ const has = (id: string) => !!lookup.getModel(id);
+ // An app starts on the model its preview was made with on this engine, else its own route (else the other engine's,
+ // for an app with no version here); opened on one of its models (?model=, from ⌘K), on that model's route.
+ const other = engine === "open" ? "cloud" : "open";
+ const appRoutes = preset?.type === "app" ? [...presetRoutes(preset, engine, has), ...presetRoutes(preset, other, has)] : [];
+ const appRoute = appRoutes.find((r) => !!requested && r.modelId === requested) ?? appRoutes[0];
+ // A camera motion or effect starts on the model its preview was made with (MiniMax H3), else its Original (Fuobe DoP),
+ // when the studio has it.
+ const presetOwn = presetModel(preset, engine, has);
+ const modelId =
+ (requested && lookup.getModel(requested)?.id) ||
+ appRoute?.modelId ||
+ (presetOwn && lookup.getModel(presetOwn)?.id) ||
+ config.defaultModels[engine] ||
+ config.defaultModels.cloud ||
+ // Open-only tools (Match colors) keep their open model under the Cloud switch, like cloud-only ones do under Open.
+ config.defaultModels.open;
+ const model = lookup.getModel(modelId);
+ // The route's own settings (Wan 2.2 at 480p; a recipe on H3 at the Quality its cover was made at) on its own model.
+ const routeSettings = appRoute && modelId === appRoute.modelId ? routeParams(appRoute, "app") : presetOwn && modelId === presetOwn ? presetParams(preset, engine, has) : {};
+ const slots: Draft["slots"] = {};
+ const imageSlot = config.slots.find((s) => s.accept === "image")?.key ?? preset?.inputs.find((s) => s.accept === "image")?.key;
+ const refs: SlotValue[] = [];
+ if (sp.get("image") && imageSlot) slots[imageSlot] = slot(sp.get("image"));
+ if (sp.get("ref")) {
+ if (config.multiRef) refs.push(slot(sp.get("ref"))!);
+ else if (imageSlot) slots[imageSlot] = slot(sp.get("ref"));
+ }
+ if (sp.get("video")) slots.video = slot(sp.get("video"));
+ if (sp.get("audio")) slots.audio = slot(sp.get("audio"));
++ // A Mureka song handed over (a music result's Extend, Remix or Stems): its id goes with it.
++ const song = sp.get("audio") && sp.get("song") ? { id: sp.get("song")!, url: sp.get("audio")! } : undefined;
++ // A song's lyrics handed over with it (a sung result's Remix, which needs the whole song's words).
++ const lyrics = sp.get("lyrics") ?? undefined;
+ // A voice sample handed over (Clean up voice → "Use as a voice sample"): the voice a cloning model speaks with.
+ if (sp.get("voice")) slots.voiceAudio = slot(sp.get("voice"));
+ // An output format handed over in the link (Export → "ProRes in the cloud"), when the model writes it.
+ const format = model?.options.formats?.find((f) => f === sp.get("format"));
+ // A size handed over (Regenerate in 2K → 1440p), when the model offers it.
+ const resolution = model?.options.resolutions?.find((r) => r === sp.get("resolution"));
++ // Stills handed over as frames (Storyboard's "Animate these panels", a Character Sheet's poses): Frames mode, evenly spaced.
++ const handed = config.frames ? handoffFrames(sp.get("frames")) : [];
++ const frames = handed.length ? handed.map((u, i) => ({ value: slot(u)!, at: spread(handed.length)[i] })) : undefined;
+ return {
+ prompt: sp.get("prompt") ?? "",
+ negativePrompt: "",
+ modelId,
+ params: { ...model?.defaults, ...routeSettings, ...(format && { format }), ...(resolution && { resolution }) },
+ slots,
+ refs,
+ presetId: sp.get("preset") ?? config.preset?.id,
+ presetOptions: {},
++ ...(frames && { frames }),
++ ...(song && { song }),
++ ...(lyrics && { lyrics }),
+ };
+}
+
+/** Rebuild a composer draft from a past generation ("Reuse"). */
+export function draftFromGeneration(g: Generation, config: StudioConfig, getModel: (id: string) => ModelDef | undefined, getPreset: (id: string) => Preset | undefined): Partial<Draft> {
+ return draftFromRequest(g.request, config, getModel, getPreset);
+}
+
+/**
+ * A composer draft from a run's request: Reuse of a past generation, and an example a page loads (applyExample). Every
+ * input comes back to its slot: the pictures in slot order, the end frame, the painted area, the voice, the clip.
+ */
+export function draftFromRequest(request: GenerationRequest, config: StudioConfig, getModel: (id: string) => ModelDef | undefined, getPreset: (id: string) => Preset | undefined): Partial<Draft> {
+ // A run styled by the Color signature / Moodboard chips comes back as it was before they routed it,
+ // with the picks on the chips (studios without the chips get the styled prompt instead).
+ const signed = config.signature ? reuseSignature(request) : null;
+ const asked = signed ? { ...request, modelId: signed.modelId, params: signed.params } : config.signature ? request : withSignatureWords(request);
+ // A run on a model Fuobe retired comes back on the one that replaced it (src/lib/catalog/replaced.ts): a Soul style
+ // becomes its Fuobe look, the retired API's own settings are dropped. An app run on the model its app ran on before comes
+ // back on the app's model now (movedAppRequest).
+ const r = movedAppRequest(migrateRequest(asked).request, getModel, getPreset).request;
+ const imgs = signed ? signed.images : (r.inputs?.images ?? []);
+ const imageKeys = config.slots.filter((s) => s.accept === "image" && s.key !== "endImage" && s.key !== "mask").map((s) => s.key);
+ const slots: Draft["slots"] = {};
+ imageKeys.forEach((k, i) => (slots[k] = slot(imgs[i])));
+ const refs = config.multiRef ? imgs.slice(imageKeys.length).map((u) => slot(u)!).filter(Boolean) : [];
+ if (r.inputs?.endImage) slots.endImage = slot(r.inputs.endImage);
+ if (r.inputs?.video) slots.video = slot(r.inputs.video);
+ if (r.inputs?.audio) slots.audio = slot(r.inputs.audio);
+ // The painted area of an inpaint (and its red-tinted picture), and the voice a cloning model speaks with.
+ if (r.inputs?.mask) slots.mask = slot(r.inputs.mask);
+ if (r.inputs?.sketch) slots.sketch = slot(r.inputs.sketch);
+ if (r.inputs?.voiceAudio) slots.voiceAudio = slot(r.inputs.voiceAudio);
+ if (r.inputs?.voiceAudio2) slots.voiceAudio2 = slot(r.inputs.voiceAudio2);
+ const params = { ...r.params };
+ // A keyframes run comes back in Frames mode, each still at its place in the clip.
+ const times = params.keyframeTimes;
+ const frames =
+ config.frames && times?.length && times.length === imgs.length && imgs.length > 1
+ ? positionsFrom(times, params.duration ?? times[times.length - 1]).map((at, i) => ({ value: slot(imgs[i])!, at }))
+ : undefined;
+ delete params.keyframeTimes;
+ // A spoken language stored as a name (Assist's "Spanish") or a locale comes back as the model's own code.
+ const languages = getModel(r.modelId)?.options.sourceLanguages;
+ if (languages?.length && params.sourceLanguage) params.sourceLanguage = matchSpokenLanguage(params.sourceLanguage, languages) ?? params.sourceLanguage;
++ // A song's lyrics come back in the lyrics editor. One of Mureka's own songs (an extend or remix by its id) comes back as
++ // the attached song's id, so a song swapped in afterwards is sent as itself, never as the old id.
++ const sung = songFromRun(params.extra, r.inputs?.audio);
++ params.extra = sung.extra;
++ const { lyrics, song } = sung;
+ // A layout run comes back in Layout mode (studios that have it): its boxes in the editor, the prompt as their caption.
+ const laid = config.layout ? withoutLayout(params) : { params, layout: undefined };
+ return {
+ prompt: r.prompt ?? "",
+ negativePrompt: r.negativePrompt ?? "",
+ modelId: r.modelId,
+ params: laid.params,
+ layout: laid.layout,
+ slots: frames ? {} : slots,
+ refs: frames ? [] : refs,
+ frames,
+ presetId: r.presetId,
+ presetOptions: r.presetOptions ?? {},
+ presetStrength: r.presetStrength,
+ mix: r.mix,
+ signature: signed?.signature,
++ lyrics,
++ song,
+ };
+}
+
+/**
+ * An example's draft (a page's "Start from an example"): its own files, words and settings over the page's starting
+ * draft (`base`: initialDraft for the page, opened on the example's preset). An example that names no model keeps the
+ * base's, so it runs on whichever engine the visitor is on, through the preset's own route there. Slots the example
+ * doesn't fill are cleared: the draft holds nothing else.
+ */
+export function applyExample(
+ example: ExampleRequest,
+ base: Draft,
+ config: StudioConfig,
+ lookup: { getModel: (id: string) => ModelDef | undefined; getPreset: (id: string) => Preset | undefined },
+): Draft {
+ const modelId = example.modelId ?? base.modelId;
+ const request: GenerationRequest = { feature: config.feature, ...example, modelId, presetId: example.presetId ?? base.presetId };
+ const d = draftFromRequest(request, config, lookup.getModel, lookup.getPreset);
+ return {
+ ...base,
+ prompt: example.prompt ?? "",
+ negativePrompt: "",
+ modelId: d.modelId ?? modelId,
+ // The route's own settings stay (the base), with what the example set over them.
+ params: { ...base.params, ...(example.params ?? {}) },
+ slots: d.slots ?? {},
+ refs: d.refs ?? [],
+ frames: undefined,
+ layout: undefined,
+ presetId: request.presetId,
+ presetOptions: { ...(example.presetOptions ?? {}) },
+ presetStrength: undefined,
+ mix: undefined,
+ // Set, not left out: the draft merges what it gets, and a Color signature picked earlier would change the run.
+ signature: undefined,
+ };
+}
diff --cc src/components/studio/mode-switch-studio.tsx
index 2e26bb8d,6f2c7341..e0edcea6
--- a/src/components/studio/mode-switch-studio.tsx
+++ b/src/components/studio/mode-switch-studio.tsx
@@@ -61,22 -61,23 +63,23 @@@ const CONFIGS: Record<HubKind, Record<s
};
/** Modes that are their own tool rather than a composer studio (Translate & dub, Loop / extend, Join, Split soundtrack, Clean up voice, Design a voice, Remove object, Remove dialogue, Evolution, Restore & colourise, Captions, Trim). */
-const TOOLS: Partial<Record<HubKind, Record<string, (p: { tabs: React.ReactNode }) => React.ReactNode>>> = {
+const TOOLS: Partial<Record<HubKind, Record<string, () => React.ReactNode>>> = {
audio: {
- translate: ({ tabs }) => <DubStudio tabs={tabs} />,
- loop: ({ tabs }) => <AudioLoopTool tabs={tabs} />,
- join: ({ tabs }) => <AudioJoinTool tabs={tabs} />,
- split: ({ tabs }) => <SplitSoundtrackTool tabs={tabs} />,
- clean: ({ tabs }) => <CleanVoiceTool tabs={tabs} />,
- design: ({ tabs }) => <DesignVoiceTool tabs={tabs} />,
+ translate: () => <DubStudio />,
+ loop: () => <AudioLoopTool />,
+ join: () => <AudioJoinTool />,
+ split: () => <SplitSoundtrackTool />,
+ clean: () => <CleanVoiceTool />,
+ design: () => <DesignVoiceTool />,
},
"video-tools": {
- "remove-object": ({ tabs }) => <RemoveObjectTool tabs={tabs} />,
- "remove-person": ({ tabs }) => <RemoveObjectTool tabs={tabs} person />,
- "remove-dialogue": ({ tabs }) => <RemoveDialogueTool tabs={tabs} />,
- evolution: ({ tabs }) => <EvolutionTool tabs={tabs} />,
- restore: ({ tabs }) => <RestoreTool tabs={tabs} />,
- captions: ({ tabs }) => <CaptionsStudio tabs={tabs} />,
- trim: ({ tabs }) => <TrimTool tabs={tabs} />,
+ "remove-object": () => <RemoveObjectTool />,
++ "remove-person": () => <RemoveObjectTool person />,
+ "remove-dialogue": () => <RemoveDialogueTool />,
+ evolution: () => <EvolutionTool />,
+ restore: () => <RestoreTool />,
+ captions: () => <CaptionsStudio />,
+ trim: () => <TrimTool />,
},
};
diff --cc src/lib/assist-schedule.ts
index 313603e7,c245fbd8..f9a36764
--- a/src/lib/assist-schedule.ts
+++ b/src/lib/assist-schedule.ts
@@@ -21,6 -21,16 +21,16 @@@ export type ScheduleRule
/** Ask first: the plan waits in the chat as an approval card. Auto: plans run up to `capUsd` per run. */
export type ScheduleApproval = "ask" | "auto";
+ /**
- * A task that runs a saved skill (package W4): no model plans it. `values` are one set of the recipe's inputs as text
++ * A task that runs a saved skill: no model plans it. `values` are one set of the recipe's inputs as text
+ * (a file is its /api/files/… URL); an input in `sources` takes the newest upload of its kind when the run starts.
+ */
+ export interface ScheduleSkill {
+ name: string;
+ values: Record<string, string>;
+ sources?: Record<string, "newest">;
+ }
+
export const SCHEDULE_HOURS = [1, 2, 3, 4, 6, 8, 12, 24, 48, 72, 168] as const;
export const MAX_SCHEDULE_HOURS = 168;
export const MAX_SCHEDULE_PROMPT = 4000;
diff --cc src/lib/av/clean-dialogue.ts
index 00000000,96df2bca..20c04ad8
mode 000000,100644..100644
--- a/src/lib/av/clean-dialogue.ts
+++ b/src/lib/av/clean-dialogue.ts
@@@ -1,0 -1,230 +1,230 @@@
+ import type { Engine, GenerationRequest } from "@/lib/catalog/types";
+ import type { ToolPlan, ToolStep } from "./audio-tools";
+ import { DBS_MODELS, dbsChannelsFor, separationPasses, splitTime, surroundSource, type DbsChannels, type SplitQuality } from "./split";
+
+ /**
+ * Audio → Split soundtrack → Clean up dialogue (DBS D5, docs/research/dbs-separation-7.md §9 D5): the speech in a noisy or
+ * musical recording made clear, on audio and video. Pure: the page and the server (src/server/audio-tools.ts, tool
+ * "clean-dialogue") share it.
+ *
+ * - Open engine (ComfyUI + ComfyUI-DBS, CPU or GPU): one job on oss-dbs-remix (graph C, soundtrack-remix-dbs): the DBS
+ * dialogue, with the music and effects mixed back under it at the level asked for (or left out). A video then gets the
+ * result back with the stream-copy mux (oss-mux), the picture untouched. DBS takes out music and effects; measured on
+ * the CPU ComfyUI (15 s clips), steady hum mostly went too (50 Hz about 50 dB lower) but hiss only about 10 dB, so the
+ * page points to Clean up voice (RE-USE, src/lib/av/clean-voice.ts) and the cloud cleaners for that.
- * - Cloud: hosted speech cleaners under their own names (DBS isn't hosted, and SAM Audio in its place is the owner's call,
- * not taken: docs/handoff/owner-decisions.json samAudioCloud false), so the cloud gives the clean voice with nothing
++ * - Cloud: hosted speech cleaners under their own names (DBS isn't hosted, and SAM Audio
++ * isn't used in its place), so the cloud gives the clean voice with nothing
+ * under it: VEED Clean Audio (takes a video's file itself), DeepFilterNet 3 (audio only: a video's soundtrack is
+ * extracted first) and ElevenLabs isolation. A video gets the voice back with fal's merge-audio-video.
+ */
+
+ export const CLEAN_DIALOGUE_FEATURE = "clean-dialogue";
+ export const OPEN_MODEL = "oss-dbs-remix";
+ export const OPEN_MUX_MODEL = "oss-mux";
+ export const CLOUD_MUX_MODEL = "merge-audio-video";
+ export const EXTRACT_MODEL = "extract-soundtrack";
+
+ /** The page's address for the tool (Split soundtrack, opened on Clean up dialogue). */
+ export const CLEAN_DIALOGUE_PRESET = "clean-dialogue";
+ /** The preset Split soundtrack's mixer opens on for a task: Clean dialogue for that task or its "Fine-tune in the mixer". */
+ export const mixPresetFor = (goal: "split" | "clean", fromClean = false): string | null => (goal === "clean" || fromClean ? CLEAN_DIALOGUE_PRESET : null);
+ export const cleanDialogueHref = (kind: "audio" | "video", url: string): string => `/audio/split?${kind}=${encodeURIComponent(url)}&preset=${CLEAN_DIALOGUE_PRESET}`;
+
+ // ---------------------------------------------------------------------------
+ // The open engine: how loud the music and effects stay under the dialogue
+
+ /** "off" leaves the music and effects out; a number is their level in dB. */
+ export type BedLevel = "off" | number;
+ export const BED_LEVELS: BedLevel[] = ["off", -24, -18, -12];
+ export const DEFAULT_BED: BedLevel = -18;
+ /** What "off" sends: AudioAdjustVolume's floor, 1e-5, under a 16-bit FLAC's smallest step. */
+ export const OFF_DB = -100;
+ export const bedLabel = (b: BedLevel): string => (b === "off" ? "Dialogue only" : `Music & effects −${Math.abs(b)} dB`);
+ /** A bed level from what a request or the page sent: a whole number from −40 to 0, or off. */
+ export function bedOf(v: unknown): BedLevel {
+ if (v === "off" || v === null || v === false) return "off";
+ const n = typeof v === "number" ? v : typeof v === "string" && v.trim() !== "" ? Number(v) : NaN;
+ return Number.isFinite(n) ? Math.min(0, Math.max(-40, Math.round(n))) : DEFAULT_BED;
+ }
+
+ // ---------------------------------------------------------------------------
+ // The cloud cleaners
+
+ export type Cleaner = "veed" | "deepfilternet" | "isolation";
+ export const CLEANERS: { id: Cleaner; label: string; model: string; op: "enhance-voice" | "separate-audio"; hint: string; takesVideo: boolean }[] = [
+ { id: "veed", label: "Clean (VEED)", model: "veed-clean-audio", op: "enhance-voice", hint: "Removes background noise and levels the voice. Keeps quiet and distant words.", takesVideo: true },
+ { id: "deepfilternet", label: "Denoise (DeepFilterNet 3)", model: "deepfilternet3", op: "enhance-voice", hint: "Open-source denoiser for steady noise, hiss and hum.", takesVideo: false },
+ { id: "isolation", label: "Voice only (ElevenLabs)", model: "elevenlabs-voice-isolation", op: "separate-audio", hint: "Keeps the voice and removes music, noise and everything else.", takesVideo: true },
+ ];
+ export const cleanerOf = (id: Cleaner) => CLEANERS.find((c) => c.id === id)!;
+ export const DEFAULT_CLEANER: Cleaner = "veed";
+
+ /** VEED Clean Audio takes up to 30 minutes of audio (fal's model page). */
+ export const VEED_MAX_SECONDS = 30 * 60;
+
+ /** VEED's bill: whole seconds, then up to whole minutes, at least one, at $0.0125 a minute. */
+ export function veedPrice(seconds: number): number {
+ return Math.max(1, Math.ceil(Math.round(Math.max(0, seconds)) / 60 - 1e-9)) * 0.0125;
+ }
+ /** DeepFilterNet 3's bill: $0.001 a second of audio. */
+ export const deepFilterNetPrice = (seconds: number): number => Math.max(0, seconds) * 0.001;
+
+ // ---------------------------------------------------------------------------
+ // Words
+
+ export const OPEN_NOTE = "Removes music and sound effects. For hiss and hum, use Clean up voice or a cloud cleaner.";
+ export const CLOUD_NOTE = "The cloud gives the clean voice on its own, with no music or effects under it.";
+ export const RELATION_NOTE = "Clean up voice repairs the voice itself (noise, echo, muffled sound) on your GPU. Clean up dialogue takes the music and effects out from under it.";
+
+ // ---------------------------------------------------------------------------
+ // The plan
+
+ export interface CleanDialogueInput {
+ engine: Engine;
+ /** The audio or video file (/api/files/…). */
+ media: string;
+ kind: "audio" | "video";
+ name?: string;
+ /** Open: the music and effects' level under the dialogue (or off). */
+ bed?: BedLevel;
+ /** Open: Fast (DBS-BSRNN) or Best (DBS-TIGER); unset = the host's pick. */
+ quality?: SplitQuality;
+ /** Open: keep a stereo recording stereo (every channel separated, about twice as long). */
+ stereo?: boolean;
+ /** Cloud: the hosted cleaner. */
+ cleaner?: Cleaner;
+ /** VEED: how much of the noise goes (0–1; its default 0.874 leaves the rest 18 dB down). */
+ strength?: number;
+ /** A video: put the clean soundtrack back on the picture (default on). */
+ remux?: boolean;
+ channels?: number;
+ seconds?: number;
+ /** The file has no sound track (from its header). */
+ silent?: boolean;
+ }
+
+ export interface CleanDialoguePlan extends ToolPlan {
+ bed: BedLevel | null;
+ cleaner: Cleaner | null;
+ mode: DbsChannels | null;
+ remux: boolean;
+ }
+
+ const nameOf = (i: Pick<CleanDialogueInput, "name" | "kind">) => i.name?.trim() || (i.kind === "video" ? "video soundtrack" : "recording");
+
+ /** What's in the way of a run (in words the page shows), or null. */
+ export function cleanDialogueProblem(i: Pick<CleanDialogueInput, "engine" | "media" | "kind" | "silent" | "seconds" | "cleaner">): string | null {
+ if (!i.media) return `Add the ${i.kind === "video" ? "video" : "audio"} to clean`;
+ if (i.silent) return i.kind === "video" ? "This video has no sound to clean" : "This file has no sound to clean";
+ if (i.engine === "cloud" && (i.cleaner ?? DEFAULT_CLEANER) === "veed" && i.seconds && i.seconds > VEED_MAX_SECONDS) return "VEED cleans up to 30 minutes — trim it first, or pick another cleaner";
+ return null;
+ }
+
+ /** Throws what's in the way (in words the page shows). */
+ export function planCleanDialogue(i: CleanDialogueInput): CleanDialoguePlan {
+ const problem = cleanDialogueProblem(i);
+ if (problem) throw new Error(problem);
+ const video = i.kind === "video";
+ const remux = video && i.remux !== false;
+ const name = nameOf(i);
+ const title = `Clean dialogue · ${name}`;
+ const seconds = i.seconds && i.seconds > 0 ? Math.round(i.seconds * 1000) / 1000 : undefined;
+ const timed = seconds ? { sourceDuration: seconds } : {};
+ const inputs = video ? { video: i.media } : { audio: i.media };
+ const base = { feature: CLEAN_DIALOGUE_FEATURE, batchTitle: title } satisfies Partial<GenerationRequest>;
+ const steps: ToolStep[] = [];
+
+ if (i.engine === "open") {
+ const bed = i.bed === undefined ? DEFAULT_BED : bedOf(i.bed);
+ const mode = dbsChannelsFor(i.stereo ? "each channel" : "mono", i.channels);
+ const level = bed === "off" ? OFF_DB : bed;
+ const extra: Record<string, unknown> = { channels: mode, voiceDb: 0, musicDb: level, effectsDb: level };
+ if (i.quality) extra.separationModel = DBS_MODELS[i.quality];
+ if (i.channels && i.channels > 0) extra.sourceChannels = Math.round(i.channels);
+ const of = remux ? 2 : 1;
+ steps.push({
+ key: "clean",
+ request: {
+ ...base,
+ modelId: OPEN_MODEL,
+ op: "separate-audio",
+ title: remux ? `${title} · soundtrack` : title,
+ inputs,
+ params: { extra, ...timed },
+ step: { label: bed === "off" ? "Dialogue only" : `Dialogue, music & effects at −${Math.abs(bed)} dB`, index: 0, of },
+ },
+ });
+ if (remux) {
+ steps.push({
+ key: "video",
+ after: ["clean"],
+ chain: [{ slot: "audio" }],
+ request: { ...base, modelId: OPEN_MUX_MODEL, op: "mux", title, inputs: { video: i.media }, step: { label: "Clean soundtrack · picture copied", index: 1, of } },
+ });
+ }
+ const surround = surroundSource(i.channels);
+ return {
+ steps,
+ length: seconds ?? null,
+ bed,
+ cleaner: null,
+ mode,
+ remux,
+ summary: `Takes the music and sound effects ${bed === "off" ? "out" : `down to −${Math.abs(bed)} dB under the dialogue`}${mode === "each channel" ? `, every channel on its own (${separationPasses(mode, i.channels)} passes)` : ""}${remux ? ", then puts it back on the picture (copied as it is)" : ""}.`,
+ notes: [
+ OPEN_NOTE,
+ ...(mode === "mono" && i.channels !== 1 && !surround ? ["The result is mono. Turn on Stereo to keep it stereo."] : []),
+ ...(surround ? [`This file has ${i.channels} channels: it is cleaned in mono, as ComfyUI saves mono or stereo only.`] : []),
+ ],
+ };
+ }
+
+ // Cloud
+ const cleaner = cleanerOf(i.cleaner ?? DEFAULT_CLEANER);
+ const extract = video && !cleaner.takesVideo;
+ const of = (extract ? 1 : 0) + 1 + (remux ? 1 : 0);
+ let index = 0;
+ if (extract) {
+ steps.push({
+ key: "sound",
+ request: { ...base, modelId: EXTRACT_MODEL, op: "separate-audio", title: `${title} · soundtrack`, inputs: { video: i.media }, params: { ...timed }, step: { label: "The video's soundtrack", index: index++, of } },
+ });
+ }
+ const strength = cleaner.id === "veed" && typeof i.strength === "number" && Number.isFinite(i.strength) ? Math.min(1, Math.max(0, i.strength)) : undefined;
+ steps.push({
+ key: "clean",
+ ...(extract && { after: ["sound"], chain: [{ slot: "audio" }] }),
+ request: {
+ ...base,
+ modelId: cleaner.model,
+ op: cleaner.op,
+ title: remux ? `${title} · voice` : title,
+ inputs: extract ? {} : inputs,
+ params: { ...timed, ...(strength !== undefined && { extra: { strength } }) },
+ step: { label: cleaner.label, index: index++, of },
+ },
+ });
+ if (remux) {
+ steps.push({
+ key: "video",
+ after: ["clean"],
+ chain: [{ slot: "audio" }],
+ request: { ...base, modelId: CLOUD_MUX_MODEL, op: "mux", title, inputs: { video: i.media }, params: { ...timed }, step: { label: "Clean voice back on the video", index: index++, of } },
+ });
+ }
+ return {
+ steps,
+ length: seconds ?? null,
+ bed: null,
+ cleaner: cleaner.id,
+ mode: null,
+ remux,
+ summary: `${cleaner.hint}${remux ? " Then the clean voice goes back on the video." : ""}`,
+ notes: [CLOUD_NOTE, ...(cleaner.id === "veed" ? ["VEED bills whole minutes, at least one, and returns 48 kHz mono at a steady loudness."] : [])],
+ };
+ }
+
+ /** About how long the open engine takes (DBS's split; the remix and mux add a second or two). */
+ export function cleanDialogueTime(o: { seconds: number; quality: SplitQuality; mode: DbsChannels; channels?: number | null; device?: string | null }): { low: number; high: number } {
+ return splitTime(o);
+ }
diff --cc src/lib/av/model3d.ts
index e85c4600,6b26793e..34e0b918
--- a/src/lib/av/model3d.ts
+++ b/src/lib/av/model3d.ts
@@@ -10,6 -12,8 +12,8 @@@ import { exactOrbitKeys, type ExactOrbi
export const MODEL3D_FEATURE = "image-to-3d";
/** The helper steps of a chain (the open text-to-3D still): kept out of the page's results and the Library. */
export const MODEL3D_STEP_FEATURE = "image-to-3d-step";
-/** "Film it photoreal" (N7-7): the photoreal orbits, listed with the models they were filmed from. */
++/** "Film it photoreal": the photoreal orbits, listed with the models they were filmed from. */
+ export const MODEL3D_FILM_FEATURE = "image-to-3d-film";
export type Model3dMode = "image" | "multi" | "text" | "objects" | "splat";
@@@ -55,8 -60,15 +60,15 @@@ export const MODELS_3D: Record<Model3dM
open: [],
},
splat: {
- cloud: [{ id: "triposplat", note: "A soft, photoreal 3D capture · ≈ $0.05" }],
- open: [{ id: "oss-triposplat", note: "A soft, photoreal 3D capture, with an orbit video" }],
+ cloud: [
+ { id: "triposplat", note: "A soft, photoreal 3D capture · ≈ $0.05" },
+ { id: "idol-3d", note: "One object from one picture · ≈ $0.10" },
+ ],
- // TripoSplat stays the default until Idol 3D is compared with it side by side (idol-3).
++ // TripoSplat stays the default until Idol 3D is compared with it side by side.
+ open: [
+ { id: "oss-triposplat", note: "A soft, photoreal 3D capture, with an orbit video" },
+ { id: "oss-idol", note: "One object from one picture, with an orbit video" },
+ ],
},
};
@@@ -267,6 -330,34 +333,34 @@@ export function animateSpinHref(v: Mode
return null;
}
+ // ---------------------------------------------------------------------------
-// Film it photoreal (build plan N7-7): a photoreal orbit whose geometry matches the 3D model
++// Film it photoreal: a photoreal orbit whose geometry matches the 3D model
+
+ /** The orbit "Film it photoreal" films: one level turn round the model, counter-clockwise seen from above. */
+ export const PHOTOREAL_ORBIT: ExactOrbit = { degrees: 360, direction: "ccw", tilt: 0, pulse: 0 };
+
+ /**
+ * The model's turntable angle (radians) for frame i of the path render: the camera moving round to the right is the
+ * model turning the other way under a still camera. One constant to flip if a GPU run shows the film turning against
+ * its render.
+ */
+ export const PHOTOREAL_TURN_SIGN: 1 | -1 = -1;
+ export function photorealAngle(i: number, frames = PATH_FRAMES): number {
+ const k = keyAt(exactOrbitKeys(PHOTOREAL_ORBIT), frames > 1 ? i / (frames - 1) : 0);
+ return (PHOTOREAL_TURN_SIGN * k.azimuth * Math.PI) / 180 + 0;
+ }
+
+ /**
+ * "Film it photoreal": the photo the model was made from, filmed going round it. Cloud: H3 Max camera-controls from the
+ * photo along the orbit. Open: Wan 2.1 + Uni3C from the photo, guided by the model recorded along the same orbit
+ * (`render`; the browser records the GLB, a splat hands its own orbit video). Null when there's no photo to start from.
+ */
+ export function photorealBody(v: Pick<Model3dView, "photo" | "poster">, engine: Engine, render?: string, still?: string) {
+ const image = v.photo ?? still;
+ if (!image) return null;
+ return { engine, image, orbit: PHOTOREAL_ORBIT, feature: MODEL3D_FILM_FEATURE, title: "Photoreal orbit", ...(engine === "open" && render && { render }) };
+ }
+
// ---------------------------------------------------------------------------
// Rig & animate (Meshy rigging on fal; cloud only — UniRig's ComfyUI pack isn't verified)
diff --cc src/lib/catalog/canvas.ts
index 8f72cfd3,7652aa37..f55b9362
--- a/src/lib/catalog/canvas.ts
+++ b/src/lib/catalog/canvas.ts
@@@ -13,9 -13,15 +13,15 @@@ import { QMA_MODEL } from "@/lib/qma"
import { getModel, getPreset, MODELS, supportsOp } from "./index";
import { dualEngine, onEngine, runsOn } from "./engines";
import { chainedWaitMessage, keyframeChain } from "./keyframes";
+ import { isSpeed, keyTimes, timingFor, timingProblem, type GapTiming, type InbetweenTiming } from "@/lib/inbetween";
import { estimateCost, inferOperation, planGeneration, routesFor, type Plan } from "./plan";
import { replacedBy, replacementOf } from "./replaced";
-import { REGEN_COPY, REGEN_MODEL } from "./regenerate";
+import { REGEN_COPY, REGEN_MODEL, REGEN_OFFERED } from "./regenerate";
+ import { compileWords, LAYOUT_PARAM, readLayout, type LayoutDraft } from "@/lib/layout-prompt";
+ import { fillLayout, layoutPlaceholders } from "@/lib/layout-surfaces";
+ import { FLY_MODELS, flyKeys, planFlyAround } from "./fly-around";
+ import type { CameraKey } from "@/lib/camera-path";
+ import type { ExactOrbit } from "@/lib/exact-orbit";
import {
OPERATION_LABELS,
OPERATION_OUTPUT,
@@@ -112,6 -122,14 +122,14 @@@ export interface CanvasNodeData
rows?: string[][];
/** Translate (video) on the open engine: the Translate & dub session it started (its result comes back from there). */
dubId?: string;
+ /** Layout: its boxes, one row per box (src/lib/layout-prompt.ts), drawn in the Layout editor. */
+ layout?: LayoutDraft;
- /** Camera path (N7-7): a preset (camera-path PATH_PRESETS), an exact orbit's numbers, or keys; the first set wins. */
++ /** Camera path: a preset (camera-path PATH_PRESETS), an exact orbit's numbers, or keys; the first set wins. */
+ pathPreset?: string;
+ orbit?: ExactOrbit;
+ keys?: CameraKey[];
+ /** Fly around: the clip's length in seconds (the cloud; your GPU always films about 5 s). */
+ duration?: number;
}
export interface CanvasNode {
@@@ -1307,6 -1438,96 +1438,96 @@@ function concatRequest(graph: CanvasGra
return { request: final.request, deps, steps };
}
+ /** A Camera path node's keys (a preset, an exact orbit or keys) and their words; none when it has nothing set. */
+ export function cameraPathOf(n: Pick<CanvasNode, "data">): { keys: CameraKey[]; label: string } {
+ return flyKeys(pathInputOf(n));
+ }
+
+ /** What a Camera path node holds, as the planner takes it: the orbit's numbers, a preset, or keys. */
+ function pathInputOf(n: Pick<CanvasNode, "data">) {
+ const d = n.data;
+ return d.orbit ? { orbit: d.orbit } : d.pathPreset ? { preset: d.pathPreset } : { keys: d.keys };
+ }
+
+ /**
- * Fly around (N7-7): the still (the first image, top to bottom; any more are other views of the subject) filmed along the
++ * Fly around: the still (the first image, top to bottom; any more are other views of the subject) filmed along the
+ * connected Camera path, as src/lib/catalog/fly-around.ts plans it. Cloud: H3 Max camera-controls, or with views H3 Max
+ * reference-to-video. Your GPU: MoGe 2's depth of the still, then Wan 2.1 + Uni3C along the server's render of the path.
+ */
+ function flyAroundRequest(graph: CanvasGraph, n: CanvasNode, model: ModelDef): NodeRequest | { error: string } {
+ const nodes = nodeMap(graph);
+ const into = (port: InputPortId) =>
+ incoming(graph, n.id)
+ .filter((e) => e.targetHandle === port && nodes.has(e.source))
+ .map((e) => nodes.get(e.source)!)
+ .sort(byPosition);
+ const pathNode = into("path")[0];
+ if (!pathNode) return { error: "Connect a Camera path" };
+ if (pathNode.type !== "camera-path") return { error: `${nodeLabel(pathNode)} can't go into Camera path` };
+ const { keys } = cameraPathOf(pathNode);
+ if (keys.length < 2) return { error: `Pick a move in “${nodeLabel(pathNode)}”` };
+ const words: string[] = [];
+ for (const s of into("prompt")) {
+ const src = sourceOf(graph, s);
+ if ("error" in src) return src;
+ if (src.kind !== "text") return { error: "Fly around takes typed words: connect a Text prompt" };
+ if (src.text) words.push(src.text);
+ }
+ const pictures: Source[] = [];
+ for (const s of into("images")) {
+ if (outputType(graph, s) !== "image") return { error: `${nodeLabel(s)} can't go into Still, then views` };
+ const src = sourceOf(graph, s);
+ if ("error" in src) return src;
+ pictures.push(src);
+ }
+ if (!pictures.length) return { error: "Connect the still to film" };
+ const urlOf = (src: Source) => (src.kind === "media" ? src.url : PLACEHOLDER.image);
+ const plan = planFlyAround({
+ engine: model.engine,
+ image: urlOf(pictures[0]),
+ views: pictures.slice(1).map(urlOf),
+ // The node's own numbers or move (not only its keys): with views, the cloud turns the camera from their words.
+ ...pathInputOf(pathNode),
+ prompt: words.join(". ") || undefined,
+ duration: n.data.duration,
+ resolution: n.data.params?.resolution,
+ feature: "canvas",
+ title: nodeLabel(n),
+ });
+ if (plan.blocker) return { error: plan.blocker };
+ // Pictures from other nodes go in as chain slots, in board order; the planner's stand-ins for them come out.
+ const deps: string[] = [];
+ const fromNodes = pictures.flatMap((src) => (src.kind === "node" ? [src.nodeId] : []));
+ for (const id of fromNodes) if (!deps.includes(id)) deps.push(id);
+ const steps: NodeStep[] = plan.steps.map((st) => {
+ // A step takes as many pictures as the planner gave it (the depth and the film: the still; references: all of them).
+ const taken = st.request.inputs?.images?.length ?? 0;
+ const mine = pictures.slice(0, taken);
+ const slots: ChainSlot[] = [];
+ const from: StepSource[] = [];
+ let literal = false;
+ for (const src of mine) {
+ if (src.kind === "node") {
+ slots.push({ slot: "images", position: literal ? "last" : "first" });
+ from.push({ node: src.nodeId });
+ } else literal = true;
+ }
+ for (const [i, c] of (st.request.chain ?? []).entries()) {
+ slots.push(c);
+ from.push({ step: st.after![i] });
+ }
+ const images = mine.flatMap((src) => (src.kind === "media" ? [src.url] : []));
+ const inputs = { ...st.request.inputs, images: images.length ? images : undefined };
+ return {
+ key: st.key,
+ request: { ...st.request, feature: st.key === "main" ? "canvas" : CANVAS_STEP_FEATURE, inputs, ...(slots.length ? { chain: slots } : { chain: undefined }) },
+ from,
+ };
+ });
+ const main = steps.find((st) => st.key === "main")!;
+ return { request: main.request, deps, steps };
+ }
+
/** A Translate node set to video with no cloud model allowed: where the open engine dubs. */
export const OPEN_DUB_HINT = "Dubbing a video on a canvas runs on the cloud (ElevenLabs Dubbing, HeyGen). On the open engine it's made in Translate & dub, where you check the translation before it's spoken: start it from here";
diff --cc src/lib/catalog/cinema.ts
index 9edabf64,7b648f80..f264a7be
--- a/src/lib/catalog/cinema.ts
+++ b/src/lib/catalog/cinema.ts
@@@ -218,6 -220,11 +220,11 @@@ export interface CinemaGenerateInput
prompt: string;
/** # camera moves, in order. */
moves?: string[];
+ /**
- * The first move as an exact orbit (build plan N7-7): an orbit move (drone-orbit, arc-left, arc-right, bullet-time) with
++ * The first move as an exact orbit: an orbit move (drone-orbit, arc-left, arc-right, bullet-time) with
+ * the Exact switch on follows these numbers instead of a LoRA's or the prompt's idea of an orbit.
+ */
+ exact?: Partial<ExactOrbit>;
settings: DirectorSettings;
brief?: string;
/** Reference images (the first one is the start frame). @elements add theirs on the server. */
@@@ -1480,7 -1488,27 +1488,27 @@@ function clipModel(model: ModelDef, inp
return instead;
}
+ /**
- * An exact orbit (build plan N7-7): the first move, an orbit with the Exact switch on, filmed from the start frame along
++ * An exact orbit: the first move, an orbit with the Exact switch on, filmed from the start frame along
+ * the orbit's numbers as Fly around plans it (src/lib/catalog/fly-around.ts): H3 Max camera-controls on the cloud; on your
+ * GPU, MoGe 2's depth, the server's render of the path and Uni3C. The other moves and the Director's words stay words.
+ */
+ function planExactVideo(input: CinemaGenerateInput): CinemaPlan | null {
+ const moves = (input.moves ?? []).filter((m) => moveBySlug(m));
+ if (!input.exact || !takesExact(moves[0])) return null;
+ const orbit = normalizeExact(input.exact, exactDefaults(moves[0]));
+ const image = input.images?.[0];
+ const compiled = compileDirector({ prompt: input.prompt, settings: input.settings, moves: moves.slice(1), brief: input.brief, mode: "video", target: "prompt" });
+ const plan = planFlyAround({ engine: input.engine, image, orbit, prompt: compiled.prompt, duration: input.duration, resolution: input.resolution, feature: "cinema" });
+ const notes = [`${moveBySlug(moves[0])!.name} follows your numbers exactly: ${exactSummary(orbit)}`, ...plan.notes];
+ if ((input.images?.length ?? 0) > 1) notes.push("An exact orbit films from the first image alone");
+ const blocker = !image ? "Add a start frame to film an exact orbit" : plan.blocker;
+ return finish(plan.model, plan.steps, notes, blocker);
+ }
+
function planVideo(input: CinemaGenerateInput, ctx: CinemaContext): CinemaPlan {
+ const exact = planExactVideo(input);
+ if (exact) return exact;
const notes: string[] = [];
const engine = input.engine;
const open = engine === "open";
diff --cc src/lib/catalog/faceless.ts
index aa582fbd,d624a03c..922cbfd2
--- a/src/lib/catalog/faceless.ts
+++ b/src/lib/catalog/faceless.ts
@@@ -605,6 -607,8 +607,8 @@@ export interface EngineModels
longNarration: string;
narrationMaxChars: number;
music: string;
- /** Other music models the settings offer for the bed (nm10-music3), each with the longest bed it makes (MUSIC_MAX). */
++ /** Other music models the settings offer for the bed, each with the longest bed it makes (MUSIC_MAX). */
+ musicChoices: string[];
/** Extends a bed the music model can't make long enough (crossfaded on the open engine, whole plays on the cloud). */
loop: string;
/** Frame by frame: the camera move over each still (Ken Burns). */
diff --cc src/lib/catalog/fly-around.ts
index 00000000,4f27086d..6d7a1969
mode 000000,100644..100644
--- a/src/lib/catalog/fly-around.ts
+++ b/src/lib/catalog/fly-around.ts
@@@ -1,0 -1,192 +1,192 @@@
+ /**
- * Fly around (build plan N7-7; research new-models-7.md §3.10 rows 3-5): a still filmed along an exact camera path, with no
++ * Fly around (research new-models-7.md §3.10 rows 3-5): a still filmed along an exact camera path, with no
+ * browser view of its scene. Fuobe DoP's and Cinema's exact orbits, Image to 3D's "Film it photoreal", Canvas's "Fly
- * around" node and Assist's fly_around tool all plan through here, on N7-5's models:
++ * around" node and Assist's fly_around tool all plan through here, on Fly path's models:
+ *
+ * - Open engine: MoGe 2 (oss-scene-moge) makes the still's depth, the server renders the path through that depth as a point
+ * cloud (src/server/path-render.ts, ChainSlot.render "path"), and Wan 2.1 + Uni3C (oss-uni3c-path) films the still along
+ * it. With a render already made (Image to 3D records its model along the path in the browser), the depth step is skipped.
+ * - Cloud: H3 Max camera-controls with the path as its keyframes. With reference views (Canvas "Fly around" with views),
- * MiniMax H3 Max reference-to-video takes the still and the views, and the path goes in words (N7-6's References route).
++ * MiniMax H3 Max reference-to-video takes the still and the views, and the path goes in words (the References route).
+ *
+ * Pure: the browser prices it, the server runs the same steps (src/server/fly-around.ts).
+ */
+
+ import { DEFAULT_MOTION, MAX_KEYS, PATH_FPS, PATH_FRAMES, PATH_PRESETS, normalizeKeys, presetKeys, toH3MaxTrajectory, type CameraKey } from "@/lib/camera-path";
+ import { exactOrbitKeys, exactSummary, exactWords, type ExactOrbit } from "@/lib/exact-orbit";
+ import { getModel, getPreset } from "./index";
+ import { onEngine } from "./engines";
+ import { estimateCost, planGeneration } from "./plan";
+ import type { Engine, GenerationRequest, GenParams, ModelDef } from "./types";
+
-/** What films a path on each engine (N7-5's), what makes the depth on the open engine, and the cloud's route with views. */
++/** What films a path on each engine , what makes the depth on the open engine, and the cloud's route with views. */
+ export const FLY_MODELS = { open: "oss-uni3c-path", cloud: "minimax-h3-max-camera", depth: "oss-scene-moge", views: "minimax-h3-max" } as const;
+ /** The cloud's lengths; the open engine always makes 81 frames at 16 fps (about 5 s). */
+ export const FLY_DURATIONS = [3, 5, 8, 10, 15];
+ export const FLY_VIEWS_MAX = 8;
+ /** MoGe's scene for a render only needs its depth picture: a lighter mesh. */
+ const DEPTH_DECIMATION = 4;
+
+ export interface FlyAroundInput {
+ engine: Engine;
+ /** The still to film (the first frame). */
+ image?: string;
+ /** Other views of the subject (cloud: references; the open engine films from the still alone). */
+ views?: string[];
+ /** The path: an exact orbit, a preset id (camera-path PATH_PRESETS, orbit_<N>_cw…) or keys. The first that is given wins. */
+ orbit?: Partial<ExactOrbit>;
+ preset?: string;
+ keys?: CameraKey[];
+ /** A render of the path made already (Image to 3D's model recorded in the browser): the open engine's guide. */
+ render?: string;
+ prompt?: string;
+ duration?: number;
+ resolution?: string;
+ feature?: string;
+ title?: string;
+ seed?: number;
+ }
+
+ export interface FlyStep {
+ key: string;
+ request: GenerationRequest;
+ after?: string[];
+ }
+
+ export interface FlyAroundPlan {
+ engine: Engine;
+ model: ModelDef;
+ keys: CameraKey[];
+ /** The path in words, for the result's caption ("360° counter-clockwise · level"). */
+ label: string;
+ steps: FlyStep[];
+ notes: string[];
+ blocker?: string;
+ costUsd: number | null;
+ /** Seconds of film. */
+ duration: number;
+ }
+
+ /** The keys a request asks for: an orbit's numbers, a preset or keys, from the photo's pose. Empty when none is given. */
+ export function flyKeys(input: Pick<FlyAroundInput, "orbit" | "preset" | "keys">): { keys: CameraKey[]; label: string } {
+ if (input.orbit) return { keys: exactOrbitKeys(input.orbit), label: exactSummary(input.orbit) };
+ const fromPreset = input.preset ? presetKeys(input.preset) : null;
+ if (fromPreset) return { keys: fromPreset, label: input.preset!.replace(/_/g, " ") };
+ const keys = input.keys?.length ? normalizeKeys(input.keys).slice(0, MAX_KEYS) : [];
+ return { keys, label: keys.length > 1 ? `${keys.length} keyframes` : "" };
+ }
+
+ const tidy = (p: string | undefined) => (p ?? "").trim();
+
+ /** The path in words, for a model that turns the camera from words (H3 Max reference-to-video): the orbit's numbers or the move. */
+ export function pathWords(input: Pick<FlyAroundInput, "orbit" | "preset">): string {
+ if (input.orbit) return exactWords(input.orbit);
+ const move = input.preset && PATH_PRESETS.find((p) => p.id === input.preset);
+ if (move) return `The camera moves: ${move.name}, ${move.description.charAt(0).toLowerCase()}${move.description.slice(1)}`;
+ const sweep = input.preset && /^orbit_(\d+(?:\.\d+)?)(?:_(cw|ccw))?$/.exec(input.preset);
+ if (sweep) return exactWords({ degrees: Number(sweep[1]), direction: sweep[2] === "cw" ? "cw" : "ccw" });
+ return "The camera flies around the subject";
+ }
+
+ function stepCost(req: GenerationRequest, engine: Engine): number | null {
+ const lookup = (id: string) => {
+ const m = getModel(id);
+ return m && onEngine(m, engine);
+ };
+ // Chained inputs are priced with stand-ins (the render a step makes first).
+ const filled: GenerationRequest = req.chain?.some((c) => c.slot === "video") ? { ...req, inputs: { ...req.inputs, video: "/api/files/placeholder.mp4" } } : req;
+ const p = planGeneration(filled, lookup, getPreset);
+ return estimateCost(p.model, p.params, 1, p.op);
+ }
+
+ /** Plan a fly-around: the steps each engine runs, priced (free on the open engine), and what it still needs. */
+ export function planFlyAround(input: FlyAroundInput): FlyAroundPlan {
+ const { engine } = input;
+ const feature = input.feature ?? "fly-around";
+ const { keys, label } = flyKeys(input);
+ const views = (input.views ?? []).filter(Boolean).slice(0, FLY_VIEWS_MAX);
+ const notes: string[] = [];
+ const seed = input.seed !== undefined ? { seed: input.seed } : {};
+ const title = input.title ? { title: input.title } : {};
+ const steps: FlyStep[] = [];
+ let model: ModelDef;
+ let duration: number;
+ const image = input.image;
+ if (engine === "open") {
+ model = getModel(FLY_MODELS.open)!;
+ duration = Math.round((PATH_FRAMES / PATH_FPS) * 10) / 10;
+ const resolution = model.options.resolutions?.find((r) => r.toLowerCase() === input.resolution?.toLowerCase()) ?? "480p";
+ const params: GenParams = { numOutputs: 1, aspectRatio: "auto", resolution, cameraPath: keys, ...seed };
+ const prompt = tidy(input.prompt) || DEFAULT_MOTION;
+ if (input.render) {
+ notes.push(`Wan 2.1 starts from the still and Uni3C keeps its camera on your render of the path — ${PATH_FRAMES} frames at ${PATH_FPS} fps (${duration} s) on your GPU`);
+ steps.push({ key: "main", request: { feature, modelId: model.id, op: "camera-path", prompt, ...title, inputs: image ? { images: [image], video: input.render } : undefined, params } });
+ } else {
+ const depth = getModel(FLY_MODELS.depth)!;
+ notes.push(
+ `MoGe 2 measures the still's depth, the studio renders the path through it, then Wan 2.1 films the still along that render with Uni3C — ${PATH_FRAMES} frames at ${PATH_FPS} fps (${duration} s) on your GPU, which needs about 48 GB`,
+ );
+ steps.push({
+ key: "depth",
+ request: { feature, modelId: depth.id, op: "scene-3d", prompt: "", inputs: image ? { images: [image] } : undefined, params: { numOutputs: 1, extra: { decimation: DEPTH_DECIMATION } }, step: { label: "Depth of the still", index: 0, of: 2 } },
+ });
+ steps.push({
+ key: "main",
+ request: { feature, modelId: model.id, op: "camera-path", prompt, ...title, inputs: image ? { images: [image] } : undefined, chain: [{ slot: "video", render: "path" }], params, step: { label: "Film along the path", index: 1, of: 2 } },
+ after: ["depth"],
+ });
+ }
+ if (views.length) notes.push("Your other views aren't used on your GPU: it films from the still alone");
+ } else if (views.length) {
+ model = getModel(FLY_MODELS.views)!;
+ duration = nearest(model.options.durations ?? FLY_DURATIONS, input.duration ?? 5);
+ const resolution = model.options.resolutions?.find((r) => r.toLowerCase() === input.resolution?.toLowerCase()) ?? model.defaults?.resolution;
+ const max = model.options.maxImages ?? 9;
+ const images = image ? [image, ...views].slice(0, max) : views.slice(0, max);
+ if (1 + views.length > max) notes.push(`${model.name} takes up to ${max} pictures: the rest are left out`);
+ const words = pathWords(input);
+ steps.push({
+ key: "main",
+ request: {
+ feature,
+ modelId: model.id,
+ op: "ref2v",
+ prompt: `${words}. Image 1 is the first frame; the other images show the same subject from other sides. ${tidy(input.prompt) || DEFAULT_MOTION}`,
+ ...title,
+ inputs: { images },
+ params: { numOutputs: 1, duration, ...(resolution ? { resolution } : {}), ...seed },
+ },
+ });
+ notes.push(`${model.name} takes the still and your ${views.length} view${views.length === 1 ? "" : "s"} as references and turns the camera from the words: the sides hold, the path is loose`);
+ } else {
+ model = getModel(FLY_MODELS.cloud)!;
+ const range = model.routes[0]?.map?.ranges?.duration;
+ duration = Math.min(range?.max ?? 15, Math.max(Math.max(1, range?.min ?? 1), Math.round((input.duration ?? 5) * 10) / 10));
+ const resolution = model.options.resolutions?.find((r) => r.toLowerCase() === input.resolution?.toLowerCase()) ?? model.defaults?.resolution;
+ if (keys.length > 1) {
+ const cam = toH3MaxTrajectory(keys);
+ notes.push("trajectory" in cam ? `H3 Max follows the ${cam.trajectory.length} keyframes from the still, with prompt expansion off` : cam.notes[0]);
+ if ("trajectory" in cam) notes.push(...cam.notes);
+ }
+ steps.push({
+ key: "main",
+ request: { feature, modelId: model.id, op: "camera-path", prompt: tidy(input.prompt) || DEFAULT_MOTION, ...title, inputs: image ? { images: [image] } : undefined, params: { numOutputs: 1, duration, ...(resolution ? { resolution } : {}), cameraPath: keys, ...seed } },
+ });
+ }
+ let blocker = !image ? "Add the still to film" : keys.length < 2 && !(engine === "cloud" && views.length) ? "Pick a path first" : undefined;
+ let cost: number | null = 0;
+ for (const s of steps) {
+ try {
+ const priced: GenerationRequest = s.request.inputs?.images?.length ? s.request : { ...s.request, inputs: { ...s.request.inputs, images: ["/api/files/placeholder.png"] } };
+ const c = stepCost(priced, engine);
+ cost = c === null || cost === null ? null : cost + c;
+ } catch (e) {
+ blocker ??= (e as Error).message;
+ }
+ }
+ return { engine, model, keys, label, steps, notes, ...(blocker && { blocker }), costUsd: cost === null ? null : Math.round(cost * 1000) / 1000, duration };
+ }
+
+ function nearest(list: number[], n: number): number {
+ return list.reduce((best, x) => (Math.abs(x - n) < Math.abs(best - n) ? x : best), list[0] ?? n);
+ }
diff --cc src/lib/catalog/lora-library.generated.ts
index a0feecc1,033f2bbd..1e1ca536
--- a/src/lib/catalog/lora-library.generated.ts
+++ b/src/lib/catalog/lora-library.generated.ts
@@@ -3373,6 -3351,53 +3373,53 @@@ export const LORA_LIBRARY: LoraEntry[]
},
"released": "2026-10-13",
"notes": "Rank-64 edit LoRA trained with AI-Toolkit for 3,000 steps at 512 and 1024 px on photo and Blender pairs covering all 96 views. Prompt: \"<qma> {azimuth} {elevation} {distance}\", 8 azimuths (front view, front-right quarter view, right side view, back-right quarter view, back view, back-left quarter view, left side view, front-left quarter view) relative to the ORIGINAL CAMERA (\"right side view\" = the camera swings 90 degrees to its own right), 4 elevations (low-angle, eye-level, elevated, high-angle shot), 3 distances (close-up, medium shot, wide shot); more edit words may follow. Card settings: strength 1.0, 30 steps, CFG 3, euler / simple, about 1 MP (768 px for previews). Quarter views, elevated shots and distance changes are the most reliable; big orbits on wide landscapes can stop short of 90 degrees. fal hosts Qwen-Image 2.1 (fal-ai/qwen-image-2.1, fal-ai/qwen-image-2.1/edit, read 2026-11-02) without a LoRA input, and Replicate has no Qwen-Image 2.1, so QMA runs on your GPU only."
+ },
+ {
+ "key": "anisora-3-2-i2v-high",
+ "name": "AniSora 3.2 for Wan 2.2 I2V A14B, high-noise expert (bilibili Index-AniSora, extracted by Kijai)",
+ "file": "Wan2_2_I2V_AniSora_3_2_HIGH_rank_64_fp16.safetensors",
+ "url": "https://huggingface.co/Kijai/WanVideo_comfy/resolve/8260d429d19fd7a72304cad059160b95d843913f/LoRAs/AniSora/Wan2_2_I2V_AniSora_3_2_HIGH_rank_64_fp16.safetensors",
+ "page": "https://huggingface.co/Kijai/WanVideo_comfy/tree/main/LoRAs/AniSora",
+ "strength": 1.0,
+ "base": "wan2.2-i2v-a14b",
+ "download": "direct",
+ "group": "adapter",
+ "target": "high",
+ "version": "8260d429d19fd7a72304cad059160b95d843913f",
+ "sha256": "bdc68451d6bccd6efb70f6eb916ede7cc470e3b6dacd0273da528246334095da",
+ "sizeBytes": 630695648,
+ "licence": {
+ "commercial": true,
+ "hostedOk": true,
+ "snapshotDate": "2026-11-02",
+ "name": "Apache-2.0 (bilibili's Index-AniSora weights: GitHub bilibili/Index-anisora LICENSE and the HF card IndexTeam/Index-anisora, V3.2 released 2025-09-23); Kijai's rank-64 extraction repository states no licence of its own"
+ },
+ "released": "2025-09-27",
+ "hostedEndpoint": "fal-ai/wan/v2.2-a14b/image-to-video/lora (transformer=high, end_image_url, num_frames 17-161)",
- "notes": "The difference between bilibili's AniSora V3.2 (anime motion trained on Wan 2.2 I2V A14B) and the base high-noise expert, extracted at rank 64 by Kijai (file last changed in commit f32501d0, 2025-09-27). The source of the file the owner's 'Keyframes to Full Character Animation' graph loads at strength 1.0 on the high-noise expert, with the lightx2v 4-step LoRA on the low-noise expert, 4 steps at CFG 1 (high 0-2, low 2-end), shift 5. Only a high-noise file exists."
++ "notes": "The difference between bilibili's AniSora V3.2 (anime motion trained on Wan 2.2 I2V A14B) and the base high-noise expert, extracted at rank 64 by Kijai (file last changed in commit f32501d0, 2025-09-27). The source of the file the 'Keyframes to Full Character Animation' graph loads at strength 1.0 on the high-noise expert, with the lightx2v 4-step LoRA on the low-noise expert, 4 steps at CFG 1 (high 0-2, low 2-end), shift 5. Only a high-noise file exists."
+ },
+ {
+ "key": "wan22-i2v-lightx2v-4step-low",
+ "name": "Lightx2v 4-step for Wan 2.2 I2V A14B, low-noise expert (Comfy-Org repack)",
+ "file": "wan2.2_i2v_lightx2v_4steps_lora_v1_low_noise.safetensors",
+ "url": "https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/ee6f4a40737a995bf5818954cfce6d59443b0f04/split_files/loras/wan2.2_i2v_lightx2v_4steps_lora_v1_low_noise.safetensors",
+ "page": "https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged",
+ "strength": 1.0,
+ "base": "wan2.2-i2v-a14b",
+ "download": "direct",
+ "group": "adapter",
+ "target": "low",
+ "version": "ee6f4a40737a995bf5818954cfce6d59443b0f04",
+ "sha256": "024f21de095bc8fad9809ded3e9e49a2e170dcf27075da8145ba7d60d8aab7f9",
+ "sizeBytes": 1226977424,
+ "licence": {
+ "commercial": true,
+ "hostedOk": true,
+ "snapshotDate": "2026-11-02",
+ "name": "Apache-2.0 (the Comfy-Org repack's card; LightX2V's Wan2.2-Lightning is Apache-2.0)"
+ },
+ "released": "2025-08-07",
+ "notes": "The repository now answers as Comfy-Org/Wan-2.2 (Hugging Face redirects the old name). The open graph loads it on the low-noise expert so the in-betweens take 4 steps; in the cloud fal's own acceleration takes its place (fal's endpoint runs its own step count), so it is never sent there."
}
];
diff --cc src/lib/catalog/marketing.ts
index 55c83bfa,0b6e9cec..54155310
--- a/src/lib/catalog/marketing.ts
+++ b/src/lib/catalog/marketing.ts
@@@ -975,10 -975,36 +975,36 @@@ export const MARKETING_IMAGE_NOTE: Reco
* Whether a run's words are set over the picture in the browser (an open model, or the Original on either engine), not
* drawn by the model (GPT Image 2.5, Ideogram, Recraft, Nano Banana Pro in the cloud).
*/
- export const wordsOnTop = (engine: Engine, modelId: string): boolean => engine === "open" || modelId === MARKETING_IMAGE_MODEL;
+ export const wordsOnTop = (engine: Engine, modelId: string, drawn = false): boolean => !drawn && (engine === "open" || modelId === MARKETING_IMAGE_MODEL);
+
+ /**
- * "Words drawn by the model" (N7-8), a choice on the formats with words (Ads, Poster, Marketplace) and in Ads Studio:
++ * "Words drawn by the model", a choice on the formats with words (Ads, Poster, Marketplace) and in Ads Studio:
+ * the copy's places (planAd, src/lib/layout-surfaces.ts) become a layout, and a model that reads boxes draws the
+ * headline, the button and the product in them. Setting the words on top in the browser stays the default: it gives
+ * your exact fonts. MOSS-Image on your GPU; MOSS-Image hosted on fal, Ideogram 4.5 or FLUX.3 in the cloud, each with
+ * prompt expansion off (src/lib/catalog/plan.ts planLayout).
+ */
+ export const DRAWN_WORDS_MODELS: Record<Engine, ModelChoice[]> = {
+ open: [{ id: "oss-moss-image", name: "MOSS-Image", note: "MOSS-Image on your GPU · draws your words in place, free" }],
+ cloud: [
+ { id: "moss-image", name: "MOSS-Image", note: "MOSS-Image, hosted on fal · draws your words in place" },
+ { id: "ideogram-4-5", name: "Ideogram 4.5", note: "Draws the exact text in place and keeps your product photo" },
+ { id: "flux-3", name: "FLUX.3", note: "Draws the text in place and keeps your product photo" },
+ ],
+ };
+
+ export const DRAWN_WORDS_LABEL = "Words drawn by the model";
+ /** The option's hint, beside the default it leaves alone. */
+ export const DRAWN_WORDS_HINT = "The headline and button are drawn into the picture, in their places. Off: they're set on top in your brand fonts, letter for letter.";
+
+ /** The model that draws the words on an engine: the one asked for when it is a choice there, else the first. */
+ export function drawnWordsModel(engine: Engine, asked?: string | null): string {
+ return asked && DRAWN_WORDS_MODELS[engine].some((c) => c.id === asked) ? asked : DRAWN_WORDS_MODELS[engine][0].id;
+ }
/** The models a Marketing Studio format can use on an engine, the default first: the Original for every image format. */
- export function formatModels(format: FormatDef, engine: Engine, has: { product: boolean; avatar: boolean }): ModelChoice[] {
+ export function formatModels(format: FormatDef, engine: Engine, has: { product: boolean; avatar: boolean }, drawn = false): ModelChoice[] {
+ if (drawn && format.text && format.pipeline === "image") return DRAWN_WORDS_MODELS[engine];
const original: ModelChoice = { id: MARKETING_IMAGE_MODEL, note: MARKETING_IMAGE_NOTE[engine] };
if (engine === "open") {
switch (format.pipeline) {
diff --cc src/lib/catalog/models.ts
index 4d647514,18e7336e..3cf0a2dd
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@@ -4,12 -4,12 +4,13 @@@ import { ASR_LANGUAGES, WHISPER_LANGUAG
import { PROMPT_HELPER_PARAM } from "@/lib/comfy";
import { QWEN21_DECODER, QWEN21_GPU, QWEN21_SPEED } from "@/lib/qwen21-speed";
import { QMA_AZIMUTHS, QMA_AZIMUTH_LABELS, QMA_DISTANCES, QMA_DISTANCE_LABELS, QMA_DISTANCE_ZOOM, QMA_ELEVATIONS, QMA_ELEVATION_DEGREES, QMA_ELEVATION_LABELS, QMA_MODEL, QMA_PARAMS } from "@/lib/qma";
+ import { H3_DECODER, H3_FAST_DECODE_OFFERED, H3_GPU_TIER } from "@/lib/gpu/h3-tier";
import { loraEntry, loraRef } from "./loras";
-import { ANGLES_LORA, MOSAIC_SCALE, MOSAIC_TARGET, SPEAK_GRAPH, SPEAK_LORA, SPEAK_PROMPT } from "./open-tools";
+import { ANGLES_LORA, ANY_ANGLE_LORA, MOSAIC_SCALE, MOSAIC_TARGET, SPEAK_GRAPH, SPEAK_LORA, SPEAK_PROMPT } from "./open-tools";
+import { ANY_ANGLE } from "./any-angle";
import { CINEMA_CROP, SOUL_ASPECTS, SOUL_TIERS } from "./soul";
import { RESTORE, offlineRestorePrompt } from "./restore";
-import { REGEN_COPY, REGEN_DEFAULT_TIER, REGEN_MODEL, REGEN_TIERS, REGEN_WORKFLOW } from "./regenerate";
+import { REGEN_COPY, REGEN_DEFAULT_TIER, REGEN_MODEL, REGEN_OFFERED, REGEN_TIERS, REGEN_WORKFLOW } from "./regenerate";
import { COMPOSITE_MODEL, COMPOSITE_WORKFLOW } from "./sharpen";
import { denoiseFor, EVOLUTION, EVOLUTION_DEFAULT_RESOLUTION, EVOLUTION_RESOLUTIONS, INTENSITIES, type Intensity } from "./evolution";
import { LAST_FRAME_CHAIN, type ModelDef, type ModelOptions, type ModelRoute, type Operation } from "./types";
@@@ -671,6 -677,37 +678,37 @@@ const open: ModelDef[] =
options: { multiShot: CONCAT_SHOTS, aspectRatios: VID_AR, durations: [3, 5, 7], resolutions: ["480p", "720p"], seed: true, negativePrompt: true, endFrame: true },
defaults: { aspectRatio: "16:9", duration: 5, resolution: "480p" },
}),
- // MiniMax H3 on 8-31 GB cards (nm10-h3-any-gpu): FastVideo's FastH3 V2 and FastH3 Trim, which MiniMax H3's GPU tier picks
++ // MiniMax H3 on 8-31 GB cards: FastVideo's FastH3 V2 and FastH3 Trim, which MiniMax H3's GPU tier picks
+ // (Auto on a smaller card, or asked for: src/server/h3-gpu.ts). Listed for their licence, their switch in Models & licences
+ // and the pre-flight's readiness; never in a picker. The speeds and the 8 GB figure are FastVideo's measurements.
+ o({
+ id: "oss-minimax-h3-fast",
+ name: "MiniMax H3 · FastH3 V2",
+ vendor: "FastVideo",
+ family: "minimax-h3",
+ kind: "video",
+ tagline: "MiniMax H3 in 8 steps on a 16 GB GPU, from words, a start frame, or start and end frames · MiniMax H3 Community License",
+ routes: [
+ comfy("t2v", "minimax-h3-fast-t2v", "FastH3 V2, 8 steps"),
+ comfy("i2v", "minimax-h3-fast-i2v", "FastH3 V2, 8 steps; the clip takes the start frame's shape"),
+ comfy("flf2v", "minimax-h3-fast-flf2v", "FastH3 V2, 8 steps; the clip takes the start frame's shape"),
+ ],
+ options: { aspectRatios: ["auto", "16:9", "9:16", "1:1", "4:3", "3:4"], durations: [3, 5, 10, 15], resolutions: ["768p"], seed: true, endFrame: true, audio: "always", promptFormat: "minimax-h3" },
+ defaults: { aspectRatio: "auto", duration: 5, resolution: "768p" },
+ hidden: true,
+ }),
+ o({
+ id: "oss-minimax-h3-trim",
+ name: "MiniMax H3 · FastH3 Trim",
+ vendor: "FastVideo",
+ family: "minimax-h3",
+ kind: "video",
+ tagline: "MiniMax H3 from words on an 8-12 GB GPU: experimental, below FastH3 V2 in quality · MiniMax H3 Community License",
+ routes: [comfy("t2v", "minimax-h3-trim-t2v", "FastH3 Trim, 8 steps, experimental")],
+ options: { aspectRatios: ["16:9", "9:16", "1:1", "4:3", "3:4"], durations: [3, 5, 10, 15], resolutions: ["768p"], seed: true, audio: "always", promptFormat: "minimax-h3" },
+ defaults: { aspectRatio: "16:9", duration: 5, resolution: "768p" },
+ hidden: true,
+ }),
o({
id: "oss-wan22-5b",
name: "Wan 2.2 5B",
@@@ -1209,6 -1164,19 +1247,19 @@@
routes: [comfy("remove-object", "video-person-remove-h3-relay", "H3 Relay Person Removal: the person painted green, 22-frame windows with 18 of history from the clean first frame (image), 12 steps, silent")],
options: { seed: true, maxImages: 1 },
}),
- // Its mask first (o/person-remover-plus): the removal graph's own SAM 3.1 chain on the part's first seconds, the person
++ // Its mask first: the removal graph's own SAM 3.1 chain on the part's first seconds, the person
+ // filled green exactly as H3 will see them. Run by Remove object's "Preview the mask", not the composer.
+ o({
+ id: "oss-h3-removal-mask",
+ name: "SAM 3.1 green mask · H3 Person Removal",
+ vendor: "Meta × Akatz Labs",
+ family: "sam",
+ kind: "video",
+ tagline: "Who H3 Person Removal will take out: SAM 3.1 finds them, the mask is grown and filled green over the first seconds",
+ routes: [comfy("bg-remove-video", "video-person-remove-h3-mask", "SAM 3.1 detect + track, threshold 0.5, grown maskGrow px, filled green: the removal's own mask")],
+ options: {},
+ hidden: true,
+ }),
// Character Swap Studio (/character-swap, o/h3-studio): Akatz Labs' workbench for whole clips. A segment is one H3 Relay
// pass (its approved mask, anchor and the previous take's lossless master as history); a mask is SAM 3.1 on any frame
// of a shot, spliced into the version it corrects. Both run through the studio, not the composer.
@@@ -1431,9 -1372,35 +1482,35 @@@
kind: "audio",
tagline: "Open music generation with lyrics",
routes: [comfy("music", "music-ace-step-15")],
- options: { durations: [30, 60, 120, 180], seed: true },
+ options: { durations: [30, 60, 120, 180], seed: true, lyrics: {} },
defaults: { duration: 60 },
}),
- // Full songs on core nodes (nm10-music3, research #10 §6.6). MiniMax Music 3 is the same model the cloud runs as
++ // Full songs on core nodes (new-models-10 §6.6). MiniMax Music 3 is the same model the cloud runs as
+ // minimax-music-3 (fal hosts it); YuE2 is open-engine only (neither fal nor Replicate hosts it), and covers a song you add.
+ o({
+ id: "oss-minimax-music-3",
+ name: "MiniMax Music 3",
+ vendor: "MiniMax",
+ family: "minimax-music",
+ kind: "audio",
+ tagline: "Full songs with expressive vocals up to 5 minutes, from your lyrics and a style",
+ badges: ["new", "top"],
+ routes: [comfy("music", "music-minimax-3", "int8 DiT and text encoder, 30 steps; songs over 2 minutes decode in tiles")],
+ options: { durations: [30, 60, 120, 180, 240, 300], seed: true, lyrics: {} },
+ defaults: { duration: 120 },
+ }),
+ o({
+ id: "oss-yue2",
+ name: "YuE2",
+ vendor: "Multimodal Art Projection",
+ family: "yue",
+ kind: "audio",
+ tagline: "Songs sung from your lyrics, or a cover of a song you add with a new style and words",
+ badges: ["new"],
+ routes: [comfy("music", "music-yue2-song", "plans the melody and chords, then sings; with a song added, SheetSage2 reads its melody for the cover")],
+ options: { durations: [60, 120, 180, 240, 300], seed: true, lyrics: { required: true }, cover: true },
+ defaults: { duration: 120 },
+ }),
// Utilities used by chained jobs (multi-shot, storyboard films, extend) and the Video tools page.
o({
id: "oss-join-clips",
@@@ -2060,32 -2047,26 +2157,52 @@@
sliders: [{ param: "numGaussians", label: "Gaussians", min: 32768, max: 1048576, step: 32768, default: 262144 }],
},
}),
- // idol-1 (docs/research/idol-9.md): Speridlabs' Idol, TripoSplat's architecture retrained, on the same core nodes. Its cloud twin
+ // Any Angle (app-any-angle, src/lib/catalog/any-angle.ts): two helpers its page runs, hidden from the pickers. The 3D view of
+ // a photo, built once (TripoSplat with the cut-out, fixed seeds, a turntable the front view is measured on, a GLB)…
+ o({
+ id: ANY_ANGLE.buildModel,
+ name: "Any Angle 3D view",
+ vendor: "Tripo (VAST)",
+ family: "tripo",
+ kind: "model3d",
+ tagline: "A 3D view of the photo's subject for picking camera angles · 8 GB GPU",
+ routes: [comfy("splat", ANY_ANGLE.buildGraph, "BiRefNet cut-out → TripoSplat (seed 46) → .spz, a 48-frame turntable, its sweep and a GLB")],
+ options: { maxImages: 1, promptless: true },
+ hidden: true,
+ }),
+ // …and one angle from it: the view rendered at the camera, repainted by Qwen-Image 2.1 with the AnyAngle LoRA (its own
+ // prompt, so no words of the visitor's). No hosted Qwen-Image 2.1 takes the LoRA, so it runs on a GPU only.
+ o({
+ id: ANY_ANGLE.shotModel,
+ name: "Any Angle",
+ vendor: "Qwen (Alibaba) · lilylilith",
+ family: "qwen-image",
+ kind: "image",
+ tagline: "The same photo from a camera you pick: a 3D view rendered there and repainted · Qwen-Image 2.1 + AnyAngle LoRA · 32 GB GPU",
+ routes: [comfy("edit", ANY_ANGLE.shotGraph, "the saved 3D view rendered at the camera → Qwen-Image 2.1 int8 + AnyAngle LoRA, 25 steps, cfg 1")],
+ options: { maxImages: 1, seed: true, promptless: true, ...(ANY_ANGLE_LORA && { loras: [ANY_ANGLE_LORA] }) },
+ hidden: true,
+ }),
++ // Idol 3D (docs/research/idol-9.md): Speridlabs' Idol, TripoSplat's architecture retrained, on the same core nodes. Its cloud twin
+ // is "idol-3d" (fal speridlabs/idol, cloud-models.generated.ts).
+ o({
+ id: "oss-idol",
+ name: "Idol 3D",
+ vendor: "Speridlabs",
+ family: "idol",
+ kind: "model3d",
+ tagline: "A Gaussian splat (.spz) of one object from one picture, plus an orbit video · TripoSplat's architecture, retrained · 8 GB GPU · Apache-2.0 · Built with DINOv3",
+ badges: ["new"],
+ routes: [comfy("splat", "image-to-splat-idol", "Idol on the TripoSplat core nodes → .spz + a 3 s orbit")],
+ options: {
+ seed: true,
+ maxImages: 1,
+ sliders: [
+ { param: "numGaussians", label: "Gaussians", min: 32768, max: 1048576, step: 32768, default: 262144 },
+ { param: "steps", label: "Steps", min: 10, max: 50, step: 1, default: 50 },
+ ],
+ },
+ }),
// Round 4 (r4/cinema-3d): Cinema Studio's "Create 3D scene". The mesh is in the photo's own camera space
// (glTF axes, metres), so the viewer starts where the photo was taken.
o({
@@@ -2389,6 -2370,37 +2506,37 @@@ const originals: ModelDef[] =
// Sound in the cloud only (fal's generate_audio): the open LTX-2.3 graphs decode no audio, so no toggle there.
engineOptions: { open: { audio: false } },
},
- // Fuobe Animation (package inbetweening): keyframe in-betweening. On your GPU one graph makes every gap between 2-10
++ // Fuobe Animation: keyframe in-betweening. On your GPU one graph makes every gap between 2-10
+ // keyframes on one set of Wan 2.2 loaders (AniSora 3.2 high, lightx2v 4-step low), keeps every Nth frame per gap and plays
+ // the film at 24 or 16 fps (src/lib/av/inbetween-graph.ts); in the cloud one hosted Wan 2.2 clip per gap with AniSora on
+ // the high-noise expert, every frame at 16 fps, joined (createKeyframeFilm). Timing: src/lib/inbetween.ts.
+ {
+ ...original({
+ id: "fuobe-animation",
+ open: [comfy("keyframes", "wan22-inbetween-anisora", "every gap on one set of loaders: AniSora 3.2 + lightx2v 4 steps, every Nth frame, one video")],
+ tagline: "Keyframes in, the in-betweens drawn, one finished animation · Wan 2.2 + AniSora free on your GPU (24 GB), or hosted on fal",
+ options: {
+ inbetween: true,
+ aspectRatios: ["auto", ...VID_AR],
+ resolutions: ["480p", "720p"],
+ seed: true,
+ negativePrompt: true,
+ maxImages: 10,
+ promptOptional: true,
+ ...(ANISORA_LORA && { loras: [loraRef(ANISORA_LORA)] }),
+ },
+ }),
+ // One clip per gap, joined, in the cloud: a chain like the open Frames film's (src/server/chains.ts createKeyframeFilm).
+ routes: [
+ comfy("keyframes", "wan22-inbetween-anisora", "every gap on one set of loaders: AniSora 3.2 + lightx2v 4 steps, every Nth frame, one video"),
+ ...(ORIGINAL_HALVES.get("fuobe-animation")?.routes ?? []),
+ { op: "keyframes", provider: "fal", endpoint: "fal-ai/wan/v2.2-a14b/image-to-video", chained: true, note: "one hosted clip per gap with AniSora, joined" },
+ ],
+ engineDefaults: { open: { resolution: "720p" } },
+ // The GPU graph needs two keyframes; in the cloud each gap's clip runs on its own (a start and an end frame).
+ engineOptions: { open: { requires: { images: 2, msg: "Add at least two keyframes: the in-betweens go between them" } } },
+ engineNote: "In the cloud every frame is kept and the animation plays at 16 fps; speeds ×2–×4 and 24 fps playback run on your GPU",
+ },
// Fuobe Cinema (O6): Cinema Studio 4.0's Original (src/lib/catalog/cinema.ts compiles the Director into the prompt and
// turns a camera move into a camera LoRA, a Fun Camera pose or LTX-2.3's camera_lora). On the user's GPU it is Wan 2.2
// 14B Lightning, 3 or 5 s at 16 fps (extend and edit run on Wan 2.2 Fun VACE, sound on LTX-2.5); in the cloud LTX-2.3
diff --cc src/lib/catalog/plan.ts
index aaa1a335,3d40b2d6..c029c091
--- a/src/lib/catalog/plan.ts
+++ b/src/lib/catalog/plan.ts
@@@ -244,6 -246,10 +246,10 @@@ const PROMPTLESS = new Set<Operation>(
"face-mosaic",
// archive-restore: the scene's words help (period, place, light) but a run without them gets a neutral one
"restore-video",
- // nm10-music3: extending a song takes its lyrics, its stems nothing
++ // Extending a song takes its lyrics, its stems nothing
+ "song-extend", "song-stems",
- // nm10-hosted-catchup: an inserted moment can be left to the model; a retexture takes words or a style picture
++ // An inserted moment can be left to the model; a retexture takes words or a style picture
+ "insert-moment", "retexture-3d",
]);
/**
diff --cc src/lib/catalog/types.ts
index c1d95959,7260be37..624534e7
--- a/src/lib/catalog/types.ts
+++ b/src/lib/catalog/types.ts
@@@ -90,16 -89,15 +90,23 @@@ export type Operation
| "camera-path" // image + params.cameraPath (+ inputs.video: the open engine's render along the path) → the camera following the path
// archive-restore
| "restore-video" // archive video (+ prompt: period, place, light; negative: what not to invent) → the same shot clean, in colour, larger
- // nm10-hosted-catchup
+ // Design a voice
+ | "voice-design" // params.voiceDescription (who is speaking) + prompt (the line) → the line in a new voice made from the words
+ // Genjutsu's Openjutsu modes
+ | "face-fix-video" // video + face photo → the same video with small or soft faces redrawn to match the photo
+ | "tone-video" // video → the same video with a film finish (detail softened, tone-mapped)
+ | "describe-video" // video part (+ a picture) → what happens in it, in words (text)
+ | "group-swap" // video part + 1–4 character pictures + roles → each named person replaced by their character
+ | "scene-edit" // video part (+ a picture) + params.extra (change / remove / new background) → the scene edited, the rest kept
+ | "picture-frame" // video part (+ a character picture) → its first frame with the character in that pose (or relit)
- | "picture-video"; // video part + an approved first frame (+ what happens) → the frame animated with the part's motion
++ | "picture-video" // video part + an approved first frame (+ what happens) → the frame animated with the part's motion
++ // Hosted tools: insert a moment, retexture
+ | "insert-moment" // video + params.startTime / params.endTime (+ prompt, reference images and clips, params.duration: the new scene's length) → the clip with a new scene between them
+ | "retexture-3d" // 3D model (inputs.model3d) + prompt or a style image → the same model with new textures
- // nm10-voice-design
- | "voice-design" // params.voiceDescription (who is speaking) + prompt (the line) → the line in a new voice made from the words
- // nm10-music3: a song's cloud tools (Mureka). The song is inputs.audio, or one of Mureka's own (params.extra.songId)
++ // A song's cloud tools (Mureka). The song is inputs.audio, or one of Mureka's own (params.extra.songId)
+ | "song-extend" // song + lyrics for the new part (+ params.startTime: where it begins; params.extra.extend_type tail | head) → the song, longer
+ | "song-remix" // song + a style (prompt) + the whole song's lyrics → a new arrangement of it
+ | "song-stems"; // song → its vocal and instrument tracks (meta.stem), one file each
export const OPERATION_LABELS: Record<Operation, string> = {
t2i: "Text to image",
@@@ -173,13 -170,11 +180,18 @@@
"camera-path": "Fly path",
composite: "Character over the footage",
"restore-video": "Restore & colourise",
+ "face-fix-video": "Fix faces",
+ "tone-video": "Fix colours",
+ "describe-video": "Describe a video",
+ "group-swap": "Group swap",
+ "scene-edit": "Scene edit",
+ "picture-frame": "First frame from a picture",
+ "picture-video": "Video from a picture",
+ "insert-moment": "Insert a moment",
+ "retexture-3d": "Retexture",
+ "song-extend": "Extend a song",
+ "song-remix": "Remix a song",
+ "song-stems": "Song stems",
};
export const OPERATION_OUTPUT: Record<Operation, MediaKind> = {
@@@ -255,13 -249,11 +267,18 @@@
"camera-path": "video",
composite: "video",
"restore-video": "video",
+ "face-fix-video": "video",
+ "tone-video": "video",
+ "describe-video": "text",
+ "group-swap": "video",
+ "scene-edit": "video",
+ "picture-frame": "image",
+ "picture-video": "video",
+ "insert-moment": "video",
+ "retexture-3d": "model3d",
+ "song-extend": "audio",
+ "song-remix": "audio",
+ "song-stems": "audio",
};
/**
@@@ -1203,6 -1243,12 +1268,12 @@@ export interface ChainSlot
* with a look makes each next frame from the previous one, and every frame gets the look's grade on its own.
*/
raw?: boolean;
+ /**
- * "path" (build plan N7-7, a video slot): the server renders the step's camera path (params.cameraPath) through the
++ * "path" (a video slot): the server renders the step's camera path (params.cameraPath) through the
+ * scene the dependency made from the step's still (MoGe 2's depth picture), and that render is the input: Uni3C's guide
+ * when no browser has drawn one (Canvas, Assist, Fuobe DoP, Cinema's exact orbits). src/server/path-render.ts.
+ */
+ render?: "path";
}
/** How many outputs a planned list (ChainSlot.of) may be short of before the steps reading it fail. */
diff --cc src/lib/comfy-variants.ts
index d488acc3,2561b605..1880db95
--- a/src/lib/comfy-variants.ts
+++ b/src/lib/comfy-variants.ts
@@@ -36,14 -37,8 +37,16 @@@ export const H3_ORBIT_GRAPH: Record<str
*/
export const REUSE_BED_GRAPH: Record<string, string> = { "voice-clean-reuse": "voice-clean-bed-reuse" };
+/**
+ * Genjutsu's Openjutsu graphs (params.extra.openjutsu): Group swap one by one (exactly 2 characters, a pass each) and From
+ * picture on native H3 (the owner's renderer) run graphs of their own.
+ */
+export const OPENJUTSU_VARIANTS: Record<string, { key: string; value: unknown; graph: string }> = {
+ "video-group-swap-h3": { key: "onePerPerson", value: true, graph: "video-group-swap-h3-one-by-one" },
+ "video-from-picture-solar": { key: "renderer", value: "h3", graph: "video-from-picture-h3" },
+};
+ /** YuE2 with a song attached (Audio → Music's "Song to cover"): the cover graph sings its melody with the new style and lyrics. */
+ export const YUE2_COVER_GRAPH: Record<string, string> = { "music-yue2-song": "music-yue2-cover" };
export interface VariantRequest {
op: string;
@@@ -77,14 -74,17 +82,20 @@@ export function resolveWorkflowId(endpo
if (shot && r.extra.productShot === true && r.images === 1 && r.has(shot)) endpoint = shot;
// Qwen-Image 2.1: Options → Speed's graph, or the small encoder's when Options → GPU says Small (src/lib/qwen21-speed.ts).
endpoint = qwen21Graph(endpoint, r.extra, r.has);
- // MiniMax H3: an orbit runs the Orbit LoRA graph (whatever the quality), else Best runs the 20-step graph.
+ // MiniMax H3: an orbit runs the Orbit LoRA graph (whatever the quality or tier); else a smaller card's tier (FastH3 V2 or Trim,
+ // as the plan decided it: src/server/h3-gpu.ts), which wins over Best; else Best runs the 20-step graph.
const orbit = H3_ORBIT_GRAPH[endpoint];
const best = H3_BEST_GRAPH[endpoint];
+ const tier = r.extra[H3_TIER_PARAM];
+ const small = tier === "fast" || tier === "trim" ? tierGraphFor(endpoint, tier, r.has) : undefined;
if (orbit && r.extra.orbit === true && r.has(orbit)) endpoint = orbit;
+ else if (small) endpoint = small;
else if (best && r.extra.quality === "best" && r.has(best)) endpoint = best;
+ const oj = OPENJUTSU_VARIANTS[endpoint];
+ const ojSettings = r.extra.openjutsu as Record<string, unknown> | undefined;
+ if (oj && ojSettings?.[oj.key] === oj.value && r.has(oj.graph)) endpoint = oj.graph;
+ const cover = YUE2_COVER_GRAPH[endpoint];
+ if (cover && r.audio && r.has(cover)) endpoint = cover;
const bed = REUSE_BED_GRAPH[endpoint];
if (bed && r.extra.background === "keep" && r.has(bed)) endpoint = bed;
return endpoint;
diff --cc src/lib/exact-orbit.ts
index 00000000,14022a41..7a538c92
mode 000000,100644..100644
--- a/src/lib/exact-orbit.ts
+++ b/src/lib/exact-orbit.ts
@@@ -1,0 -1,118 +1,118 @@@
+ /**
- * Exact orbits (build plan N7-7; research new-models-7.md §3.10 rows 3-5): an orbit move picked in Fuobe DoP, Cinema's
++ * Exact orbits (research new-models-7.md §3.10 rows 3-5): an orbit move picked in Fuobe DoP, Cinema's
+ * Director or Image to 3D, set by numbers instead of a LoRA's or a prompt's idea of an orbit: how far round (30-360°),
+ * which way (seen from above), a height tilt (0-20°, a ring tilted like the camera path library's Tilted ring) and a
+ * radius pulse (none or 25% in, twice). The numbers become the camera path library's keys (src/lib/camera-path.ts), so
- * both engines film them the way N7-5's Fly path does: H3 Max camera-controls on the cloud, Uni3C on your GPU.
++ * both engines film them the way Fly path does: H3 Max camera-controls on the cloud, Uni3C on your GPU.
+ *
+ * Pure: no DOM, no server.
+ */
+
+ import { PHOTO_KEY, type CameraKey } from "./camera-path";
+
+ export type OrbitDirection = "cw" | "ccw";
+
+ export interface ExactOrbit {
+ /** Degrees round the subject, 30-360. */
+ degrees: number;
+ /** Seen from above: counter-clockwise moves the camera round to the right (camera-path's + azimuth). */
+ direction: OrbitDirection;
+ /** Degrees the ring is tilted (0 = level) about the line of sight: it rises over the first half turn and dips below over the second. */
+ tilt: number;
+ /** How far the camera moves in and out on the way round (0 or 0.25 = 25% closer, twice). */
+ pulse: number;
+ }
+
+ export const EXACT_LIMITS = { degrees: { min: 30, max: 360, step: 5 }, tilt: { min: 0, max: 20, step: 1 }, pulses: [0, 0.25] } as const;
+
+ export const DIRECTION_NAMES: Record<OrbitDirection, string> = { cw: "Clockwise", ccw: "Counter-clockwise" };
+
+ const DEG = Math.PI / 180;
+ const clamp = (n: number, lo: number, hi: number) => Math.max(lo, Math.min(hi, n));
+ const tidy = (n: number, digits = 3) => Number(n.toFixed(digits)) + 0;
+
+ /**
+ * The orbit moves that take the Exact switch, by Fuobe DoP preset id and by Cinema move slug, with the numbers each starts
+ * from. Arc Left moves the camera round to the left (clockwise from above), Arc Right to the right.
+ */
+ export const EXACT_DEFAULTS: Readonly<Record<string, ExactOrbit>> = {
+ // Fuobe DoP / Motions (src/lib/catalog/motions.ts, Orbit)
+ "motion-360-orbit": { degrees: 360, direction: "ccw", tilt: 0, pulse: 0 },
+ "motion-arc-left": { degrees: 90, direction: "cw", tilt: 0, pulse: 0 },
+ "motion-arc-right": { degrees: 90, direction: "ccw", tilt: 0, pulse: 0 },
+ "motion-lazy-orbit": { degrees: 60, direction: "ccw", tilt: 5, pulse: 0 },
+ // Cinema's Director (src/lib/catalog/cinema.ts CAMERA_MOVES)
+ "drone-orbit": { degrees: 360, direction: "ccw", tilt: 15, pulse: 0 },
+ "arc-left": { degrees: 90, direction: "cw", tilt: 0, pulse: 0 },
+ "arc-right": { degrees: 90, direction: "ccw", tilt: 0, pulse: 0 },
+ "bullet-time": { degrees: 180, direction: "ccw", tilt: 0, pulse: 0 },
+ };
+
+ /** Whether a DoP preset or a Cinema move takes the Exact switch. */
+ export const takesExact = (id: string | null | undefined): boolean => !!id && Object.hasOwn(EXACT_DEFAULTS, id);
+
+ /** The numbers a move starts from (360° counter-clockwise, level, for anything else). */
+ export function exactDefaults(id?: string | null): ExactOrbit {
+ return { ...(id && Object.hasOwn(EXACT_DEFAULTS, id) ? EXACT_DEFAULTS[id] : { degrees: 360, direction: "ccw" as const, tilt: 0, pulse: 0 }) };
+ }
+
+ /** The numbers inside their ranges: degrees 30-360 in 5° steps, tilt 0-20°, pulse 0 or 25%. */
+ export function normalizeExact(o: Partial<ExactOrbit> | undefined, fallback: ExactOrbit = exactDefaults()): ExactOrbit {
+ const num = (v: unknown, d: number) => (typeof v === "number" && Number.isFinite(v) ? v : d);
+ const { degrees, tilt } = EXACT_LIMITS;
+ return {
+ degrees: clamp(Math.round(num(o?.degrees, fallback.degrees) / degrees.step) * degrees.step, degrees.min, degrees.max),
+ direction: o?.direction === "cw" || o?.direction === "ccw" ? o.direction : fallback.direction,
+ tilt: clamp(Math.round(num(o?.tilt, fallback.tilt)), tilt.min, tilt.max),
+ pulse: num(o?.pulse, fallback.pulse) >= 0.125 ? 0.25 : 0,
+ };
+ }
+
+ /** The most keys an exact orbit has: 12, all of which H3 Max takes, so both engines follow the same keys. */
+ export const EXACT_MAX_KEYS = 12;
+
+ /**
+ * The orbit as camera-path keys, evenly spaced in time from the photo's pose: a key at least every 30° (at least 5 keys,
+ * so a tilt and a pulse show on a short arc). The tilt is a ring tilted about the photo's line of sight (elevation =
+ * asin(sin tilt · sin turned)), rising first whichever way it turns; the pulse takes the camera 25% in and out twice.
+ */
+ export function exactOrbitKeys(input: Partial<ExactOrbit>): CameraKey[] {
+ const o = normalizeExact(input);
+ const n = clamp(Math.ceil(o.degrees / 30 - 1e-9), 4, EXACT_MAX_KEYS - 1);
+ const sign = o.direction === "ccw" ? 1 : -1;
+ return Array.from({ length: n + 1 }, (_, i) => {
+ const f = i / n;
+ const turned = o.degrees * f;
+ if (i === 0) return { ...PHOTO_KEY };
+ return {
+ t: tidy(f, 4),
+ azimuth: tidy(sign * turned, 2),
+ elevation: tidy(Math.asin(Math.sin(o.tilt * DEG) * Math.sin(turned * DEG)) / DEG, 2),
+ distance: tidy(1 - o.pulse * Math.sin(2 * Math.PI * f) ** 2, 4),
+ };
+ });
+ }
+
+ /** The numbers in a few words: "360° counter-clockwise · tilt 10° · pulse 25%". */
+ export function exactSummary(input: Partial<ExactOrbit>): string {
+ const o = normalizeExact(input);
+ return [`${o.degrees}° ${DIRECTION_NAMES[o.direction].toLowerCase()}`, o.tilt ? `tilt ${o.tilt}°` : "level", ...(o.pulse ? [`pulse ${Math.round(o.pulse * 100)}%`] : [])].join(" · ");
+ }
+
+ /** Where a tilted ring takes the camera's height over `degrees` (elevation = asin(sin tilt · sin turned)). */
+ function tiltPath(degrees: number): string {
+ if (degrees <= 90) return "rises as it goes";
+ if (degrees <= 180) return "rises above eye level and comes back down";
+ if (degrees < 360) return "rises above eye level, then dips below it";
+ return "rises above eye level, dips as far below it and comes back to eye level";
+ }
+
+ /** Words for a model that reads the path from the prompt (the cloud's reference route): where the camera goes. */
+ export function exactWords(input: Partial<ExactOrbit>): string {
+ const o = normalizeExact(input);
+ const way = o.direction === "ccw" ? "to the right" : "to the left";
+ const how = o.degrees >= 360 ? "a full 360-degree orbit" : `a ${o.degrees}-degree arc`;
+ const tilt = o.tilt ? `, the ring tilted ${o.tilt} degrees so the camera ${tiltPath(o.degrees)}` : ", at a constant height";
+ const pulse = o.pulse ? ", moving in and out twice on the way" : "";
+ return `The camera makes ${how} around the subject, moving ${way}${tilt}${pulse}, keeping the subject centered`;
+ }
diff --cc src/lib/gpu/h3-tier.ts
index 00000000,4834b920..8d4c61b7
mode 000000,100644..100644
--- a/src/lib/gpu/h3-tier.ts
+++ b/src/lib/gpu/h3-tier.ts
@@@ -1,0 -1,331 +1,331 @@@
+ import type { ModelOptions } from "@/lib/catalog/types";
+ import { gpuVramGb } from "./readiness";
+ import type { FileKey, GpuInventory, RequirementIndex } from "./types";
+
+ /**
- * MiniMax H3 on 8-31 GB graphics cards (research #10 §6.4, package nm10-h3-any-gpu). Pure: which H3 build a GPU runs, from
++ * MiniMax H3 on 8-31 GB graphics cards (new-models-10 §6.4). Pure: which H3 build a GPU runs, from
+ * what the GPU check read (its memory, its name, the PyTorch build), and the graphs and files each build takes.
+ *
+ * - Standard (32 GB or more, and any reading that can't tell: a CPU, no check yet, a card it doesn't know): today's graphs,
+ * the fl2va pruned int8 model with the Turbo v4 LoRA (or Best's 20 steps).
+ * - FastH3 V2 (16-31 GB, Ada or newer): FastVideo's 8-step DMD2 distill of H3 (FastVideo/FastVideo-FastH3-Comfy), the
+ * pruned int8 build (22.1 GB, partly offloaded on cards under 24 GB), or NVFP4 (13.6 GB) on Blackwell. Text, start frame
+ * and start + end frames to video, as Comfy-Org's FastH3 templates run it (FastVideo's own card says FL2VA wasn't
+ * distilled, so a start frame is followed less closely than on Standard).
+ * - FastH3 Trim (12-15 GB on Ada or newer, 8-15 GB on Blackwell): 42 of H3's 50 blocks, 8 steps, experimental and below V2
+ * in quality, text to video only (FastVideo's cards name eight-step text-to-video and nothing else). NVFP4 (11.9 GB) on
+ * Blackwell, else int8 ConvRot (18.9 GB, the template's format) on a CUDA 13 PyTorch, fp8 (19.7 GB) on an older one
+ * (Comfy-Org: fp8 only where int8 ConvRot can't run). Both larger files are partly offloaded to system memory.
+ * - Needs a bigger GPU: under 8 GB, under 12 GB without Blackwell, or a card older than Ada (RTX 30 and before) under
+ * 32 GB, whose kernels FastVideo didn't test. Options → GPU tier can still pick a build on any card.
+ *
+ * Every build reads the same text encoder, Qwen3-VL 32B NVFP4-AWQ (15.7 GB, offloaded after encoding), the file every
+ * FastVideo and Comfy-Org H3 template pairs with every diffusion file (it runs on any recent NVIDIA card; native on
+ * Blackwell), and the same int8 video VAE and audio VAE.
+ *
+ * Speeds and the 8 GB figure are FastVideo's own measurements (a 5 s 480p clip with sound: 13.4 s on an RTX 5090, 43.9 s
+ * on an RTX 4090, 82 s on a 4090 capped at 8 GB with the NVFP4 Trim), never measured here.
+ */
+
+ export type H3Tier = "standard" | "fast" | "trim";
+
+ /** The diffusion file's format a tier loads. */
+ export type H3Weights = "int8" | "fp8" | "nvfp4";
+
+ /** Graphics card generations, as the chooser tells them apart (compute capability in brackets). */
+ export type GpuArch = "blackwell" | "hopper" | "ada" | "ampere" | "turing" | "older" | "other" | "unknown";
+
+ /** What the GPU check read about the card a run goes to. */
+ export interface H3Device {
+ /** Graphics memory in GB, rounded as the check reads it (src/lib/gpu/requirements.ts vramGb); undefined on a CPU or with no reading. */
+ vramGb?: number;
+ /** The device's name as /system_stats gives it ("cuda:0 NVIDIA GeForce RTX 4090 : cudaMallocAsync"). */
+ name?: string;
+ /** The device type ("cuda", "mps", "xpu", "cpu"). */
+ type?: string;
+ /** ComfyUI's PyTorch build ("2.12.0+cu130"), when the check read it. */
+ torch?: string;
+ }
+
+ export interface H3TierChoice {
+ tier: H3Tier;
+ /** The diffusion file's format (fast and trim). */
+ weights?: H3Weights;
+ /** The diffusion file this tier loads in place of the graph's default (undefined: the graph's own). */
+ unet?: string;
+ /** Some of the model waits in system memory while it runs (the file is bigger than the card). */
+ offload: boolean;
+ /** "FastH3 Trim (fp8)", "FastH3 V2 (int8)", "Standard". */
+ label: string;
+ /** No build fits this card: the run goes to Standard, which the GPU pre-flight then says needs a bigger GPU. */
+ tooSmall?: boolean;
+ /** Why a smaller build isn't picked (too little memory, an older card), in plain words. */
+ reason?: string;
+ }
+
+ /** The hidden models whose switch, licence and pre-flight row each smaller build has (src/lib/catalog/models.ts). */
+ export const H3_TIER_MODEL: Record<Exclude<H3Tier, "standard">, string> = { fast: "oss-minimax-h3-fast", trim: "oss-minimax-h3-trim" };
+
+ /** Options → GPU tier's param (params.extra). Unset is Auto. */
+ export const H3_TIER_PARAM = "gpuTier";
+
+ /** The diffusion file the run loads (a binding of the FastH3 graphs). */
+ export const H3_UNET_PARAM = "unet";
+
+ /** Memory each tier starts at (GB, rounded as the GPU check reads it). */
+ export const H3_STANDARD_GB = 32;
+ export const H3_FAST_GB = 16;
+ export const H3_TRIM_GB = 12;
+ export const H3_TRIM_BLACKWELL_GB = 8;
+
+ /** FastH3 V2's files (FastVideo/FastVideo-FastH3-Comfy @ ec1e3aa3, FastVideo/FastVideo-FastH3-8-Step-V2-NVFP4-Comfy @ 994a40be). */
+ export const FAST_FILES: Record<"int8" | "nvfp4", { file: string; gb: number }> = {
+ int8: { file: "fastvideo_fasth3_8step_v2_pruned_int8_convrot.safetensors", gb: 22.13 },
+ nvfp4: { file: "fastvideo_fasth3_8step_v2_pruned_nvfp4.safetensors", gb: 13.61 },
+ };
+
+ /** FastH3 Trim's files (FastVideo/FastVideo-FastH3-Trim-Comfy @ f66c13dc). */
+ export const TRIM_FILES: Record<H3Weights, { file: string; gb: number }> = {
+ int8: { file: "fastvideo_fasth3_trim_8step_int8_convrot.safetensors", gb: 18.92 },
+ fp8: { file: "fastvideo_fasth3_trim_8step_fp8.safetensors", gb: 19.68 },
+ nvfp4: { file: "fastvideo_fasth3_trim_8step_nvfp4.safetensors", gb: 11.89 },
+ };
+
+ /** The text encoder every tier reads (the FastH3 templates' pairing). */
+ export const H3_ENCODER = "qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors";
+
+ /** The graphs each tier runs in place of a Standard graph. Trim has text to video only. */
+ export const H3_TIER_GRAPH: Record<string, Partial<Record<Exclude<H3Tier, "standard">, string>>> = {
+ "minimax-h3-t2v": { fast: "minimax-h3-fast-t2v", trim: "minimax-h3-trim-t2v" },
+ "minimax-h3-i2v": { fast: "minimax-h3-fast-i2v" },
+ "minimax-h3-flf2v": { fast: "minimax-h3-fast-flf2v" },
+ };
+
+ /** Every FastH3 graph (the ones whose diffusion file follows the card: the `unet` binding). */
+ export const H3_TIER_GRAPHS: ReadonlySet<string> = new Set(Object.values(H3_TIER_GRAPH).flatMap((t) => Object.values(t)));
+
+ /** Which tier a FastH3 graph belongs to. */
+ export function tierOfGraph(id: string): Exclude<H3Tier, "standard"> | undefined {
+ for (const t of Object.values(H3_TIER_GRAPH)) for (const [tier, g] of Object.entries(t)) if (g === id) return tier as Exclude<H3Tier, "standard">;
+ return undefined;
+ }
+
+ // ---------------------------------------------------------------------------
+ // The card's generation, from its name
+
+ /** Names, newest first: the first match wins. */
+ const ARCH_NAMES: [GpuArch, RegExp][] = [
+ // RTX 50, RTX PRO 6000 / 5000 … Blackwell, B100 / B200 / B300, GB200 / GB300, GB10 (DGX Spark), Jetson Thor.
+ ["blackwell", /\bRTX\s*50\d0\b|\bBlackwell\b|\bG?B[123]00\b|\bGB10\b|\bDGX Spark\b|\bThor\b/i],
+ ["hopper", /\bG?H(100|200|800|20)\b/i],
+ // RTX 40, RTX 6000 / 5000 / 4000 / 2000 Ada, L4, L40, L40S, L20.
+ ["ada", /\bRTX\s*40\d0\b|\bAda\b|\bL(4|40S?|20)\b/i],
+ ["ampere", /\bRTX\s*30\d0\b|\bRTX\s*A\d{3,4}\b|\bA(100|800|40|30|16|10G?|10M?|2)\b|\bOrin\b/i],
+ ["turing", /\bRTX\s*20\d0\b|\bGTX\s*16\d0\b|\bT4\b|\bTITAN RTX\b|\bQuadro RTX\b/i],
+ ["older", /\bGTX\s*(10\d0|9\d0|TITAN)\b|\bV100\b|\bTITAN (V|Xp?)\b|\bP(100|40|4)\b|\bQuadro\b|\bTesla\b/i],
+ ["other", /\bRadeon\b|\bInstinct\b|\bAMD\b|\bIntel\b|\bArc\b|\bApple\b/i],
+ ];
+
+ /** A card's generation from the name the GPU check read (and its type: Apple and Intel devices aren't CUDA). */
+ export function gpuArch(name: string | undefined, type?: string): GpuArch {
+ if (type && type !== "cuda") return type === "cpu" ? "unknown" : "other";
+ const n = name ?? "";
+ for (const [arch, re] of ARCH_NAMES) if (re.test(n)) return arch;
+ return "unknown";
+ }
+
+ /** Ada (compute capability 8.9) or newer: the cards FastVideo measured FastH3 on, and fp8's floor. */
+ export const adaOrNewer = (a: GpuArch) => a === "ada" || a === "hopper" || a === "blackwell";
+
+ /** A PyTorch built for CUDA 13 ("+cu130"), which int8 ConvRot's fast kernels need (Comfy-Org's note on its repacks). */
+ export const cuda13 = (torch: string | undefined) => /\+cu1[3-9]\d/.test(torch ?? "");
+
+ // ---------------------------------------------------------------------------
+ // The chooser
+
+ const label = (tier: H3Tier, weights?: H3Weights) =>
+ tier === "standard" ? "Standard" : `${tier === "fast" ? "FastH3 V2" : "FastH3 Trim"} (${weights})`;
+
+ /** The file a tier loads on this card. Unknown cards take the templates' default format (int8 ConvRot). */
+ export function tierWeights(tier: Exclude<H3Tier, "standard">, arch: GpuArch, torch?: string): H3Weights {
+ if (arch === "blackwell") return "nvfp4";
+ if (tier === "fast") return "int8";
+ return adaOrNewer(arch) && torch && !cuda13(torch) ? "fp8" : "int8";
+ }
+
+ /** A tier on this card: its file, and whether part of it waits in system memory. */
+ export function tierChoice(tier: H3Tier, d: H3Device): H3TierChoice {
+ if (tier === "standard") return { tier, offload: false, label: label(tier) };
+ const weights = tierWeights(tier, gpuArch(d.name, d.type), d.torch);
+ const f = tier === "fast" ? FAST_FILES[weights as "int8" | "nvfp4"] : TRIM_FILES[weights];
+ // About 2 GB of a card goes to the picture being made: a file bigger than the rest is partly offloaded.
+ const offload = typeof d.vramGb === "number" && f.gb > d.vramGb - 2;
+ return { tier, weights, unet: f.file, offload, label: label(tier, weights) };
+ }
+
+ /**
+ * The build MiniMax H3 runs on a card (Auto). A CPU, no reading and a card it can't place keep Standard, the default graph,
+ * so the GPU pre-flight judges it as it does today.
+ */
+ export function chooseH3Tier(d: H3Device): H3TierChoice {
+ const gb = d.vramGb;
+ if (typeof gb !== "number" || gb <= 0 || gb >= H3_STANDARD_GB) return tierChoice("standard", d);
+ const arch = gpuArch(d.name, d.type);
+ if (arch === "unknown") return tierChoice("standard", d);
+ const small = (reason: string): H3TierChoice => ({ tier: "standard", offload: false, label: "Needs a bigger GPU", tooSmall: true, reason });
+ if (!adaOrNewer(arch)) return small("MiniMax H3 needs 32 GB on this card. The smaller builds need an RTX 40 or newer");
+ if (gb >= H3_FAST_GB) return tierChoice("fast", d);
+ if (gb >= H3_TRIM_GB || (arch === "blackwell" && gb >= H3_TRIM_BLACKWELL_GB)) return tierChoice("trim", d);
+ return small(arch === "blackwell" ? "MiniMax H3 needs at least 8 GB" : "MiniMax H3 needs at least 12 GB on this card (8 GB on an RTX 50)");
+ }
+
+ /** The tier a run takes: the one asked for in Options → GPU tier, else Auto's. */
+ export function h3TierFor(asked: unknown, d: H3Device): H3TierChoice {
+ if (asked === "standard" || asked === "fast" || asked === "trim") return tierChoice(asked, d);
+ return chooseH3Tier(d);
+ }
+
+ /** The graph a tier runs for a Standard graph (undefined: that tier has no graph for it, so the run keeps Standard). */
+ export function tierGraphFor(endpoint: string, tier: H3Tier | undefined, has: (id: string) => boolean): string | undefined {
+ if (!tier || tier === "standard") return undefined;
+ const g = H3_TIER_GRAPH[endpoint]?.[tier];
+ return g && has(g) ? g : undefined;
+ }
+
+ /** What a smaller tier changes, as the run's notes and the composer say it. */
+ export const TIER_NOTES: Record<Exclude<H3Tier, "standard">, string> = {
+ fast: "FastH3 V2: an 8-step build of MiniMax H3 for 16-31 GB GPUs. A start frame is followed less closely than on the full model",
+ trim: "FastH3 Trim: an experimental 8-step build for 8-15 GB GPUs, below FastH3 V2 in quality. Text to video only",
+ };
+
+ /** A smaller tier picked with Best: Best needs the full model. */
+ export const TIER_BEST_NOTE = "Best needs a 32 GB GPU: this run uses 8 steps";
+
+ /** Options → GPU tier (no value is Auto: the card's own tier, src/server/h3-gpu.ts). */
+ export const H3_GPU_TIER: NonNullable<ModelOptions["controls"]>[number] = {
+ param: H3_TIER_PARAM,
+ label: "GPU tier",
+ values: ["standard", "fast", "trim"],
+ labels: {
+ standard: "32 GB or more · full model",
+ fast: "16 GB · FastH3 V2, 8 steps",
+ trim: "8-12 GB · FastH3 Trim, experimental, text to video only",
+ },
+ ops: { standard: ["t2v", "i2v", "flf2v"], fast: ["t2v", "i2v", "flf2v"], trim: ["t2v"] },
+ };
+
+ /** Sol-H3-VAE as Comfy-Org repacked it (int8 ConvRot, 1.99 GB): the full graphs' optional decoder. */
+ export const SOL_VAE = "minimax_h3_sol_vae_int8_convrot.safetensors";
+
+ /**
+ * Whether MiniMax H3 offers Options → Decoder (Fast decode). Held back: Sol-H3-VAE loads only with the core loader merged into
+ * ComfyUI master on 2026-10-28 (#17411), which no release has, the pinned ComfyUI (fc04da91) lacks, and the GPU check can't tell
+ * from a version string; no ComfyUI has accepted a run with it yet. Turn it on after the library validates on a pin with #17411
+ * (install-comfyui.sh names one as an opt-in). The full graphs already carry the decode slot and Sol's pinned file (optional).
+ */
+ export const H3_FAST_DECODE_OFFERED = false;
+
+ /**
+ * Options → Decoder: Fast decode swaps in Sol-H3-VAE, NVIDIA's 24-layer whole-clip decoder distilled from H3's (its card: a 5 s
+ * 768p clip decodes in 5.0 s instead of 12.5 s on an RTX 5090). Off by default; the full model only (it needs ComfyUI from
+ * 2026-10-28 on, and its memory grows with the clip).
+ */
+ export const H3_DECODER: NonNullable<ModelOptions["controls"]>[number] = {
+ param: "decoder",
+ label: "Decoder",
+ values: ["standard", "fast"],
+ default: "standard",
+ labels: { standard: "Standard", fast: "Fast decode · 32 GB GPU" },
+ sets: { standard: {}, fast: { vae: SOL_VAE } },
+ };
+
+ /** Fast decode picked with a smaller tier: the FastH3 graphs keep the standard decoder. */
+ export const TIER_DECODER_NOTE = "Fast decode needs a 32 GB GPU: this run uses the standard decoder";
+
+ /** What Auto runs on the card the GPU check read, as the composer says it (no file formats: visitors read it). */
+ export const AUTO_TIER_NOTES: Record<Exclude<H3Tier, "standard">, string> = {
+ fast: "On your GPU this runs as FastH3 V2, an 8-step build for 16-31 GB cards. A start frame is followed less closely than on the full model",
+ trim: "On your GPU this runs as FastH3 Trim, an experimental 8-step build for smaller cards: text to video only",
+ };
+
+ /**
+ * The composer's note under MiniMax H3's options: what a smaller tier changes when one is picked for an operation that has it,
+ * else (Auto) what the card the GPU check read runs (`auto`: BadgeMap.h3Tier).
+ */
+ export function h3TierNote(extra: Record<string, unknown> | undefined, op: string | undefined, auto?: "fast" | "trim"): string | undefined {
+ const picked = extra?.[H3_TIER_PARAM];
+ if (picked === undefined && auto && op && H3_GPU_TIER.ops?.[auto]?.includes(op)) {
+ return [AUTO_TIER_NOTES[auto], ...(extra?.quality === "best" ? [TIER_BEST_NOTE] : []), ...(extra?.decoder === "fast" ? [TIER_DECODER_NOTE] : [])].join(". ");
+ }
+ const tier = picked;
+ if ((tier !== "fast" && tier !== "trim") || !op || !H3_GPU_TIER.ops?.[tier]?.includes(op)) return undefined;
+ return [TIER_NOTES[tier], ...(extra?.quality === "best" ? [TIER_BEST_NOTE] : []), ...(extra?.decoder === "fast" ? [TIER_DECODER_NOTE] : [])].join(". ");
+ }
+
+ // ---------------------------------------------------------------------------
+ // The GPU pre-flight: the graph and file a card runs
+
+ /** What a GPU check read about its first card, as the chooser takes it. */
+ export function deviceOf(inv: GpuInventory | undefined): H3Device {
+ const d = inv?.devices[0];
+ return { vramGb: inv ? gpuVramGb(inv) : undefined, name: d?.name, type: d?.type, torch: inv?.comfy?.torch };
+ }
+
+ /**
+ * The index with a FastH3 graph needing `unet` in place of its default diffusion file (the card's NVFP4 or fp8 build), so the
+ * pre-flight checks and downloads the file the run loads. Unchanged when the file isn't one of the graph's optional files.
+ */
+ export function withTierFile(idx: RequirementIndex, graph: string, unet: string | undefined): RequirementIndex {
+ const w = idx.workflows[graph];
+ const key: FileKey = `diffusion_models/${unet}`;
+ if (!w || !unet || !w.optional.includes(key) || w.files.includes(key)) return idx;
+ const files = [...w.files.filter((f) => !/^diffusion_models\/fastvideo_fasth3_/.test(f)), key].sort();
+ return { ...idx, workflows: { ...idx.workflows, [graph]: { ...w, files, optional: w.optional.filter((f) => f !== key) } } };
+ }
+
+ /**
+ * A tool's graphs on this card: each Standard H3 graph that has a graph for the card's tier runs that one, with the card's file.
+ * `studio`: a studio row drops the H3 graphs the tier has none for (Trim's start-frame modes), so the row shows what the card
+ * can run; a single model operation keeps them (it then needs a bigger GPU). `allowed`: the tier's switch in Models & licences.
+ */
+ export function tierOnCard(
+ workflows: string[],
+ inv: GpuInventory,
+ idx: RequirementIndex,
+ opts: { studio?: boolean; allowed?: (tier: Exclude<H3Tier, "standard">) => boolean } = {},
+ ): { workflows: string[]; idx: RequirementIndex; choice?: H3TierChoice } {
+ if (!workflows.some((w) => H3_TIER_GRAPH[w])) return { workflows, idx };
+ const choice = chooseH3Tier(deviceOf(inv));
+ if (choice.tier === "standard") return { workflows, idx, choice };
+ if (opts.allowed && !opts.allowed(choice.tier)) return { workflows, idx };
+ let out = idx;
+ const graphs: string[] = [];
+ for (const w of workflows) {
+ const g = H3_TIER_GRAPH[w] ? tierGraphFor(w, choice.tier, (id) => !!idx.workflows[id]) : undefined;
+ if (g) {
+ out = withTierFile(out, g, choice.unet);
+ graphs.push(g);
+ } else if (!(opts.studio && H3_TIER_GRAPH[w])) graphs.push(w);
+ }
+ return graphs.length ? { workflows: [...new Set(graphs)], idx: out, choice } : { workflows, idx };
+ }
+
+ /** MiniMax H3's reference graphs (Character swap, the person remover on H3 Relay): no smaller build of H3 Ref2VA exists yet. */
+ export const REF2VA_H3 = /^video-(character-swap-h3|person-remove-h3)/;
+
+ /** What the pre-flight board says next to a row (src/server/gpu/readiness-service.ts): the build this card runs, or why none. */
+ export function tierRowNote(workflows: string[], choice: H3TierChoice | undefined, inv: GpuInventory, idx: RequirementIndex): { label: string; note?: string } | undefined {
+ if (choice && choice.tier !== "standard") {
+ const textOnly = choice.tier === "trim" ? "text to video only" : undefined;
+ const offload = choice.offload ? "part of it waits in system memory" : undefined;
+ const note = [textOnly, offload].filter(Boolean).join("; ");
+ return { label: choice.label, ...(note && { note: note[0].toUpperCase() + note.slice(1) }) };
+ }
+ // A card too small for the reference graphs (the GPU check's own reading, as their "Needs … GB" line says it).
+ const gb = gpuVramGb(inv);
+ const need = Math.max(0, ...workflows.filter((w) => REF2VA_H3.test(w)).map((w) => idx.workflows[w]?.vramGb ?? 0));
+ if (typeof gb === "number" && need > 0 && gb < need) {
+ return { label: "Standard", note: "Runs on the full MiniMax H3: there's no smaller build for swaps and removals yet" };
+ }
+ return undefined;
+ }
diff --cc src/lib/hubs.ts
index 44dec5c2,4671a74d..abbf3822
--- a/src/lib/hubs.ts
+++ b/src/lib/hubs.ts
@@@ -32,22 -18,24 +32,24 @@@ export const HUB_MODES: Record<HubKind
{ id: "dialogue", label: "Dialogue" },
{ id: "voice-change", label: "Voice change" },
{ id: "design", label: "Design a voice" },
- { id: "translate", label: "Translate" },
+ { id: "translate", label: "Translate", selfHostedOnly: true },
{ id: "transcribe", label: "Transcribe" },
{ id: "clean", label: "Clean up voice" },
- { id: "split", label: "Split soundtrack" },
+ { id: "split", label: "Split soundtrack", selfHostedOnly: true },
{ id: "sfx", label: "Sound effects" },
{ id: "music", label: "Music" },
+ { id: "song", label: "Extend & remix" },
{ id: "loop", label: "Loop / extend" },
{ id: "join", label: "Join" },
{ id: "video", label: "Sound for video" },
],
"video-tools": [
{ id: "matte", label: "Remove background" },
- { id: "remove-object", label: "Remove object" },
- { id: "remove-dialogue", label: "Remove dialogue" },
- { id: "remove-person", label: "Remove a person" },
- { id: "evolution", label: "Evolution" },
- { id: "restore", label: "Restore & colourise" },
+ { id: "remove-object", label: "Remove object", selfHostedOnly: true },
+ { id: "remove-dialogue", label: "Remove dialogue", selfHostedOnly: true },
++ { id: "remove-person", label: "Remove a person", ownerOnly: true, selfHostedOnly: true },
+ { id: "evolution", label: "Evolution", selfHostedOnly: true },
+ { id: "restore", label: "Restore & colourise", ownerOnly: true, selfHostedOnly: true },
{ id: "relight", label: "Relight" },
{ id: "depth", label: "Depth map" },
{ id: "captions", label: "Captions" },
diff --cc src/lib/layout-plan.ts
index 00000000,8d07a5f9..462bc3d3
mode 000000,100644..100644
--- a/src/lib/layout-plan.ts
+++ b/src/lib/layout-plan.ts
@@@ -1,0 -1,106 +1,106 @@@
+ /*
- * "Plan layout" (N7-8): a sentence ("a sale poster for my candle shop, 30% off") becomes a starting layout to adjust.
++ * "Plan layout": a sentence ("a sale poster for my candle shop, 30% off") becomes a starting layout to adjust.
+ * A text model writes a pixel draft (the instructions below, adapted with the Assist skill skills/layout-poster from
+ * OpenMOSS's Apache-2.0 prompt-enhancer skill); parseLayout reads it, validateLayout checks it. With no text model, or
+ * when its answer can't be used, planByRules lays out a poster from the sentence itself. Pure: the server's route and
+ * the tests share it.
+ */
+ import { aspectOf, parseLayout, validateLayout, type LayoutBox, type LayoutDraft, type LayoutItem } from "./layout-prompt";
+
+ /** The longest sentence the planner takes. */
+ export const PLAN_WORDS_MAX = 1000;
+
+ /**
+ * The planner's instructions. Adapted from OpenMOSS MOSS-Image's prompt-enhancer skill (skills/moss-image-prompt-enhancer
+ * SKILL.md and references/layout.md at 2b46b1e0e13b5aaec253879e0d006a42564b8b27), Copyright OpenMOSS, Apache License 2.0.
+ */
+ export const LAYOUT_PLAN_SYSTEM = `You plan image layouts for a picture model that places boxes. Answer with ONE JSON object and nothing else: no code fence, no words before or after it.
+ The schema: {"width": W, "height": H, "bbox_coord_space": "abs", "bbox_format": "xyxy", "summary": {"caption": "...", "meta": ["..."], "canvas": "single"}, "items": [{"label": "object" | "character" | "text", "caption": "...", "text": "...", "bbox": [x_min, y_min, x_max, y_max]}]}
+ Rules:
+ - Use exactly the width and height given. Boxes are whole pixels from the top-left corner: x from 0 to width, y from 0 to height. Never use 0-1 fractions.
+ - summary.caption describes the whole picture: subject, setting, medium, lighting, palette and mood, in plain sentences.
+ - One box per coherent visible unit: a headline, a product, a person, a price tag, a button. Usually 3 to 6 boxes. Boxes may overlap where the picture needs it.
+ - A "text" item carries the exact visible words in "text" (keep the user's wording, spelling and language) and its caption describes the lettering: size, weight, colour, typeface style. Write real copy, never "headline here".
+ - An "object" or "character" item's caption describes what it looks like. A box is a placement, not a border or a panel to draw.
+ - Establish a reading order and hierarchy: the headline large, supporting words smaller, enough room for the words to read at this size.
+ - Keep the user's subject, counts, style and any words they want shown. Don't invent facts such as dates, addresses or prices they didn't give.`;
+
+ /** What the planner is asked: the sentence and the canvas it draws on. */
+ export function planRequest(words: string, width: number, height: number): string {
+ return `Canvas: ${width} × ${height} pixels (width × height).\nPlan the layout for: ${words.trim()}`;
+ }
+
+ /** A model's answer as a draft on this canvas, when it is one that runs (no errors from validateLayout). */
+ export function readPlanned(text: string | null | undefined, width: number, height: number): LayoutDraft | null {
+ if (!text?.trim()) return null;
+ const parsed = parseLayout(text, { width, height });
+ if (!parsed || !parsed.draft.items.length) return null;
+ const draft: LayoutDraft = { ...parsed.draft, aspect: aspectOf(width, height) ?? parsed.draft.aspect };
+ return validateLayout(draft, width, height).some((i) => i.level === "error") ? null : draft;
+ }
+
+ // ---------------------------------------------------------------------------
+ // The rules (no text model)
+
+ const OFFER = /(\d{1,3}\s?%\s?off|half price|buy one,? get one(?: free)?|free shipping|[$£€]\s?\d+(?:[.,]\d{1,2})?|\d+(?:[.,]\d{1,2})?\s?(?:usd|eur|gbp|€|£))/i;
+ const QUOTED = /["“”«‘']([^"“”«»‘’']{2,80})["”»’']/;
+ const FOR_WHOM = /\bfor (?:my|our|the|a|an)\s+([\p{L}\p{N}'&-]+(?:\s+[\p{L}\p{N}'&-]+){0,3})/iu;
+ const STOP = /\s+(?:with|and|that|which|in|on|at|for)\b.*$/i;
+
+ const title = (s: string) =>
+ s
+ .trim()
+ .split(/\s+/)
+ .map((w) => (w.length > 2 || /^[A-Z]/.test(w) ? w[0].toUpperCase() + w.slice(1) : w))
+ .join(" ");
+
+ const box = (x0: number, y0: number, x1: number, y1: number): LayoutBox => [x0, y0, x1, y1];
+
+ /**
+ * A poster from the sentence alone: the words in quotes (or an offer such as "30% off", or who it is for) as the
+ * headline, the offer under it when the headline is something else, the subject in the middle and a button. Portrait
+ * and square canvases stack them; a wide one puts the words in a column beside the subject.
+ */
+ export function planByRules(words: string, width: number, height: number): LayoutDraft {
+ const said = words.trim().replace(/\s+/g, " ");
+ const quoted = QUOTED.exec(said)?.[1]?.trim();
+ const offer = OFFER.exec(said)?.[1]?.trim();
+ const whom = FOR_WHOM.exec(said)?.[1]?.replace(STOP, "").trim();
+ const headline =
+ quoted ??
+ (offer
+ ? offer.toUpperCase()
+ : whom
+ ? title(whom)
+ : title(
+ said
+ .split(/[,.;:!?]/)[0]
+ .split(" ")
+ .slice(0, 5)
+ .join(" "),
+ ));
+ const second = quoted && offer ? offer.toUpperCase() : !quoted && offer && whom ? title(whom) : "";
+ const subject =
+ said
+ .replace(QUOTED, "")
+ .replace(OFFER, "")
+ .replace(/[,\s]+$/, "")
+ .trim() || said;
+ const wide = width > height * 1.2;
+ const items: LayoutItem[] = wide
+ ? [
+ { label: "text", caption: "A large, bold headline in clean lettering, high contrast against the background", text: headline, box: box(0.06, 0.18, 0.48, 0.44) },
+ ...(second ? [{ label: "text" as const, caption: "Smaller supporting words under the headline, bold and easy to read", text: second, box: box(0.06, 0.48, 0.44, 0.6) }] : []),
+ { label: "text", caption: "A rounded button with a short call to action in bold letters", text: "Shop now", box: box(0.06, 0.7, 0.28, 0.82) },
+ { label: "object", caption: `The hero of the picture: ${subject}`, box: box(0.52, 0.1, 0.94, 0.9) },
+ ]
+ : [
+ { label: "text", caption: "A large, bold headline in clean lettering, high contrast against the background", text: headline, box: box(0.08, 0.05, 0.92, 0.2) },
+ ...(second ? [{ label: "text" as const, caption: "Smaller supporting words under the headline, bold and easy to read", text: second, box: box(0.2, 0.21, 0.8, 0.29) }] : []),
+ { label: "object", caption: `The hero of the picture: ${subject}`, box: box(0.14, 0.32, 0.86, 0.82) },
+ { label: "text", caption: "A rounded button with a short call to action in bold letters", text: "Shop now", box: box(0.3, 0.86, 0.7, 0.95) },
+ ];
+ const caption = said ? said[0].toUpperCase() + said.slice(1).replace(/[.\s]*$/, ".") : "";
+ const aspect = aspectOf(width, height);
+ return { summary: { caption, meta: ["poster", "graphic design"], canvas: "single" }, items, ...(aspect && { aspect }) };
+ }
diff --cc src/lib/layout-surfaces.ts
index 00000000,06c3bba0..e80c0ee7
mode 000000,100644..100644
--- a/src/lib/layout-surfaces.ts
+++ b/src/lib/layout-surfaces.ts
@@@ -1,0 -1,261 +1,261 @@@
+ /*
- * Layouts from the places that already know where things go (docs/research/new-models-7.md §4.10, N7-8): Ads Studio's
++ * Layouts from the places that already know where things go (docs/research/new-models-7.md §4.10): Ads Studio's
+ * planned rectangles (planAd), Marketing Studio's formats (the same planner, in the layout the browser sets the words
+ * in), and a Canvas Layout node fed by a Table. Pure: the browser, the server and the tests share it.
+ *
+ * Two kinds of layout come out of an ad plan:
+ * - "words": the headline, body and button as text items with their exact words, the logo area, a colour panel and
+ * the product as object items, so a model that reads boxes (MOSS-Image, FLUX.3, Ideogram 4.5) draws the whole ad;
+ * - "clear": the product alone, in the part of the picture the words leave free, so a picture that gets its words set
+ * on top in the browser keeps the product out of their way.
+ */
+ import { planAd, sizeFor, themeFrom, type AdContent, type AdLayout, type AdPlan, type Measure, type Rect, type TextBox } from "@/components/ads/layout";
+ import type { LayoutBox, LayoutDraft, LayoutItem } from "./layout-prompt";
+
+ /**
+ * A text width without a canvas (the server and tests): about half the font size per character, a little more in
+ * bold. The boxes guide the model; they don't set the type, so an estimate is enough.
+ */
+ export const roughMeasure: Measure = (text, font) => {
+ const px = Number(/(\d+(?:\.\d+)?)px/.exec(font)?.[1] ?? 16);
+ const bold = /^\s*[6-9]00\b/.test(font);
+ return [...text].length * px * (bold ? 0.58 : 0.52);
+ };
+
+ export type AdDraftMode = "words" | "clear";
+
+ export interface AdDraftOptions {
+ mode: AdDraftMode;
+ /** What the product (or the scene) looks like: the picture's own description. */
+ product: string;
+ /** The whole picture in words (the summary caption). */
+ caption: string;
+ /** Style tags (summary.meta). */
+ meta?: string[];
+ }
+
+ const clamp01 = (v: number) => Math.max(0, Math.min(1, v));
+ const round = (v: number) => Math.round(v * 1e4) / 1e4;
+
+ function boxOf(r: Rect, W: number, H: number): LayoutBox {
+ return [round(clamp01(r.x / W)), round(clamp01(r.y / H)), round(clamp01((r.x + r.w) / W)), round(clamp01((r.y + r.h) / H))];
+ }
+
+ /** A text block's rectangle on the canvas (as planRects reads it). */
+ function textRect(b: TextBox): Rect {
+ return {
+ x: b.align === "center" ? b.x - b.width / 2 : b.x,
+ y: b.y,
+ w: b.width,
+ h: b.lines.length * b.lineHeight,
+ };
+ }
+
+ function intersect(a: Rect, b: Rect): Rect | null {
+ const x0 = Math.max(a.x, b.x);
+ const y0 = Math.max(a.y, b.y);
+ const x1 = Math.min(a.x + a.w, b.x + b.w);
+ const y1 = Math.min(a.y + a.h, b.y + b.h);
+ return x1 > x0 && y1 > y0 ? { x: x0, y: y0, w: x1 - x0, h: y1 - y0 } : null;
+ }
+
+ /** Every rectangle the words (and the logo) take, as the browser draws them. */
+ export function copyRects(plan: AdPlan): Rect[] {
+ return [plan.logo, plan.brand && textRect(plan.brand), textRect(plan.headline), plan.body && textRect(plan.body), plan.cta].filter((r): r is Rect => !!r && r.w > 0 && r.h > 0);
+ }
+
+ /**
+ * Where the product goes: the picture's rectangle, less the words' space. When the words sit on the picture (Overlay,
+ * Band), the largest free part of it above, below, left or right of them; a part smaller than a fifth of the picture
+ * is no room for a product, so the whole picture is used.
+ */
+ export function productRect(plan: AdPlan): Rect {
+ const img: Rect = plan.image ? { x: plan.image.x, y: plan.image.y, w: plan.image.w, h: plan.image.h } : { x: 0, y: 0, w: plan.w, h: plan.h };
+ const over = copyRects(plan)
+ .filter((r) => r !== plan.logo)
+ .map((r) => intersect(r, img))
+ .filter((r): r is Rect => !!r);
+ if (!over.length) return img;
+ const x0 = Math.min(...over.map((r) => r.x));
+ const y0 = Math.min(...over.map((r) => r.y));
+ const x1 = Math.max(...over.map((r) => r.x + r.w));
+ const y1 = Math.max(...over.map((r) => r.y + r.h));
+ const gap = plan.w * 0.02;
+ const parts: Rect[] = [
+ { x: img.x, y: img.y, w: img.w, h: y0 - gap - img.y },
+ { x: img.x, y: y1 + gap, w: img.w, h: img.y + img.h - y1 - gap },
+ { x: img.x, y: img.y, w: x0 - gap - img.x, h: img.h },
+ { x: x1 + gap, y: img.y, w: img.x + img.w - x1 - gap, h: img.h },
+ ].filter((r) => r.w > 0 && r.h > 0);
+ const best = parts.sort((a, b) => b.w * b.h - a.w * a.h)[0];
+ return best && best.w * best.h >= (img.w * img.h) / 5 ? best : img;
+ }
+
+ /** The family a CSS font string names first ("800 64px \"Inter\", system-ui" → Inter). */
+ const familyOf = (font: string) => /"([^"]+)"/.exec(font)?.[1] ?? "clean sans-serif";
+ /** A text colour as words a model reads: its hex, or white / near-black for the planner's rgba shades. */
+ const colourWords = (c: string) => (/^#[0-9a-f]{6}$/i.test(c) ? `colour ${c}` : /255,\s*255,\s*255/.test(c) ? "white" : `colour ${c}`);
+
+ const sentence = (s: string) => s.trim().replace(/[.\s]+$/, "");
+
+ /** The logo box's caption: the logo itself goes to the model as its last reference image (adDraft's `logo`). */
+ export const LOGO_CAPTION = "The brand's logo, exactly as in the last reference image, small and crisp";
+
+ /** An ad plan as a layout draft (see the file comment for the two modes). */
+ export function adPlanDraft(plan: AdPlan, o: AdDraftOptions): LayoutDraft {
+ const W = plan.w;
+ const H = plan.h;
+ const items: LayoutItem[] = [];
+ const product = sentence(o.product) || "The product";
+ if (o.mode === "words") {
+ if (plan.panel)
+ items.push({
+ label: "object",
+ caption: `A flat, solid ${plan.panel.color} colour panel with nothing printed on it`,
+ box: boxOf(plan.panel, W, H),
+ });
+ items.push({
+ label: "object",
+ caption: product,
+ box: boxOf(productRect(plan), W, H),
+ });
+ if (plan.logo)
+ items.push({
+ label: "object",
+ caption: LOGO_CAPTION,
+ box: boxOf(plan.logo, W, H),
+ });
+ const text = (b: TextBox | undefined, what: string) => {
+ const words = b?.lines.join("\n").trim();
+ if (!b || !words) return;
+ items.push({
+ label: "text",
+ caption: `${what}, ${b.align === "center" ? "centred" : "left-aligned"}, ${colourWords(b.color)}, in a ${familyOf(b.font)}-style typeface`,
+ text: words,
+ box: boxOf(textRect(b), W, H),
+ });
+ };
+ text(plan.brand, "The brand name in small capitals");
+ text(plan.headline, "A large, bold headline");
+ text(plan.body, "Smaller supporting copy, easy to read");
+ const label = plan.cta?.text.lines.join(" ").trim();
+ if (plan.cta && label) {
+ items.push({
+ label: "text",
+ caption: `A rounded pill button in ${plan.cta.color} with its label in bold ${colourWords(plan.cta.text.color)} letters`,
+ text: label,
+ box: boxOf(plan.cta, W, H),
+ });
+ }
+ } else {
+ items.push({
+ label: "object",
+ caption: product,
+ box: boxOf(productRect(plan), W, H),
+ });
+ }
+ const shade = o.mode === "words" && plan.scrim ? "A soft dark shade fades in behind the words so they read clearly" : "";
+ const clear = o.mode === "clear" ? "No text, letters or logos anywhere; the rest of the picture stays calm and uncluttered" : "";
+ const caption = [sentence(o.caption), shade, clear].filter(Boolean).join(". ");
+ const aspect = aspectFrom(W, H);
+ return {
+ summary: {
+ caption: caption ? `${caption}.` : "",
+ meta: o.meta ?? [],
+ canvas: "single",
+ },
+ items,
+ ...(aspect && { aspect }),
+ };
+ }
+
+ function gcd(a: number, b: number): number {
+ return b ? gcd(b, a % b) : a;
+ }
+ const aspectFrom = (w: number, h: number) => {
+ const g = gcd(Math.round(w), Math.round(h));
+ return g ? `${Math.round(w) / g}:${Math.round(h) / g}` : undefined;
+ };
+
+ export interface AdDraftInput {
+ /** "4:5", "3:4"… (the picture's shape). */
+ ratio: string;
+ layout: AdLayout;
+ content: AdContent;
+ brand?: {
+ colors?: string[];
+ fonts?: { heading?: string; body?: string };
+ logo?: string;
+ } | null;
+ mode: AdDraftMode;
+ product: string;
+ caption: string;
+ meta?: string[];
+ /**
+ * The brand's logo goes to the model as its last reference image: plan its place. Without it there is no logo box,
+ * so a model that draws from words alone doesn't make up a mark in the brand's name.
+ */
+ logo?: boolean;
+ }
+
+ /**
+ * The layout for an ad or a Marketing Studio picture: planned as the browser would set it (planAd, with the brand's
+ * colours and fonts, and the logo's place when the logo goes to the model), then turned into a draft. The draft keeps the shape
+ * asked for, so the server compiles it at the size the model renders (src/lib/catalog/plan.ts planLayout).
+ */
+ export function adDraft(i: AdDraftInput): LayoutDraft {
+ const { w, h } = sizeFor(i.ratio);
+ const plan = planAd({
+ ratio: i.ratio,
+ layout: i.layout,
+ content: i.content,
+ theme: themeFrom(i.brand),
+ image: { w, h },
+ logo: i.logo && i.brand?.logo ? { w: 3, h: 1 } : null,
+ measure: roughMeasure,
+ });
+ const draft = adPlanDraft(plan, {
+ mode: i.mode,
+ product: i.product,
+ caption: i.caption,
+ meta: i.meta,
+ });
+ return /^\d+:\d+$/.test(i.ratio) ? { ...draft, aspect: i.ratio } : draft;
+ }
+
+ // ---------------------------------------------------------------------------
+ // Tables (Canvas): one layout, a batch of posters
+
+ const PLACEHOLDER = /\{([^{}\n]{1,40})\}/g;
+
+ /** The "{Column}" names a layout's words use (text items, captions and the whole picture's caption). */
+ export function layoutPlaceholders(draft: LayoutDraft): string[] {
+ const found = new Set<string>();
+ const scan = (s?: string) => {
+ for (const m of (s ?? "").matchAll(PLACEHOLDER)) found.add(m[1].trim());
+ };
+ scan(draft.summary.caption);
+ for (const it of draft.items) {
+ scan(it.text);
+ scan(it.caption);
+ }
+ return [...found];
+ }
+
+ /** A layout with a table row's cells in its "{Column}" placeholders (names as the columns spell them, trimmed). */
+ export function fillLayout(draft: LayoutDraft, columns: string[], cells: string[]): LayoutDraft {
+ const at = new Map<string, string>();
+ columns.forEach((c, j) => {
+ if (c.trim()) at.set(c.trim(), cells[j] ?? "");
+ });
+ const fill = (s: string) => s.replace(PLACEHOLDER, (all, name: string) => (at.has(name.trim()) ? at.get(name.trim())! : all));
+ return {
+ ...draft,
+ summary: { ...draft.summary, caption: fill(draft.summary.caption) },
+ items: draft.items.map((it) => ({
+ ...it,
+ caption: fill(it.caption),
+ ...(it.text !== undefined && { text: fill(it.text) }),
+ })),
+ };
+ }
diff --cc src/lib/licences.ts
index 1b6f51ad,4ced8d4f..f0785c65
--- a/src/lib/licences.ts
+++ b/src/lib/licences.ts
@@@ -634,12 -580,12 +635,18 @@@ export const ATTRIBUTIONS: Attribution[
url: "https://huggingface.co/nvidia/NVIDIA-NemotronLabs-RE-USE",
note: "Trained in part on WSJ (LDC) and an internal NVIDIA set (model card). The older nvidia/RE-USE repository is non-commercial (NSCLv1); Fuobe uses only the NemotronLabs repositories.",
},
+ {
+ for: "Genjutsu: Group swap, Scene edit, From picture, Fix faces and Fix colours",
+ text: "Openjutsu, copyright (c) 2026 D3voz: the graphs Fuobe sends to your GPU, the settings code Fuobe ported from it, the SolarRenderer long-clip patch and the 17 light looks' wording",
+ licence: "MIT",
+ url: "https://github.com/D3voz/openjutsu",
+ },
+ {
+ for: "The Layout Poster skill and Plan layout",
+ text: "Adapted from MOSS-Image's prompt-enhancer skill and its layout reference (commit 2b46b1e), copyright OpenMOSS",
+ licence: "Apache-2.0",
+ url: "https://github.com/OpenMOSS/MOSS-Image",
+ },
];
/** The parts of a LoRA's licence snapshot the class needs (src/lib/catalog/types.ts LoraLicence). */
diff --cc src/lib/lyrics.ts
index 00000000,cafc99d2..0dafc87b
mode 000000,100644..100644
--- a/src/lib/lyrics.ts
+++ b/src/lib/lyrics.ts
@@@ -1,0 -1,217 +1,217 @@@
+ /**
- * Song lyrics with section tags (nm10-music3): what Audio → Music's lyrics editor writes into params.extra.lyrics and what
++ * Song lyrics with section tags: what Audio → Music's lyrics editor writes into params.extra.lyrics and what
+ * every model that sings reads. Pure (browser and server).
+ *
+ * The models read the structure from tags on lines of their own: MiniMax Music 3 ("[intro] [verse] [pre-chorus] [chorus]
+ * [post-chorus] [bridge] [instrumental] [solo] [outro]", its card and fal's schema: "text on the same line as a leading tag is
+ * dropped"), YuE2 and ACE-Step ([Verse], [Chorus], [Bridge], [Outro]), Mureka and MiniMax Music 2.5 (the same names). Fuobe
+ * writes them in title case ("[Pre-Chorus]"), each on its own line, words on the lines below it.
+ */
+
+ /** The params.extra key the lyrics travel in (the ComfyUI graphs' `lyrics` binding reads it as it is). */
+ export const LYRICS_PARAM = "lyrics";
+
+ /** params.extra key of a song tool's source when it is one of the provider's own songs (a result's meta.songId). */
+ export const SONG_ID_PARAM = "songId";
+
+ /**
+ * A past run's song, for Reuse: its lyrics (back in the editor) and its Mureka song id together with the song that id names
+ * (so the id goes again only while that song is the one attached); `extra` comes back without either.
+ */
+ export function songFromRun(
+ extra: Record<string, unknown> | undefined,
+ audio: string | undefined,
+ ): { extra: Record<string, unknown> | undefined; lyrics?: string; song?: { id: string; url: string } } {
+ if (!extra || (!(LYRICS_PARAM in extra) && !(SONG_ID_PARAM in extra))) return { extra };
+ const { [LYRICS_PARAM]: words, [SONG_ID_PARAM]: id, ...rest } = extra;
+ return {
+ extra: Object.keys(rest).length ? rest : undefined,
+ ...(typeof words === "string" && { lyrics: words }),
+ ...(typeof id === "string" && id && audio && { song: { id, url: audio } }),
+ };
+ }
+
+ /**
+ * A request's song id, for a song tool: one of Mureka's own songs goes by its id only while it is still the song attached;
+ * any other song (one swapped in, or a stale id left in the settings) is sent as the file itself.
+ */
+ export function withSongId(
+ extra: Record<string, unknown> | undefined,
+ song: { id: string; url: string } | undefined,
+ attached: string | undefined,
+ byId: boolean,
+ ): Record<string, unknown> | undefined {
+ const rest = { ...extra };
+ delete rest[SONG_ID_PARAM];
+ if (byId && song && attached && attached === song.url) rest[SONG_ID_PARAM] = song.id;
+ return Object.keys(rest).length ? rest : undefined;
+ }
+
+ /** The section tags the editor offers, in song order. */
+ export const SECTION_TAGS = ["Intro", "Verse", "Pre-Chorus", "Chorus", "Post-Chorus", "Bridge", "Instrumental", "Solo", "Outro"] as const;
+
+ /** The lyrics of an instrumental (MiniMax Music 3 needs some: a run with none asks for this). */
+ export const INSTRUMENTAL = "[Instrumental]";
+
+ export interface LyricsSection {
+ /** The tag's name as written in title case ("Verse", "Verse 2", "Chorus - Guitar"), or null for lines before any tag. */
+ tag: string | null;
+ lines: string[];
+ }
+
+ /** A section tag on its own: "[Verse]", "[verse 2]", "[Pre Chorus]", "[Outro - Final Chord]". */
+ const TAG = /^\[([^\[\]\n]{1,100})\]/;
+
+ /** "pre chorus" / "PRE-CHORUS" → "Pre-Chorus"; a number or a note after the name is kept ("Verse 2", "Intro - Guitar Riff"). */
+ export function tagName(raw: string): string {
+ const t = raw.trim().replace(/\s+/g, " ");
+ const known = SECTION_TAGS.find((s) => t.toLowerCase().replace(/[\s_]+/g, "-").startsWith(s.toLowerCase()));
+ if (!known) return t.charAt(0).toUpperCase() + t.slice(1);
+ const rest = t.slice(known.length).replace(/^[\s_-]*(?=\d)/, " ");
+ return `${known}${rest}`;
+ }
+
+ /** The sections of a song's lyrics: each tag with the lines under it (words after a tag on its line move below it). */
+ export function parseLyrics(text: string): LyricsSection[] {
+ const out: LyricsSection[] = [];
+ let current: LyricsSection | null = null;
+ for (const raw of text.replace(/\r\n?/g, "\n").split("\n")) {
+ let line = raw.trim();
+ let m = TAG.exec(line);
+ while (m) {
+ current = { tag: tagName(m[1]), lines: [] };
+ out.push(current);
+ line = line.slice(m[0].length).trim();
+ m = TAG.exec(line);
+ }
+ if (!line) continue;
+ if (!current) {
+ current = { tag: null, lines: [] };
+ out.push(current);
+ }
+ current.lines.push(line);
+ }
+ return out;
+ }
+
+ /**
+ * The lyrics as the models read them: one tag per line in title case, its words below it, a blank line between sections,
+ * no trailing spaces. Empty when there are no words and no tags.
+ */
+ export function normalizeLyrics(text: string | undefined | null): string {
+ if (!text?.trim()) return "";
+ return parseLyrics(text)
+ .map((s) => [...(s.tag ? [`[${s.tag}]`] : []), ...s.lines].join("\n"))
+ .join("\n\n");
+ }
+
+ /** Only instrumental sections (or nothing at all): nothing to sing. */
+ export function isInstrumental(text: string | undefined | null): boolean {
+ const sections = parseLyrics(text ?? "");
+ return sections.every((s) => (s.tag ? /^(instrumental|solo|inst|break|interlude)\b/i.test(s.tag) : false) && s.lines.length === 0);
+ }
+
+ /** The lyrics a request carries (params.extra.lyrics), normalized; empty when there are none. */
+ export function lyricsOf(extra: Record<string, unknown> | undefined): string {
+ const v = extra?.[LYRICS_PARAM];
+ return typeof v === "string" ? normalizeLyrics(v) : "";
+ }
+
+ /** What is wrong with these lyrics for a model that takes up to `max` characters, in plain words; null when they fit. */
+ export function lyricsProblem(text: string, max: number | undefined, model = "This model"): string | null {
+ const n = normalizeLyrics(text).length;
+ if (max && n > max) return `${model} sings up to ${max.toLocaleString("en-US")} characters of lyrics: these are ${n.toLocaleString("en-US")}. Shorten them or drop a verse`;
+ return null;
+ }
+
+ /** What is wrong with a description and lyrics read as one text of up to `max` characters (Lyria 3.5); null when they fit. */
+ export function promptLyricsProblem(prompt: string, lyrics: string, max: number, model = "This model"): string | null {
+ const n = promptWithLyrics(prompt, lyrics).length;
+ if (n > max) {
+ return `${model} reads up to ${max.toLocaleString("en-US")} characters of description and lyrics together: these are ${n.toLocaleString("en-US")}. Shorten them or drop a verse`;
+ }
+ return null;
+ }
+
+ /** The prompt with the lyrics after it, for a model that reads both in one text (Lyria 3.5). */
+ export function promptWithLyrics(prompt: string, lyrics: string): string {
+ const words = normalizeLyrics(lyrics);
+ if (!words) return prompt;
+ const p = prompt.trim().replace(/[.\s]+$/, "");
+ return isInstrumental(words) ? `${p}. Instrumental, no vocals.` : `${p}.\n\nLyrics:\n${words}`;
+ }
+
+ /**
+ * A tag put in at the cursor on a line of its own, a blank line between it and the words before it, the cursor on the line
+ * after it for the words. At the start of a line it goes before that line, else after the line the cursor is on. For the
+ * editor's tag chips.
+ */
+ export function insertTag(text: string, at: number, tag: string): { text: string; cursor: number } {
+ const pos = Math.max(0, Math.min(text.length, at));
+ const lineStart = pos === 0 || text[pos - 1] === "\n";
+ const nl = text.indexOf("\n", pos);
+ const cut = lineStart ? pos : nl === -1 ? text.length : nl;
+ const before = text.slice(0, cut).replace(/\s+$/, "");
+ const after = text.slice(cut).replace(/^\s+/, "");
+ const lead = before ? `${before}\n\n` : "";
+ const block = `[${tagName(tag)}]\n`;
+ return { text: `${lead}${block}${after ? `\n${after}` : ""}`, cursor: lead.length + block.length };
+ }
+
+ /** The sections' tags in order, for a one-line summary ("Verse · Chorus · Verse · Chorus · Bridge"). */
+ export function structureOf(text: string): string[] {
+ return parseLyrics(text).flatMap((s) => (s.tag ? [s.tag] : []));
+ }
+
+ /** Seconds as m:ss ("2:00", "4:30"). */
+ export function songLength(seconds: number): string {
+ const s = Math.max(0, Math.round(seconds));
+ return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
+ }
+
+ /**
+ * What Mureka's song tools take (fal's schemas, read 2026-11-02): Stems an MP3 or M4A song of up to 10 MB; Remix a song of
+ * 10 to 350 seconds with vocals (not an instrumental).
+ */
+ export const STEMS_FORMATS = ["mp3", "m4a"];
+ export const STEMS_MAX_BYTES = 10 * 1000 * 1000;
+ export const REMIX_SECONDS = { min: 10, max: 350 } as const;
+
+ const FORMAT_OF_TYPE: Record<string, string> = {
+ "audio/mpeg": "mp3",
+ "audio/mp3": "mp3",
+ "audio/mp4": "m4a",
+ "audio/m4a": "m4a",
+ "audio/x-m4a": "m4a",
+ "audio/aac": "aac",
+ "audio/wav": "wav",
+ "audio/x-wav": "wav",
+ "audio/wave": "wav",
+ "audio/flac": "flac",
+ "audio/x-flac": "flac",
+ "audio/ogg": "ogg",
+ "audio/webm": "webm",
+ };
+
+ /** A song file's format ("mp3", "wav"…) from its type, else its name; undefined when neither says. */
+ export function songFormat(contentType: string | undefined, name: string | undefined): string | undefined {
+ const byType = contentType ? FORMAT_OF_TYPE[contentType.split(";")[0].trim().toLowerCase()] : undefined;
+ if (byType) return byType;
+ const ext = /\.([a-z0-9]{2,5})(?:[?#]|$)/i.exec(name?.split("/").pop() ?? "")?.[1]?.toLowerCase();
+ return ext === "mpeg" || ext === "mpga" ? "mp3" : ext;
+ }
+
+ /** Why a song tool can't take this song, in plain words; null when it can (what isn't known yet is not held against it). */
+ export function songToolProblem(op: string, song: { format?: string; bytes?: number; seconds?: number }): string | null {
+ if (op === "song-stems") {
+ if (song.format && !STEMS_FORMATS.includes(song.format)) return `Stems take an MP3 or M4A song: this one is a ${song.format.toUpperCase()} file. Save it as an MP3 and add it again`;
+ if (song.bytes && song.bytes > STEMS_MAX_BYTES) {
+ return `Stems take a song of up to 10 MB: this one is ${Math.ceil(song.bytes / 100_000) / 10} MB. Save it as a smaller MP3 and add it again`;
+ }
+ }
+ if (op === "song-remix" && song.seconds && (song.seconds < REMIX_SECONDS.min || song.seconds > REMIX_SECONDS.max)) {
+ return `Remix takes a song of ${songLength(REMIX_SECONDS.min)} to ${songLength(REMIX_SECONDS.max)}: this one is ${songLength(song.seconds)}`;
+ }
+ return null;
+ }
+
diff --cc src/lib/output-actions.ts
index 01c4985e,03fd7ac3..dd2ef06e
--- a/src/lib/output-actions.ts
+++ b/src/lib/output-actions.ts
@@@ -12,9 -12,10 +12,11 @@@ import { PRESETS as GRADE_PRESETS } fro
import { storedPath } from "./share";
import { decodeMoss, LAYOUT_PARAM, readLayout, type LayoutDraft } from "./layout-prompt";
import { REMOVE_DIALOGUE_FEATURE } from "./av/remove-dialogue";
-import { canRerender, regenerateFamily, regenerateHref, rerenderLabel } from "./catalog/regenerate";
+import { canRerender, REGEN_OFFERED, regenerateFamily, regenerateHref, rerenderLabel } from "./catalog/regenerate";
import { CLEAN_FEATURE } from "./av/clean-voice";
+import { anyAngleHref } from "./catalog/any-angle";
+ import { isInstrumental, lyricsOf, songFormat, STEMS_FORMATS } from "./lyrics";
+ import { CLEAN_DIALOGUE_FEATURE, cleanDialogueHref } from "./av/clean-dialogue";
export type OutputActionId =
| "animate"
@@@ -156,8 -150,12 +163,12 @@@ export function outputActions(g: Genera
link("add-sound", "Add sound", `/audio/video?video=${q(o.url)}`);
link("split-soundtrack", "Split soundtrack", `/audio/split?video=${q(o.url)}`);
link("remove-dialogue", "Remove dialogue", `/video-tools/remove-dialogue?video=${q(o.url)}`);
- // H3 Person Removal (o/person-remover-plus): Video tools → Remove a person with the clip in.
++ // H3 Person Removal: Video tools → Remove a person with the clip in.
+ link("remove-person", "Remove a person", `/video-tools/remove-person?video=${q(o.url)}`);
// Clean up voice on a video's soundtrack: results that carry sound, and uploads (a clip from a phone or a call).
if (g.feature === "upload" || (g.op && SOUNDED_VIDEO_OPS.has(g.op))) link("clean-voice", "Clean up voice", `/audio/clean?video=${q(o.url)}`);
+ // Clean up dialogue (Split soundtrack's preset): the music and effects out from under the speech, or a cloud cleaner.
+ if ((g.feature === "upload" || (g.op && SOUNDED_VIDEO_OPS.has(g.op))) && g.feature !== CLEAN_DIALOGUE_FEATURE) link("clean-dialogue", "Clean up dialogue", cleanDialogueHref("video", o.url));
// A Fuobe DoP colour-grade effect: the clip opens in Color grading with its grade picked (one click to export).
const dopGrade = gradeOf(o);
link("grade", dopGrade ? `Apply the ${dopGrade.name} grade` : "Color grade", `/color-grade?video=${q(o.url)}${dopGrade ? `&preset=${q(dopGrade.id)}` : ""}`);
@@@ -251,9 -285,14 +298,16 @@@ export function nextSteps(g: Generation
const at = ids.indexOf("upscale");
return at < 0 ? [...regen, ...ids] : [...ids.slice(0, at + 1), ...regen, ...ids.slice(at + 1)];
};
+ // A picture made in Edit: Relight in place of Edit (its composer is right there).
+ const image: OutputActionId[] | undefined = o.kind === "image" && g.feature === "edit" ? ["animate", "relight", "upscale"] : NEXT_STEPS[o.kind];
- const order: OutputActionId[] = o.kind === "video" ? [...(gradeOf(o) ? (["grade"] as const) : []), ...(withRegen(video) ?? [])] : (image ?? []);
+ // A song: its song tools first (where they're offered), then Split soundtrack.
+ const song: OutputActionId[] = ["extend-song", "remix-song", "song-stems", "split-soundtrack"];
+ const order: OutputActionId[] =
+ o.kind === "video"
+ ? [...(gradeOf(o) ? (["grade"] as const) : []), ...(withRegen(video) ?? [])]
+ : o.kind === "audio" && g.op && SONG_OPS.has(g.op) && all.some((a) => a.id === "extend-song")
+ ? song
- : (NEXT_STEPS[o.kind] ?? []);
++ : (image ?? []);
return order
.map((id) => all.find((a) => a.id === id && a.href))
.filter((a): a is OutputAction => !!a)
diff --cc src/lib/path-splat.ts
index 00000000,5d34a089..4891ddc7
mode 000000,100644..100644
--- a/src/lib/path-splat.ts
+++ b/src/lib/path-splat.ts
@@@ -1,0 -1,63 +1,63 @@@
+ /**
- * A headless point-cloud renderer (build plan N7-7, option B): the frames of a camera path drawn through a still's point
++ * A headless point-cloud renderer (option B): the frames of a camera path drawn through a still's point
+ * cloud (scene3d buildPointCloud) with no browser and no GPU, for the server's path render (src/server/path-render.ts).
+ * It draws what the browser's recordPath draws for Uni3C: the points seen from each camera, nearest in front, black where
+ * nothing was seen.
+ *
+ * Pure: typed arrays in, typed arrays out.
+ */
+
+ import type { Mat3, Mat4 } from "./camera-path";
+ import type { PointCloud } from "./scene3d";
+
+ /** The widest a point is drawn (pixels), so a point right in front of the camera doesn't paint the whole frame. */
+ export const MAX_SPLAT_PX = 6;
+
+ /**
+ * One frame, RGB (3 bytes a pixel, rows top-down), of `cloud` (glTF axes: x right, y up, the photo looking down −Z) seen by
+ * a camera-to-world `pose` in OpenCV axes (x right, y down, z forward; the world is the photo camera's own frame, as
+ * camera-path framePoses makes them) with pixel intrinsic `k`. Each point is a square as wide as its size at its distance.
+ */
+ export function splatFrame(cloud: Pick<PointCloud, "positions" | "colors" | "sizes" | "count">, pose: Mat4, k: Mat3, width: number, height: number, out?: Uint8Array): Uint8Array {
+ const rgb = out ?? new Uint8Array(width * height * 3);
+ rgb.fill(0);
+ const zbuf = new Float32Array(width * height).fill(Infinity);
+ const [fx, fy, cx, cy] = [k[0][0], k[1][1], k[0][2], k[1][2]];
+ // World → camera: R^T (p − eye), R's columns being the camera's right, down and forward.
+ const ex = pose[0][3];
+ const ey = pose[1][3];
+ const ez = pose[2][3];
+ const r = [0, 1, 2].map((c) => [pose[0][c], pose[1][c], pose[2][c]]);
+ const { positions: P, colors: C, sizes: S } = cloud;
+ for (let i = 0; i < cloud.count; i++) {
+ // glTF → OpenCV: y and z flip.
+ const px = P[i * 3] - ex;
+ const py = -P[i * 3 + 1] - ey;
+ const pz = -P[i * 3 + 2] - ez;
+ const zc = r[2][0] * px + r[2][1] * py + r[2][2] * pz;
+ if (zc <= 1e-4) continue;
+ const xc = r[0][0] * px + r[0][1] * py + r[0][2] * pz;
+ const yc = r[1][0] * px + r[1][1] * py + r[1][2] * pz;
+ const u = (fx * xc) / zc + cx;
+ const v = (fy * yc) / zc + cy;
+ const half = Math.min(MAX_SPLAT_PX, Math.max(1, (fx * S[i]) / zc)) / 2;
+ const x0 = Math.max(0, Math.floor(u - half));
+ const x1 = Math.min(width - 1, Math.ceil(u + half) - 1);
+ const y0 = Math.max(0, Math.floor(v - half));
+ const y1 = Math.min(height - 1, Math.ceil(v + half) - 1);
+ if (x0 > x1 || y0 > y1) continue;
+ const red = Math.round(C[i * 3] * 255);
+ const green = Math.round(C[i * 3 + 1] * 255);
+ const blue = Math.round(C[i * 3 + 2] * 255);
+ for (let y = y0; y <= y1; y++)
+ for (let x = x0; x <= x1; x++) {
+ const o = y * width + x;
+ if (zc >= zbuf[o]) continue;
+ zbuf[o] = zc;
+ rgb[o * 3] = red;
+ rgb[o * 3 + 1] = green;
+ rgb[o * 3 + 2] = blue;
+ }
+ }
+ return rgb;
+ }
diff --cc src/lib/studios.ts
index 5a87967a,329a334f..38ad6438
--- a/src/lib/studios.ts
+++ b/src/lib/studios.ts
@@@ -325,6 -326,27 +326,27 @@@ export const MUSIC_STUDIO: StudioConfi
suggestions: ["Lo-fi hip hop beat with soft piano, 80 bpm", "Epic orchestral trailer music building to a drop", "Upbeat indie pop with handclaps and a whistled hook"],
};
+ /**
- * Audio → Extend & remix (nm10-music3): a song's cloud tools on Mureka. Extend it with new lyrics, remix it in another style
++ * Audio → Extend & remix: a song's cloud tools on Mureka. Extend it with new lyrics, remix it in another style
+ * with its lyrics, or split it into its stems. Any song works: Mureka's own by its id, any other sent to it first. The
+ * song's length is read so an extension starts at its end (voiceFacts).
+ */
+ export const SONG_TOOLS_STUDIO: StudioConfig = {
+ feature: "song-tools",
+ title: "Audio",
+ hero: "Take a song further",
+ subtitle: "Extend it with new lyrics, remix it in another style, or split it into its tracks. Runs in the cloud on Mureka.",
+ placeholder: "The remix's style: genre, mood, voice, instruments",
+ kind: "audio",
+ ops: ["song-extend", "song-remix", "song-stems"],
+ feed: { kind: "audio", features: ["song-tools"] },
+ slots: [{ key: "audio", label: "Song", accept: "audio", required: true }],
+ defaultModels: { cloud: "mureka-extend", open: "" },
+ promptOptional: true,
+ voiceFacts: true,
+ controlsTitle: "Options",
+ };
+
export const FOLEY_STUDIO: StudioConfig = {
feature: "audio",
title: "Audio",
diff --cc src/server/assist/studio-tools.ts
index 81010ff9,b0f3e786..3d5eb7df
--- a/src/server/assist/studio-tools.ts
+++ b/src/server/assist/studio-tools.ts
@@@ -704,6 -717,41 +717,41 @@@ const restoreVideo = defineTool(
},
});
+ /**
+ * A clip Remove a person can't read (its length and size unknown): the same H3 removal as separate steps in the Library,
+ * on the part asked for (else up to a minute from its start), without its sound.
+ */
+ function removePersonSteps(i: RemovePersonToolInput): PipelineStep[] {
+ const start = i.start ?? 0;
+ const plan = planRemoval({
+ engine: "open",
+ mode: "type",
+ eraser: getEraser("oss-h3-person-remove")!,
+ title: removalTitle({ mode: "type", prompt: i.who }),
+ source: { url: i.video, hasAudio: false },
+ range: { start, end: i.end ?? start + REMOVE.maxSeconds },
+ prompt: i.who,
+ ...(i.mask_grow !== undefined && { maskGrow: i.mask_grow }),
+ });
+ return plan.steps.map((s) => ({ key: s.key, request: { ...s.request, feature: s.request.feature ?? "assist" }, ...(s.after?.length && { after: s.after, chain: s.chain }) }));
+ }
+
-/** Remove a person (o/person-remover-plus): Video tools → Remove a person, H3 Person Removal on your GPU. */
++/** Remove a person: Video tools → Remove a person, H3 Person Removal on your GPU. */
+ const removePerson = defineTool({
+ name: "remove_person",
+ description:
+ "Remove a person from a video and rebuild the scene behind them — Fuobe's Remove a person (Video tools → Remove a person): MiniMax H3 with Akatz Labs' Person Remover LoRA on your GPU (open source, free), from a clean first frame Qwen-Image 2.1 makes, in 22-frame windows; the clip's sound is kept. " +
+ "It runs on your GPU only (24 GB with offloading and the H3 Relay nodes). In the studio the user can check the green mask first and redo any weak window. For objects, or on the cloud, use generate with a remove-object model. Gated by the same approval card as generate.",
+ schema: RemovePersonInput,
+ gated: true,
+ title: (i) => `Remove · ${i.who.slice(0, 60)}`,
+ place: (i, ctx) => placeFor(STUDIO_ROUTES.remove_person, i, ctx),
+ plan: (i, ctx) => planVia("remove_person", STUDIO_ROUTES.remove_person, i, ctx, () => planSteps("remove_person", removePersonSteps(i))),
+ async run(i, ctx) {
+ return runVia(STUDIO_ROUTES.remove_person, i, ctx, "Started removing the person", () => startPipeline("Remove a person", removePersonSteps(i), removalTitle({ mode: "type", prompt: i.who })));
+ },
+ });
+
/**
* Blockout to film (package blockout-film): Cinema's Blockout plan (src/lib/catalog/cinema.ts planBlockout), run as a
* pipeline in the Library: one call or shots cut at the beats and joined in the cloud, 81-frame depth windows on the GPU.
@@@ -771,7 -819,70 +819,70 @@@ const blockoutFilm = defineTool(
},
});
- export const STUDIO_TOOLS = [splitLayers, restyleFootage, dubVideo, facelessEpisode, createAds, addCaptions, restoreVideo, blockoutFilm];
+ // ---------------------------------------------------------------------------
-// Fly around (build plan N7-7): a still filmed along an exact camera path
++// Fly around: a still filmed along an exact camera path
+
+ export const FlyAroundToolInput = z.object({
+ image: ref.describe("The still to film: the clip's first frame (a character, a product, a scene)."),
+ views: z.array(ref).max(FLY_VIEWS_MAX).optional().describe("Cloud only: other pictures of the same subject from other sides; MiniMax H3 Max takes them as references (the path then goes in words)."),
+ preset: z
+ .enum(PATH_PRESETS.map((p) => p.id) as [string, ...string[]])
+ .optional()
+ .describe(`A ready move: ${PATH_PRESETS.map((p) => `${p.id} (${p.name})`).join(", ")}. Leave it out to give the orbit's numbers instead.`),
+ degrees: z.number().min(30).max(360).optional().describe("An exact orbit: how far round the subject, 30–360° (default 360)."),
+ direction: z.enum(["cw", "ccw"]).optional().describe("An exact orbit's direction seen from above: cw moves the camera round to the left, ccw to the right (default ccw)."),
+ tilt: z.number().min(0).max(20).optional().describe("An exact orbit's height tilt, 0–20°: the ring rises over the first half turn and dips below eye level over the second."),
+ pulse: z.boolean().optional().describe("An exact orbit moves 25% in and out twice on the way round."),
+ prompt: z.string().max(1500).optional().describe("Motion words: what the subject does while the camera moves (the camera's own move is set by the path)."),
+ duration: z.number().min(1).max(15).optional().describe("Cloud only: seconds (default 5). Your GPU always films about 5 s."),
+ });
+ export type FlyAroundToolInput = z.infer<typeof FlyAroundToolInput>;
+
+ /** The fly-around's steps as a pipeline in the Library (src/lib/catalog/fly-around.ts). */
+ function flyAroundSteps(i: FlyAroundToolInput, ctx: ToolContext): PipelineStep[] {
+ const engine = engineOf(ctx);
+ const exact = !i.preset || i.degrees !== undefined || i.direction !== undefined || i.tilt !== undefined || i.pulse !== undefined;
+ const plan = planFlyAround({
+ engine,
+ image: i.image,
+ views: i.views,
+ ...(exact ? { orbit: { degrees: i.degrees ?? 360, direction: i.direction ?? "ccw", tilt: i.tilt ?? 0, pulse: i.pulse ? 0.25 : 0 } } : { preset: i.preset }),
+ prompt: i.prompt,
+ duration: i.duration,
+ feature: "fly-around",
+ });
+ if (plan.blocker) throw new Error(plan.blocker);
+ return plan.steps.map((s) => ({ key: s.key, request: s.request, ...(s.after?.length && { after: s.after }) }));
+ }
+
+ const flyAround = defineTool({
+ name: "fly_around",
+ description:
+ "Film a still along an exact camera path: an orbit set by numbers (degrees, direction seen from above, a height tilt, a radius pulse) or a ready move (Orbit 360°, arcs, a tilted ring, a figure of eight, dollies, trucks) — Fuobe's Fly around. " +
+ "In the cloud MiniMax H3 Max camera controls follows the path as keyframes from the still (5 s at 768P is $0.40 at list price); with other views of the subject, MiniMax H3 Max takes them as references and the path goes in words. " +
+ "On your GPU MoGe 2 measures the still's depth, the studio renders the path through it, and Wan 2.1 with Uni3C films the still along that render: free, about 5 s, a large GPU (about 48 GB). Gated by the same approval card as generate.",
+ schema: FlyAroundToolInput,
+ gated: true,
+ title: (i) => (i.preset ? `Fly around: ${PATH_PRESETS.find((p) => p.id === i.preset)?.name ?? i.preset}` : `Fly around: ${i.degrees ?? 360}°`),
+ plan: (i, ctx) => {
+ try {
+ return planSteps("fly_around", flyAroundSteps(i, ctx));
+ } catch (e) {
+ return [{ tool: "fly_around", modelId: "fly-around", modelName: "Fly around", kind: "video", op: "camera-path", prompt: "Fly around", count: 0, costUsd: 0, demo: false, atomic: true, error: (e as Error).message }];
+ }
+ },
+ async run(i, ctx) {
+ let steps: PipelineStep[];
+ try {
+ steps = flyAroundSteps(i, ctx);
+ } catch (e) {
+ return { content: JSON.stringify({ error: (e as Error).message }), isError: true };
+ }
+ return startPipeline("Fly around", steps, "Fly around");
+ },
+ });
+
+ export const STUDIO_TOOLS = [splitLayers, restyleFootage, dubVideo, facelessEpisode, createAds, addCaptions, restoreVideo, removePerson, blockoutFilm, flyAround];
/** For tests: the fallback pipelines, as they would be created. */
- export const fallbackSteps = { restore: restoreSteps, layers: layerSteps, restyle: restyleSteps, dub: dubSteps, faceless: facelessSteps, captions: captionSteps, ads: adRequests, blockout: blockoutSteps };
+ export const fallbackSteps = { restore: restoreSteps, layers: layerSteps, restyle: restyleSteps, dub: dubSteps, faceless: facelessSteps, captions: captionSteps, ads: adRequests, blockout: blockoutSteps, flyAround: flyAroundSteps };
diff --cc src/server/audio-tools.ts
index 21c801b0,31a0a055..33d6575b
--- a/src/server/audio-tools.ts
+++ b/src/server/audio-tools.ts
@@@ -20,14 -20,11 +21,15 @@@ import { tenant, tenantAccount } from "
* the plan from src/lib/av/audio-tools.ts, src/lib/av/split.ts or src/lib/av/remove-dialogue.ts is priced step by step,
* and a run is one createPipeline batch, so its results land in the Library like any generation. Split soundtrack and
* Remove dialogue run on the open engine only (DBS isn't hosted); a split's mix goes back on the video with a "remux" run
- * on either engine.
+ * on either engine. Clean up dialogue (src/lib/av/clean-dialogue.ts) runs on both: DBS's remix on the open engine, a hosted
+ * speech cleaner (VEED, DeepFilterNet 3, ElevenLabs isolation) in the cloud.
*/
-const FileUrl = z.string().startsWith("/api/files/").max(500);
+/** A stored file, or one of Fuobe's published example inputs (a page's example, loaded as the source: example-files.ts). */
+const FileUrl = z
+ .string()
+ .max(500)
+ .refine((v) => v.startsWith("/api/files/") || isExampleRef(v), { message: "Invalid input: expected a stored file" });
const Engine = z.enum(["cloud", "open"]);
const Curve = z.enum(["equal-power", "linear"]).optional();
const Crossfade = z.number().min(0).max(CROSSFADE_MAX).optional();
diff --cc src/server/canvas.ts
index 1149de72,a16a5ecd..8e5f6776
--- a/src/server/canvas.ts
+++ b/src/server/canvas.ts
@@@ -170,6 -192,13 +192,13 @@@ const NodeData = z.object(
rows: z.array(z.array(z.string().max(TABLE_LIMITS.cell)).max(TABLE_LIMITS.columns)).max(TABLE_LIMITS.rows * 2).optional(),
// Translate (video) on the open engine: the dub it started in Translate & dub.
dubId: z.string().max(40).optional(),
+ // Layout: its boxes (read as a Fuobe draft, anything else dropped).
+ layout: LayoutData.optional(),
- // Camera path (N7-7): a preset, an exact orbit or keys; Fly around: the clip's length.
++ // Camera path: a preset, an exact orbit or keys; Fly around: the clip's length.
+ pathPreset: z.string().max(40).optional(),
+ orbit: ExactOrbitSchema.optional(),
+ keys: z.array(CameraKeySchema).min(1).max(MAX_KEYS).optional(),
+ duration: z.number().min(1).max(15).optional(),
});
const Num = z.number().finite();
diff --cc src/server/cinema-schemas.ts
index 78f091f0,f707a82f..c243c785
--- a/src/server/cinema-schemas.ts
+++ b/src/server/cinema-schemas.ts
@@@ -112,6 -112,10 +112,10 @@@ export const GenerateBody = z.object(
modelId: z.string().max(80).optional(),
prompt: z.string().max(60_000).default(""),
moves: z.array(z.string().max(40)).max(12).optional(),
- // N7-7: the first move as an exact orbit.
++ // The first move as an exact orbit.
+ exact: z
+ .object({ degrees: z.number().min(30).max(360), direction: z.enum(["cw", "ccw"]), tilt: z.number().min(0).max(20).optional(), pulse: z.number().min(0).max(0.25).optional() })
+ .optional(),
settings: DirectorSchema.optional(),
images: z.array(FileRef).max(30).optional(),
videos: z.array(FileRef).max(10).optional(),
diff --cc src/server/db.ts
index d1b746cf,e6975faa..2c02c5ef
--- a/src/server/db.ts
+++ b/src/server/db.ts
@@@ -605,9 -605,13 +605,13 @@@ export const MIGRATIONS: string[] =
CREATE INDEX IF NOT EXISTS assets_account ON assets(account_id, created_at DESC);
CREATE INDEX IF NOT EXISTS assets_rel ON assets(rel_path);
CREATE INDEX IF NOT EXISTS assets_generation ON assets(generation_id);`,
- // originals (o/nm10-voice-design): a designed voice on its element (Design a voice): the model, the words, what its clip
+ // Design a voice: a designed voice on its element: the model, the words, what its clip
// says and, once the cloud has cloned it, Qwen3-TTS's embedding file (src/lib/catalog/elements.ts ElementVoice).
`ALTER TABLE characters ADD COLUMN voice_json TEXT;`,
- // originals (o/w2s-w4): a scheduled task can run a saved skill (Skills W4) instead of a request Assist plans: the
++ // a scheduled task can run a saved skill instead of a request Assist plans: the
+ // skill's name, one set of its inputs as text (a file is its /api/files/… URL) and the file inputs that take the
+ // newest upload of their kind when the run starts. NULL: a request, as before.
+ `ALTER TABLE assist_schedules ADD COLUMN skill_json TEXT;`,
];
/**
diff --cc src/server/enhance.ts
index e2e03ec3,e3e2107f..4c4c2176
--- a/src/server/enhance.ts
+++ b/src/server/enhance.ts
@@@ -182,6 -183,36 +183,36 @@@ export async function enhanceSoulWords(
return out && out.length > w.length ? out : words;
}
-/** Audio → Music's "Write the lyrics" (nm10-music3): words to sing, tagged by section as every Fuobe music model reads them. */
++/** Audio → Music's "Write the lyrics": words to sing, tagged by section as every Fuobe music model reads them. */
+ const LYRICS_SYSTEM = `You write lyrics for a song generation model. Answer with the lyrics only: no title, no notes, no quotes, no code fence.
+ Rules:
+ - Put each section tag on a line of its own, in square brackets: [Intro], [Verse], [Pre-Chorus], [Chorus], [Bridge], [Outro]; [Instrumental] or [Solo] for a part with no singing. The words of a section go on the lines under its tag.
+ - A common shape is Verse, Chorus, Verse, Chorus, Bridge, Chorus; repeat the chorus word for word.
+ - Short, singable lines of 5 to 10 words that rhyme or half-rhyme. Concrete images over abstractions.
+ - Only the words to be sung: no stage directions, no instruments, no chord names.
+ - Keep the description's language, subject, mood and any words it quotes.`;
+
+ /**
+ * Lyrics for a song described in `idea`, about as long as `seconds` of music and at most `max` characters, from whichever
+ * LLM the install allows (Claude or a local model); null when none answers. Tags are normalized (src/lib/lyrics.ts).
+ */
+ export async function writeLyrics(idea: string, o: { seconds?: number; max?: number } = {}): Promise<string | null> {
+ const seconds = o.seconds && o.seconds > 0 ? Math.min(600, o.seconds) : 120;
+ const sections = seconds <= 45 ? "one verse and one chorus" : seconds <= 100 ? "a verse, a chorus, a second verse and the chorus again" : "a full song (two or three verses, the chorus after each, a bridge)";
+ const room = o.max ? ` Stay under ${Math.floor(o.max * 0.9)} characters.` : "";
+ const text = await llmText(LYRICS_SYSTEM, `Write lyrics for this song, about ${Math.round(seconds / 60 * 10) / 10} minutes long: ${sections}.${room}\n\n${idea.trim()}`);
+ const words = normalizeLyrics(text?.replace(/^```\w*\n?|```$/g, ""));
+ if (!words) return null;
+ return o.max && words.length > o.max ? trimLyrics(words, o.max) : words;
+ }
+
+ /** Lyrics cut to at most `max` characters at the last line break before it (at `max` itself when there is none). */
+ export function trimLyrics(words: string, max: number): string {
+ const cut = words.lastIndexOf("\n", max);
+ const out = normalizeLyrics(words.slice(0, cut > 0 ? cut : max));
+ return out.length > max ? out.slice(0, max).trimEnd() : out;
+ }
+
export async function enhancePrompt(prompt: string, kind: MediaKind, op: Operation): Promise<string> {
return (await llmText(SYSTEM, instruction(prompt, kind, op))) ?? heuristicEnhance(prompt, kind, op);
}
diff --cc src/server/fly-around.ts
index 00000000,bdb07cdb..6760dd36
mode 000000,100644..100644
--- a/src/server/fly-around.ts
+++ b/src/server/fly-around.ts
@@@ -1,0 -1,153 +1,153 @@@
+ import "server-only";
+ import { nanoid } from "nanoid";
+ import { z } from "zod";
+ import { DISTANCE, MAX_KEYS } from "@/lib/camera-path";
+ import { EXACT_LIMITS } from "@/lib/exact-orbit";
+ import { FLY_VIEWS_MAX, planFlyAround, type FlyAroundInput, type FlyAroundPlan, type FlyStep } from "@/lib/catalog/fly-around";
+ import type { Generation } from "@/lib/catalog/types";
+ import { cancelGeneration, createGenerations, previewChained, previewGeneration } from "./generations";
+ import { isOffered } from "./model-access";
+
+ /**
- * Fly around (build plan N7-7): the plan from src/lib/catalog/fly-around.ts, checked step by step on this install (keys,
++ * Fly around: the plan from src/lib/catalog/fly-around.ts, checked step by step on this install (keys,
+ * demo mode, Settings → Models & licences, the engine mode) and run as one batch. Fuobe DoP's exact orbits, Image to 3D's
+ * "Film it photoreal", Canvas's Fly around node and Assist's fly_around tool call it (/api/fly-around).
+ */
+
+ const FileRef = z.string().startsWith("/api/files/").max(500);
+
+ export const CameraKeySchema = z.object({
+ t: z.number().min(0).max(1),
+ azimuth: z.number().min(-360 * 32).max(360 * 32),
+ elevation: z.number().min(-90).max(90),
+ distance: z.number().min(DISTANCE.min).max(DISTANCE.max),
+ truck: z.number().min(-4).max(4).optional(),
+ });
+
+ export const ExactOrbitSchema = z.object({
+ degrees: z.number().min(EXACT_LIMITS.degrees.min).max(EXACT_LIMITS.degrees.max),
+ direction: z.enum(["cw", "ccw"]),
+ tilt: z.number().min(EXACT_LIMITS.tilt.min).max(EXACT_LIMITS.tilt.max).default(0),
+ pulse: z.number().min(0).max(0.25).default(0),
+ });
+
+ /** What /api/fly-around takes. */
+ export const FlyAroundSchema = z.object({
+ engine: z.enum(["cloud", "open"]),
+ image: FileRef.optional(),
+ views: z.array(FileRef).max(FLY_VIEWS_MAX).optional(),
+ orbit: ExactOrbitSchema.optional(),
+ preset: z.string().max(40).optional(),
+ keys: z.array(CameraKeySchema).min(1).max(MAX_KEYS).optional(),
+ render: FileRef.optional(),
+ prompt: z.string().max(1500).optional(),
+ duration: z.number().min(1).max(15).optional(),
+ resolution: z.string().max(10).optional(),
+ /** Where the run is filed: the studio's feed it starts from (default "fly-around"). */
+ feature: z
+ .string()
+ .regex(/^[a-z0-9][a-z0-9-]{0,39}$/)
+ .optional(),
+ title: z.string().max(80).optional(),
+ seed: z.number().int().min(0).max(4_294_967_295).optional(),
+ requestId: z.string().max(80).optional(),
+ });
+
+ export class FlyAroundError extends Error {
+ constructor(
+ message: string,
+ public status = 422,
+ ) {
+ super(message);
+ }
+ }
+
+ export interface FlyAroundPreview {
+ engine: FlyAroundPlan["engine"];
+ model: { id: string; name: string };
+ label: string;
+ keys: FlyAroundPlan["keys"];
+ duration: number;
+ steps: number;
+ notes: string[];
+ blocker?: string;
+ costUsd: number | null;
+ demo: boolean;
+ }
+
+ /** The plan as this install runs it: a model switched off in Settings → Models & licences is a blocker. */
+ function plan(input: FlyAroundInput): FlyAroundPlan {
+ const p = planFlyAround(input);
+ const off = p.steps.find((s) => !isOffered(s.request.modelId));
+ return off && !p.blocker ? { ...p, blocker: "This move is switched off on this studio" } : p;
+ }
+
+ /** The run as the server would make it, priced, without running it. */
+ export function previewFlyAround(input: FlyAroundInput): FlyAroundPreview {
+ const p = plan(input);
+ let blocker = p.blocker;
+ let cost: number | null = p.costUsd;
+ let demo = false;
+ const notes = [...p.notes];
+ if (!blocker) {
+ cost = 0;
+ try {
+ for (const s of p.steps) {
+ const r = s.after?.length ? previewChained(s.request, s.after.length) : previewGeneration(s.request);
+ demo ||= r.demo;
+ cost = r.costUsd === null || cost === null ? null : cost + r.costUsd;
+ for (const n of r.notes ?? []) if (!notes.includes(n)) notes.push(n);
+ }
+ } catch (e) {
+ blocker = (e as Error).message;
+ cost = p.costUsd;
+ }
+ }
+ return {
+ engine: p.engine,
+ model: { id: p.model.id, name: p.model.name },
+ label: p.label,
+ keys: p.keys,
+ duration: p.duration,
+ steps: p.steps.length,
+ notes,
+ ...(blocker && { blocker }),
+ costUsd: demo ? 0 : cost === null ? null : Math.round(cost * 1000) / 1000,
+ demo,
+ };
+ }
+
+ /** Run the steps in order as one batch (each waits for the steps it names). The film first. */
+ export function runFlySteps(steps: FlyStep[], batchId = nanoid(10)): Generation[] {
+ const made: Record<string, Generation[]> = {};
+ const all: Generation[] = [];
+ try {
+ for (const s of steps) {
+ const deps = s.after?.map((k) => made[k]?.[0]?.id).filter((x): x is string => !!x) ?? [];
+ const created = createGenerations(s.request, { batchId, ...(deps.length && { dependsOn: deps }) });
+ made[s.key] = created;
+ all.push(...created);
+ }
+ } catch (e) {
+ for (const g of all) void cancelGeneration(g.id);
+ throw new FlyAroundError((e as Error).message);
+ }
+ const film = made.main?.[0];
+ return film ? [film, ...all.filter((g) => g.id !== film.id)] : all;
+ }
+
+ export interface FlyAroundResult {
+ final: Generation;
+ items: Generation[];
+ batchId: string;
+ plan: FlyAroundPreview;
+ }
+
+ /** Plan, check every step, then run them. */
+ export function createFlyAround(input: FlyAroundInput): FlyAroundResult {
+ const preview = previewFlyAround(input);
+ if (preview.blocker) throw new FlyAroundError(preview.blocker);
+ const batchId = nanoid(10);
+ const items = runFlySteps(plan(input).steps, batchId);
+ return { final: items[0], items, batchId, plan: preview };
+ }
diff --cc src/server/gpu/tools.ts
index a7a6c1ba,009d52ad..a73a94f2
--- a/src/server/gpu/tools.ts
+++ b/src/server/gpu/tools.ts
@@@ -8,9 -10,9 +10,9 @@@ import { graphLoras, PERSON_REMOVER_LOR
import { BLOCKOUT_MODELS, PATH_MODELS } from "@/lib/catalog/cinema";
import { dualEngine, onEngine, runsOn } from "@/lib/catalog/engines";
import { FRAMES_MODELS } from "@/lib/catalog/keyframes";
- import { REMOVE_TOOLS } from "@/lib/catalog/remove-object";
+ import { PERSON_REMOVAL_TOOLS, REMOVE_TOOLS } from "@/lib/catalog/remove-object";
import { RESTORE, RESTORE_OPEN_JOIN } from "@/lib/catalog/restore";
-import { REGEN_DEFAULT_TIER, REGEN_JOIN, REGEN_MODEL, regenerateGraphLoras } from "@/lib/catalog/regenerate";
+import { REGEN_DEFAULT_TIER, REGEN_JOIN, REGEN_MODEL, REGEN_OFFERED, regenerateGraphLoras } from "@/lib/catalog/regenerate";
import { COMPOSITE_MODEL } from "@/lib/catalog/sharpen";
import { ORIGINALS, SHARPEN_TOOLS } from "@/lib/catalog/genjutsu";
import { libraryEntry, loraEntry, loraRef, needsToken } from "@/lib/catalog/loras";
@@@ -188,6 -192,17 +192,17 @@@ export const STUDIO_ROWS: StudioRowDef[
{ href: "/character-swap", label: "Character swap", group: "Video", workflows: [STUDIO_WORKFLOWS.mask, STUDIO_WORKFLOWS.segment] },
// Cinema's 3D scene films a still along a keyframed camera path (N7-5).
{ href: "/cinema", label: "Fly path", group: "Video", steps: [{ modelId: PATH_MODELS.open, op: "camera-path" }] },
- // Exact orbits (N7-7): Fuobe DoP's and Cinema's orbit moves by their numbers, Canvas's Fly around and Assist's fly_around:
++ // Exact orbits: Fuobe DoP's and Cinema's orbit moves by their numbers, Canvas's Fly around and Assist's fly_around:
+ // MoGe 2 measures the still's depth, the server renders the path, Uni3C films along it.
+ {
+ href: "/motions",
+ label: "Exact orbits and Fly around",
+ group: "Video",
+ steps: [
+ { modelId: FLY_MODELS.depth, op: "scene-3d" },
+ { modelId: FLY_MODELS.open, op: "camera-path" },
+ ],
+ },
// Cinema's Blockout to film on your GPU: the first frame from the references, the depth cut into windows, each window
// rendered by the blockout graph and handed over on its last frame, then joined. An upload without a depth pass (the
// usual Blender render) runs the restyle graph instead, which reads the depth with Depth Anything 3. The projects list
@@@ -300,6 -316,21 +325,21 @@@
{ modelId: REMOVE_DIALOGUE_MODELS.mux, op: "mux" },
],
},
- // Remove a person (o/person-remover-plus): the part fitted to 24 fps, its first frame cleaned by Qwen-Image 2.1, the green
++ // Remove a person: the part fitted to 24 fps, its first frame cleaned by Qwen-Image 2.1, the green
+ // mask preview, H3 Relay's Person Removal with Akatz Labs' Person Remover LoRA, and the sound put back.
+ {
+ href: "/video-tools/remove-person",
+ label: "Remove a person",
+ group: "Video tools",
+ steps: [
+ { modelId: "oss-h3-person-remove", op: "remove-object", loras: [PERSON_REMOVER_LORA] },
+ { modelId: PERSON_REMOVAL_TOOLS.mask, op: "bg-remove-video" },
+ { modelId: PERSON_REMOVAL_TOOLS.fit, op: "trim" },
+ { modelId: PERSON_REMOVAL_TOOLS.frame, op: "frame" },
+ { modelId: PERSON_REMOVAL_TOOLS.clean, op: "edit" },
+ { modelId: REMOVE_TOOLS.open.mux, op: "mux" },
+ ],
+ },
{ href: "/video-tools/relight", label: "Relight", group: "Video tools", config: S.VIDEO_RELIGHT_STUDIO },
{ href: "/video-tools/depth", label: "Depth map", group: "Video tools", config: S.VIDEO_DEPTH_STUDIO },
{ href: "/video-tools/join", label: "Join clips", group: "Video tools", config: S.JOIN_CLIPS_STUDIO },
diff --cc src/server/layout-plan.ts
index 00000000,98f406c7..7d47c944
mode 000000,100644..100644
--- a/src/server/layout-plan.ts
+++ b/src/server/layout-plan.ts
@@@ -1,0 -1,31 +1,31 @@@
+ import "server-only";
+ import { LAYOUT_MULTIPLE, type LayoutDraft } from "@/lib/layout-prompt";
+ import { LAYOUT_PLAN_SYSTEM, planByRules, planRequest, readPlanned } from "@/lib/layout-plan";
+ import { llmText, llmTextBackend } from "./enhance";
+
+ /**
- * "Plan layout" (the Layout editor; N7-8): the sentence becomes a draft on the editor's canvas. The install's AI helper
++ * "Plan layout" (the Layout editor): the sentence becomes a draft on the editor's canvas. The install's AI helper
+ * (Claude when it is allowed, else a local model) writes it; an answer that doesn't read as a layout, or one that
+ * validateLayout refuses, falls back to the rules, as does an install with no AI helper.
+ */
+ export interface PlannedLayout {
+ layout: LayoutDraft;
+ /** Who planned it: the AI helper, or Fuobe's rules. */
+ by: "llm" | "rules";
+ }
+
+ export async function planLayoutFromWords(
+ words: string,
+ width: number,
+ height: number,
+ ask: (system: string, user: string) => Promise<string | null> = (s, u) => llmText(s, u, { json: "object" }),
+ ): Promise<PlannedLayout> {
+ if (llmTextBackend()) {
+ const planned = readPlanned(await ask(LAYOUT_PLAN_SYSTEM, planRequest(words, width, height)).catch(() => null), width, height);
+ if (planned) return { layout: planned, by: "llm" };
+ }
+ return { layout: planByRules(words, width, height), by: "rules" };
+ }
+
+ /** A canvas side the planner takes: a multiple of 16 from 256 to 2048 px (else the 1024 default). */
+ export const planSide = (v: unknown): number => (typeof v === "number" && Number.isInteger(v) && v >= 256 && v <= 2048 && v % LAYOUT_MULTIPLE === 0 ? v : 1024);
diff --cc src/server/path-render.ts
index 00000000,ba0db3fd..f8f83398
mode 000000,100644..100644
--- a/src/server/path-render.ts
+++ b/src/server/path-render.ts
@@@ -1,0 -1,98 +1,98 @@@
+ import "server-only";
+ import { spawn } from "node:child_process";
+ import fs from "node:fs";
+ import path from "node:path";
+ import { nanoid } from "nanoid";
+ import sharp from "sharp";
+ import { PATH_FPS, PATH_FRAMES, framePoses, renderSize, type CameraKey } from "@/lib/camera-path";
+ import { splatFrame } from "@/lib/path-splat";
+ import { LENS, buildPointCloud, lensFov } from "@/lib/scene3d";
+ import { adoptFile, readRef, scratchDir } from "./storage";
+
+ /**
- * The server's path render (build plan N7-7, option B: a small headless point-cloud renderer, no node pack): a still and
++ * The server's path render (option B: a small headless point-cloud renderer, no node pack): a still and
+ * its depth picture (MoGe 2's, from the depth step) become a point cloud the way Cinema's 3D scene builds one (scene3d
+ * buildPointCloud, the photo taken with the scene's default lens), drawn along the camera path at 81 frames, 16 fps (the
+ * Uni3C graph's length), black where nothing was seen, and encoded to an MP4 by ffmpeg. Canvas, Assist, Fuobe DoP and
+ * Cinema's exact orbits use it, since none of them has a browser view of the scene; Cinema's 3D scene and Image to 3D
+ * still record theirs in the browser.
+ *
+ * It runs inside the step's run (generations.ts advanceDependents): an account's step reads only its own files
+ * (readRef) and the render is stored as its file.
+ */
+
+ /** At most this many points (every second pixel of an 832 px render): a few seconds of CPU for 81 frames. */
+ const MAX_POINTS = 300_000;
+
+ export class PathRenderError extends Error {}
+
+ /** Raw RGBA pixels of a picture at exactly `size`. */
+ async function pixels(data: Buffer, size: { width: number; height: number }) {
+ const img = sharp(data, { failOn: "none" }).rotate().removeAlpha().ensureAlpha().resize(size.width, size.height, { fit: "fill" });
+ const { data: raw, info } = await img.raw().toBuffer({ resolveWithObject: true });
+ return { width: info.width, height: info.height, data: raw };
+ }
+
+ /** Frames as RGB into ffmpeg's stdin, an H.264 MP4 out (yuv420p, so every reader plays it), written to `file`. */
+ function encode(file: string, frames: number, width: number, height: number, fps: number, frame: (i: number) => Uint8Array): Promise<void> {
+ return new Promise((resolve, reject) => {
+ const args = ["-hide_banner", "-loglevel", "error", "-f", "rawvideo", "-pix_fmt", "rgb24", "-s", `${width}x${height}`, "-r", String(fps), "-i", "pipe:0"];
+ args.push("-c:v", "libx264", "-preset", "veryfast", "-crf", "18", "-pix_fmt", "yuv420p", "-movflags", "+faststart", "-f", "mp4", "-y", file);
+ let child: ReturnType<typeof spawn>;
+ try {
+ child = spawn(process.env.FFMPEG_PATH || "ffmpeg", args, { stdio: ["pipe", "ignore", "pipe"] });
+ } catch {
+ reject(new PathRenderError("Rendering the camera path needs ffmpeg on the studio's server"));
+ return;
+ }
+ let err = "";
+ child.stderr!.on("data", (b: Buffer) => (err += b.toString()));
+ child.on("error", () => reject(new PathRenderError("Rendering the camera path needs ffmpeg on the studio's server")));
+ child.on("close", (code) => (code === 0 ? resolve() : reject(new PathRenderError(`The camera path couldn't be encoded${err ? `: ${err.trim().split("\n").pop()}` : ""}`))));
+ child.stdin!.on("error", () => undefined);
+ (async () => {
+ for (let i = 0; i < frames; i++) {
+ if (!child.stdin!.write(frame(i))) await new Promise((r) => child.stdin!.once("drain", r));
+ }
+ child.stdin!.end();
+ })().catch(() => child.kill());
+ });
+ }
+
+ export interface PathRenderInput {
+ /** The still (the clip's first frame). */
+ photo: string;
+ /** Its depth picture (MoGe 2's depth render; any grey or Spectral depth map scene3d reads). */
+ depth: string;
+ keys: CameraKey[];
+ frames?: number;
+ fps?: number;
+ }
+
+ /** The path through the still's scene: its frame size and a renderer for frame i (RGB, rows top-down). */
+ export async function pathScene(input: Omit<PathRenderInput, "fps">): Promise<{ width: number; height: number; count: number; frame: (i: number) => Uint8Array }> {
+ const [photoFile, depthFile] = await Promise.all([readRef(input.photo), readRef(input.depth)]);
+ const meta = await sharp(photoFile.data, { failOn: "none" }).metadata();
+ const aspect = (meta.autoOrient?.width ?? meta.width ?? 1) / (meta.autoOrient?.height ?? meta.height ?? 1);
+ // Read at the render's own size, so every point covers about its pixel there.
+ const size = renderSize(aspect);
+ const photo = await pixels(photoFile.data, size);
+ const depth = await pixels(depthFile.data, size);
+ const hFov = lensFov(LENS.default, aspect).h;
+ const cloud = buildPointCloud(photo, depth, { hFov, maxPoints: MAX_POINTS });
+ const poses = framePoses(input.keys, input.frames ?? PATH_FRAMES, cloud.depth, hFov, size);
+ // A new buffer a frame: the encoder's pipe may still hold the last one.
+ return { ...size, count: poses.poses.length, frame: (i) => splatFrame(cloud, poses.poses[i], poses.intrinsic, size.width, size.height) };
+ }
+
+ /** Render the path and store it (an MP4, as the generation's derived file): its URL, for the step's `video`. */
+ export async function renderPathVideo(input: PathRenderInput, generationId?: string): Promise<string> {
+ const scene = await pathScene(input);
+ const file = path.join(scratchDir(), `path-${nanoid(10)}.mp4`);
+ try {
+ await encode(file, scene.count, scene.width, scene.height, input.fps ?? PATH_FPS, scene.frame);
+ return adoptFile({ from: file, contentType: "video/mp4", name: "path-render.mp4", source: "derived", ...(generationId && { generationId }) }).url;
+ } finally {
+ fs.rmSync(file, { force: true });
+ }
+ }
diff --cc src/server/providers/comfyui.ts
index 7eceb33a,0ee735f0..d8595e7c
--- a/src/server/providers/comfyui.ts
+++ b/src/server/providers/comfyui.ts
@@@ -61,10 -62,10 +63,11 @@@ import { CHARACTER_SWAP, packResolution
import { maskMemoryProblem } from "@/lib/catalog/swap-studio";
import { STUDIO_WORKFLOWS } from "@/lib/catalog/swap-studio-plan";
import { maskGraph, segmentGraph, type MaskGraphOptions, type SegmentGraphOptions } from "@/lib/swap-studio-graphs";
+import { CONTEXT_LOOP_IDS, OPENJUTSU_IDS, openjutsuGraph, openjutsuLeftOut, runName, type OpenjutsuSettings } from "@/lib/openjutsu-graphs";
import { RESTORE_EXTRA_KEYS, restoreGraph, restoreJob, type RestoreJob } from "@/lib/restore-graph";
import { getMaker, makerPrompt, OPEN_TARGET_PROBLEM, ORIGINALS, swapTarget } from "@/lib/catalog/genjutsu";
- import { CLICK_OPEN_PROBLEM, HAND_OFF, REMOVE_SCENE, targetPhrase } from "@/lib/catalog/remove-object";
+ import { CLICK_OPEN_PROBLEM, HAND_OFF, REMOVE_SCENE, REVIEW_EXTRA, reuseOf, reviewOfRun, targetPhrase, type RemovalReview } from "@/lib/catalog/remove-object";
+ import { H3_REMOVAL_WORKFLOW } from "@/lib/catalog/character-swap";
import type { GenInput, MediaKind, ModelRoute, Operation } from "@/lib/catalog/types";
import { imageSize } from "@/lib/image-size";
import { probeMedia, type MediaInfo } from "@/lib/media-probe";
diff --cc src/server/remove-object.ts
index 615bdb1d,52c406ae..4626d6ee
--- a/src/server/remove-object.ts
+++ b/src/server/remove-object.ts
@@@ -1,9 -1,10 +1,10 @@@
import "server-only";
import { z } from "zod";
import { getModel } from "@/lib/catalog";
-import { characterLicenceLine, PERSON_REMOVER_LORA } from "@/lib/catalog/character-swap";
+import { PERSON_REMOVER_LORA } from "@/lib/catalog/character-swap";
import {
chooseEraser,
+ getEraser as chooseEraserById,
paintedPoints,
pieceSeconds,
planPieces,
@@@ -208,9 -225,12 +225,11 @@@ function planInputNow(body: RemovalBody
notes.push(
"Qwen-Image 2.1 first makes a clean copy of the part's first frame with the person gone; MiniMax H3 with Akatz Labs' Person Remover LoRA then rebuilds what was behind them, 22 frames at a time from it, and the clip's sound goes back on",
"People only — for an object, pick Wan 2.1 VACE + SAM 3.1",
+ "Preview the mask first: the person filled green, as H3 will see them — keep every part of them covered (hands, hair, a shadow); grow the mask if an edge shows",
+ "When it's done, each 22-frame window has its own preview: redo a weak one with a new seed, and every window before it is kept exactly",
"Needs the H3 Relay nodes on your ComfyUI (scripts/comfy/install-comfyui.sh with H3_RELAY=1) and 24 GB of VRAM with offloading (64–128 GB of RAM); the part runs at 24 fps",
- characterLicenceLine("open", "fuobe-character-swap").replace("nodes GPL-3.0", "H3 Relay nodes GPL-3.0"),
);
- } else notes.push(eraser.effects ? "VOID needs a 24–40 GB GPU. Its CogVideoX base is licensed for commercial use only after registering, up to 1 million visits a month" : "Wan 2.1 VACE 14B needs a 24 GB GPU · Apache-2.0 (SAM 3.1: Meta's SAM License)");
+ } else notes.push(eraser.effects ? "VOID needs a 24–40 GB GPU" : "Wan 2.1 VACE 14B needs a 24 GB GPU");
} else {
const max = pieceSeconds(eraser, source.fps);
const limit = eraser.window ? `up to ${eraser.window.cap} frames (${max.toFixed(1)} s of this clip)` : max < 5 ? "clips under 5 s" : `up to ${Math.floor(max)} s`;
diff --cc tests/account-idol.test.ts
index 00000000,e2d8a2a1..e98867fd
mode 000000,100644..100644
--- a/tests/account-idol.test.ts
+++ b/tests/account-idol.test.ts
@@@ -1,0 -1,83 +1,83 @@@
+ import fs from "node:fs";
+ import os from "node:os";
+ import path from "node:path";
+ import { afterAll, beforeAll, describe, expect, it } from "vitest";
+ import { startFakeComfy, TINY_PNG, type FakeComfy } from "./helpers/fake-comfy-runner";
+
+ /**
- * Idol 3D (idol-1) under public sign-up: 3D models are closed to accounts, so an account's Idol run answers 403
++ * Idol 3D under public sign-up: 3D models are closed to accounts, so an account's Idol run answers 403
+ * own-gpu-tool on both engines — on its own linked ComfyUI (oss-idol) and with its own fal.ai key (idol-3d) — and
+ * nothing reaches its GPU or fal.
+ */
+
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-account-idol-"));
+ process.env.FUOBE_DATA_DIR = dir;
+ process.env.COMFYUI_URL = "http://owner-comfy.test:8188";
+ process.env.FUOBE_PUBLIC_SIGNUP = "1";
+ delete process.env.FUOBE_PASSWORD;
+ delete process.env.FUOBE_ENGINE_MODE;
+ globalThis.__fuobeTestDiskFree = 1e13;
+
+ const realFetch = globalThis.fetch;
+ const fetched: string[] = [];
+ globalThis.fetch = (async (u: RequestInfo | URL) => {
+ fetched.push(String(u));
+ return new Response("not stubbed", { status: 599 });
+ }) as typeof fetch;
+
+ const auth = await import("@/server/auth");
+ const keys = await import("@/server/account-keys");
+ const generationsRoute = await import("@/app/api/generations/route");
+ const { saveFile } = await import("@/server/storage");
+ const { getModel } = await import("@/lib/catalog");
+ const { model3dRequest } = await import("@/lib/av/model3d");
+
+ let fake: FakeComfy;
+ let cookie = "";
+ let account = "";
+ beforeAll(async () => {
+ fake = await startFakeComfy({ loras: [], delayMs: 0 });
+ globalThis.__fuobeTestGpuPort = fake.port;
+ auth.setPassword("install password");
+ account = auth.createAccount("[email protected]", "long enough").id;
+ auth.setAccountGpu(account, { url: fake.url });
+ keys.saveAccountKey(account, "fal", "acct-fal-idol");
+ cookie = `${auth.SESSION_COOKIE}=${auth.createSession(account).value}`;
+ });
+ afterAll(async () => {
+ globalThis.fetch = realFetch;
+ globalThis.__fuobeTestGpuPort = undefined;
+ globalThis.__fuobeTestDiskFree = undefined;
+ await fake.close();
+ fs.rmSync(dir, { recursive: true, force: true });
+ });
+
+ const post = (body: unknown) => {
+ const text = JSON.stringify(body);
+ return generationsRoute.POST(
+ new Request("http://localhost:3000/api/generations", {
+ method: "POST",
+ headers: { cookie, host: "localhost:3000", "content-type": "application/json", "content-length": String(Buffer.byteLength(text)) },
+ body: text,
+ }) as never,
+ );
+ };
+
+ describe("Idol 3D stays closed to accounts", () => {
+ it.each([
+ ["open", "oss-idol"],
+ ["cloud", "idol-3d"],
+ ] as const)("on the %s engine (%s): 403 own-gpu-tool, nothing sent", async (engine, modelId) => {
+ expect(getModel(modelId)?.engine).toBe(engine);
+ const photo = saveFile({ data: TINY_PNG, contentType: "image/png", source: "upload", accountId: account }).url;
+ const req = model3dRequest({ engine, mode: "splat", modelId, photo, quality: "quick", photoCrop: true });
+ expect(req.modelId).toBe(modelId);
+ fake.log.length = 0;
+ fetched.length = 0;
+ const r = await post(req);
+ expect(r.status, await r.clone().text()).toBe(403);
+ expect((await r.json()).code).toBe("own-gpu-tool");
+ expect(fake.log.filter((e) => e.path === "/prompt" || e.path === "/upload/image")).toHaveLength(0);
+ expect(fetched.filter((u) => /fal\.(run|ai|media)/.test(u))).toHaveLength(0);
+ });
+ });
diff --cc tests/assist-schedules.test.ts
index 570bcc86,7d280be0..04ff9c2a
--- a/tests/assist-schedules.test.ts
+++ b/tests/assist-schedules.test.ts
@@@ -367,3 -367,249 +367,249 @@@ describe("connectors in scheduled runs"
expect(m.seen[0].system).toMatch(/say what you'll do and wait for the user's OK in chat/);
});
});
+
-describe("a skill on a schedule (Skills W4)", () => {
++describe("a skill on a schedule", () => {
+ const skills = () => import("@/server/skills");
+ const recipes = () => import("@/server/recipes");
+ /** A model that must never be called: a skill task's runs have no model planning them. */
+ const noModel: import("@/server/assist/agent").ModelCall = async () => {
+ throw new Error("a skill task called a model");
+ };
+ const at = T("2026-10-27T08:00:00Z");
+ const daily = { kind: "daily" as const, time: "09:00" };
+
+ async function promoSkill(name = "weekly-promo") {
+ const s = await skills();
+ if (s.getSkill(name)) return name;
+ s.createSkill({ name, title: "Weekly promo", description: "A promo still from a product photo.", body: "# Weekly promo\n\n1. Stage the product." });
+ (await recipes()).saveRecipe(name, {
+ fuobeRecipe: 1,
+ params: [
+ { id: "product", label: "Product photo", type: "image", required: true },
+ { id: "name", label: "Product name", type: "text", required: true, max: 200 },
+ ],
+ steps: [{ key: "ad", kind: "generate", request: { feature: "skill", modelId: "nano-banana-pro", op: "edit", prompt: "{{name}} on a sunlit plinth", inputs: { images: ["{{product}}"] } } }],
+ });
+ return name;
+ }
+
+ async function upload(name: string, createdAt: number, accountId?: string) {
+ const { saveFile } = await import("@/server/storage");
+ const { encodePng } = await import("@/server/png");
+ const a = saveFile({ data: encodePng({ width: 8, height: 8, data: Buffer.alloc(8 * 8 * 4, 200) }), contentType: "image/png", source: "upload", name, ...(accountId && { accountId }) });
+ db().prepare("UPDATE assets SET created_at = ? WHERE id = ?").run(createdAt, a.id);
+ return a;
+ }
+
+ const stored = (threadId: string) => JSON.parse((db().prepare("SELECT messages_json FROM assist_threads WHERE id = ?").get(threadId) as { messages_json: string }).messages_json) as Anthropic.Beta.BetaMessageParam[];
+
+ it("newest upload with no upload of that kind yet: the run fails and says why, and the task stays on", async () => {
+ const name = await promoSkill();
+ const s = sched.createSchedule({ ...base, prompt: "", title: "", skill: { name, values: { name: "Lumen lamp" }, sources: { product: "newest" } }, rule: daily }, at);
+ expect(await sched.sweepSchedules(T("2026-10-27T09:00:00Z"), { model: noModel })).toEqual([]);
+ expect(sched.getSchedule(s.id)).toMatchObject({ paused: false, runs: 1, last: { threadId: null, status: "failed", text: "There's no image upload yet for “Product photo” — upload one, or edit the task to pick a file" } });
+ });
+
+ it("an input the skill can do without, set to the newest upload with none yet, is left out and the run goes ahead", async () => {
+ const name = "logo-promo";
+ (await skills()).createSkill({ name, title: "Logo promo", description: "A promo still, with a logo when there is one.", body: "# Logo promo\n\n1. Stage it." });
+ (await recipes()).saveRecipe(name, {
+ fuobeRecipe: 1,
+ params: [
+ { id: "name", label: "Product name", type: "text", required: true, max: 200 },
+ { id: "logo", label: "Logo", type: "image" },
+ ],
+ steps: [{ key: "ad", kind: "generate", request: { feature: "skill", modelId: "nano-banana-pro", prompt: "{{name}} on a sunlit plinth", inputs: { images: ["{{logo}}"] } } }],
+ });
+ const s = sched.createSchedule({ ...base, prompt: "", title: "", skill: { name, values: { name: "Lumen lamp" }, sources: { logo: "newest" } }, rule: daily }, at);
+ const [id] = await sched.sweepSchedules(T("2026-10-27T09:00:00Z"), { model: noModel });
+ const t = threadOf(id);
+ expect(t.items[1]).toMatchObject({ role: "user", text: "Product name: Lumen lamp · Logo: no image upload yet, so it's left out" });
+ expect(t.items.find((i) => i.role === "approval")).toMatchObject({ status: "pending", summary: "Logo promo" });
+ const use = stored(id).flatMap((m) => (typeof m.content === "string" ? [] : m.content)).find((b) => b.type === "tool_use");
+ expect(use).toMatchObject({ name: "run_skill", input: { name, values: { name: "Lumen lamp" } } });
+ expect(sched.getSchedule(s.id)).toMatchObject({ paused: false, last: { threadId: id, status: "waiting" } });
+ (await skills()).deleteSkill(name);
+ });
+
+ it("the dialog starts a needed file input on the newest upload, and one the skill can do without on none", async () => {
+ const { inputsFrom, skillTask } = await import("@/components/assist/schedule-skill");
+ const view = {
+ name: "two-shots",
+ recipe: {
+ params: [
+ { id: "front", label: "Front", type: "image", required: true },
+ { id: "back", label: "Back", type: "image", required: true },
+ { id: "logo", label: "Logo", type: "image" },
+ { id: "badge", label: "Badge", type: "image", required: true, default: "/api/files/uploads/badge.png" },
+ ],
+ },
+ } as unknown as import("@/lib/recipe").RecipeView;
+ // Only the first needed input of a kind reads the newest upload, so two never take the same file; the second asks for one.
+ const fresh = skillTask(view, inputsFrom(null));
+ expect(fresh.task).toEqual({ name: "two-shots", values: {}, sources: { front: "newest" } });
+ expect(fresh.errors).toMatchObject({ back: "Back is needed" });
+ expect(Object.keys(fresh.errors)).toEqual(["back"]);
+ // Picked by hand: the newest upload for the optional logo, a file for the back.
+ const picked = skillTask(view, { ...inputsFrom(null), values: { back: "/api/files/uploads/back.png" }, sources: { logo: "newest" } });
+ expect(picked).toMatchObject({ ok: true, task: { values: { back: "/api/files/uploads/back.png" }, sources: { front: "newest", logo: "newest" } } });
+ // A saved task reopens as it was saved: what it left out stays out.
+ expect(skillTask(view, inputsFrom(picked.task)).task).toEqual(picked.task);
+ });
+
+ it("is checked when saved: the skill, its inputs and the engine; and needs no prompt or model", async () => {
+ const name = await promoSkill();
+ const save = (skill: import("@/lib/assist-schedule").ScheduleSkill, extra: Partial<import("@/server/assist/schedules").ScheduleInput> = {}) =>
+ sched.createSchedule({ ...base, prompt: "", title: "", skill, rule: daily, ...extra }, at);
+ expect(() => save({ name: "nope", values: {} })).toThrow("There's no skill called /nope");
+ expect(() => save({ name: "product-photoshoot", values: {} })).toThrow(/doesn't run by itself/);
+ expect(() => save({ name, values: { colour: "red" }, sources: { product: "newest" } })).toThrow("/weekly-promo has no input “colour”");
+ expect(() => save({ name, values: { product: "/api/files/uploads/x.png" }, sources: { name: "newest" } })).toThrow(/Product name isn't a file/);
+ expect(() => save({ name, values: {}, sources: { product: "newest" } })).toThrow("Product name is needed");
+ expect(() => save({ name, values: { name: "Lumen" }, sources: { product: "newest" } }, { engine: "open" })).toThrow(/runs on the cloud only/);
+ expect(() => sched.createSchedule({ ...base, prompt: " ", title: "x", rule: daily }, at)).toThrow("Write what Assist should do each time");
+ const s = save({ name, values: { name: "Lumen lamp" }, sources: { product: "newest" } }, { mode: { mode: "smart" }, connectors: true, attachments: ["/api/files/uploads/a.png"] });
+ expect(s).toMatchObject({
+ title: "Weekly promo",
+ prompt: "/weekly-promo Product photo: your newest image upload · Product name: Lumen lamp",
+ skill: { name, values: { name: "Lumen lamp" }, sources: { product: "newest" } },
+ // No model plans it, so no mode and no connectors; a request's files don't apply.
+ mode: null,
+ connectors: false,
+ attachments: [],
+ });
+ // Through the route, with no prompt; switching back to a request needs one.
+ const res = await listRoute.POST(new Request("http://x", { method: "POST", body: JSON.stringify({ ...base, prompt: "", title: "Promo", skill: { name, values: { name: "Lumen" }, sources: { product: "newest" } }, rule: daily }) }));
+ expect(res.status).toBe(201);
+ const ctx = { params: Promise.resolve({ scheduleId: (await res.json()).id }) };
+ const back = await oneRoute.PATCH(new Request("http://x", { method: "PATCH", body: JSON.stringify({ skill: null, prompt: "" }) }), ctx);
+ expect(back.status).toBe(400);
+ expect((await back.json()).error).toBe("Write what Assist should do each time");
+ });
+
+ it("ask first: one card with the skill's price, and the newest upload is read when the run starts", async () => {
+ const name = await promoSkill();
+ const older = await upload("old.png", T("2026-10-26T08:00:00Z"));
+ const s = sched.createSchedule({ ...base, prompt: "", title: "", skill: { name, values: { name: "Lumen lamp" }, sources: { product: "newest" } }, rule: daily }, at);
+ // Uploaded after the task was saved: the run uses it. A signed-up account's upload is never the studio's newest.
+ const newer = await upload("new.png", T("2026-10-27T08:30:00Z"));
+ await upload("account.png", T("2026-10-27T08:50:00Z"), "acct-w4");
+ const [id] = await sched.sweepSchedules(T("2026-10-27T09:00:00Z"), { model: noModel });
+ const t = threadOf(id);
+ expect(t).toMatchObject({ status: "waiting", agent: "offline", scheduleId: s.id });
+ expect(t.items[0]).toMatchObject({ role: "notice", text: expect.stringMatching(/^Scheduled run of “Weekly promo” · Every day at 09:00 · plans wait for your approval · runs the Weekly promo skill as it was saved, with no AI model planning it\.$/) });
+ expect(t.items[1]).toMatchObject({ role: "user", text: "Product photo: your newest image upload (file 1) · Product name: Lumen lamp", skills: [name], attachments: [newer.url] });
+ const card = t.items.find((i) => i.role === "approval");
+ const price = (await recipes()).estimateRecipe(name, { values: { product: newer.url, name: "Lumen lamp" } }, "cloud");
+ expect(card).toMatchObject({ status: "pending", summary: "Weekly promo", totalUsd: price.total });
+ expect(card?.role === "approval" && card.jobs.map((j) => [j.tool, j.modelId])).toEqual([["run_skill", "nano-banana-pro"]]);
+ // The offline planner's note isn't under a skill task's card: no planner made it.
+ expect(t.items.some((i) => i.role === "notice" && /Offline planner/.test(i.text))).toBe(false);
+ const use = stored(id).flatMap((m) => (typeof m.content === "string" ? [] : m.content)).find((b) => b.type === "tool_use");
+ expect(use).toMatchObject({ name: "run_skill", input: { name, values: { name: "Lumen lamp", product: newer.url }, engine: "cloud" } });
+ expect(older.url).not.toBe(newer.url);
+ expect(sched.getSchedule(s.id)!.last).toMatchObject({ threadId: id, status: "waiting", text: expect.stringMatching(/^A plan waits for your approval/) });
+ // Approved later: the skill's steps start with the file that was newest when it ran.
+ await agent.answerApproval(id, true);
+ await agent.run(id);
+ const made = threadOf(id).items.flatMap((i) => (i.role === "generations" ? i.ids : []));
+ expect(made).toHaveLength(1);
+ const { getGeneration } = await import("@/server/generations");
+ expect(getGeneration(made[0])!.request).toMatchObject({ prompt: "Lumen lamp on a sunlit plinth", inputs: { images: [newer.url] }, skill: { name } });
+ expect(sched.getSchedule(s.id)!.last).toMatchObject({ status: "done", text: "Started 1 result" });
+ });
+
+ it("auto-run: within the cap it starts on its own; over the cap it waits, with the reason", async () => {
+ const name = await promoSkill();
+ const photo = await upload("cap.png", T("2026-10-27T08:40:00Z"));
+ setSetting("falKey", "fal-test-key");
+ const realFetch = globalThis.fetch;
+ // The paid job is queued for fal; no request may leave this test.
+ globalThis.fetch = (async () => new Response("offline", { status: 503 })) as typeof fetch;
+ try {
+ const price = spendOf(tools.planFor("run_skill", { name, values: { product: photo.url, name: "Lumen" } }, { engine: "cloud" }).jobs)!;
+ expect(price).toBeGreaterThan(0);
+ const skill = { name, values: { name: "Lumen", product: photo.url } };
+ const fits = sched.createSchedule({ ...base, prompt: "", title: "Fits", approval: "auto", capUsd: Math.round(price * 150) / 100, skill, rule: daily }, at);
+ const [a] = await sched.sweepSchedules(T("2026-10-27T09:00:00Z"), { model: noModel });
+ expect(threadOf(a)).toMatchObject({ status: "idle", spentUsd: price });
+ expect(threadOf(a).items.some((i) => i.role === "approval")).toBe(false);
+ expect(threadOf(a).items.filter((i) => i.role === "generations")).toHaveLength(1);
+ expect(threadOf(a).items.at(-1)).toMatchObject({ role: "assistant", text: "Started Weekly promo. The results appear here and in your Library as they finish." });
+ expect(sched.getSchedule(fits.id)!.last).toMatchObject({ status: "done", text: "Started 1 result" });
+ sched.deleteSchedule(fits.id);
+
+ const cap = Math.floor(price * 50) / 100;
+ sched.createSchedule({ ...base, prompt: "", title: "Over", approval: "auto", capUsd: cap, skill, rule: daily }, at);
+ const [b] = await sched.sweepSchedules(T("2026-10-27T09:00:00Z"), { model: noModel });
+ const t = threadOf(b);
+ expect(t.status).toBe("waiting");
+ expect(t.items.some((i) => i.role === "generations")).toBe(false);
+ expect(t.items.find((i) => i.role === "approval")).toMatchObject({ status: "pending", summary: "Weekly promo" });
+ expect(t.items.at(-1)).toMatchObject({ role: "notice", text: expect.stringMatching(/^Waiting for you: it costs about \$[\d.]+ and this run has \$[\d.]+ left of its \$[\d.]+ cap\./) });
+ } finally {
+ globalThis.fetch = realFetch;
+ db().prepare("UPDATE generations SET status = 'canceled' WHERE status IN ('queued', 'running')").run();
+ }
+ });
+
+ it("a fixed file keeps its task's file out of Empty trash; a value that no longer fits fails the run with the reason", async () => {
+ const name = await promoSkill();
+ const photo = await upload("fixed.png", T("2026-10-27T08:45:00Z"));
+ const s = sched.createSchedule({ ...base, prompt: "", title: "Fixed", skill: { name, values: { name: "Lumen", product: photo.url } }, rule: daily }, at);
+ const { assetUses } = await import("@/server/generations");
+ expect(assetUses(photo.id)).toContainEqual({ what: "scheduled task", key: s.id, name: "Fixed" });
+ // The skill's inputs changed after the task was saved (a new required input): the run says what's missing.
+ (await recipes()).saveRecipe(name, {
+ fuobeRecipe: 1,
+ params: [
+ { id: "product", label: "Product photo", type: "image", required: true },
+ { id: "name", label: "Product name", type: "text", required: true, max: 200 },
+ { id: "tagline", label: "Tagline", type: "text", required: true },
+ ],
+ steps: [{ key: "ad", kind: "generate", request: { feature: "skill", modelId: "nano-banana-pro", op: "edit", prompt: "{{name}}: {{tagline}}", inputs: { images: ["{{product}}"] } } }],
+ });
+ const [id] = await sched.sweepSchedules(T("2026-10-27T09:00:00Z"), { model: noModel });
+ expect(threadOf(id).items.some((i) => i.role === "approval")).toBe(false);
+ expect(sched.getSchedule(s.id)!.last).toMatchObject({ threadId: id, status: "failed", text: "Weekly promo didn't start: /weekly-promo needs tagline (text)" });
+ (await skills()).deleteSkill(name);
+ });
+
+ it("a renamed skill keeps its tasks; a deleted one pauses them and says why", async () => {
+ const s0 = await skills();
+ const name = await promoSkill("monday-promo");
+ const s = sched.createSchedule({ ...base, prompt: "", title: "Monday", skill: { name, values: { name: "Lumen" }, sources: { product: "newest" } }, rule: daily }, at);
+ s0.updateSkill(name, { name: "monday-ad" });
+ expect(sched.getSchedule(s.id)).toMatchObject({ paused: false, skill: { name: "monday-ad" }, prompt: "/monday-ad Product photo: your newest image upload · Product name: Lumen" });
+ s0.deleteSkill("monday-ad");
+ expect(sched.getSchedule(s.id)).toMatchObject({ paused: true, nextRunAt: null, last: { threadId: null, status: "failed", text: "Paused: its skill was deleted" } });
+ expect(await sched.sweepSchedules(T("2026-10-28T09:00:00Z"), { model: noModel })).toEqual([]);
+ // It can still be renamed or deleted; resuming says why it can't run.
+ expect(sched.updateSchedule(s.id, { title: "Monday (old)" })!.title).toBe("Monday (old)");
+ expect(() => sched.updateSchedule(s.id, { paused: false })).toThrow("There's no skill called /monday-ad");
+ // A skill removed behind deleteSkill's back: the start finds no skill and pauses the task.
+ const other = await promoSkill("tuesday-promo");
+ const t = sched.createSchedule({ ...base, prompt: "", title: "Tuesday", skill: { name: other, values: { name: "Lumen" }, sources: { product: "newest" } }, rule: daily }, at);
+ db().prepare("DELETE FROM skills WHERE name = ?").run(other);
+ const res = await runRoute.POST(new Request("http://x", { method: "POST" }), { params: Promise.resolve({ scheduleId: t.id }) });
+ expect(res.status).toBe(422);
+ expect(await res.json()).toMatchObject({ threadId: null, reason: "paused", error: "Its skill was deleted — edit the task to pick another" });
+ expect(sched.getSchedule(t.id)).toMatchObject({ paused: true });
+ });
+
+ it("the migration adds skill_json to a database from before, and its tasks keep running as requests", () => {
+ const d = db();
+ const id = MIGRATIONS.findIndex((m) => m.includes("ALTER TABLE assist_schedules ADD COLUMN skill_json"));
+ // The base's migration 25 (characters.voice_json) keeps its place; this one comes after it.
+ expect(MIGRATIONS[25]).toContain("ALTER TABLE characters ADD COLUMN voice_json");
+ expect(id).toBe(26);
+ const old = sched.createSchedule({ ...base, title: "From before", rule: daily }, at);
+ d.exec("ALTER TABLE assist_schedules DROP COLUMN skill_json");
+ d.prepare("DELETE FROM _migrations WHERE id = ?").run(id);
+ d.close();
+ globalThis.__fuobeDb = undefined;
+ const cols = (db().prepare("PRAGMA table_info(assist_schedules)").all() as { name: string }[]).map((c) => c.name);
+ expect(cols).toContain("skill_json");
+ expect(sched.getSchedule(old.id)).toMatchObject({ title: "From before", prompt: "Make today's perfume ad", skill: null });
+ });
+ });
diff --cc tests/cloud-catalog-fixes.test.ts
index 95ae83bf,ec5f49d0..f4095913
--- a/tests/cloud-catalog-fixes.test.ts
+++ b/tests/cloud-catalog-fixes.test.ts
@@@ -183,7 -185,10 +185,10 @@@ describe("defaults the APIs would get w
expect(buildPayload(route("sonilo-sfx").map!, { prompt: "rain" })).toMatchObject({ audio_format: "mp3" });
expect(buildPayload(route("minimax-music-2-5").map!, { prompt: "lofi" })).toEqual({ prompt: "lofi", lyrics_optimizer: true });
expect(buildPayload(route("whisper").map!, { audio: "a.mp3" })).toMatchObject({ chunk_level: "word" });
- expect(getModel("mureka-song")!.options.controls!.map((c) => c.param)).toEqual(["model"]);
- // Mureka 9.5 runs on its own route (nm10-music3): no Version, and a past run's Version isn't sent.
++ // Mureka 9.5 runs on its own route: no Version, and a past run's Version isn't sent.
+ expect(route("mureka-song").endpoint).toBe("mureka/v9.5/generate/song");
+ expect(getModel("mureka-song")!.options.controls).toBeUndefined();
+ expect(buildPayload(route("mureka-song").map!, { prompt: "pop", extra: { model: "mureka-8" } })).toEqual({ prompt: "pop" });
expect(getModel("seedream-5-flash-layers")!.pricing).toMatchObject({ unit: "request", usd: 0.135 });
expect(getModel("veed-subtitles")!.pricing?.note).toMatch(/dynamic styles .* 2x/);
});
diff --cc tests/comfy-library-4.test.ts
index c0117068,53248f81..a3f508be
--- a/tests/comfy-library-4.test.ts
+++ b/tests/comfy-library-4.test.ts
@@@ -102,7 -100,12 +102,12 @@@ describe("round-4 ComfyUI workflows", (
"minimax-h3-i2v-hq",
"minimax-h3-flf2v-hq",
"minimax-h3-orbit",
- // MiniMax H3 on 8-31 GB cards (nm10-h3-any-gpu): FastH3 V2 and Trim, unvalidated like the H3 graphs until a GPU run.
++ // MiniMax H3 on 8-31 GB cards: FastH3 V2 and Trim, unvalidated like the H3 graphs until a GPU run.
+ "minimax-h3-fast-t2v",
+ "minimax-h3-fast-i2v",
+ "minimax-h3-fast-flf2v",
+ "minimax-h3-trim-t2v",
- // Design a voice (nm10-voice-design): ComfyUI-QwenTTS and ComfyUI-VoxCPM2 aren't on the validation server (tests/voice-design-server.test.ts).
+ // Design a voice: ComfyUI-QwenTTS and ComfyUI-VoxCPM2 aren't on the validation server (tests/voice-design-server.test.ts).
"tts-qwen3-design",
"tts-qwen3-clone",
"tts-voxcpm2",
@@@ -148,25 -148,9 +153,24 @@@
"voice-clean-bed-reuse",
"video-character-swap-h3",
"video-character-swap-h3-relay",
- "video-person-remove-h3-relay",
"video-character-swap-h3-segment",
"video-mask-h3-relay",
+ // Any Angle's two graphs: run end to end on the GPU, they wait for their /prompt check while that ComfyUI is busy
+ // rendering (the app stays the owner's until then: src/server/any-angle-live.ts).
+ "any-angle-3d",
+ "any-angle-shot",
"video-regenerate-h3",
+ // Genjutsu's Openjutsu modes: their packs aren't on the validation server yet; each opens only after its /prompt
+ // check and a real render (workflows/comfyui/gpu-tested.json, src/server/genjutsu-live.ts).
+ "video-group-swap-h3",
+ "video-group-swap-h3-one-by-one",
+ "video-scene-edit-h3",
+ "image-from-picture-prepare",
+ "video-scene-describe",
+ "video-from-picture-solar",
+ "video-from-picture-h3",
+ "video-fix-faces-h3",
+ "video-fix-colours",
]);
for (const w of manifest.workflows) for (const o of w.outputs) if (o.role) expect(ROLES, `${w.id} ${o.role}`).toContain(o.role);
});
diff --cc tests/e2e/exact-orbits.mjs
index 00000000,41353298..92078762
mode 000000,100644..100644
--- a/tests/e2e/exact-orbits.mjs
+++ b/tests/e2e/exact-orbits.mjs
@@@ -1,0 -1,209 +1,209 @@@
-// Exact orbits and Fly around (build plan N7-7) in a real browser (the app must be running in demo mode).
++// Exact orbits and Fly around in a real browser (the app must be running in demo mode).
+ // Usage: node tests/e2e/exact-orbits.mjs [appUrl] [--shots=dir]. Exits 1 on any failure.
+ //
+ // At 1440 px and 390 px, in light and dark: the Exact switch and its controls on a Fuobe DoP orbit move (/video?preset=…)
+ // and in Cinema's move picker, "Film it photoreal" on an Image to 3D result, and the Camera path and Fly around nodes on a
+ // canvas. Each: the controls render, the price fits, nothing scrolls sideways, keyboard focus reaches every new control,
+ // a finger drags the degrees slider on a phone; no page errors or console errors.
+ import assert from "node:assert/strict";
+ import fs from "node:fs";
+ import path from "node:path";
+ import { DESKTOP, PHONE, launch } from "./_browser.mjs";
+
+ const args = process.argv.slice(2);
+ const app = (args.find((a) => !a.startsWith("--")) ?? "http://localhost:3000").replace(/\/$/, "");
+ const shots = args.find((a) => a.startsWith("--shots="))?.slice(8);
+ if (shots) fs.mkdirSync(shots, { recursive: true });
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
+ const step = (name) => console.log(`- ${name}`);
+ async function call(url, method = "GET", data) {
+ const res = await fetch(app + url, { method, headers: { "Content-Type": "application/json" }, ...(data !== undefined && { body: JSON.stringify(data) }) });
+ return res.json();
+ }
+ async function until(fn, what, ms = 90_000) {
+ const t = Date.now();
+ for (;;) {
+ const v = await fn();
+ if (v) return v;
+ if (Date.now() - t > ms) throw new Error(`Timed out waiting for ${what}`);
+ await sleep(700);
+ }
+ }
+
+ const status = await call("/api/status");
+ assert.notEqual(status.demoMode, "off", "run the app in demo mode (FUOBE_DEMO_MODE=on)");
+
+ // A photo, a finished 3D model of it (a demo) to film, and a canvas with the two nodes.
+ const photo = await (
+ await fetch(`${app}/api/uploads`, { method: "POST", headers: { "content-type": "image/jpeg", "x-file-name": "figure.jpg" }, body: fs.readFileSync(path.resolve("public/previews/presets/app-3d-figure.jpg")) })
+ ).json();
+ assert.ok(photo.url, `an upload: ${JSON.stringify(photo).slice(0, 200)}`);
+ const made = await call("/api/generations", "POST", { feature: "image-to-3d", modelId: "oss-pixal3d", op: "image-to-3d", inputs: { images: [photo.url] } });
+ const model3d = made.items?.[0];
+ assert.ok(model3d, `a demo 3D model: ${JSON.stringify(made).slice(0, 200)}`);
+ await until(async () => (await call(`/api/generations/${model3d.id}`)).status === "succeeded", "the demo 3D model");
+ const graph = {
+ nodes: [
+ { id: "still", type: "image-input", position: { x: 0, y: 0 }, data: { url: photo.url } },
+ { id: "path", type: "camera-path", position: { x: 0, y: 260 }, data: { orbit: { degrees: 180, direction: "cw", tilt: 10, pulse: 0.25 } } },
+ { id: "fly", type: "fly-around", position: { x: 420, y: 80 }, data: { modelId: "minimax-h3-max-camera" } },
+ ],
+ edges: [
+ { id: "e1", source: "still", sourceHandle: "out", target: "fly", targetHandle: "images" },
+ { id: "e2", source: "path", sourceHandle: "out", target: "fly", targetHandle: "path" },
+ ],
+ };
+ const canvas = await call("/api/canvases", "POST", { name: "Exact orbits check", graph });
+ assert.ok(canvas.id, "a canvas");
+ const cinema = await call("/api/cinema/projects", "POST", { name: "Exact orbits check" });
+ assert.ok(cinema.id, "a Cinema project");
+
+ const browser = await launch();
+ const failures = [];
+
+ async function context(phone, scheme, engine) {
+ const ctx = await browser.newContext({ ...(phone ? PHONE : DESKTOP), colorScheme: scheme });
+ await ctx.addInitScript((e) => {
+ localStorage.setItem("fuobe.engine", e);
+ document.addEventListener("DOMContentLoaded", () => {
+ const s = document.createElement("style");
+ s.textContent = "nextjs-portal{display:none!important}";
+ document.head.append(s);
+ });
+ }, engine);
+ const page = await ctx.newPage();
+ page.on("pageerror", (e) => failures.push(`${phone ? "phone" : "desktop"} ${scheme}: page error ${e.message}`));
+ page.on("console", (m) => m.type() === "error" && !/Failed to load resource/.test(m.text()) && failures.push(`${phone ? "phone" : "desktop"} ${scheme}: console ${m.text().slice(0, 200)}`));
+ return { ctx, page };
+ }
+ const noSideScroll = async (page, what) => assert.equal(await page.evaluate(() => document.documentElement.scrollWidth - window.innerWidth), 0, `${what}: nothing scrolls sideways`);
+ const shoot = (page, name) => shots && page.screenshot({ path: path.join(shots, `${name}.png`) });
+ const fits = async (loc, what) => {
+ const box = await loc.boundingBox();
+ const vw = await loc.page().evaluate(() => window.innerWidth);
+ assert.ok(box && box.x >= -1 && box.x + box.width <= vw + 1, `${what} fits the screen`);
+ };
+
+ /** Tab from the switch: focus reaches it and, once on, the sliders and the direction and pulse buttons. */
+ async function exactControls(page, root, what, phone) {
+ const sw = root.getByRole("switch", { name: "Exact orbit" });
+ await sw.focus();
+ assert.equal(await sw.evaluate((el) => el === document.activeElement), true, `${what}: the switch takes focus`);
+ await page.keyboard.press("Space");
+ await root.getByRole("slider").first().waitFor({ timeout: 10_000 });
+ assert.equal(await root.getByRole("slider").count(), 2, `${what}: degrees and tilt`);
+ const reached = new Set();
+ for (let i = 0; i < 8; i++) {
+ await page.keyboard.press("Tab");
+ const label = await page.evaluate(() => {
+ const el = document.activeElement;
+ return el?.getAttribute("role") === "slider" ? `slider:${el.getAttribute("aria-valuetext")}` : (el?.textContent ?? "").trim();
+ });
+ reached.add(label);
+ }
+ for (const want of ["Clockwise", "In and out 25%"]) assert.ok([...reached].some((l) => l === want || l.startsWith(want)) || [...reached].some((l) => l.includes("Counter")), `${what}: focus reaches ${want} (${[...reached].join(" | ")})`);
+ assert.ok([...reached].some((l) => l.startsWith("slider:")), `${what}: focus reaches the sliders`);
+ await fits(root, what);
+ // The degrees slider: a drag (a finger on the phone) changes it.
+ const slider = root.getByRole("slider").first();
+ const before = await slider.getAttribute("aria-valuenow");
+ const track = await root.locator("[data-slot=slider]").first().boundingBox();
+ if (phone) {
+ const cdp = await page.context().newCDPSession(page);
+ const y = track.y + track.height / 2;
+ const touch = (type, x) => cdp.send("Input.dispatchTouchEvent", { type, touchPoints: type === "touchEnd" ? [] : [{ x, y }] });
+ await touch("touchStart", track.x + track.width - 4);
+ await touch("touchMove", track.x + track.width * 0.4);
+ await touch("touchMove", track.x + track.width * 0.3);
+ await touch("touchEnd");
+ } else {
+ await page.mouse.move(track.x + track.width - 4, track.y + track.height / 2);
+ await page.mouse.down();
+ await page.mouse.move(track.x + track.width * 0.3, track.y + track.height / 2, { steps: 6 });
+ await page.mouse.up();
+ }
+ await sleep(200);
+ assert.notEqual(await slider.getAttribute("aria-valuenow"), before, `${what}: dragging the degrees slider changes it`);
+ }
+
+ for (const phone of [false, true]) {
+ for (const scheme of ["light", "dark"]) {
+ const tag = `${phone ? "390" : "1440"}-${scheme}`;
+ try {
+ step(`${tag}: Fuobe DoP's 360 Orbit`);
+ {
+ const { ctx, page } = await context(phone, scheme, scheme === "light" ? "cloud" : "open");
+ await page.goto(`${app}/video?preset=motion-360-orbit`, { waitUntil: "load", timeout: 120_000 });
+ const root = page.getByTestId("exact-orbit");
+ await root.waitFor({ timeout: 60_000 });
+ await exactControls(page, root, `${tag} DoP`, phone);
+ // The composer's price is the exact orbit's (short on a phone, so the model chip keeps its name).
+ await page.getByText(scheme === "light" ? /≈ \$0\.40/ : phone ? /^Free$/ : /Free · on your GPU/).locator("visible=true").first().waitFor({ timeout: 30_000 });
+ await noSideScroll(page, `${tag} DoP`);
+ await shoot(page, `dop-${tag}`);
+ await ctx.close();
+ }
+ step(`${tag}: Cinema's move picker`);
+ {
+ const { ctx, page } = await context(phone, scheme, "cloud");
+ await page.goto(`${app}/cinema/${cinema.id}`, { waitUntil: "load", timeout: 120_000 });
+ await page.getByRole("button", { name: "Add a camera move" }).first().click({ timeout: 60_000 });
+ await page.getByRole("option", { name: /Drone Orbit/ }).or(page.getByRole("button", { name: /Drone Orbit/ })).first().click({ timeout: 30_000 });
+ const root = page.getByTestId("exact-orbit");
+ await root.waitFor({ timeout: 30_000 });
+ await exactControls(page, root, `${tag} Cinema`, phone);
+ await noSideScroll(page, `${tag} Cinema`);
+ await shoot(page, `cinema-${tag}`);
+ await ctx.close();
+ }
+ step(`${tag}: Image to 3D's Film it photoreal`);
+ {
+ const { ctx, page } = await context(phone, scheme, "cloud");
+ await page.goto(`${app}/image-to-3d`, { waitUntil: "load", timeout: 120_000 });
+ const film = page.getByRole("button", { name: /Film it photoreal/ }).first();
+ await film.waitFor({ timeout: 60_000 });
+ await film.scrollIntoViewIfNeeded();
+ await page.getByText(/≈ \$0\.40|Placeholder · free/).first().waitFor({ timeout: 30_000 });
+ await fits(film, `${tag} Film it photoreal`);
+ await film.focus();
+ assert.equal(await film.evaluate((el) => el === document.activeElement), true, `${tag}: Film it photoreal takes focus`);
+ await noSideScroll(page, `${tag} Image to 3D`);
+ await shoot(page, `model3d-${tag}`);
+ await ctx.close();
+ }
+ step(`${tag}: Canvas's Camera path and Fly around nodes`);
+ {
+ const { ctx, page } = await context(phone, scheme, "cloud");
+ await page.goto(`${app}/canvas/${canvas.id}`, { waitUntil: "load", timeout: 120_000 });
+ await page.getByText("Fly around", { exact: true }).first().waitFor({ timeout: 60_000 });
+ await page.getByText("Camera path", { exact: true }).first().waitFor({ timeout: 30_000 });
+ // The board's own nodes: the Fly around node's ports read Still, then views and Camera path.
+ await page.getByText("Still, then views").first().waitFor({ timeout: 10_000 });
+ // On a phone the board is for looking: its nodes are edited as cards on the Nodes tab.
+ if (phone) await page.getByRole("tab", { name: "Nodes" }).or(page.getByRole("button", { name: "Nodes" })).first().click();
+ const move = page.getByRole("combobox", { name: /Move of/ }).locator("visible=true").first();
+ await move.waitFor({ timeout: 20_000 });
+ await move.focus();
+ assert.equal(await move.evaluate((el) => el === document.activeElement), true, `${tag}: the move list takes focus`);
+ const root = page.getByTestId("exact-orbit").locator("visible=true").first();
+ await root.getByText("180° clockwise · tilt 10° · pulse 25%").waitFor({ timeout: 10_000 });
+ assert.equal(await root.getByRole("slider").count(), 2, `${tag}: the node's sliders`);
+ await root.getByRole("slider").first().focus();
+ await page.keyboard.press("ArrowRight");
+ await root.getByText("185° clockwise · tilt 10° · pulse 25%").waitFor({ timeout: 10_000 });
+ await shoot(page, `canvas-${tag}`);
+ await noSideScroll(page, `${tag} Canvas`);
+ await ctx.close();
+ }
+ } catch (e) {
+ failures.push(`${tag}: ${e.message}`);
+ }
+ }
+ }
+
+ await browser.close();
+ if (failures.length) {
+ console.error(`\n${failures.length} failure(s):\n${failures.map((f) => ` ✗ ${f}`).join("\n")}`);
+ process.exit(1);
+ }
+ console.log("\nAll exact-orbit checks passed");
diff --cc tests/e2e/h3-any-gpu.mjs
index 00000000,f256c065..20494b2a
mode 000000,100644..100644
--- a/tests/e2e/h3-any-gpu.mjs
+++ b/tests/e2e/h3-any-gpu.mjs
@@@ -1,0 -1,209 +1,209 @@@
-// nm10-h3-any-gpu in the browser (no run reaches a GPU): MiniMax H3's Options in the Video studio on your GPU (GPU tier with
++// MiniMax H3 on smaller cards in the browser (no run reaches a GPU): MiniMax H3's Options in the Video studio on your GPU (GPU tier with
+ // Auto, 32 GB, FastH3 V2 and Trim; no Decoder until Fast decode validates), the composer's note for a picked tier and for Auto on the card the
+ // last GPU check read, and the Connect board's Video row naming the build that card gets. Each at 1440 and 390 px, light and
+ // dark, without sideways scroll, failing on console errors.
+ // Usage: FUOBE_DATA_DIR=<the dev server's data dir> node tests/e2e/h3-any-gpu.mjs [appUrl] [--shots <dir>] (on a dev server started fresh,
+ // with an empty data dir)
+ // The dev server runs with COMFYUI_URL=http://comfy.test:8188 (unreachable). The script writes the install's last GPU check
+ // into the server's database (a 12 GB RTX 4070, the Trim files present) before any page reads it. Generate is never pressed.
+ import crypto from "node:crypto";
+ import fs from "node:fs";
+ import path from "node:path";
+ import { createRequire } from "node:module";
+ import { launch, root } from "./_browser.mjs";
+
+ const argv = process.argv.slice(2);
+ const app = (argv.find((a) => !a.startsWith("--") && argv[argv.indexOf(a) - 1] !== "--shots") ?? "http://localhost:3000").replace(/\/$/, "");
+ const shots = argv.includes("--shots") ? argv[argv.indexOf("--shots") + 1] : undefined;
+ if (shots) fs.mkdirSync(shots, { recursive: true });
+ const dataDir = process.env.FUOBE_DATA_DIR;
+ if (!dataDir) throw new Error("Set FUOBE_DATA_DIR to the dev server's data dir");
+ const comfyUrl = (process.env.COMFYUI_URL ?? "http://comfy.test:8188").replace(/\/+$/, "");
+
+ const failures = [];
+ const check = (label, ok, extra = "") => {
+ console.log(`${ok ? "ok " : "FAIL"} ${label.padEnd(84)}${extra ? ` ${extra}` : ""}`);
+ if (!ok) failures.push(label);
+ };
+ const flat = (s) => String(s ?? "").replace(/\s+/g, " ").trim();
+
+ // ---- The install's last GPU check: a 12 GB RTX 4070 on a CUDA 12.8 PyTorch with FastH3 Trim's fp8 file and the shared files.
+ async function seed() {
+ // The server creates its database on its first request.
+ await fetch(`${app}/api/status`).catch(() => null);
+ const Database = createRequire(path.join(root, "package.json"))("better-sqlite3");
+ const db = new Database(path.join(dataDir, "fuobe.db"));
+ const index = JSON.parse(fs.readFileSync(path.join(root, "workflows/comfyui/requirements.json"), "utf8"));
+ const files = ["diffusion_models/fastvideo_fasth3_trim_8step_fp8.safetensors", ...index.workflows["minimax-h3-trim-t2v"].files.filter((f) => !f.startsWith("diffusion_models/"))];
+ const models = {};
+ for (const folder of index.folders) models[folder] = { have: {}, total: 0 };
+ for (const key of files) {
+ const [folder, file] = key.split("/");
+ models[folder].have[file] = index.files[key].sizeBytes;
+ models[folder].total++;
+ }
+ const at = Date.now();
+ const inventory = {
+ v: 1, via: "server", checkedAt: at, tookMs: 5, reachable: true,
+ comfy: { version: "0.43.0", os: "posix", torch: "2.9.1+cu128", embeddedPython: false, deployEnv: "local-git", flags: { cpuOnly: false } },
+ devices: [{ name: "cuda:0 NVIDIA GeForce RTX 4070 : cudaMallocAsync", type: "cuda", index: 0, vramTotal: 12 * 2 ** 30, vramFree: 11 * 2 ** 30 }],
+ ram: { total: 64 * 2 ** 30, free: 48 * 2 ** 30 },
+ manager: { api: "none" },
+ nodes: { have: [], missing: [], total: 1700, readAt: at, how: "object_info" },
+ combos: {}, packs: {}, models, loras: {}, fingerprint: "e2e", errors: [],
+ };
+ const urlHash = crypto.createHash("sha256").update(`${comfyUrl.toLowerCase()}|server`).digest("hex");
+ db.prepare(
+ `INSERT INTO gpu_snapshots (target_key, via, url_hash, checked_at, index_hash, inventory_json, report_json, stale) VALUES ('install', 'server', ?, ?, ?, ?, NULL, 0)
+ ON CONFLICT(target_key, via) DO UPDATE SET url_hash = excluded.url_hash, checked_at = excluded.checked_at, index_hash = excluded.index_hash, inventory_json = excluded.inventory_json, report_json = NULL, stale = 0`,
+ ).run(urlHash, at, index.hash, JSON.stringify(inventory));
+ db.close();
+ }
+
+ const browser = await launch();
+ const errors = [];
+ const contextFor = async (engine, width = 1440, colorScheme = "light") => {
+ const context = await browser.newContext({ viewport: { width, height: width < 500 ? 844 : 900 }, colorScheme, ...(width < 500 && { isMobile: true, hasTouch: true }) });
+ await context.addInitScript((e) => {
+ try {
+ localStorage.setItem("fuobe.engine", e);
+ } catch {}
+ }, engine);
+ const page = await context.newPage();
+ page.setDefaultTimeout(60_000);
+ page.on("console", (m) => {
+ if (m.type() === "error") errors.push(`${width} ${colorScheme} ${new URL(page.url()).pathname}: ${m.text().slice(0, 1500)}`);
+ });
+ page.on("pageerror", (e) => errors.push(`${width} ${colorScheme}: ${String(e).slice(0, 200)}`));
+ return { context, page };
+ };
+ const composer = (page) => page.locator("[data-composer]").first();
+ const shoot = (page, name) => (shots ? page.screenshot({ path: path.join(shots, name), fullPage: false }) : undefined);
+ const noSideways = (page) => page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1);
+ const openMenu = async (page) => {
+ const button = page.locator('button[aria-label^="Model: "][aria-label$="Change model"]:visible').first();
+ const search = page.getByPlaceholder(/^Search( (all )?models)?/);
+ for (let i = 0; i < 3; i++) {
+ await button.waitFor({ state: "visible", timeout: 60_000 });
+ await button.focus();
+ await page.keyboard.press("Enter");
+ if (await search.waitFor({ timeout: 10_000 }).then(() => true, () => false)) return search;
+ }
+ await search.waitFor();
+ return search;
+ };
+ const pick = async (page, query, id) => {
+ const search = page.getByPlaceholder(/^Search( (all )?models)?/);
+ await search.fill(query);
+ const row = page.locator(`[cmdk-item][data-value$=":${id}"]`).first();
+ await row.waitFor({ timeout: 15_000 });
+ let picked = false;
+ for (let i = 0; i < 12 && !picked; i++) {
+ picked = (await row.getAttribute("data-selected")) === "true";
+ if (!picked) await page.keyboard.press("ArrowDown");
+ }
+ await page.keyboard.press("Enter");
+ await page.waitForTimeout(900);
+ };
+ /** Opens the chip that holds MiniMax H3's settings (the Video studio names it Director; on a phone it can sit in Settings). */
+ const openOptions = async (page) => {
+ const chip = composer(page).getByRole("button", { name: /^(Director|Options)/ }).first();
+ if (!(await chip.isVisible().catch(() => false))) {
+ const settings = composer(page).getByRole("button", { name: /^Settings:/ }).first();
+ await settings.focus();
+ await page.keyboard.press("Enter");
+ const sheet = page.getByRole("dialog").first();
+ await sheet.waitFor({ timeout: 10_000 });
+ const inner = sheet.getByRole("button", { name: /^(Director|Options)/ }).first();
+ await inner.focus();
+ await page.keyboard.press("Enter");
+ return;
+ }
+ await chip.focus();
+ await page.keyboard.press("Enter");
+ };
+ const listOf = async (page, box) => {
+ await box.focus();
+ await page.keyboard.press("Enter");
+ const list = page.getByRole("listbox").last();
+ await list.waitFor({ timeout: 10_000 });
+ const items = (await list.getByRole("option").allInnerTexts()).map(flat);
+ await page.keyboard.press("Escape");
+ return items;
+ };
+
+ if (argv.includes("--seed-only")) {
+ await seed();
+ process.exit(0);
+ }
+ try {
+ await seed();
+ // The Connect page starts a fresh check of the (unreachable) address once the last one is a minute old, and the server keeps
+ // the check it read in memory: its four visits come first, within that minute of the seed, on a server started fresh.
+ for (const width of [1440, 390]) {
+ for (const scheme of ["light", "dark"]) {
+ const tag = `${width} ${scheme}`;
+ // ---- Connect your GPU: the Video row names the build this card gets.
+ {
+ const { context, page } = await contextFor("open", width, scheme);
+ await page.goto(`${app}/connect`, { waitUntil: "load" });
+ const line = page.getByText(/(Ready on|On) this GPU:/).first();
+ await line.waitFor({ timeout: 60_000 }).catch(() => {});
+ const row = page.locator("li").filter({ has: page.getByText("Video", { exact: true }) }).filter({ hasText: /this GPU:/ }).first();
+ const text = flat(await row.innerText().catch(() => ""));
+ check(`${tag} connect: the Video row reads Ready on this GPU: FastH3 Trim (fp8)`, /Ready on this GPU: FastH3 Trim \(fp8\)/.test(text), text.slice(0, 160));
+ check(`${tag} connect: it says text to video only`, /Text to video only/.test(text));
+ const swap = flat(await page.locator("li").filter({ has: page.getByText("Character swap", { exact: true }) }).first().innerText().catch(() => ""));
+ check(`${tag} connect: Character swap says it needs the full model`, /Runs on the full MiniMax H3/.test(swap), swap.slice(0, 160));
+ if (width < 500) await row.scrollIntoViewIfNeeded().catch(() => {});
+ await shoot(page, `connect-${width}-${scheme}.png`);
+ check(`${tag} connect: nothing scrolls sideways`, await noSideways(page));
+ await context.close();
+ }
+ }
+ }
+ for (const width of [1440, 390]) {
+ for (const scheme of ["light", "dark"]) {
+ const tag = `${width} ${scheme}`;
+ // ---- Video studio on your GPU: MiniMax H3's GPU tier and Decoder, and the composer's note.
+ {
+ const { context, page } = await contextFor("open", width, scheme);
+ await page.goto(`${app}/video`, { waitUntil: "load" });
+ await composer(page).waitFor({ timeout: 60_000 });
+ await page.waitForTimeout(1200);
+ await openMenu(page);
+ await pick(page, "MiniMax H3", "oss-minimax-h3");
+ await composer(page).getByRole("textbox").first().fill("A lighthouse at dusk, waves on the rocks, gulls calling");
+ await page.waitForTimeout(800);
+ await page.getByText(/On your GPU this runs as/).first().waitFor({ timeout: 15_000 }).catch(() => {});
+ // Auto on the 12 GB card the check read: Trim, said in plain words.
+ const auto = page.getByText(/On your GPU this runs as FastH3 Trim/);
+ check(`${tag} video: Auto on a 12 GB card says it runs as FastH3 Trim`, (await auto.count()) > 0);
+ await openOptions(page);
+ const tier = page.getByRole("combobox", { name: "GPU tier" });
+ await tier.waitFor({ timeout: 10_000 });
+ const tiers = await listOf(page, tier);
+ check(`${tag} video: GPU tier offers Auto, 32 GB, FastH3 V2 and Trim`, tiers[0] === "Auto" && tiers.some((t) => /FastH3 V2/.test(t)) && tiers.some((t) => /FastH3 Trim, experimental, text to video only/.test(t)), tiers.join(" | "));
+ // Fast decode is held back until it validates on a ComfyUI with Sol's loader (H3_FAST_DECODE_OFFERED).
+ check(`${tag} video: no Decoder option yet`, (await page.getByRole("combobox", { name: "Decoder" }).count()) === 0);
+ // FastH3 V2 picked: the composer says what it changes.
+ await tier.focus();
+ await page.keyboard.press("Enter");
+ await page.getByRole("listbox").last().getByRole("option", { name: /FastH3 V2/ }).click();
+ await page.waitForTimeout(400);
+ check(`${tag} video: FastH3 V2 picked, the composer says what it changes`, (await page.getByText(/^FastH3 V2: an 8-step build of MiniMax H3/).count()) > 0);
+ await shoot(page, `video-${width}-${scheme}.png`);
+ check(`${tag} video: nothing scrolls sideways`, await noSideways(page));
+ await context.close();
+ }
+ }
+ }
+ check("no console errors", errors.length === 0, errors.slice(0, 5).join(" || "));
+ } finally {
+ await browser.close();
+ }
+ if (failures.length) {
+ console.log(`\n${failures.length} failed`);
+ process.exit(1);
+ }
+ console.log("\nall passed");
diff --cc tests/e2e/hosted-catchup.mjs
index 00000000,a13e2f0e..327c8005
mode 000000,100644..100644
--- a/tests/e2e/hosted-catchup.mjs
+++ b/tests/e2e/hosted-catchup.mjs
@@@ -1,0 -1,228 +1,228 @@@
-// The hosted catch-up (build package nm10-hosted-catchup), browser check at 1440 and 390 px, light and dark, in demo mode:
++// The hosted catch-up, browser check at 1440 and 390 px, light and dark, in demo mode:
+ // Lipsync prices H3 Max Lip Sync on the voice's length (1.2x over 15 s) and refuses a voice under 5 s before Generate; Relight
+ // on H3 Max asks for a light, draws its sphere and prices the clip's seconds; Edit video's "Insert a moment" has a two-handle
+ // range over the clip and prices the new moment; Image to 3D offers Tripo P2 and a Retexture action on a result. No console
+ // errors, nothing scrolls sideways.
+ // Usage: node tests/e2e/hosted-catchup.mjs [appUrl] [--shots <dir>] (app running with FUOBE_DEMO_MODE=on; needs ffmpeg).
+ // Exits 1 on a failed check.
+ import { spawnSync } from "node:child_process";
+ import fs from "node:fs";
+ import os from "node:os";
+ import path from "node:path";
+ import { launch, root } from "./_browser.mjs";
+
+ const argv = process.argv.slice(2);
+ const app = (argv.find((a) => !a.startsWith("--") && argv[argv.indexOf(a) - 1] !== "--shots") ?? "http://localhost:3000").replace(/\/$/, "");
+ const shots = argv.includes("--shots") ? argv[argv.indexOf("--shots") + 1] : undefined;
+ if (shots) fs.mkdirSync(shots, { recursive: true });
+
+ const failures = [];
+ const check = (label, ok, extra = "") => {
+ console.log(`${ok ? "ok " : "FAIL"} ${label.padEnd(78)}${extra ? ` ${extra}` : ""}`);
+ if (!ok) failures.push(label);
+ };
+
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-catchup-e2e-"));
+ const ff = (args) => {
+ const r = spawnSync("ffmpeg", ["-v", "error", "-y", ...args]);
+ if (r.status !== 0) throw new Error(`ffmpeg failed: ${r.stderr}`);
+ };
+ const clip = path.join(tmp, "clip-8s.mp4");
+ ff(["-f", "lavfi", "-i", "testsrc=size=1280x720:rate=24", "-t", "8", "-pix_fmt", "yuv420p", clip]);
+ const voice20 = path.join(tmp, "voice-20s.wav");
+ ff(["-f", "lavfi", "-i", "sine=frequency=220:duration=20", voice20]);
+ const voice2 = path.join(root, "scripts/eval/fixtures/voice.wav");
+ const portrait = path.join(root, "scripts/eval/fixtures/start-frame.png");
+
+ const browser = await launch();
+ try {
+ for (const [width, height] of [
+ [1440, 900],
+ [390, 844],
+ ]) {
+ for (const scheme of ["light", "dark"]) {
+ const tag = `${width} ${scheme}`;
+ const context = await browser.newContext({ viewport: { width, height }, colorScheme: scheme, ...(width < 500 ? { isMobile: true, hasTouch: true } : {}) });
+ await context.addInitScript(() => {
+ try {
+ localStorage.setItem("fuobe.engine", "cloud");
+ } catch {}
+ });
+ const page = await context.newPage();
+ const errors = [];
+ page.on("console", (m) => m.type() === "error" && errors.push(m.text()));
+ page.on("pageerror", (e) => errors.push(String(e)));
+ const shot = async (name) => shots && (await page.screenshot({ path: path.join(shots, `${name}-${width}-${scheme}.png`) }));
+ const sideways = () => page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
+ const open = async (url, name) => {
+ await page.goto(`${app}${url}`, { waitUntil: "load", timeout: 180_000 });
+ const chip = page.getByRole("button", { name: /^Model: / }).first();
+ await chip.waitFor({ timeout: 120_000 });
+ await page
+ .waitForFunction((n) => (document.querySelector("button[aria-label^='Model: ']")?.getAttribute("aria-label") ?? "").includes(n), name, { timeout: 20_000 })
+ .catch(() => {});
+ return (await chip.getAttribute("aria-label")) ?? "";
+ };
+ // On a phone the model's own chips sit in the Settings sheet.
+ const chips = async () => {
+ if (width < 500) {
+ await page.getByRole("button", { name: /^Settings:/ }).first().click();
+ await page.waitForTimeout(400);
+ }
+ };
+ // Demo mode shows placeholders as free: the price checked is the picker row's (the amounts are unit-tested).
+ const rowPrice = async (id) => {
+ await page.getByRole("button", { name: /^Model: / }).first().click();
+ const row = page.locator(`[cmdk-item][data-value$=":${id}"]`).first();
+ await row.waitFor({ timeout: 15_000 });
+ const text = await row.innerText();
+ await page.keyboard.press("Escape");
+ await page.waitForTimeout(300);
+ return text.replace(/\n/g, " | ");
+ };
+
+ // ---- Lipsync: H3 Max Lip Sync on a 20 s voice (×1.2 over 15 s) and a 2 s one (refused).
+ check(`${tag}: Lipsync opens on H3 Max Lip Sync`, (await open("/lipsync?model=minimax-h3-max-lipsync", "H3 Max Lip Sync")).includes("H3 Max Lip Sync"));
+ await page.locator('input[type="file"][accept^="image/"]').first().setInputFiles(portrait);
+ await page.locator('input[type="file"][accept^="audio/"]').first().setInputFiles(voice20);
+ const lipRow = await rowPrice("minimax-h3-max-lipsync");
+ check(`${tag}: the picker prices H3 Max Lip Sync per second`, /\$0\.08\/sec/.test(lipRow), lipRow);
+ await shot("lipsync");
+ check(`${tag}: no sideways scroll in Lipsync`, (await sideways()) <= 1, `${await sideways()} px`);
+ await open("/lipsync?model=minimax-h3-max-lipsync", "H3 Max Lip Sync");
+ await page.locator('input[type="file"][accept^="image/"]').first().setInputFiles(portrait);
+ await page.locator('input[type="file"][accept^="audio/"]').first().setInputFiles(voice2);
+ const short = await page
+ .getByRole("button", { name: /^Generate — .*needs at least 5 s of audio/ })
+ .first()
+ .waitFor({ timeout: 20_000 })
+ .then(
+ () => true,
+ () => false,
+ );
+ check(`${tag}: a 2 s voice is refused before Generate`, short);
+
+ // ---- Relight: H3 Max asks for a light, draws its sphere, prices the clip.
+ check(`${tag}: Relight opens on H3 Max Relight`, (await open("/video-tools/relight?model=minimax-h3-max-relight", "H3 Max Relight")).includes("H3 Max Relight"));
+ await page.locator('input[type="file"][accept^="video/"]').first().setInputFiles(clip);
+ const ask = await page
+ .getByRole("button", { name: /^Generate — Pick a light: / })
+ .first()
+ .waitFor({ timeout: 20_000 })
+ .then(
+ () => true,
+ () => false,
+ );
+ check(`${tag}: it asks for a light first`, ask);
+ await chips();
+ await page.getByRole("button", { name: /^Pick a light/ }).locator("visible=true").first().click();
+ await page.getByRole("button", { name: /^Golden hour/ }).first().click();
+ const lit = await page
+ .getByRole("button", { name: /Light · Golden hour/ })
+ .locator("visible=true")
+ .first()
+ .waitFor({ timeout: 20_000 })
+ .then(
+ () => true,
+ () => false,
+ );
+ check(`${tag}: the Golden hour sphere is set`, lit);
+ await shot("relight");
+ await page.keyboard.press("Escape");
+ await page.waitForTimeout(300);
+ await page.locator("h1").first().click({ force: true });
+ await page.waitForTimeout(300);
+ const relightRow = await rowPrice("minimax-h3-max-relight");
+ check(`${tag}: the picker prices H3 Max Relight per second`, /\$0\.08\/sec/.test(relightRow), relightRow);
+ check(`${tag}: no sideways scroll in Relight`, (await sideways()) <= 1, `${await sideways()} px`);
+ await page.keyboard.press("Escape");
+
+ // ---- Edit video: Insert a moment with a two-handle range.
+ check(`${tag}: Edit video opens on H3 Max Insert`, (await open("/video-edit?model=minimax-h3-max-insert", "Insert a moment")).includes("Insert a moment"));
+ await page.locator('input[type="file"][accept^="video/"]').first().setInputFiles(clip);
+ await page.waitForTimeout(1500);
+ await chips();
+ const range = page.getByRole("button", { name: /^Insert · / }).locator("visible=true").first();
+ const hasRange = await range
+ .waitFor({ timeout: 20_000 })
+ .then(
+ () => true,
+ () => false,
+ );
+ check(`${tag}: the insert range chip shows`, hasRange, hasRange ? await range.innerText() : "");
+ if (hasRange) {
+ await range.click();
+ const thumbs = page.getByRole("slider");
+ await thumbs.first().waitFor({ timeout: 10_000 });
+ check(`${tag}: the range has two handles over the 8 s clip`, (await thumbs.count()) === 2 && (await thumbs.nth(1).getAttribute("aria-valuemax")) === "8");
+ const before = Number(await thumbs.first().getAttribute("aria-valuenow"));
+ check(`${tag}: the handles open around the clip's middle`, before === 3.5, String(before));
+ await thumbs.first().focus();
+ await page.keyboard.press("ArrowRight");
+ await page.waitForTimeout(300);
+ const after = Number(await thumbs.first().getAttribute("aria-valuenow"));
+ check(`${tag}: a handle moves by 1/8 s`, after === before + 0.125, String(after));
+ await shot("insert");
+ check(`${tag}: no sideways scroll with the range open`, (await sideways()) <= 1, `${await sideways()} px`);
+ await page.keyboard.press("Escape");
+ await page.waitForTimeout(300);
+ await page.locator("h1").first().click({ force: true });
+ await page.waitForTimeout(300);
+ }
+ const insertRow = await rowPrice("minimax-h3-max-insert");
+ check(`${tag}: the picker prices H3 Max Insert per second`, /\$0\.06\/sec/.test(insertRow), insertRow);
+
+ // ---- Image to 3D: Tripo P2 is offered; a result has Retexture.
+ await page.goto(`${app}/image-to-3d?model=tripo-p2`, { waitUntil: "load", timeout: 180_000 });
+ await page.getByRole("heading").first().waitFor({ timeout: 120_000 });
+ await page.waitForTimeout(1500);
+ const body = await page.locator("main").innerText();
+ check(`${tag}: Image to 3D offers Tripo P2`, /Tripo P2/.test(body));
+ const up = await page.request.post(`${app}/api/uploads`, { multipart: { file: { name: "chair.png", mimeType: "image/png", buffer: fs.readFileSync(portrait) } } });
+ const photo = (await up.json()).url;
+ const res = await page.request.fetch(`${app}/api/generations`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ data: JSON.stringify({ feature: "image-to-3d", modelId: "tripo-p2", op: "image-to-3d", inputs: { images: [photo] } }),
+ });
+ check(`${tag}: a Tripo P2 run starts (demo)`, res.ok(), String(res.status()));
+ const retexture = page.getByRole("button", { name: /^Retexture$/ }).first();
+ let shown = false;
+ for (let i = 0; i < 12 && !shown; i++) {
+ await page.waitForTimeout(5000);
+ await page.reload({ waitUntil: "load" });
+ await page.waitForTimeout(2500);
+ shown = await retexture.isVisible().catch(() => false);
+ }
+ check(`${tag}: a 3D result has Retexture`, shown);
+ if (shown) {
+ await retexture.click();
+ const dialog = page.getByRole("dialog");
+ await dialog.waitFor({ timeout: 10_000 });
+ await dialog.getByLabel("The new look").fill("weathered bronze with green patina");
+ const price = await dialog
+ .getByText(/\$0\.30|Placeholder/)
+ .first()
+ .waitFor({ timeout: 20_000 })
+ .then(
+ () => true,
+ () => false,
+ );
+ check(`${tag}: Retexture shows its price before running`, price, (await dialog.innerText()).replace(/\n/g, " | ").slice(0, 200));
+ await shot("retexture");
+ check(`${tag}: no sideways scroll with Retexture open`, (await sideways()) <= 1, `${await sideways()} px`);
+ await page.keyboard.press("Escape");
+ }
+ check(`${tag}: no console errors`, errors.length === 0, errors.slice(0, 3).join(" | ").slice(0, 300));
+ await context.close();
+ }
+ }
+ } finally {
+ await browser.close();
+ fs.rmSync(tmp, { recursive: true, force: true });
+ }
+ if (failures.length) {
+ console.log(`\n${failures.length} failed`);
+ process.exit(1);
+ }
+ console.log("\nall checks passed");
diff --cc tests/e2e/inbetweening.mjs
index 00000000,61bb2d0d..c27fcb67
mode 000000,100644..100644
--- a/tests/e2e/inbetweening.mjs
+++ b/tests/e2e/inbetweening.mjs
@@@ -1,0 -1,208 +1,208 @@@
-// Keyframe animation (package inbetweening) in the browser, in demo mode (no run reaches a GPU or a key): the Video
++// Keyframe animation in the browser, in demo mode (no run reaches a GPU or a key): the Video
+ // studio's Frames mode in Animation style (a timing chip per gap, the live length, the playback rate, Keep mouth still,
+ // what the cloud keeps), Storyboard's "Animate these panels" opening it with the panels as keyframes, a character's
+ // "Animate between poses", and the Character Sheet page. Each at 1440 and 390 px, light and dark, without sideways
+ // scroll, failing on any console error.
+ // Usage: FUOBE_DEMO_MODE=on pnpm dev -p 3412 & node tests/e2e/inbetweening.mjs [appUrl] [--shots <dir>]
+ // Nothing is generated on a GPU: the storyboard is made in the cloud on placeholder results; Generate is never pressed.
+ import fs from "node:fs";
+ import path from "node:path";
+ import { launch, root } from "./_browser.mjs";
+
+ const argv = process.argv.slice(2);
+ const app = (argv.find((a) => !a.startsWith("--") && argv[argv.indexOf(a) - 1] !== "--shots") ?? "http://localhost:3000").replace(/\/$/, "");
+ const shots = argv.includes("--shots") ? argv[argv.indexOf("--shots") + 1] : undefined;
+ if (shots) fs.mkdirSync(shots, { recursive: true });
+
+ const failures = [];
+ const check = (label, ok, extra = "") => {
+ console.log(`${ok ? "ok " : "FAIL"} ${label.padEnd(84)}${extra ? ` ${extra}` : ""}`);
+ if (!ok) failures.push(label);
+ };
+ const call = async (p, init) => {
+ const r = await fetch(`${app}${p}`, init);
+ return r.json();
+ };
+
+ const status = await call("/api/status");
+ if (status.demoMode === "off") throw new Error("run the app in demo mode (FUOBE_DEMO_MODE=on)");
+
+ // Three keyframes (the eval's drawn faces).
+ const upload = async (file) => {
+ const form = new FormData();
+ form.append("file", new Blob([fs.readFileSync(path.join(root, "scripts/eval/fixtures/character", file))], { type: "image/png" }), file);
+ return (await call("/api/uploads", { method: "POST", body: form })).url;
+ };
+ const keys = [await upload("drawn-face-1.png"), await upload("drawn-face-2.png"), await upload("drawn-face-3.png")];
+
+ // A storyboard of three panels in the cloud (placeholder results: no key).
+ const board = await call("/api/storyboards", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ engine: "cloud",
+ story: "A paper fox wakes, stretches and runs off",
+ frames: 3,
+ }),
+ });
+ const boardIds = (board.items ?? []).map((g) => g.id);
+ for (let i = 0; i < 120; i++) {
+ const all = await Promise.all(boardIds.map((id) => call(`/api/generations/${id}`)));
+ if (all.every((g) => ["succeeded", "failed", "canceled"].includes(g.status ?? g.generation?.status))) break;
+ await new Promise((r) => setTimeout(r, 1000));
+ }
+ check("storyboard made on placeholder results", boardIds.length >= 3, `${boardIds.length} frames`);
+
+ // A character element with three pictures.
+ const element = await call("/api/elements", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ name: "Paper fox",
+ kind: "character",
+ references: keys,
+ }),
+ });
+ const elementId = element.id ?? element.element?.id;
+
+ const browser = await launch();
+ const contextFor = async (engine, width, colorScheme) => {
+ const context = await browser.newContext({
+ viewport: { width, height: width < 500 ? 844 : 900 },
+ colorScheme,
+ ...(width < 500 && { isMobile: true, hasTouch: true }),
+ });
+ await context.addInitScript((e) => {
+ try {
+ localStorage.setItem("fuobe.engine", e);
+ } catch {}
+ }, engine);
+ const page = await context.newPage();
+ page.setDefaultTimeout(60_000);
+ const errors = [];
+ page.on("console", (m) => m.type() === "error" && errors.push(m.text()));
+ page.on("pageerror", (e) => errors.push(String(e)));
+ return { context, page, errors };
+ };
+ const noSideways = (page) => page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1);
+ const shoot = (page, name) => (shots ? page.screenshot({ path: path.join(shots, name) }) : undefined);
+ const strip = (page) => page.locator("[data-frames-strip]").first();
+ const framesUrl = `/video?${new URLSearchParams({ model: "fuobe-animation", frames: keys.join(",") })}`;
+
+ for (const width of [1440, 390]) {
+ for (const scheme of ["light", "dark"]) {
+ const tag = `${width} ${scheme}`;
+ // ---- Frames mode, Animation style, on your GPU
+ {
+ const { context, page, errors } = await contextFor("open", width, scheme);
+ await page.goto(`${app}${framesUrl}`, { waitUntil: "load" });
+ await strip(page).waitFor({ timeout: 90_000 });
+ await page.waitForTimeout(1500);
+ const s = strip(page);
+ check(`${tag}: Frames opens with the 3 handed-over keyframes`, (await s.locator('button[aria-label^="Frame "][aria-label$=": replace"]').count()) === 3);
+ check(`${tag}: Animation style is on`, (await s.getByRole("switch").first().getAttribute("aria-checked")) === "true");
+ check(`${tag}: a timing chip per gap`, (await s.locator("[data-gap-chip]").count()) === 2);
+ check(`${tag}: the last keyframe is the end frame`, (await s.locator('button[aria-label^="Frame 3, end frame"]').count()) === 1);
+ const before = await s.locator("[data-animation-length]").innerText();
+ await s.locator("[data-gap-chip]").first().click();
+ const pop = page.getByRole("dialog").last();
+ await pop.waitFor();
+ await pop.getByRole("radio", { name: "×3" }).click();
+ await pop.getByRole("button", { name: "More frames" }).click();
+ // Typed key by key, as a person types: the spaces stay.
+ const words = pop.getByPlaceholder("she jumps and lands");
+ await words.click();
+ await words.pressSequentially("he leaps high", { delay: 20 });
+ await page.waitForTimeout(300);
+ check(`${tag}: a gap's words keep their spaces as typed`, (await words.inputValue()) === "he leaps high", await words.inputValue());
+ const chip = await s.locator("[data-gap-chip]").first().innerText();
+ check(`${tag}: the chip shows the gap's frames and speed`, /\d+ f · ×3/.test(chip.replace(/\s+/g, " ")), chip.replace(/\s+/g, " "));
+ await shoot(page, `frames-gap-${width}-${scheme}.png`);
+ await page.keyboard.press("Escape");
+ const after = await s.locator("[data-animation-length]").innerText();
+ check(`${tag}: the total length follows the timing`, before !== after, `${before} → ${after}`);
+ await s.getByRole("radio", { name: /16 fps/ }).click();
+ await s.getByText("Keep mouth still").click();
+ await page.waitForTimeout(400);
+ const longer = await s.locator("[data-animation-length]").innerText();
+ check(`${tag}: 16 fps plays it longer`, parseFloat(longer) > parseFloat(after), longer);
+ // The price on your GPU: Free.
+ const free = await page.locator("[data-composer]").first().getByText(/free/i).count();
+ check(`${tag}: free on your GPU`, free > 0);
+ check(`${tag}: no sideways scroll (Frames)`, await noSideways(page));
+ await shoot(page, `frames-${width}-${scheme}.png`);
+ // Style off: back to Wan 2.2 14B's frames.
+ await s.getByRole("switch").first().click();
+ await page.waitForTimeout(800);
+ check(`${tag}: Animation off leaves the gap chips`, (await s.locator("[data-gap-chip]").count()) === 0);
+ check(`${tag}: no console errors (Frames)`, errors.length === 0, errors.slice(0, 2).join(" | "));
+ await context.close();
+ }
+ // ---- In the cloud: every frame kept at 16 fps, said plainly
+ if (scheme === "light") {
+ const { context, page, errors } = await contextFor("cloud", width, scheme);
+ await page.goto(`${app}${framesUrl}`, { waitUntil: "load" });
+ await strip(page).waitFor({ timeout: 90_000 });
+ await page.waitForTimeout(1500);
+ const s = strip(page);
+ check(`${tag}: cloud says what runs on your GPU`, (await s.getByText(/Faster speeds and 24 fps playback are on your GPU/).count()) === 1);
+ check(`${tag}: cloud plays at 16 fps only`, (await s.getByRole("radio", { name: /24 fps/ }).count()) === 0);
+ await s.locator("[data-gap-chip]").first().click();
+ const pop = page.getByRole("dialog").last();
+ await pop.waitFor();
+ check(`${tag}: cloud keeps ×2–×4 for your GPU`, await pop.getByRole("radio", { name: "×3" }).isDisabled());
+ await page.keyboard.press("Escape");
+ check(`${tag}: no sideways scroll (cloud)`, await noSideways(page));
+ check(`${tag}: no console errors (cloud)`, errors.length === 0, errors.slice(0, 2).join(" | "));
+ await shoot(page, `frames-cloud-${width}.png`);
+ await context.close();
+ }
+ // ---- Storyboard: Animate these panels
+ {
+ const { context, page, errors } = await contextFor("cloud", width, scheme);
+ await page.goto(`${app}/storyboard`, { waitUntil: "load" });
+ const link = page.locator("[data-animate-panels]").first();
+ await link.waitFor({ timeout: 90_000 });
+ check(`${tag}: no sideways scroll (Storyboard)`, await noSideways(page));
+ await shoot(page, `storyboard-${width}-${scheme}.png`);
+ await link.click();
+ await page.waitForURL(/\/video\?/, { timeout: 60_000 });
+ await strip(page).waitFor({ timeout: 90_000 });
+ await page.waitForTimeout(1200);
+ check(`${tag}: Animate these panels opens Frames with the panels`, (await strip(page).locator("[data-gap-chip]").count()) === boardIds.length - 1);
+ check(`${tag}: no console errors (Storyboard)`, errors.length === 0, errors.slice(0, 2).join(" | "));
+ await context.close();
+ }
+ // ---- A character: Animate between poses; the Character Sheet page
+ {
+ const { context, page, errors } = await contextFor("open", width, scheme);
+ if (elementId) {
+ await page.goto(`${app}/elements/${elementId}`, { waitUntil: "load" });
+ const btn = page.locator("[data-animate-poses]").first();
+ await btn.waitFor({ timeout: 90_000 });
+ await btn.click();
+ const pop = page.getByRole("dialog").last();
+ await pop.waitFor();
+ check(`${tag}: three poses picked by default`, (await pop.locator('button[aria-pressed="true"]').count()) === 3);
+ check(`${tag}: no sideways scroll (character)`, await noSideways(page));
+ await shoot(page, `poses-${width}-${scheme}.png`);
+ await pop.getByRole("link", { name: /Animate 3 poses/ }).click();
+ await page.waitForURL(/\/video\?/, { timeout: 60_000 });
+ await strip(page).waitFor({ timeout: 90_000 });
+ check(`${tag}: the poses open as keyframes`, (await strip(page).locator("[data-gap-chip]").count()) === 2);
+ } else check(`${tag}: character element made`, false);
+ await page.goto(`${app}/character-sheet`, { waitUntil: "load" });
+ await page.waitForTimeout(2500);
+ check(`${tag}: no sideways scroll (Character Sheet)`, await noSideways(page));
+ await shoot(page, `character-sheet-${width}-${scheme}.png`);
+ check(`${tag}: no console errors (character)`, errors.length === 0, errors.slice(0, 2).join(" | "));
+ await context.close();
+ }
+ }
+ }
+ await browser.close();
+ if (failures.length) {
+ console.log(`\n${failures.length} failed`);
+ process.exit(1);
+ }
+ console.log("\nall passed");
diff --cc tests/e2e/layouts-everywhere.mjs
index 00000000,bc86fb92..4461d8dd
mode 000000,100644..100644
--- a/tests/e2e/layouts-everywhere.mjs
+++ b/tests/e2e/layouts-everywhere.mjs
@@@ -1,0 -1,212 +1,212 @@@
-// N7-8 in the browser (nothing is run: no GPU, no fal key): the Canvas Layout node and its editor (boxes drawn by touch
++// Layouts everywhere in the browser (nothing is run: no GPU, no fal key): the Canvas Layout node and its editor (boxes drawn by touch
+ // at 390 px, Plan layout from a sentence, Done back on the card), Marketing Studio's "Words drawn by the model" switch with
+ // its hint and the drawing model in Settings, and Ads Studio's switch with its hint. Each at 1440 and 390 px, light and
+ // dark: the controls render, nothing scrolls sideways, keyboard focus reaches every new control, no console errors.
+ // Usage: node tests/e2e/layouts-everywhere.mjs [appUrl] [--shots <dir>] (a server in demo mode: FUOBE_DEMO_MODE=on)
+ import fs from "node:fs";
+ import path from "node:path";
+ import { launch } from "./_browser.mjs";
+
+ const argv = process.argv.slice(2);
+ const app = (argv.find((a) => !a.startsWith("--") && argv[argv.indexOf(a) - 1] !== "--shots") ?? "http://localhost:3000").replace(/\/$/, "");
+ const shots = argv.includes("--shots") ? argv[argv.indexOf("--shots") + 1] : undefined;
+ if (shots) fs.mkdirSync(shots, { recursive: true });
+
+ const failures = [];
+ const check = (label, ok, extra = "") => {
+ console.log(`${ok ? "ok " : "FAIL"} ${label.padEnd(90)}${extra ? ` ${extra}` : ""}`);
+ if (!ok) failures.push(label);
+ };
+ const api = async (p, body) => (await fetch(app + p, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) })).json();
+
+ // A board: a Layout node (one box) into MOSS-Image on your GPU.
+ const layout = { summary: { caption: "", meta: [], canvas: "single" }, items: [{ label: "text", caption: "Bold", text: "30% OFF", box: [0.1, 0.05, 0.9, 0.2] }], aspect: "3:4" };
+ const newCanvas = () =>
+ api("/api/canvases", {
+ name: "Layouts",
+ graph: {
+ nodes: [
+ { id: "l", type: "layout", position: { x: 0, y: 0 }, data: { layout } },
+ { id: "m", type: "model", position: { x: 420, y: 0 }, data: { modelId: "oss-moss-image", mediaKind: "image", params: { aspectRatio: "3:4" } } },
+ ],
+ edges: [{ id: "e1", source: "l", sourceHandle: "out", target: "m", targetHandle: "prompt" }],
+ },
+ });
+ const first = await newCanvas();
+ check("api: a board with a Layout node saves", !!first.id, first.error ?? "");
+ // A brand with a product, for Ads Studio.
+ const brand = await api("/api/brands", { name: "Ember & Wick", description: "Small-batch soy candles", colors: ["#a3411f", "#f6efe3"] });
+ const brandId = brand.id ?? brand.brand?.id;
+ const product = brandId ? await api("/api/products", { brandId, name: "Autumn Soy Candle", description: "Amber glass jar", images: [] }) : {};
+ check("api: a brand and a product for Ads Studio", !!brandId && !!product.id, JSON.stringify(brand).slice(0, 120));
+
+ const browser = await launch();
+ const errorsOf = (page) => {
+ const errs = [];
+ page.on("console", (m) => m.type() === "error" && errs.push(m.text()));
+ page.on("pageerror", (e) => errs.push(e.message));
+ return errs;
+ };
+ const noSideways = (page) => page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1);
+ const shoot = (page, name) => (shots ? page.screenshot({ path: path.join(shots, name) }) : undefined);
+ /** Tab until the element (a locator) has focus, up to n presses. */
+ const tabTo = async (page, locator, n = 80) => {
+ const el = await locator.elementHandle();
+ for (let i = 0; i < n; i++) {
+ await page.keyboard.press("Tab");
+ if (await page.evaluate((e) => document.activeElement === e || e.contains(document.activeElement), el)) return true;
+ }
+ return false;
+ };
+
+ try {
+ for (const width of [1440, 390]) {
+ for (const scheme of ["light", "dark"]) {
+ const tag = `${width} ${scheme}`;
+ const phone = width < 500;
+ const context = await browser.newContext({ viewport: { width, height: phone ? 844 : 900 }, colorScheme: scheme, ...(phone && { isMobile: true, hasTouch: true }) });
+ await context.addInitScript(() => {
+ try {
+ localStorage.setItem("fuobe.engine", "open");
+ } catch {}
+ });
+ const page = await context.newPage();
+ page.setDefaultTimeout(60_000);
+ const errs = errorsOf(page);
+
+ // --- Canvas: the Layout node and its editor (a fresh board each time)
+ const canvas = await newCanvas();
+ await page.goto(`${app}/canvas/${canvas.id}`, { waitUntil: "load" });
+ const card = page.locator(".react-flow__node-layout").first();
+ await card.waitFor();
+ await page.waitForTimeout(1200);
+ check(
+ `${tag} canvas: the Layout node shows its box${phone ? "" : " and Edit layout"}`,
+ (await card.innerText()).includes("1 box") && (phone || (await card.getByRole("button", { name: "Edit layout", exact: true }).count()) === 1),
+ );
+ // Phones edit in the Nodes list (the board is read-only there).
+ if (phone)
+ await page
+ .getByRole("button", { name: "Nodes", exact: true })
+ .or(page.getByRole("tab", { name: "Nodes", exact: true }))
+ .first()
+ .click();
+ const edit = phone ? page.getByRole("button", { name: "Edit layout", exact: true }).first() : card.getByRole("button", { name: "Edit layout", exact: true });
+ await edit.waitFor();
+ check(`${tag} canvas: keyboard focus reaches Edit layout`, await tabTo(page, edit, 120));
+ await edit.click();
+ const dialog = page.getByRole("dialog");
+ await dialog.waitFor();
+ const board = dialog.locator("[data-layout-canvas]");
+ await board.waitFor();
+ check(`${tag} editor: opens on the board's 3:4 canvas sized for MOSS-Image`, /3:4/.test(await dialog.innerText()));
+ // Draw a box: by touch on a phone, with the mouse on a desktop.
+ const b = await board.boundingBox();
+ const from = { x: b.x + b.width * 0.2, y: b.y + b.height * 0.4 };
+ const to = { x: b.x + b.width * 0.7, y: b.y + b.height * 0.8 };
+ if (phone) {
+ const cdp = await context.newCDPSession(page);
+ const touch = (type, p) => cdp.send("Input.dispatchTouchEvent", { type, touchPoints: p ? [{ x: p.x, y: p.y, id: 1 }] : [] });
+ await touch("touchStart", from);
+ for (let i = 1; i <= 8; i++) await touch("touchMove", { x: from.x + ((to.x - from.x) * i) / 8, y: from.y + ((to.y - from.y) * i) / 8 });
+ await touch("touchEnd");
+ } else {
+ await page.mouse.move(from.x, from.y);
+ await page.mouse.down();
+ await page.mouse.move(to.x, to.y, { steps: 8 });
+ await page.mouse.up();
+ }
+ await page.waitForTimeout(300);
+ check(`${tag} editor: dragging draws a second box${phone ? " (touch)" : ""}`, (await board.locator("[data-layout-box]").count()) === 2);
+ // Plan layout from the whole picture's words.
+ const plan = dialog.getByRole("button", { name: "Plan layout" });
+ if (phone && !(await plan.isVisible()))
+ await dialog
+ .getByRole("button", { name: /boxes|box/ })
+ .first()
+ .click();
+ await dialog.locator("#layout-caption").fill("a sale poster for my candle shop, 30% off");
+ check(`${tag} editor: Plan layout is there with its hint`, (await plan.isVisible()) && (await dialog.locator("#layout-plan-hint").isVisible()));
+ if (!phone) {
+ await dialog.locator("#layout-caption").focus();
+ await page.keyboard.press("Shift+Tab");
+ check(`${tag} editor: keyboard focus reaches Plan layout`, await plan.evaluate((e) => document.activeElement === e));
+ }
+ await plan.click();
+ await page.waitForFunction(() => document.querySelectorAll("[data-layout-box]").length >= 3, null, { timeout: 30_000 }).catch(() => {});
+ const planned = await board.locator("[data-layout-box]").count();
+ check(`${tag} editor: Plan layout lays out the poster's boxes`, planned >= 3, `${planned} boxes`);
+ check(`${tag} editor: the planned headline reads 30% OFF`, (await dialog.innerText()).includes("30% OFF"));
+ check(`${tag} editor: nothing scrolls sideways`, await noSideways(page));
+ await shoot(page, `editor-${width}-${scheme}.png`);
+ await dialog.getByRole("button", { name: "Done" }).click();
+ await page.waitForTimeout(500);
+ const shown = phone ? await page.locator("main").innerText() : await card.innerText();
+ check(`${tag} canvas: Done puts the planned boxes on the ${phone ? "node's row" : "card"}`, shown.includes(`${planned} boxes`), shown.replace(/\s+/g, " ").slice(0, 80));
+ check(`${tag} canvas: nothing scrolls sideways`, await noSideways(page));
+ await shoot(page, `canvas-${width}-${scheme}.png`);
+
+ // --- Marketing Studio: Ads format, Words on the image → Words drawn by the model
+ await page.goto(`${app}/marketing?template=ad-hero-headline`, { waitUntil: "load" });
+ const words = page.getByRole("button", { name: "Headline and button text" });
+ await words.waitFor();
+ await page.waitForTimeout(800);
+ await words.click();
+ const sw = page.getByRole("switch", { name: "Words drawn by the model" });
+ await sw.waitFor();
+ check(
+ `${tag} marketing: the switch and its hint render, off by default`,
+ (await sw.getAttribute("aria-checked")) === "false" && (await page.getByText("set on top in your brand fonts, letter for letter").first().isVisible()),
+ );
+ await sw.focus();
+ await page.keyboard.press("Space");
+ check(`${tag} marketing: the switch turns on from the keyboard`, (await sw.getAttribute("aria-checked")) === "true");
+ check(`${tag} marketing: nothing scrolls sideways (panel open)`, await noSideways(page));
+ await shoot(page, `marketing-${width}-${scheme}.png`);
+ await page.keyboard.press("Escape");
+ await page.waitForTimeout(300);
+ await page.getByRole("button", { name: /^Settings:/ }).click();
+ await page.waitForTimeout(400);
+ check(`${tag} marketing: Settings lists MOSS-Image as the model that draws the words`, await page.getByText("draws your words in place").first().isVisible());
+ await page.keyboard.press("Escape");
+
+ // --- Ads Studio: the switch and its hint
+ if (brandId) {
+ await page.goto(`${app}/ads/${brandId}`, { waitUntil: "load" });
+ await page.waitForTimeout(1500);
+ await page.getByText("New ads", { exact: true }).first().click();
+ const adsSwitch = page.getByRole("switch", { name: "Words drawn by the model" });
+ const found = await adsSwitch.waitFor({ timeout: 15_000 }).then(
+ () => true,
+ () => false,
+ );
+ check(`${tag} ads: the switch renders with its hint`, found && (await page.locator("#ads-drawn-words-hint").isVisible()));
+ if (found) {
+ check(`${tag} ads: keyboard focus reaches the switch`, phone || (await tabTo(page, adsSwitch, 120)));
+ await adsSwitch.click();
+ await page.waitForTimeout(800);
+ check(`${tag} ads: on, it says the ad is drawn whole in 4:5`, await page.getByText("drawn whole in 4:5").first().isVisible());
+ const price = await page
+ .locator("text=/Placeholder · free|Free|≈/")
+ .first()
+ .isVisible()
+ .catch(() => false);
+ check(`${tag} ads: a price shows beside Create`, price);
+ check(`${tag} ads: nothing scrolls sideways`, await noSideways(page));
+ await shoot(page, `ads-${width}-${scheme}.png`);
+ }
+ }
+ check(`${tag}: no console errors`, errs.length === 0, errs.slice(0, 2).join(" | "));
+ await context.close();
+ }
+ }
+ } catch (e) {
+ check(`script: ${e.message.split("\n")[0]}`, false);
+ } finally {
+ await browser.close();
+ }
+ if (failures.length) {
+ console.log(`\n${failures.length} failed`);
+ process.exit(1);
+ }
+ console.log("\nall passed");
diff --cc tests/fly-around.test.ts
index 00000000,a522ca11..65f0bc92
mode 000000,100644..100644
--- a/tests/fly-around.test.ts
+++ b/tests/fly-around.test.ts
@@@ -1,0 -1,383 +1,383 @@@
+ import { spawnSync } from "node:child_process";
+ import fs from "node:fs";
+ import os from "node:os";
+ import path from "node:path";
+ import { afterAll, beforeAll, describe, expect, it } from "vitest";
+
+ /**
- * Exact orbits and Fly around (build plan N7-7): the orbit's numbers as camera-path keys, the plan on both engines, the
++ * Exact orbits and Fly around: the orbit's numbers as camera-path keys, the plan on both engines, the
+ * server's headless path render (option B) and its chain slot, and /api/fly-around.
+ */
+
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-fly-around-"));
+ process.env.FUOBE_DATA_DIR = dir;
+ process.env.COMFYUI_URL = "http://127.0.0.1:9";
+ process.env.OLLAMA_URL = "http://127.0.0.1:9";
+
+ const { setSetting } = await import("@/server/settings");
+ const { saveFile, readRef } = await import("@/server/storage");
+ const { encodePng } = await import("@/server/png");
+ const gens = await import("@/server/generations");
+ const exact = await import("@/lib/exact-orbit");
+ const fly = await import("@/lib/catalog/fly-around");
+ const { PHOTO_KEY, PATH_FRAMES, toH3MaxTrajectory, H3_LIMITS, framePoses, renderSize } = await import("@/lib/camera-path");
+ const { splatFrame } = await import("@/lib/path-splat");
+ const { buildPointCloud, lensFov, LENS } = await import("@/lib/scene3d");
+ const { pathScene, renderPathVideo } = await import("@/server/path-render");
+ const route = await import("@/app/api/fly-around/route");
+
+ beforeAll(() => {
+ setSetting("demoMode", "auto");
+ setSetting("enhanceProvider", "none");
+ });
+ afterAll(() => fs.rmSync(dir, { recursive: true, force: true }));
+
+ /** A 64 × 48 still: a red square in the middle of a blue field, and its depth (the square near, bright). */
+ function scene() {
+ const w = 64;
+ const h = 48;
+ const photo = Buffer.alloc(w * h * 4);
+ const depth = Buffer.alloc(w * h * 4);
+ for (let y = 0; y < h; y++)
+ for (let x = 0; x < w; x++) {
+ const o = (y * w + x) * 4;
+ const inside = x > 20 && x < 44 && y > 12 && y < 36;
+ photo.set(inside ? [220, 30, 30, 255] : [30, 60, 200, 255], o);
+ const g = inside ? 230 : 40 + Math.round((y / h) * 60);
+ depth.set([g, g, g, 255], o);
+ }
+ const save = (data: Buffer, name: string) => saveFile({ data: encodePng({ width: w, height: h, data }), contentType: "image/png", name, source: "upload" }).url;
+ return { photo: save(photo, "still.png"), depth: save(depth, "depth.png") };
+ }
+
+ describe("exact orbit settings → keys", () => {
+ it("starts at the photo, turns the asked degrees the asked way, and stays within H3 Max's 12 keys", () => {
+ const keys = exact.exactOrbitKeys({ degrees: 360, direction: "ccw", tilt: 0, pulse: 0 });
+ expect(keys[0]).toEqual(PHOTO_KEY);
+ expect(keys.at(-1)).toMatchObject({ t: 1, azimuth: 360, elevation: 0, distance: 1 });
+ expect(keys.length).toBeLessThanOrEqual(exact.EXACT_MAX_KEYS);
+ const cam = toH3MaxTrajectory(keys);
+ expect("trajectory" in cam && cam.trajectory.length).toBe(keys.length);
+ expect(cam.notes).toEqual([]);
+ expect(keys.length).toBeLessThanOrEqual(H3_LIMITS.max);
+ const cw = exact.exactOrbitKeys({ degrees: 90, direction: "cw" });
+ expect(cw.at(-1)!.azimuth).toBe(-90);
+ expect(cw.length).toBe(5);
+ expect(cw.every((k, i) => i === 0 || k.azimuth < cw[i - 1].azimuth)).toBe(true);
+ });
+
+ it("tilts the ring (rising first, either way) and pulses the radius 25% in twice", () => {
+ for (const direction of ["cw", "ccw"] as const) {
+ const keys = exact.exactOrbitKeys({ degrees: 360, direction, tilt: 20, pulse: 0.25 });
+ const top = Math.max(...keys.map((k) => k.elevation));
+ expect(top).toBeCloseTo(20, 0);
+ expect(keys.find((k) => k.t === 0.25 || Math.abs(k.t - 0.2727) < 0.01)!.elevation).toBeGreaterThan(0);
+ expect(Math.min(...keys.map((k) => k.distance))).toBeCloseTo(0.75, 1);
+ expect(keys.at(-1)!.distance).toBeCloseTo(1, 3);
+ }
+ });
+
+ it("keeps the numbers in range and knows which moves take the switch", () => {
+ expect(exact.normalizeExact({ degrees: 5, tilt: 99, pulse: 0.2, direction: "x" as never })).toEqual({ degrees: 30, direction: "ccw", tilt: 20, pulse: 0.25 });
+ expect(exact.normalizeExact({ degrees: 412 }).degrees).toBe(360);
+ for (const id of ["motion-360-orbit", "motion-arc-left", "motion-arc-right", "motion-lazy-orbit", "drone-orbit", "arc-left", "arc-right", "bullet-time"]) expect(exact.takesExact(id), id).toBe(true);
+ expect(exact.takesExact("dolly-in")).toBe(false);
+ expect(exact.exactDefaults("arc-left")).toMatchObject({ degrees: 90, direction: "cw" });
+ expect(exact.exactSummary({ degrees: 180, direction: "cw", tilt: 10, pulse: 0.25 })).toBe("180° clockwise · tilt 10° · pulse 25%");
+ });
+ });
+
+ describe("the fly-around plan", () => {
+ const image = "/api/files/uploads/still.png";
+ const orbit = { degrees: 360, direction: "ccw" as const, tilt: 0, pulse: 0 };
+
+ it("on your GPU: MoGe's depth, then Uni3C along the server's render of the path, free", () => {
+ const p = fly.planFlyAround({ engine: "open", image, orbit });
+ expect(p.blocker).toBeUndefined();
+ expect(p.steps.map((s) => [s.key, s.request.modelId, s.request.op])).toEqual([
+ ["depth", "oss-scene-moge", "scene-3d"],
+ ["main", "oss-uni3c-path", "camera-path"],
+ ]);
+ expect(p.steps[1].after).toEqual(["depth"]);
+ expect(p.steps[1].request.chain).toEqual([{ slot: "video", render: "path" }]);
+ expect(p.steps[1].request.params?.cameraPath).toEqual(exact.exactOrbitKeys(orbit));
+ expect(p.costUsd).toBe(0);
+ expect(p.duration).toBeCloseTo(5.1, 1);
+ });
+
+ it("with a render already made (Image to 3D), skips the depth", () => {
+ const p = fly.planFlyAround({ engine: "open", image, preset: "orbit_360", render: "/api/files/uploads/r.webm" });
+ expect(p.steps).toHaveLength(1);
+ expect(p.steps[0].request.inputs).toEqual({ images: [image], video: "/api/files/uploads/r.webm" });
+ });
+
+ it("in the cloud: H3 Max camera-controls with the keys, 5 s at 768P = $0.40 at list", () => {
+ const p = fly.planFlyAround({ engine: "cloud", image, orbit, duration: 5 });
+ expect(p.steps).toHaveLength(1);
+ expect(p.steps[0].request).toMatchObject({ modelId: "minimax-h3-max-camera", op: "camera-path", params: { duration: 5, resolution: "768P" } });
+ expect(p.costUsd).toBeCloseTo(0.4, 3);
+ });
+
+ it("in the cloud with views: H3 Max reference-to-video with the still first and the path in words", () => {
+ const p = fly.planFlyAround({ engine: "cloud", image, views: ["/api/files/uploads/back.png"], orbit: { ...orbit, direction: "cw", degrees: 180 } });
+ expect(p.steps[0].request).toMatchObject({ modelId: "minimax-h3-max", op: "ref2v", inputs: { images: [image, "/api/files/uploads/back.png"] } });
+ expect(p.steps[0].request.prompt).toMatch(/180-degree arc around the subject, moving to the left/);
+ });
+
+ it("puts a preset or a sweep into words for the reference route, and says where a tilted ring takes the camera", () => {
+ expect(fly.pathWords({ preset: "orbit_90_cw" })).toMatch(/^The camera moves: Arc 90° left/);
+ expect(fly.pathWords({ preset: "orbit_45_ccw" })).toMatch(/45-degree arc around the subject, moving to the right/);
+ expect(fly.pathWords({})).toBe("The camera flies around the subject");
+ expect(exact.exactWords({ degrees: 90, tilt: 10 })).toMatch(/camera rises as it goes/);
+ expect(exact.exactWords({ degrees: 180, tilt: 10 })).toMatch(/rises above eye level and comes back down/);
+ expect(exact.exactWords({ degrees: 270, tilt: 10 })).toMatch(/then dips below it/);
+ expect(exact.exactWords({ degrees: 360, tilt: 10 })).toMatch(/dips as far below it and comes back to eye level/);
+ // The keys agree: below eye level past half a turn.
+ expect(Math.min(...exact.exactOrbitKeys({ degrees: 270, tilt: 10 }).map((k) => k.elevation))).toBeLessThan(0);
+ });
+
+ it("asks for the still and a path", () => {
+ expect(fly.planFlyAround({ engine: "cloud", orbit }).blocker).toBe("Add the still to film");
+ expect(fly.planFlyAround({ engine: "open", image }).blocker).toBe("Pick a path first");
+ });
+ });
+
+ describe("the server's path render (option B)", () => {
+ it("draws the photo's own view on frame 0 and turns away from it later", () => {
+ const w = 32;
+ const h = 24;
+ const photo = { width: w, height: h, data: new Uint8Array(w * h * 4).map((_, i) => (i % 4 === 0 ? 200 : i % 4 === 3 ? 255 : 40)) };
+ const depth = { width: w, height: h, data: new Uint8Array(w * h * 4).fill(128) };
+ const hFov = lensFov(LENS.default, w / h).h;
+ const cloud = buildPointCloud(photo, depth, { hFov });
+ const size = { width: w, height: h };
+ const poses = framePoses(exact.exactOrbitKeys({ degrees: 90, direction: "ccw" }), 3, cloud.depth, hFov, size);
+ const first = splatFrame(cloud, poses.poses[0], poses.intrinsic, w, h);
+ const lit = (f: Uint8Array) => f.filter((_, i) => i % 3 === 0 && f[i] > 100).length;
+ expect(lit(first)).toBe(w * h);
+ // A quarter turn round a flat picture sees it edge-on: most of the frame is a hole (black).
+ expect(lit(splatFrame(cloud, poses.poses[2], poses.intrinsic, w, h))).toBeLessThan(w * h * 0.5);
+ });
+
+ it("reads the still and its depth, renders 81 frames of the still's shape and stores an MP4", async () => {
+ const { photo, depth } = scene();
+ const s = await pathScene({ photo, depth, keys: exact.exactOrbitKeys({ degrees: 60, direction: "cw" }) });
+ expect(s.count).toBe(PATH_FRAMES);
+ expect({ width: s.width, height: s.height }).toEqual(renderSize(64 / 48));
+ const f0 = s.frame(0);
+ const mid = ((s.height / 2) * s.width + s.width / 2) * 3;
+ expect(f0[mid]).toBeGreaterThan(150); // the red square in the middle
+ if (spawnSync("ffmpeg", ["-version"]).status !== 0) return;
+ const url = await renderPathVideo({ photo, depth, keys: exact.exactOrbitKeys({ degrees: 60, direction: "cw" }) });
+ const file = await readRef(url);
+ expect(file.contentType).toBe("video/mp4");
+ expect(file.data.subarray(4, 8).toString()).toBe("ftyp");
+ }, 60_000);
+
+ it("takes the depth picture of the scene step for a path slot", () => {
+ const outputs = [
+ { url: "/api/files/outputs/scene.glb", kind: "model3d" as const },
+ { url: "/api/files/outputs/depth.png", kind: "image" as const },
+ ];
+ expect(gens.pickOutput(outputs, { slot: "video", render: "path" })?.url).toBe("/api/files/outputs/depth.png");
+ });
+ });
+
+ describe("/api/fly-around", () => {
+ const post = (url: string, body: unknown) => route.POST(new Request(`http://localhost:3000${url}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) }));
+
+ it("prices a preview on both engines and refuses a body without a path's numbers in range", async () => {
+ const { photo } = scene();
+ const open = await post("/api/fly-around?preview=1", { engine: "open", image: photo, orbit: { degrees: 180, direction: "cw" } });
+ expect(open.status).toBe(200);
+ expect(await open.json()).toMatchObject({ engine: "open", steps: 2, costUsd: 0, label: "180° clockwise · level" });
+ const cloud = await post("/api/fly-around?preview=1", { engine: "cloud", image: photo, preset: "orbit_90_cw" });
+ expect(await cloud.json()).toMatchObject({ engine: "cloud", model: { id: "minimax-h3-max-camera" }, steps: 1 });
+ expect((await post("/api/fly-around?preview=1", { engine: "open", image: photo, orbit: { degrees: 720, direction: "cw" } })).status).toBe(400);
+ });
+
+ it("runs a demo on the open engine as two chained steps, the film waiting for the depth with a path slot", async () => {
+ const { photo } = scene();
+ setSetting("demoMode", "on");
+ try {
+ const r = await post("/api/fly-around", { engine: "open", image: photo, orbit: { degrees: 90, direction: "ccw" } });
+ expect(r.status).toBe(201);
+ const out = await r.json();
+ expect(out.items).toHaveLength(2);
+ expect(out.final.modelId).toBe("oss-uni3c-path");
+ expect(out.final.request.chain).toEqual([{ slot: "video", render: "path" }]);
+ } finally {
+ setSetting("demoMode", "auto");
+ }
+ });
+ });
+
+ describe("Cinema's Director: an orbit move with the Exact switch", () => {
+ const still = "/api/files/uploads/still.png";
+ const base = (engine: "cloud" | "open", over: Record<string, unknown> = {}) => ({ engine, mode: "video" as const, action: "generate" as const, prompt: "She smiles", settings: {}, moves: ["drone-orbit", "slow-zoom-in"], images: [still], ...over });
+
+ it("films the numbers on both engines, the other moves stay words", async () => {
+ const { planCinema } = await import("@/lib/catalog/cinema");
+ const exactOrbit = { degrees: 180, direction: "cw" as const, tilt: 10, pulse: 0 };
+ const cloud = planCinema(base("cloud", { exact: exactOrbit }), { cloudAllowed: true });
+ expect(cloud.blocker).toBeUndefined();
+ expect(cloud.steps.map((s) => s.request.modelId)).toEqual(["minimax-h3-max-camera"]);
+ expect(cloud.steps[0].request.params?.cameraPath).toEqual(exact.exactOrbitKeys(exactOrbit));
+ expect(cloud.steps[0].request.prompt).toMatch(/She smiles/);
+ expect(cloud.notes[0]).toBe("Drone Orbit follows your numbers exactly: 180° clockwise · tilt 10°");
+ const open = planCinema(base("open", { exact: exactOrbit }), { cloudAllowed: true });
+ expect(open.steps.map((s) => [s.key, s.request.modelId, s.after])).toEqual([
+ ["depth", "oss-scene-moge", undefined],
+ ["main", "oss-uni3c-path", ["depth"]],
+ ]);
+ expect(open.costUsd).toBe(0);
+ });
+
+ it("keeps the LoRA's or the prompt's orbit with the switch off, and asks for a start frame with it on", async () => {
+ const { planCinema } = await import("@/lib/catalog/cinema");
+ const loose = planCinema(base("cloud"), { cloudAllowed: true });
+ expect(loose.steps[0].request.modelId).not.toBe("minimax-h3-max-camera");
+ expect(planCinema(base("cloud", { exact: { degrees: 90, direction: "ccw" }, images: [] }), { cloudAllowed: true }).blocker).toBe("Add a start frame to film an exact orbit");
+ // A move that isn't an orbit ignores the numbers.
+ expect(planCinema(base("cloud", { moves: ["dolly-in"], exact: { degrees: 90, direction: "ccw" } }), { cloudAllowed: true }).steps[0].request.modelId).not.toBe("minimax-h3-max-camera");
+ });
+ });
+
+ describe("the prompt bars", () => {
+ it("Cinema starts a new first move from its own numbers, and keeps them when only later moves change", async () => {
+ const { withMoves } = await import("@/components/cinema/draft");
+ expect(withMoves({ moves: ["drone-orbit"] }, ["arc-left"])).toEqual({ moves: ["arc-left"], exact: null });
+ expect(withMoves({ moves: ["drone-orbit"] }, ["drone-orbit", "dolly-in"])).toEqual({ moves: ["drone-orbit", "dolly-in"] });
+ });
+
+ it("a phone's price line is short", async () => {
+ const { flyPrice } = await import("@/components/fly-around-run");
+ const open = { engine: "open", demo: false, costUsd: 0 } as never;
+ expect(flyPrice(open)).toBe("Free · on your GPU");
+ expect(flyPrice(open, true)).toBe("Free");
+ expect(flyPrice({ engine: "cloud", demo: true } as never, true)).toBe("Placeholder");
+ });
+ });
+
+ describe("Image to 3D: Film it photoreal", () => {
+ it("films the photo round the model: the model's render on your GPU, H3 Max's keyframes in the cloud", async () => {
+ const m3d = await import("@/lib/av/model3d");
+ const open = m3d.photorealBody({ photo: "/api/files/uploads/mug.png" }, "open", "/api/files/uploads/orbit.webm")!;
+ expect(open).toMatchObject({ engine: "open", image: "/api/files/uploads/mug.png", render: "/api/files/uploads/orbit.webm", feature: m3d.MODEL3D_FILM_FEATURE, orbit: m3d.PHOTOREAL_ORBIT });
+ const plan = fly.planFlyAround(open);
+ expect(plan.steps.map((s) => s.request.modelId)).toEqual(["oss-uni3c-path"]);
+ const cloud = m3d.photorealBody({ photo: "/api/files/uploads/mug.png" }, "cloud", "/api/files/uploads/orbit.webm")!;
+ expect(cloud).not.toHaveProperty("render");
+ expect(fly.planFlyAround(cloud).steps[0].request.modelId).toBe("minimax-h3-max-camera");
+ expect(m3d.photorealBody({}, "cloud")).toBeNull();
+ expect(m3d.photorealBody({}, "cloud", undefined, "/api/files/outputs/drawn.png")!.image).toBe("/api/files/outputs/drawn.png");
+ // The model turns the other way to the camera: a full turn over the 81 frames, starting at the front.
+ expect(m3d.photorealAngle(0)).toBe(0);
+ expect(m3d.photorealAngle(PATH_FRAMES - 1)).toBeCloseTo(-2 * Math.PI, 5);
+ });
+ });
+
+ describe("Canvas: the Camera path and Fly around nodes", () => {
+ const node = (id: string, type: string, x: number, y: number, data: Record<string, unknown> = {}) => ({ id, type, position: { x, y }, data }) as never;
+ const edge = (source: string, target: string, targetHandle: string) => ({ id: `${source}>${target}:${targetHandle}`, source, sourceHandle: "out", target, targetHandle });
+
+ it("has the node types, ports and outputs", async () => {
+ const c = await import("@/lib/catalog/canvas");
+ expect(c.NODE_SPECS["camera-path"].group).toBe("Inputs");
+ expect(c.NODE_SPECS["fly-around"]).toMatchObject({ group: "Generate", ops: ["camera-path"] });
+ expect(c.isGenerator({ type: "fly-around" })).toBe(true);
+ expect(c.isGenerator({ type: "camera-path" })).toBe(false);
+ expect(c.inputPorts({ type: "fly-around", data: {} }).map((p) => [p.id, p.type, p.multiple])).toEqual([
+ ["prompt", "text", true],
+ ["images", "image", true],
+ ["path", "path", false],
+ ]);
+ const g = { nodes: [], edges: [] };
+ expect(c.outputType(g, node("p", "camera-path", 0, 0))).toBe("path");
+ expect(c.outputType(g, node("f", "fly-around", 0, 0))).toBe("video");
+ expect(c.acceptsType("preview", "path")).toBe(false);
+ expect(c.defaultModelForNode({ type: "fly-around", data: {} }, "open")?.id).toBe("oss-uni3c-path");
+ expect(c.defaultModelForNode({ type: "fly-around", data: {} }, "cloud")?.id).toBe("minimax-h3-max-camera");
+ expect(c.paletteItems().some((p) => p.id === "camera-path")).toBe(true);
+ expect(c.cameraPathOf({ data: { orbit: { degrees: 90, direction: "cw", tilt: 0, pulse: 0 } } }).keys.at(-1)!.azimuth).toBe(-90);
+ });
+
+ it("compiles a still, a view and a path into the engine's steps, a generated still chained in", async () => {
+ const c = await import("@/lib/catalog/canvas");
+ const graph = (modelId: string, still: Record<string, unknown>) => ({
+ nodes: [
+ still.type === "model" ? node("img", "model", 0, 0, { modelId: "nano-banana-pro", mediaKind: "image" }) : node("img", "image-input", 0, 0, { url: "/api/files/uploads/still.png" }),
+ node("view", "image-input", 0, 100, { url: "/api/files/uploads/back.png" }),
+ node("path", "camera-path", 0, 200, { orbit: { degrees: 180, direction: "ccw", tilt: 0, pulse: 0 } }),
+ node("fly", "fly-around", 300, 0, { modelId }),
+ ],
+ edges: [edge("img", "fly", "images"), edge("view", "fly", "images"), edge("path", "fly", "path")],
+ });
+ const cloud = c.describeNode(graph("minimax-h3-max-camera", {}) as never, graph("minimax-h3-max-camera", {}).nodes[3] as never);
+ expect(cloud.error).toBeUndefined();
+ expect(cloud.steps!.map((s) => [s.request.modelId, s.request.op])).toEqual([["minimax-h3-max", "ref2v"]]);
+ expect(cloud.steps![0].request.inputs?.images).toEqual(["/api/files/uploads/still.png", "/api/files/uploads/back.png"]);
+ // The Camera path's own numbers reach the words H3 Max turns the camera from.
+ expect(cloud.steps![0].request.prompt).toMatch(/180-degree arc around the subject, moving to the right/);
+ const preset = graph("minimax-h3-max-camera", {});
+ preset.nodes[2] = node("path", "camera-path", 0, 200, { pathPreset: "orbit_tilt_20" });
+ expect(c.describeNode(preset as never, preset.nodes[3] as never).steps![0].request.prompt).toMatch(/^The camera moves: Tilted ring, a full ring tilted 20°/);
+ const g = graph("oss-uni3c-path", { type: "model" });
+ const open = c.describeNode(g as never, g.nodes[3] as never);
+ expect(open.error).toBeUndefined();
+ expect(open.deps).toEqual(["img"]);
+ expect(open.costUsd).toBe(0);
+ const [depth, main] = open.steps!;
+ expect(depth).toMatchObject({ key: "depth", request: { modelId: "oss-scene-moge", chain: [{ slot: "images", position: "first" }] }, from: [{ node: "img" }] });
+ expect(main).toMatchObject({ key: "main", request: { modelId: "oss-uni3c-path", chain: [{ slot: "images", position: "first" }, { slot: "video", render: "path" }] }, from: [{ node: "img" }, { step: "depth" }] });
+ expect(depth.request.feature).toBe(c.CANVAS_STEP_FEATURE);
+ // Nothing on the path: said on the node.
+ const bare = { ...g, edges: g.edges.filter((e) => e.targetHandle !== "path") };
+ expect(c.describeNode(bare as never, g.nodes[3] as never).error).toBe("Connect a Camera path");
+ });
+ });
+
+ describe("Assist / MCP: fly_around", () => {
+ it("takes a still and an orbit's numbers or a preset, and plans the engine's steps", async () => {
+ const tools = await import("@/server/assist/studio-tools");
+ const tool = tools.STUDIO_TOOLS.find((t) => t.name === "fly_around")!;
+ expect(tool).toBeDefined();
+ expect(tools.FlyAroundToolInput.safeParse({ image: "/api/files/uploads/a.png", degrees: 720 }).success).toBe(false);
+ expect(tools.FlyAroundToolInput.safeParse({ image: "/api/files/uploads/a.png", preset: "orbit_90_cw" }).success).toBe(true);
+ expect(tools.FlyAroundToolInput.safeParse({ image: "/api/files/uploads/a.png", preset: "spin" }).success).toBe(false);
+ const ctx = { engine: "open" } as never;
+ const open = tools.fallbackSteps.flyAround({ image: "/api/files/uploads/a.png", degrees: 90, direction: "cw" }, ctx);
+ expect(open.map((s) => [s.key, s.request.modelId, s.after])).toEqual([
+ ["depth", "oss-scene-moge", undefined],
+ ["main", "oss-uni3c-path", ["depth"]],
+ ]);
+ const cloud = tools.fallbackSteps.flyAround({ image: "/api/files/uploads/a.png", preset: "orbit_tilt_20" }, { engine: "cloud" } as never);
+ expect(cloud[0].request).toMatchObject({ modelId: "minimax-h3-max-camera", op: "camera-path" });
+ });
+ });
+
+ describe("the GPU pre-flight board", () => {
+ it("lists exact orbits on the depth and Uni3C graphs", async () => {
+ const { STUDIO_ROWS, studioTool } = await import("@/server/gpu/tools");
+ const row = STUDIO_ROWS.find((r) => r.href === "/motions")!;
+ expect(row.label).toBe("Exact orbits and Fly around");
+ const t = studioTool(row)!;
+ expect(t.workflows).toEqual(expect.arrayContaining(["scene-mesh-moge", "wan21-i2v-uni3c-path"]));
+ });
+ });
+
+ describe("an account's path render reads only its own files", () => {
+ it("refuses the owner's still and depth inside an account's run, and renders the account's own", async () => {
+ const auth = await import("@/server/auth");
+ const { runAsTenant } = await import("@/server/tenant");
+ const { RefError } = await import("@/server/storage");
+ const a = auth.createAccount("[email protected]", "long enough").id;
+ const owners = scene();
+ const keys = exact.exactOrbitKeys({ degrees: 60, direction: "ccw" });
+ await runAsTenant({ kind: "account", id: a }, async () => {
+ await expect(pathScene({ ...owners, keys })).rejects.toBeInstanceOf(RefError);
+ const mine = scene();
+ expect((await pathScene({ ...mine, keys })).count).toBe(PATH_FRAMES);
+ });
+ });
+ });
diff --cc tests/h3-any-gpu.test.ts
index 00000000,5d951736..260350c6
mode 000000,100644..100644
--- a/tests/h3-any-gpu.test.ts
+++ b/tests/h3-any-gpu.test.ts
@@@ -1,0 -1,343 +1,343 @@@
+ import fs from "node:fs";
+ import os from "node:os";
+ import path from "node:path";
+ import { afterAll, describe, expect, it } from "vitest";
+ import type { GenInput } from "@/lib/catalog/types";
+ import type { ComfyWorkflow, ManifestWorkflow } from "@/lib/comfy";
+ import type { GpuInventory, RequirementIndex } from "@/lib/gpu/types";
+
-// Package nm10-h3-any-gpu (docs/research/new-models-10.md §6.4): MiniMax H3 on 8-31 GB cards (FastH3 V2 and Trim), the GPU
++// MiniMax H3 on smaller cards (docs/research/new-models-10.md §6.4): MiniMax H3 on 8-31 GB cards (FastH3 V2 and Trim), the GPU
+ // tier decided once per run, the pre-flight checking the graph and file the run loads, the board naming each card's build,
+ // and Fast decode (Sol-H3-VAE) on the full model. All on the open engine: the cloud keeps fal's hosted MiniMax H3.
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-h3-any-gpu-"));
+ process.env.FUOBE_DATA_DIR = tmp;
+ process.env.COMFYUI_URL = "http://comfy.test:8188";
+ const { prepareWorkflow } = await import("@/server/providers/comfyui");
+ const { getModel } = await import("@/lib/catalog");
+ const { resolveWorkflowId } = await import("@/lib/comfy-variants");
+ const T = await import("@/lib/gpu/h3-tier");
+ const { h3Gpu } = await import("@/server/h3-gpu");
+ const { previewGeneration } = await import("@/server/generations");
+ const { changeAccess, modelLicence } = await import("@/server/model-access");
+ const { setSetting } = await import("@/server/settings");
+ const { writeSnapshot, dropSnapshots } = await import("@/server/gpu/snapshots");
+ const { gateGeneration } = await import("@/server/gpu/gate");
+ const { buildViews } = await import("@/server/gpu/readiness-service");
+ const { STUDIO_ROWS, studioTool } = await import("@/server/gpu/tools");
+ afterAll(() => fs.rmSync(tmp, { recursive: true, force: true }));
+
+ const LIBRARY = path.join(process.cwd(), "workflows/comfyui");
+ const read = (f: string) => JSON.parse(fs.readFileSync(path.join(LIBRARY, f), "utf8"));
+ const manifest = read("manifest.json") as { workflows: ManifestWorkflow[] };
+ const entry = (id: string) => manifest.workflows.find((w) => w.id === id)!;
+ const graph = (id: string) => read(`${id}.json`) as ComfyWorkflow;
+ const pins = read("model-pins.json") as Record<string, { revision: string; sizeBytes: number; sha256: string }>;
+ const index = read("requirements.json") as RequirementIndex;
+ const has = (id: string) => manifest.workflows.some((w) => w.id === id);
+ const variant = (endpoint: string, op: string, extra: Record<string, unknown>) => resolveWorkflowId(endpoint, { op, clips: 0, images: 0, audio2: false, extra, has });
+
+ const RTX4070 = "cuda:0 NVIDIA GeForce RTX 4070 Ti SUPER : cudaMallocAsync";
+ const RTX5060 = "cuda:0 NVIDIA GeForce RTX 5060 Ti : cudaMallocAsync";
+ const RTX4090 = "cuda:0 NVIDIA GeForce RTX 4090 : cudaMallocAsync";
+ const GIB = 2 ** 30;
+
+ /** The install's last GPU check: one card (or none), the H3 files present or not. */
+ const INSTALL = { kind: "install", key: "install", via: "server" } as const;
+ function inventory(o: { gb?: number; name?: string; torch?: string; files?: string[] }): GpuInventory {
+ const at = Date.now();
+ // The folders the H3 graphs read, listed (a folder the check didn't read would leave its files unknown, never missing).
+ const models: GpuInventory["models"] = { diffusion_models: { have: {}, total: 0 }, text_encoders: { have: {}, total: 0 }, vae: { have: {}, total: 0 }, loras: { have: {}, total: 0 } };
+ for (const key of o.files ?? []) {
+ const [folder, file] = key.split("/");
+ (models[folder] ??= { have: {}, total: 0 }).have[file] = null;
+ }
+ for (const m of Object.values(models)) m.total = Object.keys(m.have).length;
+ return {
+ v: 1,
+ via: "server",
+ checkedAt: at,
+ tookMs: 5,
+ reachable: true,
+ comfy: { version: "0.43.0", os: "posix", torch: o.torch ?? "2.12.0+cu130", embeddedPython: false, deployEnv: "local-git", flags: {} as never },
+ devices: o.gb === undefined ? [] : [{ name: o.name ?? RTX4070, type: "cuda", index: 0, vramTotal: o.gb * GIB, vramFree: o.gb * GIB }],
+ manager: { api: "none" },
+ nodes: { have: [], missing: [], total: 1, readAt: at, how: "object_info" },
+ combos: {},
+ packs: {},
+ models,
+ loras: {},
+ fingerprint: "x",
+ errors: [],
+ } as never;
+ }
+ const checked = (o: Parameters<typeof inventory>[0]) => writeSnapshot(INSTALL, inventory(o));
+
+ const FAST = ["minimax-h3-fast-t2v", "minimax-h3-fast-i2v", "minimax-h3-fast-flf2v"];
+ const TRIM = "minimax-h3-trim-t2v";
+ const SHARED = ["text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors", "vae/minimax_h3_audio_vae_fp32.safetensors", "vae/minimax_h3_video_vae_int8_convrot.safetensors"];
+
+ describe("the FastH3 graphs", () => {
+ it("are Comfy-Org's FastH3 template: sigma shift 10 / 3, Comfy Kitchen attention, VSA at 10%, 8 steps res_multistep", () => {
+ for (const id of [...FAST, TRIM]) {
+ const g = graph(id);
+ const cls = (c: string) => Object.values(g).filter((n) => n.class_type === c);
+ expect(cls("MiniMaxH3SigmaShift")[0].inputs, id).toMatchObject({ shift_video: 10, shift_audio: 3 });
+ expect(cls("ModelAttentionBackend")[0].inputs.attention, id).toBe("comfy kitchen attention");
+ expect(cls("BlockSparseAttention")[0].inputs, id).toMatchObject({ selection: "vsa", "selection.keep_percent": 10, start_percent: 0.2, end_percent: 1, sink_conditioning: "exact_kv_and_rows" });
+ expect(cls("BasicScheduler")[0].inputs, id).toMatchObject({ scheduler: "simple", steps: 8 });
+ expect(cls("KSamplerSelect")[0].inputs.sampler_name, id).toBe("res_multistep");
+ expect(cls("CLIPLoader")[0].inputs.clip_name, id).toBe(T.H3_ENCODER);
+ // No turbo LoRA, no custom node: core nodes only.
+ expect(entry(id).customNodes ?? [], id).toEqual([]);
+ expect(index.workflows[id].packs, id).toEqual({});
+ }
+ // Start frame and start + end frames on V2 only; Trim is text to video.
+ expect(graph("minimax-h3-fast-i2v")["131"].inputs).toMatchObject({ first_frame: ["138", 0] });
+ expect(graph("minimax-h3-fast-i2v")["131"].inputs.last_frame).toBeUndefined();
+ expect(graph("minimax-h3-fast-flf2v")["131"].inputs).toMatchObject({ first_frame: ["138", 0], last_frame: ["140", 0] });
+ expect(graph(TRIM)["131"].inputs.first_frame).toBeUndefined();
+ expect(entry(TRIM).capability).toBe("t2v");
+ });
+
+ it("bind the diffusion file, and list every build of it with its pinned size and hash", () => {
+ for (const id of FAST) {
+ expect(entry(id).bindings.unet, id).toEqual([{ node: "127", input: "unet_name" }]);
+ expect(index.workflows[id].files).toEqual([`diffusion_models/${T.FAST_FILES.int8.file}`, ...SHARED]);
+ expect(index.workflows[id].optional).toEqual([`diffusion_models/${T.FAST_FILES.nvfp4.file}`]);
+ expect(index.workflows[id].vramGb).toBe(16);
+ }
+ expect(index.workflows[TRIM].files).toEqual([`diffusion_models/${T.TRIM_FILES.int8.file}`, ...SHARED]);
+ expect(index.workflows[TRIM].optional).toEqual([`diffusion_models/${T.TRIM_FILES.fp8.file}`, `diffusion_models/${T.TRIM_FILES.nvfp4.file}`]);
+ expect(index.workflows[TRIM].vramGb).toBe(12);
+ for (const f of [...Object.values(T.FAST_FILES), ...Object.values(T.TRIM_FILES)]) {
+ const file = index.files[`diffusion_models/${f.file}`];
+ expect(file, f.file).toBeDefined();
+ expect(file.pinnedUrl).toMatch(/\/resolve\/[0-9a-f]{40}\//);
+ // The chooser's sizes are the files' (GB, two decimals).
+ expect(Math.abs(file.sizeBytes! / 1e9 - f.gb), f.file).toBeLessThan(0.01);
+ expect(pins[file.pinnedUrl].sha256).toMatch(/^[0-9a-f]{64}$/);
+ }
+ expect(entry(TRIM).notes).toMatch(/8 GB figure is FastVideo's test/);
+ expect(entry("minimax-h3-fast-i2v").notes).toMatch(/FL2VA was not distilled/);
+ // Unvalidated like the other H3 graphs until a GPU run.
+ for (const id of [...FAST, TRIM]) expect(entry(id).validated, id).toBe(false);
+ });
+
+ it("give the full graphs a decode loader of their own, so Fast decode swaps only the decoder", () => {
+ for (const id of ["minimax-h3-t2v", "minimax-h3-i2v", "minimax-h3-flf2v", "minimax-h3-t2v-hq", "minimax-h3-i2v-hq", "minimax-h3-flf2v-hq"]) {
+ const g = graph(id);
+ expect(g["122"].inputs.vae, id).toEqual(["136", 0]);
+ expect(g["131"].inputs.vae, id).toEqual(["119", 0]);
+ expect(g["136"].inputs.vae_name, id).toBe(g["119"].inputs.vae_name);
+ expect(entry(id).bindings.vae, id).toEqual([{ node: "136", input: "vae_name" }]);
+ expect(index.workflows[id].optional, id).toEqual([`vae/${T.SOL_VAE}`]);
+ }
+ expect(pins[index.files[`vae/${T.SOL_VAE}`].pinnedUrl]).toMatchObject({ sizeBytes: 1988306504 });
+ expect(index.workflows["minimax-h3-orbit"].optional).toEqual([]);
+ });
+ });
+
+ describe("the graph a run takes", () => {
+ it("a smaller tier runs its graph, winning over Best; an orbit keeps its graph; Trim has text to video only", () => {
+ expect(variant("minimax-h3-t2v", "t2v", { gpuTier: "fast" })).toBe("minimax-h3-fast-t2v");
+ expect(variant("minimax-h3-i2v", "i2v", { gpuTier: "fast", quality: "best" })).toBe("minimax-h3-fast-i2v");
+ expect(variant("minimax-h3-flf2v", "flf2v", { gpuTier: "fast" })).toBe("minimax-h3-fast-flf2v");
+ expect(variant("minimax-h3-t2v", "t2v", { gpuTier: "trim" })).toBe(TRIM);
+ expect(variant("minimax-h3-i2v", "i2v", { gpuTier: "trim" })).toBe("minimax-h3-i2v");
+ expect(variant("minimax-h3-i2v", "i2v", { gpuTier: "trim", quality: "best" })).toBe("minimax-h3-i2v-hq");
+ expect(variant("minimax-h3-i2v", "i2v", { gpuTier: "fast", orbit: true })).toBe("minimax-h3-orbit");
+ expect(variant("minimax-h3-t2v", "t2v", { gpuTier: "standard", quality: "best" })).toBe("minimax-h3-t2v-hq");
+ expect(variant("minimax-h3-t2v", "t2v", {})).toBe("minimax-h3-t2v");
+ });
+
+ it("binds the card's file and keeps the H3 canvas and frame grid", async () => {
+ const prompt = await prepareWorkflow("minimax-h3-t2v", { prompt: "a lighthouse", seed: 7, aspectRatio: "16:9", duration: 5, extra: { gpuTier: "trim", unet: T.TRIM_FILES.nvfp4.file } } as GenInput, {
+ generationId: "g-h3",
+ op: "t2v",
+ upload: async (_d, _t, name) => `up_${name}`,
+ media: () => undefined,
+ serverRam: async () => undefined,
+ modelPath: async () => undefined,
+ });
+ const g = prompt.workflow as ComfyWorkflow;
+ expect(g["127"].inputs.unet_name).toBe(T.TRIM_FILES.nvfp4.file);
+ expect(g["131"].inputs).toMatchObject({ width: 1344, height: 768, length: 124 });
+ });
+ });
+
+ describe("Auto and Options → GPU tier, decided once per run", () => {
+ it("routes a smaller card to its build, with its file; keeps the full model otherwise", () => {
+ try {
+ dropSnapshots("install");
+ expect(h3Gpu("minimax-h3-t2v", {}, has)).toEqual({ gpuTier: "standard" });
+ checked({ gb: 16, name: RTX4070 });
+ expect(h3Gpu("minimax-h3-t2v", {}, has)).toMatchObject({ gpuTier: "fast", unet: T.FAST_FILES.int8.file, note: T.TIER_NOTES.fast });
+ checked({ gb: 16, name: RTX5060 });
+ expect(h3Gpu("minimax-h3-i2v", {}, has)).toMatchObject({ gpuTier: "fast", unet: T.FAST_FILES.nvfp4.file });
+ checked({ gb: 12, name: RTX4070, torch: "2.9.1+cu128" });
+ expect(h3Gpu("minimax-h3-t2v", {}, has)).toMatchObject({ gpuTier: "trim", unet: T.TRIM_FILES.fp8.file, note: T.TIER_NOTES.trim });
+ // Trim has no start-frame graph: the full model (the pre-flight then says it needs a bigger GPU).
+ expect(h3Gpu("minimax-h3-i2v", {}, has)).toEqual({ gpuTier: "standard" });
+ checked({ gb: 32, name: RTX4090 });
+ expect(h3Gpu("minimax-h3-t2v", {}, has)).toEqual({ gpuTier: "standard" });
+ // Best and Fast decode on a smaller build say they need 32 GB.
+ checked({ gb: 16, name: RTX4070 });
+ expect(h3Gpu("minimax-h3-t2v", { quality: "best", vae: T.SOL_VAE }, has)?.note).toMatch(/Best needs a 32 GB GPU.*Fast decode needs a 32 GB GPU/);
+ // Asked for: on any card; an orbit and another model take no tier.
+ checked({ gb: 48, name: RTX4090 });
+ expect(h3Gpu("minimax-h3-t2v", { gpuTier: "trim" }, has)).toMatchObject({ gpuTier: "trim", unet: T.TRIM_FILES.int8.file });
+ expect(h3Gpu("minimax-h3-i2v", { orbit: true }, has)).toBeUndefined();
+ expect(h3Gpu("qwen-image-21-t2i", {}, has)).toBeUndefined();
+ } finally {
+ dropSnapshots("install");
+ }
+ });
+
+ it("holds a build switched off in Models & licences: Auto keeps the full model, asking for it is refused", () => {
+ checked({ gb: 16, name: RTX4070 });
+ try {
+ changeAccess([{ kind: "model", id: "oss-minimax-h3-fast", on: false }]);
+ expect(h3Gpu("minimax-h3-t2v", {}, has)).toEqual({ gpuTier: "standard" });
+ expect(() => h3Gpu("minimax-h3-t2v", { gpuTier: "fast" }, has)).toThrow(/(turned|switched) off in Settings → Models & licences/);
+ } finally {
+ changeAccess([{ kind: "reset" }]);
+ dropSnapshots("install");
+ }
+ });
+
+ it("carries the tier and file on the run's plan, and drops a file the request names", () => {
+ const g = globalThis as unknown as { __fuobeComfyReach?: { ok: boolean; at: number; url: string } };
+ const before = g.__fuobeComfyReach;
+ g.__fuobeComfyReach = { ok: true, at: Date.now(), url: "http://comfy.test:8188" };
+ setSetting("demoMode", "off");
+ try {
+ const run = (extra: Record<string, unknown> = {}) => previewGeneration({ feature: "video", modelId: "oss-minimax-h3", prompt: "a lighthouse at dusk", params: { aspectRatio: "16:9", duration: 5, extra } });
+ checked({ gb: 12, name: RTX4070 });
+ const trim = run({ unet: "something-else.safetensors" });
+ expect(trim).toMatchObject({ demo: false, h3: { gpuTier: "trim", unet: T.TRIM_FILES.int8.file }, route: { provider: "comfyui", endpoint: "minimax-h3-t2v" } });
+ expect(trim.notes).toContain(T.TIER_NOTES.trim);
+ checked({ gb: 32, name: RTX4090 });
+ const full = run({ unet: "something-else.safetensors" });
+ expect(full.h3).toEqual({ gpuTier: "standard" });
+ expect(full.notes ?? []).not.toContain(T.TIER_NOTES.trim);
+ // A FastH3 build named directly (its hidden model): its own tier, and the card's file, never the request's.
+ checked({ gb: 16, name: RTX5060 });
+ const direct = previewGeneration({ feature: "video", modelId: "oss-minimax-h3-trim", prompt: "a lighthouse at dusk", params: { aspectRatio: "16:9", duration: 5, extra: { unet: "something-else.safetensors" } } });
+ expect(direct).toMatchObject({ h3: { gpuTier: "trim", unet: T.TRIM_FILES.nvfp4.file }, route: { provider: "comfyui", endpoint: "minimax-h3-trim-t2v" } });
+ expect(h3Gpu("minimax-h3-fast-i2v", { unet: "something-else.safetensors", gpuTier: "trim" }, has)).toMatchObject({ gpuTier: "fast", unet: T.FAST_FILES.nvfp4.file });
+ } finally {
+ g.__fuobeComfyReach = before;
+ setSetting("demoMode", "auto");
+ dropSnapshots("install");
+ }
+ });
+ });
+
+ describe("the GPU pre-flight", () => {
+ const gate = (extra: Record<string, unknown>, h3?: { gpuTier: string; unet?: string }) =>
+ gateGeneration(INSTALL, { request: { feature: "video", modelId: "oss-minimax-h3", prompt: "a fox", params: { extra } }, route: { provider: "comfyui", endpoint: "minimax-h3-t2v" }, op: "t2v", modelId: "oss-minimax-h3", h3, actor: "owner" });
+
+ it("checks the build and file the run loads", async () => {
+ const trim = [...SHARED, `diffusion_models/${T.TRIM_FILES.nvfp4.file}`];
+ checked({ gb: 12, name: RTX5060, files: trim });
+ try {
+ // The card's NVFP4 file is there: ready, though the graph's default (int8) isn't.
+ expect(await gate({}, { gpuTier: "trim", unet: T.TRIM_FILES.nvfp4.file })).toEqual({ ok: true });
+ // Its int8 file isn't: the owner is told what's missing.
+ expect(await gate({}, { gpuTier: "trim", unet: T.TRIM_FILES.int8.file })).toMatchObject({ ok: true, warning: expect.stringMatching(/more thing/) });
+ // The full model on the same card: its files are missing.
+ expect(await gate({}, { gpuTier: "standard" })).toMatchObject({ ok: true, warning: expect.stringMatching(/more thing/) });
+ } finally {
+ dropSnapshots("install");
+ }
+ });
+
+ it("asks for Sol-H3-VAE only when Fast decode is picked", async () => {
+ const full = index.workflows["minimax-h3-t2v"].files;
+ checked({ gb: 32, name: RTX4090, files: full });
+ // Fast decode is held back (H3_FAST_DECODE_OFFERED): the control is put on the model here as it will be once it validates.
+ const options = getModel("oss-minimax-h3")!.options;
+ const controls = options.controls;
+ options.controls = [...(controls ?? []), T.H3_DECODER];
+ try {
+ expect(await gate({}, { gpuTier: "standard" })).toEqual({ ok: true });
+ expect(await gate({ vae: T.SOL_VAE }, { gpuTier: "standard" })).toMatchObject({ ok: true, warning: expect.stringMatching(/1 more thing/) });
+ // Options → Decoder as the composer sends it: the option's value, which the model's control turns into Sol's file.
+ expect(await gate({ decoder: "fast" }, { gpuTier: "standard" })).toMatchObject({ ok: true, warning: expect.stringMatching(/1 more thing/) });
+ expect(await gate({ decoder: "standard" }, { gpuTier: "standard" })).toEqual({ ok: true });
+ } finally {
+ options.controls = controls;
+ dropSnapshots("install");
+ }
+ });
+
+ it("withTierFile swaps the default file for the card's, and nothing else", () => {
+ const out = T.withTierFile(index, TRIM, T.TRIM_FILES.fp8.file);
+ expect(out.workflows[TRIM].files).toEqual([`diffusion_models/${T.TRIM_FILES.fp8.file}`, ...SHARED]);
+ expect(out.workflows[TRIM].optional).toEqual([`diffusion_models/${T.TRIM_FILES.nvfp4.file}`]);
+ expect(T.withTierFile(index, TRIM, T.TRIM_FILES.int8.file)).toBe(index);
+ expect(T.withTierFile(index, TRIM, "elsewhere.safetensors")).toBe(index);
+ expect(T.withTierFile(index, "minimax-h3-t2v", T.TRIM_FILES.fp8.file)).toBe(index);
+ });
+ });
+
+ describe("the pre-flight board", () => {
+ const ctx = { account: false, computer: false, isolatedUrl: false };
+ const row = (href: string, inv: GpuInventory) => buildViews(inv, index, ctx).report.studios.find((r) => r.href === href)!;
+
+ it("names the build each card gets on the Video row, and checks that build's files", () => {
+ const trimFiles = [...SHARED, `diffusion_models/${T.TRIM_FILES.int8.file}`];
+ const trim = row("/video", inventory({ gb: 12, name: RTX4070, files: trimFiles }));
+ expect(trim.gpuTier).toEqual({ label: "FastH3 Trim (int8)", note: "Text to video only; part of it waits in system memory" });
+ expect(trim.tool.state).toBe("ready");
+ const fast = row("/video", inventory({ gb: 16, name: RTX5060 }));
+ expect(fast.gpuTier).toEqual({ label: "FastH3 V2 (nvfp4)" });
+ expect(fast.tool.needs.map((n) => n.key)).toContain(`file:diffusion_models/${T.FAST_FILES.nvfp4.file}`);
+ expect(fast.tool.vram.needGb).toBe(16);
+ // 32 GB and up, or a card no build fits: no build named.
+ expect(row("/video", inventory({ gb: 32, name: RTX4090 })).gpuTier).toBeUndefined();
+ expect(row("/video", inventory({ gb: 8, name: RTX4070 })).gpuTier).toBeUndefined();
+ // Auto's build for the composer's note.
+ expect(buildViews(inventory({ gb: 12, name: RTX4070 }), index, ctx).badges.h3Tier).toBe("trim");
+ expect(buildViews(inventory({ gb: 48, name: RTX4090 }), index, ctx).badges.h3Tier).toBeUndefined();
+ });
+
+ it("says plainly that swaps and removals still need the full model", () => {
+ const swap = row("/character-swap", inventory({ gb: 16, name: RTX4070 }));
+ expect(swap.gpuTier?.note).toMatch(/Runs on the full MiniMax H3: there's no smaller build for swaps and removals yet/);
+ expect(row("/character-swap", inventory({ gb: 48, name: RTX4090 })).gpuTier).toBeUndefined();
+ // The Video row's own tool is the full model's three modes (the board swaps them per card).
+ expect(studioTool(STUDIO_ROWS.find((r) => r.href === "/video")!)!.workflows).toEqual(expect.arrayContaining(["minimax-h3-t2v", "minimax-h3-i2v", "minimax-h3-flf2v"]));
+ });
+ });
+
+ describe("Models & licences", () => {
+ it("lists each build with its licence and its own switch, never in a picker", () => {
+ for (const id of ["oss-minimax-h3-fast", "oss-minimax-h3-trim"]) {
+ const m = getModel(id)!;
+ expect(m.hidden, id).toBe(true);
+ expect(m.engine, id).toBe("open");
+ expect(modelLicence(m).licence.name + modelLicence(m).licence.note, id).toMatch(/MiniMax H3 Community License/);
+ }
+ expect(getModel("oss-minimax-h3-trim")!.routes.map((r) => r.op)).toEqual(["t2v"]);
+ expect(getModel("oss-minimax-h3-fast")!.routes.map((r) => r.op)).toEqual(["t2v", "i2v", "flf2v"]);
+ expect(T.H3_TIER_MODEL).toEqual({ fast: "oss-minimax-h3-fast", trim: "oss-minimax-h3-trim" });
+ });
+
+ it("records Sol-H3-VAE's licence as unconfirmed on the full model's row", () => {
+ const full = modelLicence(getModel("oss-minimax-h3")!).licence;
+ expect(full.class).toBe("regions");
+ expect(full.note).toMatch(/Sol-H3-VAE \(Efficient-Large-Model; the optional fast decoder\): licence unconfirmed/);
+ for (const id of ["minimax-h3-t2v", "minimax-h3-i2v-hq"]) expect(entry(id).license, id).toMatch(/Sol-H3-VAE.*licence unconfirmed/);
+ expect(entry("minimax-h3-fast-t2v").license).not.toMatch(/Sol-H3-VAE/);
+ });
+
+ it("holds Fast decode back until a ComfyUI with Sol's loader validates it, and keeps it off by default when offered", () => {
+ const controls = getModel("oss-minimax-h3")!.options.controls!;
+ expect(T.H3_FAST_DECODE_OFFERED).toBe(false);
+ expect(controls.map((c) => c.param)).toEqual(["quality", "gpuTier"]);
+ expect(T.H3_DECODER).toMatchObject({ param: "decoder", default: "standard", sets: { standard: {}, fast: { vae: T.SOL_VAE } } });
+ expect(controls.find((c) => c.param === "gpuTier")?.default).toBeUndefined();
+ for (const id of ["oss-minimax-h3-fast", "oss-minimax-h3-trim"]) expect(getModel(id)!.options.controls, id).toBeUndefined();
+ });
+ });
diff --cc tests/h3-tier.test.ts
index 00000000,2d4ef16a..9a673443
mode 000000,100644..100644
--- a/tests/h3-tier.test.ts
+++ b/tests/h3-tier.test.ts
@@@ -1,0 -1,167 +1,167 @@@
+ import { describe, expect, it } from "vitest";
+ import {
+ FAST_FILES,
+ TRIM_FILES,
+ chooseH3Tier,
+ cuda13,
+ gpuArch,
+ h3TierFor,
+ h3TierNote,
+ tierChoice,
+ tierGraphFor,
+ tierOfGraph,
+ } from "@/lib/gpu/h3-tier";
+
-// Package nm10-h3-any-gpu (docs/research/new-models-10.md §6.4): which MiniMax H3 build a card runs, at every memory and
++// MiniMax H3 on smaller cards (docs/research/new-models-10.md §6.4): which MiniMax H3 build a card runs, at every memory and
+ // generation edge. The card names are /system_stats device names as ComfyUI reports them.
+ const RTX5090 = "cuda:0 NVIDIA GeForce RTX 5090 : cudaMallocAsync";
+ const RTX5070 = "cuda:0 NVIDIA GeForce RTX 5070 : cudaMallocAsync";
+ const RTX5060 = "cuda:0 NVIDIA GeForce RTX 5060 : cudaMallocAsync";
+ const RTX4090 = "cuda:0 NVIDIA GeForce RTX 4090 : cudaMallocAsync";
+ const RTX4070 = "cuda:0 NVIDIA GeForce RTX 4070 : cudaMallocAsync";
+ const RTX3090 = "cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync";
+ const CU130 = "2.12.0+cu130";
+ const CU128 = "2.9.1+cu128";
+
+ describe("the card's generation", () => {
+ it.each([
+ [RTX5090, "blackwell"],
+ ["cuda:0 NVIDIA RTX PRO 6000 Blackwell Workstation Edition : cudaMallocAsync", "blackwell"],
+ ["cuda:0 NVIDIA GB10 : cudaMallocAsync", "blackwell"],
+ ["cuda:0 NVIDIA B200 : cudaMallocAsync", "blackwell"],
+ ["cuda:0 NVIDIA H100 80GB HBM3 : cudaMallocAsync", "hopper"],
+ [RTX4090, "ada"],
+ ["cuda:0 NVIDIA GeForce RTX 4060 Laptop GPU : cudaMallocAsync", "ada"],
+ ["cuda:0 NVIDIA RTX 6000 Ada Generation : cudaMallocAsync", "ada"],
+ ["cuda:0 NVIDIA L40S : cudaMallocAsync", "ada"],
+ ["cuda:0 NVIDIA L4 : cudaMallocAsync", "ada"],
+ [RTX3090, "ampere"],
+ ["cuda:0 NVIDIA RTX A6000 : cudaMallocAsync", "ampere"],
+ ["cuda:0 NVIDIA A100-SXM4-80GB : cudaMallocAsync", "ampere"],
+ ["cuda:0 NVIDIA A10G : cudaMallocAsync", "ampere"],
+ ["cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync", "turing"],
+ ["cuda:0 Tesla T4 : cudaMallocAsync", "turing"],
+ ["cuda:0 NVIDIA GeForce GTX 1080 Ti : cudaMallocAsync", "older"],
+ ["cuda:0 Tesla V100-SXM2-32GB : cudaMallocAsync", "older"],
+ ["cuda:0 AMD Radeon RX 7900 XTX : native", "other"],
+ ["cuda:0 Some Future Card : cudaMallocAsync", "unknown"],
+ ])("%s → %s", (name, arch) => expect(gpuArch(name, "cuda")).toBe(arch));
+
+ it("an Apple or Intel device isn't CUDA, and a CPU is unknown", () => {
+ expect(gpuArch("mps", "mps")).toBe("other");
+ expect(gpuArch("xpu:0 Intel Arc A770", "xpu")).toBe("other");
+ expect(gpuArch("cpu", "cpu")).toBe("unknown");
+ });
+
+ it("reads a CUDA 13 PyTorch build", () => {
+ expect(cuda13(CU130)).toBe(true);
+ expect(cuda13("2.12.0+cu131")).toBe(true);
+ expect(cuda13(CU128)).toBe(false);
+ expect(cuda13(undefined)).toBe(false);
+ });
+ });
+
+ describe("Auto: the tier a card gets", () => {
+ // [vram GB, name, torch] → [tier, weights, label, too small]
+ it.each<[number | undefined, string | undefined, string | undefined, string, string | undefined, string, boolean]>([
+ // No reading, a CPU, or a card it can't place: Standard (the default graph), never a guess.
+ [undefined, RTX4090, CU130, "standard", undefined, "Standard", false],
+ [0, RTX4090, CU130, "standard", undefined, "Standard", false],
+ [16, "cuda:0 Some Future Card", CU130, "standard", undefined, "Standard", false],
+ // 32 GB and up: Standard on every generation.
+ [32, RTX5090, CU130, "standard", undefined, "Standard", false],
+ [80, "cuda:0 NVIDIA A100-SXM4-80GB", CU130, "standard", undefined, "Standard", false],
+ [48, "cuda:0 NVIDIA RTX 6000 Ada Generation", CU128, "standard", undefined, "Standard", false],
+ // 16-31 GB: FastH3 V2, NVFP4 on Blackwell, int8 elsewhere (V2 has no fp8 build for ComfyUI).
+ [31, RTX4090, CU130, "fast", "int8", "FastH3 V2 (int8)", false],
+ [24, RTX4090, CU130, "fast", "int8", "FastH3 V2 (int8)", false],
+ [24, RTX4090, CU128, "fast", "int8", "FastH3 V2 (int8)", false],
+ [16, RTX4070, CU130, "fast", "int8", "FastH3 V2 (int8)", false],
+ [16, RTX5060, CU130, "fast", "nvfp4", "FastH3 V2 (nvfp4)", false],
+ // 12-15 GB: Trim. NVFP4 on Blackwell; int8 on a CUDA 13 PyTorch, fp8 on an older one; int8 when the build is unknown.
+ [15, RTX4070, CU130, "trim", "int8", "FastH3 Trim (int8)", false],
+ [12, RTX4070, CU128, "trim", "fp8", "FastH3 Trim (fp8)", false],
+ [12, RTX4070, undefined, "trim", "int8", "FastH3 Trim (int8)", false],
+ [12, RTX5070, CU130, "trim", "nvfp4", "FastH3 Trim (nvfp4)", false],
+ // 8-11 GB: Trim on Blackwell only.
+ [11, RTX5060, CU130, "trim", "nvfp4", "FastH3 Trim (nvfp4)", false],
+ [8, RTX5060, CU130, "trim", "nvfp4", "FastH3 Trim (nvfp4)", false],
+ [11, RTX4070, CU130, "standard", undefined, "Needs a bigger GPU", true],
+ [8, RTX4070, CU130, "standard", undefined, "Needs a bigger GPU", true],
+ // Under 8 GB: nothing fits.
+ [7.9, RTX5060, CU130, "standard", undefined, "Needs a bigger GPU", true],
+ [6, RTX4070, CU130, "standard", undefined, "Needs a bigger GPU", true],
+ // Older than Ada under 32 GB: needs a bigger GPU (FastVideo measured RTX 40 and 50 only).
+ [24, RTX3090, CU130, "standard", undefined, "Needs a bigger GPU", true],
+ [16, "cuda:0 Tesla T4", CU130, "standard", undefined, "Needs a bigger GPU", true],
+ [24, "cuda:0 AMD Radeon RX 7900 XTX", CU130, "standard", undefined, "Needs a bigger GPU", true],
+ ])("%s GB %s (%s) → %s %s", (vramGb, name, torch, tier, weights, label, tooSmall) => {
+ const c = chooseH3Tier({ vramGb, name, type: "cuda", torch });
+ expect(c.tier).toBe(tier);
+ expect(c.weights).toBe(weights);
+ expect(c.label).toBe(label);
+ expect(!!c.tooSmall).toBe(tooSmall);
+ if (tooSmall) expect(c.reason).toBeTruthy();
+ });
+
+ it("names the file each tier loads, and offloads when it is bigger than the card", () => {
+ expect(chooseH3Tier({ vramGb: 24, name: RTX4090, type: "cuda", torch: CU130 })).toMatchObject({ unet: FAST_FILES.int8.file, offload: true });
+ expect(chooseH3Tier({ vramGb: 16, name: RTX5060, type: "cuda", torch: CU130 })).toMatchObject({ unet: FAST_FILES.nvfp4.file, offload: false });
+ expect(chooseH3Tier({ vramGb: 12, name: RTX4070, type: "cuda", torch: CU128 })).toMatchObject({ unet: TRIM_FILES.fp8.file, offload: true });
+ expect(chooseH3Tier({ vramGb: 12, name: RTX5070, type: "cuda", torch: CU130 })).toMatchObject({ unet: TRIM_FILES.nvfp4.file, offload: true });
+ expect(chooseH3Tier({ vramGb: 32, name: RTX5090, type: "cuda" }).unet).toBeUndefined();
+ });
+
+ it("a Mac or an Intel card under 32 GB needs a bigger GPU; with no memory reading it keeps Standard", () => {
+ expect(chooseH3Tier({ vramGb: 24, name: "mps", type: "mps" }).tooSmall).toBe(true);
+ expect(chooseH3Tier({ name: "mps", type: "mps" })).toEqual({ tier: "standard", offload: false, label: "Standard" });
+ });
+ });
+
+ describe("Options → GPU tier", () => {
+ it("an explicit pick wins on any card, with the card's file", () => {
+ expect(h3TierFor("trim", { vramGb: 24, name: RTX3090, type: "cuda", torch: CU130 })).toMatchObject({ tier: "trim", weights: "int8" });
+ expect(h3TierFor("fast", { vramGb: 32, name: RTX5090, type: "cuda" })).toMatchObject({ tier: "fast", weights: "nvfp4", offload: false });
+ expect(h3TierFor("standard", { vramGb: 12, name: RTX4070, type: "cuda" })).toMatchObject({ tier: "standard" });
+ // A pick on a card with no reading takes the templates' default format.
+ expect(h3TierFor("trim", {})).toMatchObject({ tier: "trim", weights: "int8", offload: false });
+ });
+
+ it("Auto (no pick, or a value it doesn't know) is the chooser's", () => {
+ expect(h3TierFor(undefined, { vramGb: 16, name: RTX4070, type: "cuda", torch: CU130 }).tier).toBe("fast");
+ expect(h3TierFor("huge", { vramGb: 16, name: RTX4070, type: "cuda", torch: CU130 }).tier).toBe("fast");
+ });
+
+ it("tierChoice for Standard loads the graph's own file", () => {
+ expect(tierChoice("standard", { vramGb: 8 })).toEqual({ tier: "standard", offload: false, label: "Standard" });
+ });
+ });
+
+ describe("the graph each tier runs", () => {
+ const all = () => true;
+ it("fast has text, start frame and start + end frames; trim text to video only", () => {
+ expect(tierGraphFor("minimax-h3-t2v", "fast", all)).toBe("minimax-h3-fast-t2v");
+ expect(tierGraphFor("minimax-h3-i2v", "fast", all)).toBe("minimax-h3-fast-i2v");
+ expect(tierGraphFor("minimax-h3-flf2v", "fast", all)).toBe("minimax-h3-fast-flf2v");
+ expect(tierGraphFor("minimax-h3-t2v", "trim", all)).toBe("minimax-h3-trim-t2v");
+ expect(tierGraphFor("minimax-h3-i2v", "trim", all)).toBeUndefined();
+ expect(tierGraphFor("minimax-h3-flf2v", "trim", all)).toBeUndefined();
+ expect(tierGraphFor("minimax-h3-t2v", "standard", all)).toBeUndefined();
+ expect(tierGraphFor("minimax-h3-t2v", "fast", () => false)).toBeUndefined();
+ expect(tierOfGraph("minimax-h3-trim-t2v")).toBe("trim");
+ expect(tierOfGraph("minimax-h3-fast-flf2v")).toBe("fast");
+ expect(tierOfGraph("minimax-h3-t2v")).toBeUndefined();
+ });
+
+ it("the composer's note says what a smaller tier changes", () => {
+ expect(h3TierNote({ gpuTier: "trim" }, "t2v")).toMatch(/experimental/);
+ expect(h3TierNote({ gpuTier: "trim" }, "i2v")).toBeUndefined();
+ expect(h3TierNote({ gpuTier: "fast", quality: "best" }, "i2v")).toMatch(/Best needs a 32 GB GPU/);
+ expect(h3TierNote({}, "t2v")).toBeUndefined();
+ expect(h3TierNote({ gpuTier: "trim", decoder: "fast" }, "t2v")).toMatch(/Fast decode needs a 32 GB GPU/);
+ // Auto: what the card the GPU check read runs, in plain words.
+ expect(h3TierNote({}, "i2v", "fast")).toMatch(/^On your GPU this runs as FastH3 V2/);
+ expect(h3TierNote({}, "i2v", "trim")).toBeUndefined();
+ expect(h3TierNote({ gpuTier: "standard" }, "t2v", "trim")).toBeUndefined();
+ });
+ });
diff --cc tests/hosted-catchup.test.ts
index 00000000,7ea720e4..d94dee60
mode 000000,100644..100644
--- a/tests/hosted-catchup.test.ts
+++ b/tests/hosted-catchup.test.ts
@@@ -1,0 -1,425 +1,425 @@@
+ import fs from "node:fs";
+ import os from "node:os";
+ import path from "node:path";
+ import { afterAll, describe, expect, it } from "vitest";
+
+ /**
- * Package nm10-hosted-catchup: fal's H3 Max lip sync, relight, insert and five looks, H3 Max Turbo, Vidu Q4, Meshy retexture and
++ * The hosted catch-up: fal's H3 Max lip sync, relight, insert and five looks, H3 Max Turbo, Vidu Q4, Meshy retexture and
+ * Tripo P2, and Replicate's H3 Lite and HighSpeed. Payloads are checked against the stored schemas (docs/research/new-models-10.json
+ * endpointRecords, read 2026-11-02 with scripts/fetch-hosted-schemas.py --catchup); prices against the price lines stored with
+ * them. No paid call is made: pure functions and demo mode only.
+ */
+
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-hosted-catchup-"));
+ process.env.FUOBE_DATA_DIR = dir;
+ process.env.COMFYUI_URL = "http://127.0.0.1:9";
+ afterAll(() => fs.rmSync(dir, { recursive: true, force: true }));
+
+ const { getModel, getPreset, MODELS } = await import("@/lib/catalog");
+ const { buildPayload, extractOutputs } = await import("@/lib/catalog/payload");
+ const { estimateCost, hostedInputProblem, planGeneration, routesFor } = await import("@/lib/catalog/plan");
+ const { clipWindowProblem, insertHandles, insertRangeProblem, INSERT_RANGE, portraitShapeProblem, voiceWindowProblem } = await import("@/lib/catalog/clip-windows");
+ const { clipBlocker } = await import("@/lib/composer");
+ const { LIGHT_PRESETS, lightPreset, SPHERE_SIZE, spherePixels } = await import("@/lib/relight-sphere");
+ const { MODELS_3D, RETEXTURE_MODELS, retextureRequest } = await import("@/lib/av/model3d");
+ const { paidApiLicence } = await import("@/lib/licences");
+ const { mockProvider } = await import("@/server/providers/mock");
+ type Req = import("@/lib/catalog/types").GenerationRequest;
+ type Route = import("@/lib/catalog/types").ModelRoute;
+
+ type Spec = { type?: string; values?: unknown[]; maxItems?: number; minimum?: number; maximum?: number; maxLength?: number; required?: boolean; default?: unknown };
+ type Endpoint = { provider: string; endpoint: string; status: string; inputs: Record<string, Spec>; keyFields: Record<string, string>; price: string; licence: string };
+ const research = (JSON.parse(fs.readFileSync("docs/research/new-models-10.json", "utf8")) as { endpointRecords: Endpoint[] }).endpointRecords;
+ const schemaOf = (r: Route) => research.find((e) => e.provider === r.provider && e.endpoint === r.endpoint)!;
+
+ const IDS = [
+ "minimax-h3-max-lipsync",
+ "minimax-h3-max-relight",
+ "minimax-h3-max-insert",
+ "minimax-h3-max-look-pixel",
+ "minimax-h3-max-look-hand-drawn",
+ "minimax-h3-max-look-low-poly",
+ "minimax-h3-max-look-retro-toon",
+ "minimax-h3-max-look-vhs",
+ "minimax-h3-max-turbo",
+ "minimax-h3-max-turbo-refs",
+ "minimax-h3-max-turbo-extend",
+ "minimax-h3-lite",
+ "minimax-h3-highspeed",
+ "vidu-q4",
+ "meshy-7-retexture",
+ "meshy-6-retexture",
+ "tripo-p2",
+ ];
+
+ /** Every field the payload sends is one the stored schema has, with a value its enum and limits allow; every required one goes. */
+ function checkAgainstSchema(r: Route, payload: Record<string, unknown>) {
+ const { inputs } = schemaOf(r);
+ for (const [k, v] of Object.entries(payload)) {
+ const spec = inputs[k];
+ expect(spec, `${r.endpoint} has no ${k}`).toBeDefined();
+ if (spec.values) expect(spec.values, `${r.endpoint} ${k}`).toContain(v);
+ if (spec.type === "integer") expect(Number.isInteger(v), `${k} is whole`).toBe(true);
+ if (typeof v === "number" && spec.minimum !== undefined) expect(v, `${r.endpoint} ${k}`).toBeGreaterThanOrEqual(spec.minimum);
+ if (typeof v === "number" && spec.maximum !== undefined) expect(v, `${r.endpoint} ${k}`).toBeLessThanOrEqual(spec.maximum);
+ if (typeof v === "string" && spec.maxLength !== undefined) expect(v.length).toBeLessThanOrEqual(spec.maxLength);
+ if (Array.isArray(v) && spec.maxItems !== undefined) expect(v.length, `${k} items`).toBeLessThanOrEqual(spec.maxItems);
+ }
+ for (const [k, spec] of Object.entries(inputs)) if (spec.required) expect(payload[k], `${r.endpoint} requires ${k}`).toBeDefined();
+ }
+
+ const IMG = "https://example.com/a.png";
+ const CLIP = "https://example.com/a.mp4";
+ const VOICE = "https://example.com/a.mp3";
+ const GLB = "https://example.com/a.glb";
+
+ /** Plan a request as the server does and build the payload its route sends. */
+ function payloadFor(modelId: string, req: Partial<Req> = {}) {
+ const plan = planGeneration({ feature: "video", modelId, prompt: "A lighthouse keeper climbs the stairs", ...req } as Req, getModel, getPreset);
+ const r = routesFor(plan.model, plan.op)[0];
+ const payload = buildPayload(r.map!, {
+ ...plan.params,
+ prompt: plan.prompt,
+ images: req.inputs?.images,
+ endImage: req.inputs?.endImage,
+ video: req.inputs?.video,
+ videos: req.inputs?.videos,
+ audio: req.inputs?.audio,
+ audios: req.inputs?.audios,
+ model3d: req.inputs?.model3d,
+ } as never);
+ checkAgainstSchema(r, payload);
+ return { plan, route: r, payload };
+ }
+
+ describe("research: every catch-up endpoint read at its source", () => {
+ it("is stored with its schema, price and licence, and live", () => {
+ for (const id of IDS) {
+ const m = getModel(id)!;
+ expect(m, id).toBeTruthy();
+ expect(m.engine).toBe("cloud");
+ for (const r of m.routes) {
+ const e = schemaOf(r);
+ expect(e, `${id} ${r.endpoint}`).toBeTruthy();
+ expect(e.status).toBe("active");
+ expect(e.price).toMatch(/\$/);
+ expect(e.licence).toBe("proprietary paid API");
+ }
+ }
+ });
+
+ it("records Vidu Q4 as fal exposes it: no text-to-video route, 12 reference pictures and 3 voice clips", () => {
+ const vidu = getModel("vidu-q4")!;
+ expect(vidu.routes.map((r) => r.op)).toEqual(["i2v", "ref2v"]);
+ expect(vidu.options.maxImages).toBe(12);
+ expect(vidu.options.maxAudios).toBe(3);
+ expect(research.some((e) => e.endpoint === "fal-ai/vidu/q4/text-to-video")).toBe(false);
+ });
+
+ it("shows each as a proprietary paid API in Settings → Models & licences, switched on", () => {
+ for (const id of IDS) {
+ const m = getModel(id)!;
+ expect(paidApiLicence(m.vendor, m.routes).class, id).toBe("paid-api");
+ expect(MODELS.some((x) => x.id === id && !x.hidden), id).toBe(true);
+ }
+ });
+ });
+
+ describe("payloads match the stored schemas", () => {
+ it("H3 Max lip sync: a portrait and a voice, no words", () => {
+ const { plan, payload } = payloadFor("minimax-h3-max-lipsync", { prompt: "", inputs: { images: [IMG], audio: VOICE } });
+ expect(plan.op).toBe("avatar");
+ expect(payload).toMatchObject({ image_url: IMG, audio_url: VOICE, resolution: "768P" });
+ expect(payload.prompt).toBeUndefined();
+ });
+
+ it("H3 Max relight: the clip, the sphere as its reference, the clip's own shape", () => {
+ const { plan, payload } = payloadFor("minimax-h3-max-relight", { prompt: "", inputs: { video: CLIP, images: [IMG] } });
+ expect(plan.op).toBe("relight-video");
+ expect(payload).toMatchObject({ video_url: CLIP, reference_image_url: IMG, aspect_ratio: "adaptive", resolution: "768P" });
+ });
+
+ it("H3 Max insert: the range goes as start_time and resume_time, the moment's length as duration", () => {
+ const { plan, payload } = payloadFor("minimax-h3-max-insert", {
+ prompt: "",
+ inputs: { video: CLIP, images: [IMG] },
+ params: { startTime: 3.5, endTime: 6, duration: 8, sourceDuration: 12 },
+ });
+ expect(plan.op).toBe("insert-moment");
+ expect(payload).toMatchObject({ video_url: CLIP, start_time: 3.5, resume_time: 6, duration: 8, reference_image_urls: [IMG] });
+ expect(payload.prompt).toBeUndefined();
+ });
+
+ it("H3 Max looks: words or a first frame; VHS takes its tape wear", () => {
+ expect(payloadFor("minimax-h3-max-look-pixel").payload).toMatchObject({ aspect_ratio: "16:9", duration: 5 });
+ const vhs = payloadFor("minimax-h3-max-look-vhs", { inputs: { images: [IMG] }, params: { extra: { damage_level: "heavy" } } });
+ expect(vhs.plan.op).toBe("i2v");
+ expect(vhs.payload).toMatchObject({ image_url: IMG, damage_level: "heavy" });
+ });
+
+ it("H3 Max Turbo: text, frames, references and extend each send their own fields, prompt expansion as fal's default", () => {
+ expect(payloadFor("minimax-h3-max-turbo").payload).toMatchObject({ prompt_expansion_mode: "balanced", resolution: "768P", aspect_ratio: "16:9" });
+ const flf = payloadFor("minimax-h3-max-turbo", { inputs: { images: [IMG], endImage: IMG } });
+ expect(flf.plan.op).toBe("flf2v");
+ expect(flf.payload).toMatchObject({ image_url: IMG, end_image_url: IMG });
+ const refs = payloadFor("minimax-h3-max-turbo-refs", { inputs: { images: [IMG, IMG], videos: [CLIP], audios: [VOICE] } });
+ expect(refs.payload).toMatchObject({ reference_image_urls: [IMG, IMG], reference_video_urls: [CLIP], reference_audio_urls: [VOICE] });
+ // The extend keeps the clip's shape: no aspect ratio goes (fal's "auto").
+ const ext = payloadFor("minimax-h3-max-turbo-extend", { inputs: { video: CLIP } });
+ expect(ext.plan.op).toBe("extend");
+ expect(ext.payload.aspect_ratio).toBeUndefined();
+ });
+
+ it("Replicate's H3 Lite and HighSpeed: a start frame is never also a reference picture", () => {
+ const lite = payloadFor("minimax-h3-lite", { inputs: { images: [IMG] } });
+ expect(lite.payload).toMatchObject({ first_frame_image: IMG, ratio: "16:9", resolution: "768P" });
+ expect(lite.payload.reference_image_urls).toBeUndefined();
+ const fast = payloadFor("minimax-h3-highspeed", { inputs: { images: [IMG] } });
+ expect(fast.payload).toMatchObject({ first_frame_image: IMG, ratio: "adaptive" });
+ const refs = payloadFor("minimax-h3-highspeed", { inputs: { images: [IMG, IMG] } });
+ expect(refs.plan.op).toBe("ref2v");
+ expect(refs.payload).toMatchObject({ reference_image_urls: [IMG, IMG] });
+ expect(refs.payload.first_frame_image).toBeUndefined();
+ });
+
+ it("Vidu Q4: a start frame, or references with voices, at a resolution its routes take", () => {
+ expect(payloadFor("vidu-q4", { inputs: { images: [IMG] }, params: { resolution: "4K" } }).payload).toMatchObject({ image_url: IMG, resolution: "4K" });
+ const refs = payloadFor("vidu-q4", { inputs: { images: [IMG, IMG], audios: [VOICE] } });
+ expect(refs.plan.op).toBe("ref2v");
+ expect(refs.payload).toMatchObject({ reference_image_urls: [IMG, IMG], reference_audio_urls: [VOICE], aspect_ratio: "16:9" });
+ });
+
+ it("Meshy retexture: the model, the words or the style picture, PBR on", () => {
+ const req = retextureRequest({ glb: GLB, prompt: "weathered bronze", style: IMG, size: "4k" });
+ const { plan, payload } = payloadFor(req.modelId, req);
+ expect(plan.op).toBe("retexture-3d");
+ expect(payload).toMatchObject({ model_url: GLB, text_style_prompt: "weathered bronze", image_style_url: IMG, texture_resolution: "4k", enable_pbr: true });
+ expect(retextureRequest({ glb: GLB, prompt: "x".repeat(900) }).prompt).toHaveLength(600);
+ expect(RETEXTURE_MODELS.map((m) => m.id)).toEqual(["meshy-7-retexture", "meshy-6-retexture"]);
+ });
+
+ it("Tripo P2: one photo, offered in Image to 3D", () => {
+ expect(payloadFor("tripo-p2", { prompt: "", inputs: { images: [IMG] }, params: { extra: { texture_quality: "detailed" } } }).payload).toMatchObject({
+ image_url: IMG,
+ texture_quality: "detailed",
+ // fal: "The fast quality requires v3.5-20260815"; the newest version goes with every quality.
+ texture_version: "v3.5-20260815",
+ });
+ expect(payloadFor("tripo-p2", { prompt: "", inputs: { images: [IMG] }, params: { extra: { texture_quality: "fast" } } }).payload).toMatchObject({ texture_quality: "fast", texture_version: "v3.5-20260815" });
+ expect(MODELS_3D.image.cloud.some((m) => m.id === "tripo-p2")).toBe(true);
+ });
+ });
+
+ describe("prices follow fal's and Replicate's pages", () => {
+ const cost = (id: string, params: Record<string, unknown>, op?: string, now?: number) =>
+ estimateCost(getModel(id)!, params as never, 1, op as never, false, now ?? Date.UTC(2026, 10, 20));
+
+ it("H3 Max lip sync: per second of the voice, 1.2× over 15 s (fal: 30 s at 768P costs $2.88)", () => {
+ expect(cost("minimax-h3-max-lipsync", { sourceDuration: 5 }, "avatar")).toBe(0.4);
+ expect(cost("minimax-h3-max-lipsync", { sourceDuration: 15 }, "avatar")).toBe(1.2);
+ expect(cost("minimax-h3-max-lipsync", { sourceDuration: 30 }, "avatar")).toBe(2.88);
+ expect(cost("minimax-h3-max-lipsync", { sourceDuration: 60, resolution: "2K" }, "avatar")).toBe(23.04);
+ });
+
+ it("H3 Max relight: on the clip's length; insert: on the new moment alone", () => {
+ expect(cost("minimax-h3-max-relight", { sourceDuration: 8 }, "relight-video")).toBe(0.64);
+ expect(cost("minimax-h3-max-relight", { sourceDuration: 8, resolution: "480P" }, "relight-video")).toBe(0.4);
+ expect(cost("minimax-h3-max-insert", { duration: 8, sourceDuration: 40 }, "insert-moment")).toBe(0.48);
+ expect(cost("minimax-h3-max-insert", { duration: 5, resolution: "480p" }, "insert-moment")).toBe(0.25);
+ });
+
+ it("H3 Max Turbo: fal's November rate until 2026-11-15, then the list rate; references at H3 Max's rates", () => {
+ expect(cost("minimax-h3-max-turbo", { duration: 5 }, "t2v", Date.UTC(2026, 10, 2))).toBe(0.14);
+ expect(cost("minimax-h3-max-turbo", { duration: 5 }, "t2v", Date.UTC(2026, 10, 16))).toBe(0.2);
+ expect(cost("minimax-h3-max-turbo", { duration: 10, resolution: "1080P" }, "i2v", Date.UTC(2026, 10, 16))).toBe(0.8);
+ expect(cost("minimax-h3-max-turbo-refs", { duration: 5 }, "ref2v")).toBe(0.4);
+ expect(cost("minimax-h3-max-turbo-extend", { duration: 5, resolution: "2K" }, "extend")).toBe(0.8);
+ });
+
+ it("H3 looks, Lite, HighSpeed and Vidu Q4 per second", () => {
+ expect(cost("minimax-h3-max-look-vhs", { duration: 15 }, "t2v")).toBe(1.2);
+ expect(cost("minimax-h3-lite", { duration: 5, resolution: "480P" }, "t2v")).toBe(0.125);
+ expect(cost("minimax-h3-highspeed", { duration: 10 }, "t2v")).toBe(0.6);
+ expect(cost("vidu-q4", { duration: 5 }, "i2v")).toBe(0.333);
+ expect(cost("vidu-q4", { duration: 5, resolution: "540p" }, "i2v")).toBe(0.158);
+ });
+
+ it("3D: Meshy retexture $0.30 ($0.45 at 8K), Tripo P2 $1.10-1.30 by texture quality", () => {
+ expect(cost("meshy-7-retexture", {})).toBe(0.3);
+ expect(cost("meshy-6-retexture", { extra: { texture_resolution: "8k" } })).toBe(0.45);
+ expect(cost("tripo-p2", {})).toBe(1.1);
+ expect(cost("tripo-p2", { extra: { texture_quality: "detailed" } })).toBe(1.2);
+ expect(cost("tripo-p2", { extra: { texture_quality: "extreme" } })).toBe(1.3);
+ });
+ });
+
+ describe("hosted limits are checked before a paid call, in Fuobe's words", () => {
+ it("a prompt over the API's limit", () => {
+ const vidu = getModel("vidu-q4")!;
+ expect(hostedInputProblem(vidu, "i2v", "x".repeat(5000), {}, {})).toBeNull();
+ expect(hostedInputProblem(vidu, "i2v", "x".repeat(5001), {}, {})).toBe("Vidu Q4 takes up to 5,000 characters of prompt, and this one has 5,001: shorten it");
+ expect(() => planGeneration({ feature: "video", modelId: "vidu-q4", prompt: "x".repeat(6000), inputs: { images: [IMG] } } as Req, getModel, getPreset)).toThrow(/5,000 characters/);
+ });
+
+ it("a relight with no light, a retexture with neither words nor a style picture", () => {
+ expect(() => planGeneration({ feature: "video-tools", modelId: "minimax-h3-max-relight", prompt: "", inputs: { video: CLIP } } as Req, getModel, getPreset)).toThrow(
+ "Pick a light: MiniMax H3 Max Relight matches the light on a sphere you choose",
+ );
+ expect(() => planGeneration(retextureRequest({ glb: GLB }), getModel, getPreset)).toThrow("Describe the new look, or add a style picture");
+ });
+
+ it("insert-video's range: start 1.625 s or later, the resume 2.625 s or later and after it, both within 60 s and the clip", () => {
+ expect(insertRangeProblem(undefined, 5)).toMatch(/Mark where/);
+ expect(insertRangeProblem(1.5, 5)).toMatch(/1.625 s into the clip/);
+ expect(insertRangeProblem(4, 4)).toMatch(/after the new moment starts/);
+ expect(insertRangeProblem(4, 61)).toMatch(/first 60 s/);
+ expect(insertRangeProblem(4, 9, 8)).toMatch(/The clip is 8 s long/);
+ expect(insertRangeProblem(INSERT_RANGE.minStart, 2, 8)).toBe("The clip can pick up again 2.625 s in at the earliest: move the second handle right");
+ expect(insertRangeProblem(INSERT_RANGE.minStart, INSERT_RANGE.minResume, 8)).toBeNull();
+ expect(() => planGeneration({ feature: "video-edit", modelId: "minimax-h3-max-insert", prompt: "", inputs: { video: CLIP } } as Req, getModel, getPreset)).toThrow(/Mark where/);
+ });
+
+ it("clip and voice windows: relight up to 15 s, lip sync 5 s to 15 min, a portrait 0.4-2.5 wide", () => {
+ const relight = getModel("minimax-h3-max-relight")!;
+ expect(clipWindowProblem(relight, 20)).toBe("MiniMax H3 Max Relight takes 2.4–15 s clips, and this one is 20 s: trim it first");
+ expect(clipWindowProblem(relight, 10)).toBeNull();
+ expect(clipBlocker("relight-video", { duration: 20 }, {}, relight, undefined)).toMatch(/2.4–15 s clips/);
+ expect(clipWindowProblem(getModel("minimax-h3-max-turbo-extend")!, 61)).toMatch(/1.625–60 s clips/);
+ const lip = getModel("minimax-h3-max-lipsync")!;
+ expect(voiceWindowProblem(lip, 3)).toMatch(/at least 5 s of audio/);
+ expect(voiceWindowProblem(lip, 16 * 60)).toBe("MiniMax H3 Max Lip Sync · up to 15 min takes up to 15 minutes of audio, and this is 16 min 0 s: trim it first");
+ expect(voiceWindowProblem(lip, 600)).toBeNull();
+ expect(portraitShapeProblem(lip, 1000, 3000)).toMatch(/0.4:1 \(tall\)/);
+ expect(portraitShapeProblem(lip, 1080, 1920)).toBeNull();
+ });
+
+ it("an inserted moment takes a clip of any length past 2.625 s: only the two points keep to its first minute", () => {
+ const insert = getModel("minimax-h3-max-insert")!;
+ expect(clipWindowProblem(insert, 90)).toBeNull();
+ expect(clipBlocker("insert-moment", { duration: 90 }, {}, insert, undefined)).toBeNull();
+ expect(clipWindowProblem(insert, 2)).toMatch(/at least 2.625 s|2.625/);
+ expect(insertRangeProblem(10, 12, 90)).toBeNull();
+ });
+
+ it("reference lists past what the endpoint takes, Turbo's 12 references in all, and Vidu Q4's mp3 voices", () => {
+ const plan = (modelId: string, inputs: Req["inputs"]) => () => planGeneration({ feature: "video", modelId, prompt: "Image 1 walks", inputs } as Req, getModel, getPreset);
+ const n = (k: number, u: string) => Array.from({ length: k }, () => u);
+ expect(plan("minimax-h3-max-insert", { video: CLIP, images: n(10, IMG) })).toThrow("MiniMax H3 Max Insert a moment takes up to 9 pictures as references, and this run has 10: remove 1");
+ expect(plan("minimax-h3-max-insert", { video: CLIP, videos: n(4, CLIP) })).toThrow(/up to 3 clips as references/);
+ expect(plan("minimax-h3-max-turbo-refs", { videos: n(4, CLIP) })).toThrow(/up to 3 clips/);
+ expect(plan("minimax-h3-lite", { images: [IMG, IMG], audios: n(4, VOICE) })).toThrow("MiniMax H3 Lite takes up to 3 sound clips as references, and this run has 4: remove 1");
+ expect(plan("vidu-q4", { images: n(13, IMG) })).toThrow(/up to 12 pictures/);
+ expect(plan("minimax-h3-max-turbo-refs", { images: n(9, IMG), videos: n(3, CLIP), audios: n(3, VOICE) })).toThrow(
+ "MiniMax H3 Max Turbo · references takes up to 12 references in all — pictures, clips and sound together — and this run has 15: remove 3",
+ );
+ expect(plan("minimax-h3-max-turbo-refs", { images: n(6, IMG), videos: n(3, CLIP), audios: n(3, VOICE) })).not.toThrow();
+ expect(plan("vidu-q4", { images: [IMG, IMG], audios: ["https://example.com/voice.wav"] })).toThrow("Vidu Q4 takes MP3 voice clips only: convert the others to MP3 first");
+ expect(plan("vidu-q4", { images: [IMG, IMG], audios: [VOICE, "data:audio/mpeg;base64,AAAA"] })).not.toThrow();
+ // A start frame is never counted as a reference.
+ expect(plan("vidu-q4", { images: [IMG] })).not.toThrow();
+ });
+
+ it("the longest whole-second length each API takes is offered (Vidu Q4 16 s, H3 Max insert 13 s)", () => {
+ expect(getModel("vidu-q4")!.options.durations?.at(-1)).toBe(16);
+ expect(getModel("minimax-h3-max-insert")!.options.durations?.at(-1)).toBe(13);
+ });
+ });
+
+ describe("a talking portrait's shape, read from the file before the run", () => {
+ /** A PNG header of the given size (enough for imageSize). */
+ const png = (w: number, h: number) => {
+ const b = Buffer.alloc(33);
+ Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]).copy(b, 0);
+ b.writeUInt32BE(13, 8);
+ b.write("IHDR", 12, "ascii");
+ b.writeUInt32BE(w, 16);
+ b.writeUInt32BE(h, 20);
+ b[24] = 8;
+ b[25] = 6;
+ return b;
+ };
+ it("H3 Max lip sync refuses a picture too tall or too wide, and takes a phone portrait", async () => {
+ const { saveFile } = await import("@/server/storage");
+ const { previewGeneration } = await import("@/server/generations");
+ const run = (w: number, h: number) => () =>
+ previewGeneration({ feature: "lipsync", modelId: "minimax-h3-max-lipsync", engine: "cloud", prompt: "", inputs: { images: [saveFile({ data: png(w, h), contentType: "image/png", source: "upload" }).id], audio: VOICE } } as Req);
+ expect(run(400, 1200)).toThrow("MiniMax H3 Max Lip Sync · up to 15 min takes pictures from 0.4:1 (tall) to 2.5:1 (wide), and this one is 400×1200: crop it first");
+ expect(run(3000, 1000)).toThrow(/2.5:1 \(wide\)/);
+ // (Past the shape it goes on to need a fal key here: no shape refusal.)
+ expect(run(1080, 1920)).not.toThrow(/crop it first/);
+ });
+ });
+
+ describe("the canvas", () => {
+ it("leaves out what it can't feed: a 3D model to retexture, the two points of an inserted moment, a light picked on a sphere", async () => {
+ const { modelChoices, nodeOps } = await import("@/lib/catalog/canvas");
+ const ids = (kind: string) => modelChoices({ type: "model", data: { mediaKind: kind } } as never).map((m) => m.id);
+ expect(ids("model3d")).not.toContain("meshy-7-retexture");
+ expect(ids("model3d")).not.toContain("meshy-6-retexture");
+ expect(ids("model3d")).toContain("tripo-p2");
+ expect(ids("video")).not.toContain("minimax-h3-max-insert");
+ expect(ids("video")).not.toContain("minimax-h3-max-relight");
+ expect(ids("video")).toContain("minimax-h3-max-turbo");
+ expect(nodeOps({ type: "model", data: {} } as never, getModel("meshy-7-retexture")!)).toEqual([]);
+ });
+ });
+
+ describe("the insert range control", () => {
+ it("opens around the clip's middle on 1/8 s stops, within the clip and 60 s", () => {
+ expect(insertHandles(12)).toEqual({ min: 1.625, max: 12, start: 5.5, resume: 6.5 });
+ expect(insertHandles(90).max).toBe(60);
+ expect(insertHandles(undefined).max).toBe(60);
+ });
+
+ it("keeps the handles in order and inside the track", () => {
+ expect(insertHandles(10, [0.2, 0.3])).toMatchObject({ start: 1.625, resume: 2.625 });
+ expect(insertHandles(10, [2.5, 2.75])).toMatchObject({ start: 2.5, resume: 2.75 });
+ expect(insertHandles(10, [9.9, 12])).toMatchObject({ start: 9.875, resume: 10 });
+ expect(insertHandles(10, [5, 4])).toMatchObject({ start: 5, resume: 5.125 });
+ const h = insertHandles(7.3, [2.06, 6.94]);
+ expect(h.start % 0.125).toBe(0);
+ expect(insertRangeProblem(h.start, h.resume, 7.3)).toBeNull();
+ });
+ });
+
+ describe("the relight sphere", () => {
+ it("is a square picture of the size fal reads, for every preset", () => {
+ expect(SPHERE_SIZE).toBe(512);
+ for (const p of LIGHT_PRESETS) expect(spherePixels(p).length, p.id).toBe(512 * 512 * 4);
+ expect(spherePixels(LIGHT_PRESETS[0], 64).length).toBe(64 * 64 * 4);
+ });
+
+ it("is lit from the preset's side over a dark ground, in the light's colour", () => {
+ const size = 128;
+ const px = spherePixels(lightPreset("golden-left")!, size);
+ const at = (x: number, y: number) => Array.from(px.slice((y * size + x) * 4, (y * size + x) * 4 + 4));
+ const left = at(Math.round(size * 0.22), size / 2);
+ const right = at(Math.round(size * 0.78), size / 2);
+ expect(left[0]).toBeGreaterThan(right[0] + 60);
+ // Warm: more red than blue where it's lit.
+ expect(left[0]).toBeGreaterThan(left[2] + 40);
+ expect(at(0, 0)).toEqual([at(0, 0)[0], at(0, 0)[0], at(0, 0)[0], 255]);
+ expect(at(0, 0)[0]).toBeLessThan(80);
+ const fire = spherePixels(lightPreset("campfire")!, size);
+ const lum = (b: Uint8ClampedArray, x: number, y: number) => b[(y * size + x) * 4];
+ expect(lum(fire, size / 2, Math.round(size * 0.8))).toBeGreaterThan(lum(fire, size / 2, Math.round(size * 0.2)));
+ });
+ });
+
+ describe("demo mode", () => {
+ it("answers an inserted moment with a clip and a retexture with a model", async () => {
+ const run = async (modelId: string, op: string) => {
+ const m = getModel(modelId)!;
+ const res = await mockProvider.submit({ generationId: `t-${op}`, model: m, route: routesFor(m, op as never)[0], input: { prompt: "x" } as never });
+ return (await mockProvider.poll({ externalId: res.externalId, meta: { ...res.meta, startedAt: Date.now() - 600_000 }, route: routesFor(m, op as never)[0], model: m, createdAt: Date.now() - 60_000 })) as {
+ outputs?: { kind: string }[];
+ };
+ };
+ expect((await run("minimax-h3-max-insert", "insert-moment")).outputs?.[0].kind).toBe("video");
+ expect((await run("meshy-7-retexture", "retexture-3d")).outputs?.[0].kind).toBe("model3d");
+ });
+
+ it("reads a retexture's GLB from fal's answer", () => {
+ expect(extractOutputs({ model_glb: { url: "https://x/m.glb" }, thumbnail: { url: "https://x/t.png" } }, "retexture-3d")[0]).toMatchObject({ url: "https://x/m.glb", kind: "model3d" });
+ });
+ });
diff --cc tests/idol.test.ts
index 00000000,5f1e11db..1bfd2caa
mode 000000,100644..100644
--- a/tests/idol.test.ts
+++ b/tests/idol.test.ts
@@@ -1,0 -1,122 +1,122 @@@
+ import fs from "node:fs";
+ import path from "node:path";
+ import { describe, expect, it } from "vitest";
+ import { APPS, MODELS, getModel } from "@/lib/catalog";
+ import { modelChoices } from "@/lib/catalog/canvas";
+ import type { Manifest } from "@/lib/comfy";
+ import { licenceTerms, workflowLicence } from "@/lib/licences";
+
+ /**
- * Idol 3D (idol-1, docs/research/idol-9.md §5.5): the library entry, the graph (a copy of TripoSplat's with Idol's
++ * Idol 3D (docs/research/idol-9.md §5.5): the library entry, the graph (a copy of TripoSplat's with Idol's
+ * files, its reference sampler, the core-node photo crop and the haze threshold), its licence notice and its name.
+ */
+
+ const root = process.cwd();
+ const manifest = JSON.parse(fs.readFileSync(path.join(root, "workflows", "comfyui", "manifest.json"), "utf8")) as Manifest;
+ const entry = manifest.workflows.find((w) => w.id === "image-to-splat-idol")!;
+ type Node = { class_type: string; inputs: Record<string, unknown> };
+ const graph = JSON.parse(fs.readFileSync(path.join(root, "workflows", "comfyui", "image-to-splat-idol.json"), "utf8")) as Record<string, Node>;
+ const tripo = JSON.parse(fs.readFileSync(path.join(root, "workflows", "comfyui", "image-to-splat-triposplat.json"), "utf8")) as Record<string, Node>;
+ const NYNXZ = "https://huggingface.co/nynxz/Idol/resolve/c718f2b1b95b353edd07d17e845719fc10880a44";
+
+ describe("image-to-splat-idol: the manifest entry", () => {
+ it("is a splat on core nodes with Best's defaults, the photo crop off and 8 GB", () => {
+ expect(entry).toMatchObject({ capability: "splat", customNodes: [], vramGb: 8, limits: { maxGaussians: 1048576 } });
+ expect(entry.defaults).toMatchObject({ splatFormat: "spz", cutout: true, photoCrop: false, steps: 50, cfg: 4, numGaussians: 262144 });
+ expect(Object.keys(entry.bindings).sort()).toEqual(["cfg", "cutout", "filenamePrefix", "image", "numGaussians", "orbitFrames", "photoCrop", "sampler", "seed", "splatFormat", "steps"]);
+ expect(entry.bindings.sampler).toEqual([{ node: "88:6", input: "sampler_name" }]);
+ expect(entry.bindings.photoCrop).toEqual([{ node: "88:104", input: "switch" }]);
+ expect(entry.bindings.seed).toEqual([
+ { node: "88:6", input: "seed" },
+ { node: "88:55", input: "seed" },
+ ]);
+ });
+
+ it("needs Idol's two pinned files and the three it shares with TripoSplat", () => {
+ const models = Object.fromEntries(entry.models.map((m) => [m.file, m]));
+ expect(Object.fromEntries(entry.models.map((m) => [m.file, m.sizeGb]))).toEqual({
+ "idol_fp16.safetensors": 0.74,
+ "idol_decoder_fp16.safetensors": 0.58,
+ "dino_v3_vit_h.safetensors": 1.68,
+ "flux2-vae.safetensors": 0.34,
+ "birefnet.safetensors": 0.44,
+ });
+ expect(models["idol_fp16.safetensors"].url).toBe(`${NYNXZ}/diffusion_models/idol_fp16.safetensors`);
+ expect(models["idol_decoder_fp16.safetensors"].url).toBe(`${NYNXZ}/vae/idol_decoder_fp16.safetensors`);
+ const pins = JSON.parse(fs.readFileSync(path.join(root, "workflows", "comfyui", "model-pins.json"), "utf8")) as Record<string, { sizeBytes: number; sha256: string }>;
+ expect(pins[`${NYNXZ}/diffusion_models/idol_fp16.safetensors`]).toMatchObject({ sizeBytes: 741107210, sha256: "cf452146f78e23a0d34be8f9f79bcde642b9a40ef493046c8e9d5f79096f6dd0" });
+ expect(pins[`${NYNXZ}/vae/idol_decoder_fp16.safetensors`]).toMatchObject({ sizeBytes: 576148658, sha256: "c511d99eb668ec4b06d883cb6e43770bc35e3864e16e7058e8d6211ba5c509aa" });
+ });
+
+ it("is in the GPU check's index and validated", () => {
+ const req = JSON.parse(fs.readFileSync(path.join(root, "workflows", "comfyui", "requirements.json"), "utf8")) as { workflows: Record<string, { files: string[]; packs: object }> };
+ expect(req.workflows["image-to-splat-idol"].files).toEqual(["background_removal/birefnet.safetensors", "clip_vision/dino_v3_vit_h.safetensors", "diffusion_models/idol_fp16.safetensors", "vae/flux2-vae.safetensors", "vae/idol_decoder_fp16.safetensors"]);
+ expect(req.workflows["image-to-splat-idol"].packs).toEqual({});
+ const state = JSON.parse(fs.readFileSync(path.join(root, "scripts", "comfy", "validation-state.json"), "utf8")) as Record<string, { validated: boolean }>;
+ expect(state["image-to-splat-idol"].validated).toBe(true);
+ });
+ });
+
+ describe("image-to-splat-idol: the graph", () => {
+ it("loads Idol's files and samples at its reference settings", () => {
+ expect(graph["88:16"].inputs).toMatchObject({ unet_name: "idol_fp16.safetensors", weight_dtype: "default" });
+ expect(graph["88:11"].inputs.vae_name).toBe("idol_decoder_fp16.safetensors");
+ expect(graph["88:6"].inputs).toMatchObject({ steps: 50, cfg: 4, sampler_name: "euler", scheduler: "simple", denoise: 1 });
+ expect(Object.values(graph).some((n) => n.class_type === "ModelSamplingSD3")).toBe(false);
+ });
+
+ it("drops the haze from the orbit video only", () => {
+ expect(graph["75"].inputs.opacity_threshold).toBe(0.05);
+ expect(graph["92"].inputs.splat).toEqual(["88:55", 0]);
+ });
+
+ it("crops a photo looser on core nodes, behind a switch that is off by default", () => {
+ expect(graph["88:101"]).toMatchObject({ class_type: "ImageScale", inputs: { image: ["88:2", 0], upscale_method: "lanczos", width: 720, height: 720, crop: "disabled" } });
+ expect(graph["88:102"]).toMatchObject({ class_type: "EmptyImage", inputs: { width: 1024, height: 1024, batch_size: 1, color: 0 } });
+ expect(graph["88:103"]).toMatchObject({ class_type: "ImageCompositeMasked", inputs: { destination: ["88:102", 0], source: ["88:101", 0], x: 152, y: 152, resize_source: false } });
+ expect(graph["88:104"]).toMatchObject({ class_type: "ComfySwitchNode", inputs: { switch: false, on_false: ["88:2", 0], on_true: ["88:103", 0] } });
+ expect(graph["88:24"].inputs.image).toEqual(["88:104", 0]);
+ // The object spans 720 / 1.2 = 600 px on the 1024 canvas, as Idol's "real" crop (1024 / 1.7 ≈ 602 px) does.
+ expect(Math.round(720 / 1.2)).toBe(600);
+ expect(152 * 2 + 720).toBe(1024);
+ });
+
+ it("keeps everything else as TripoSplat's graph has it", () => {
+ const changed = new Set(["88:16", "88:11", "88:6", "75", "88:24", "88:101", "88:102", "88:103", "88:104"]);
+ for (const [id, node] of Object.entries(tripo)) {
+ expect(graph[id]?.class_type, id).toBe(node.class_type);
+ if (!changed.has(id) && !["51", "42"].includes(id)) expect(graph[id].inputs, id).toEqual(node.inputs);
+ }
+ expect(Object.keys(graph).filter((id) => !tripo[id]).sort()).toEqual(["88:101", "88:102", "88:103", "88:104"]);
+ });
+ });
+
+ describe("Idol 3D: licence, name and where it shows", () => {
+ it("names Apache-2.0, the TripoSplat MIT attribution and the DINOv3 notice", () => {
+ const text = workflowLicence(entry);
+ expect(text).toMatch(/^Apache-2.0/);
+ expect(text).toMatch(/TripoSplat architecture \(MIT/);
+ expect(licenceTerms(text).notices).toEqual(["Built with DINOv3"]);
+ // The same catches as TripoSplat's (the DINOv3 License's trade-control terms).
+ const triposplat = manifest.workflows.find((w) => w.id === "image-to-splat-triposplat")!;
+ expect(licenceTerms(text).flags).toEqual(licenceTerms(workflowLicence(triposplat)).flags);
+ });
+
+ it("is the only model or app called Idol 3D (one per engine), apart from the K-pop Idol app", () => {
+ expect(MODELS.filter((m) => m.name === "Idol 3D").map((m) => [m.id, m.engine])).toEqual(
+ expect.arrayContaining([
+ ["oss-idol", "open"],
+ ["idol-3d", "cloud"],
+ ]),
+ );
+ expect(MODELS.filter((m) => m.name === "Idol 3D")).toHaveLength(2);
+ expect(APPS.filter((a) => a.name === "Idol 3D")).toEqual([]);
+ expect(APPS.some((a) => a.name === "Idol")).toBe(true);
+ });
+
+ it("is offered by a Canvas 3D model node, with its sliders", () => {
+ const ids = modelChoices({ type: "model", data: { mediaKind: "model3d" } } as never).map((m) => m.id);
+ expect(ids).toEqual(expect.arrayContaining(["oss-idol", "idol-3d"]));
+ expect(getModel("oss-idol")!.options?.sliders?.map((s) => s.param)).toEqual(["numGaussians", "steps"]);
+ });
+ });
diff --cc tests/layouts-everywhere.test.ts
index 00000000,41d4445d..57272d4b
mode 000000,100644..100644
--- a/tests/layouts-everywhere.test.ts
+++ b/tests/layouts-everywhere.test.ts
@@@ -1,0 -1,434 +1,434 @@@
+ import fs from "node:fs";
+ import os from "node:os";
+ import path from "node:path";
+ import { afterAll, describe, expect, it } from "vitest";
+
-// N7-8 (docs/research/new-models-7.md §5.9): layouts from Canvas, Marketing Studio, Ads Studio and Assist.
++// Layouts everywhere (docs/research/new-models-7.md §5.9): layouts from Canvas, Marketing Studio, Ads Studio and Assist.
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-layouts-everywhere-"));
+ process.env.FUOBE_DATA_DIR = tmp;
+ process.env.COMFYUI_URL = "http://127.0.0.1:9";
+ process.env.OLLAMA_URL = "http://127.0.0.1:9";
+ afterAll(() => fs.rmSync(tmp, { recursive: true, force: true }));
+
+ const { getModel, getPreset } = await import("@/lib/catalog");
+ const { planGeneration } = await import("@/lib/catalog/plan");
+ const { describeNode, cleanGraph } = await import("@/lib/catalog/canvas");
+ const { compileMoss, validateLayout, readsBoxes } = await import("@/lib/layout-prompt");
+ const { adDraft, adPlanDraft, fillLayout, layoutPlaceholders, LOGO_CAPTION, productRect, roughMeasure } = await import("@/lib/layout-surfaces");
+ const { planAd, themeFrom } = await import("@/components/ads/layout");
+ const { DRAWN_WORDS_MODELS, drawnWordsModel, formatModels, FORMATS, wordsOnTop, MARKETING_IMAGE_MODEL } = await import("@/lib/catalog/marketing");
+ const { planByRules, readPlanned } = await import("@/lib/layout-plan");
+ const { setSetting } = await import("@/server/settings");
+ const mk = await import("@/server/marketing");
+ const ads = await import("@/server/ads");
+ const { planLayoutFromWords } = await import("@/server/layout-plan");
+ const skills = await import("@/server/skills");
+ const canvasServer = await import("@/server/canvas");
+ const tools = await import("@/server/assist/tools");
+
+ import type { CanvasEdge, CanvasGraph, CanvasNode } from "@/lib/catalog/canvas";
+ import type { BrandKit, Product } from "@/lib/catalog/marketing";
+ import type { GenerationRequest } from "@/lib/catalog/types";
+ import type { LayoutDraft } from "@/lib/layout-prompt";
+
+ setSetting("demoMode", "auto");
+
+ const brand = {
+ id: "b1",
+ name: "Ember & Wick",
+ tagline: "Small-batch candles",
+ colors: ["#a3411f", "#f6efe3", "#1d1a17"],
+ fonts: { heading: "Fraunces", body: "Inter" },
+ values: [],
+ aesthetics: ["warm", "handmade"],
+ tone: ["friendly"],
+ sellingPoints: [],
+ competitors: [],
+ socials: [],
+ images: [],
+ details: [],
+ status: "ready",
+ source: "manual",
+ logo: "/api/files/logo.png",
+ } as unknown as BrandKit;
+ const product = {
+ id: "p1",
+ brandId: "b1",
+ name: "Autumn Soy Candle",
+ description: "Amber glass jar, cedar and clove",
+ sellingPoints: ["40-hour burn"],
+ images: ["/api/files/candle.png"],
+ createdAt: 0,
+ updatedAt: 0,
+ } as unknown as Product;
+
+ const inside = (d: LayoutDraft) => d.items.every((it) => it.box.every((v) => v >= 0 && v <= 1) && it.box[2] > it.box[0] && it.box[3] > it.box[1]);
+ const overlaps = (a: number[], b: number[]) => a[0] < b[2] && b[0] < a[2] && a[1] < b[3] && b[1] < a[3];
+
+ // ---------------------------------------------------------------------------
+
+ describe("an ad plan as a layout (AdPlan → draft)", () => {
+ const plan = planAd({
+ ratio: "4:5",
+ layout: "overlay",
+ content: { headline: "Autumn Glow", body: "Hand-poured soy, cedar and clove.", cta: "Shop now" },
+ theme: themeFrom(brand),
+ image: { w: 1080, h: 1350 },
+ logo: { w: 3, h: 1 },
+ measure: roughMeasure,
+ });
+
+ it("maps the headline, body and button to text items with their words, the logo and the product to objects", () => {
+ const d = adPlanDraft(plan, { mode: "words", product: "Autumn Soy Candle in amber glass", caption: "A finished social ad" });
+ const texts = d.items.filter((i) => i.label === "text").map((i) => i.text?.replace(/\n/g, " "));
+ expect(texts).toEqual(["Autumn Glow", "Hand-poured soy, cedar and clove.", "Shop now"]);
+ expect(d.items.find((i) => i.caption === LOGO_CAPTION)?.label).toBe("object");
+ const prod = d.items.find((i) => i.caption.startsWith("Autumn Soy Candle"))!;
+ expect(prod.label).toBe("object");
+ // The product stays out of the words' space, and every box is inside the picture.
+ for (const t of d.items.filter((i) => i.label === "text")) expect(overlaps(prod.box, t.box), t.text).toBe(false);
+ expect(inside(d)).toBe(true);
+ expect(d.aspect).toBe("4:5");
+ expect(d.summary.caption).toMatch(/soft dark shade/);
+ expect(validateLayout(d, 1088, 1360).filter((i) => i.level === "error")).toEqual([]);
+ // The type is described by family and colour, never as a CSS font string.
+ expect(d.items.find((i) => i.text === "Autumn Glow")?.caption).toMatch(/Fraunces-style typeface/);
+ expect(JSON.stringify(d)).not.toMatch(/px "/);
+ });
+
+ it("keeps clear: only the product, in the part of the picture the words leave free", () => {
+ const d = adPlanDraft(plan, { mode: "clear", product: "Autumn Soy Candle", caption: "Advertising photograph" });
+ expect(d.items).toHaveLength(1);
+ expect(d.items[0]).toMatchObject({ label: "object", caption: "Autumn Soy Candle" });
+ const r = productRect(plan);
+ expect(r.y + r.h).toBeLessThanOrEqual(plan.headline.y);
+ expect(d.summary.caption).toMatch(/No text, letters or logos anywhere/);
+ });
+
+ it("uses the whole picture when the words sit beside it (Panel)", () => {
+ const panel = planAd({ ratio: "4:5", layout: "panel", content: { headline: "Autumn Glow" }, theme: themeFrom(brand), image: { w: 1080, h: 1350 }, measure: roughMeasure });
+ expect(productRect(panel)).toEqual({ x: panel.image!.x, y: panel.image!.y, w: panel.image!.w, h: panel.image!.h });
+ const d = adPlanDraft(panel, { mode: "words", product: "candle", caption: "" });
+ expect(d.items[0].caption).toMatch(/flat, solid #[0-9a-f]{6} colour panel/i);
+ });
+ });
+
+ describe("a table row in a layout's {Column} placeholders", () => {
+ const draft: LayoutDraft = {
+ summary: { caption: "A poster for {Product}", meta: [], canvas: "single" },
+ items: [
+ { label: "text", caption: "Bold", text: "{Headline}", box: [0.1, 0.05, 0.9, 0.2] },
+ { label: "text", caption: "Price tag", text: "Only {Price}", box: [0.6, 0.8, 0.95, 0.95] },
+ { label: "object", caption: "{Product} on a table", box: [0.2, 0.3, 0.8, 0.75] },
+ ],
+ };
+ it("finds the placeholders and fills them, leaving unknown ones as written", () => {
+ expect(layoutPlaceholders(draft).sort()).toEqual(["Headline", "Price", "Product"]);
+ const f = fillLayout(draft, ["Headline", " Price ", "Other"], ["Autumn Glow", "$18", "x"]);
+ expect(f.items.map((i) => i.text ?? i.caption)).toEqual(["Autumn Glow", "Only $18", "{Product} on a table"]);
+ expect(f.summary.caption).toBe("A poster for {Product}");
+ expect(draft.items[0].text).toBe("{Headline}"); // not changed in place
+ });
+ });
+
+ // ---------------------------------------------------------------------------
+
+ const node = (id: string, type: CanvasNode["type"], x: number, y: number, data: CanvasNode["data"] = {}): CanvasNode => ({ id, type, position: { x, y }, data });
+ const edge = (source: string, target: string, targetHandle = "prompt"): CanvasEdge => ({ id: `${source}>${target}:${targetHandle}`, source, sourceHandle: "out", target, targetHandle });
+ const poster: LayoutDraft = {
+ summary: { caption: "A warm candle sale poster", meta: ["poster"], canvas: "single" },
+ items: [
+ { label: "text", caption: "Bold cream serif", text: "30% OFF", box: [0.1, 0.05, 0.9, 0.2] },
+ { label: "object", caption: "Three lit candles", box: [0.25, 0.35, 0.75, 0.9] },
+ ],
+ aspect: "3:4",
+ };
+ const board = (modelId: string, params: CanvasNode["data"]["params"] = {}, layout: LayoutDraft = poster): CanvasGraph => ({
+ nodes: [node("l", "layout", 0, 0, { layout }), node("m", "model", 400, 0, { modelId, mediaKind: "image", params })],
+ edges: [edge("l", "m")],
+ });
+
+ describe("the Canvas Layout node", () => {
+ it("is an Inputs node with a text output that a model's Prompt takes", () => {
+ const g = cleanGraph(board("oss-moss-image"));
+ expect(g.edges).toHaveLength(1);
+ // A board saved and read back keeps the layout (the server's own check).
+ const parsed = canvasServer.parseGraph(g)!;
+ expect(parsed.nodes[0].data.layout?.items).toHaveLength(2);
+ });
+
+ it("compiles for each downstream model at the size it renders (sourceOf → planLayout)", () => {
+ const at = (modelId: string, params: CanvasNode["data"]["params"] = {}) => {
+ const g = board(modelId, params);
+ const d = describeNode(g, g.nodes[1]);
+ expect(d.error, modelId).toBeUndefined();
+ expect(d.request?.params?.extra?.layout, modelId).toBeTruthy();
+ return d.plan!;
+ };
+ // MOSS-Image on your GPU: its JSON at the canvas the node's picture takes (3:4, then 16:9).
+ const tall = at("oss-moss-image", { aspectRatio: "3:4" });
+ expect(tall.layout).toMatchObject({ format: "moss", boxes: 2 });
+ expect(tall.prompt).toBe(compileMoss({ ...poster, summary: { ...poster.summary, caption: "A warm candle sale poster" } }, tall.layout!.width!, tall.layout!.height!));
+ expect(tall.layout!.height!).toBeGreaterThan(tall.layout!.width!);
+ const wide = at("oss-moss-image", { aspectRatio: "16:9" });
+ expect(wide.layout!.width!).toBeGreaterThan(wide.layout!.height!);
+ expect(wide.prompt).not.toBe(tall.prompt);
+ // MOSS-Image on fal: the same JSON, the size sent with it, expansion off.
+ const fal = at("moss-image");
+ expect(fal.layout?.format).toBe("moss");
+ expect(fal.params.enhancePrompt).toBe(false);
+ // FLUX.3 and Ideogram 4.5 read their own forms.
+ expect(at("flux-3").layout?.format).toBe("flux3");
+ expect(at("ideogram-4-5").layout?.format).toBe("ideogram");
+ // A model that doesn't place boxes gets sentences.
+ const words = at("nano-banana-pro");
+ expect(readsBoxes(getModel("nano-banana-pro"))).toBe(false);
+ expect(words.layout?.format).toBe("words");
+ expect(words.prompt).toMatch(/30% OFF/);
+ });
+
+ it("reads as sentences in a text model, and asks for a box and for one layout at a time", () => {
+ const text = board("text-llm");
+ text.nodes[1].data.mediaKind = "text";
+ const r = describeNode(text, text.nodes[1]);
+ expect(r.request?.params?.extra?.layout).toBeUndefined();
+ expect(r.request?.prompt).toMatch(/30% OFF/);
+ const empty = board("oss-moss-image", {}, { ...poster, items: [] });
+ expect(describeNode(empty, empty.nodes[1]).error).toMatch(/Draw a box in “Layout”/);
+ const two = board("oss-moss-image");
+ two.nodes.push(node("l2", "layout", 0, 300, { layout: poster }));
+ two.edges.push(edge("l2", "m"));
+ expect(describeNode(two, two.nodes[1]).error).toBe("Connect one layout at a time");
+ });
+
+ it("with a Table, fills {Column} in the layout's words row by row: one layout, a batch of posters", () => {
+ const layout: LayoutDraft = {
+ ...poster,
+ items: [
+ { ...poster.items[0], text: "{Offer}" },
+ { ...poster.items[1], caption: "{Product}, lit, on a table" },
+ ],
+ };
+ const g = board("oss-moss-image", {}, layout);
+ g.nodes.push(
+ node("t", "table", 0, 300, {
+ columns: ["Offer", "Product"],
+ rows: [
+ ["30% OFF", "Soy candles"],
+ ["2 FOR $30", "Beeswax tapers"],
+ ],
+ }),
+ );
+ g.edges.push(edge("t", "m"));
+ const d = describeNode(g, g.nodes[1]);
+ expect(d.error).toBeUndefined();
+ expect(d.rows).toBe(2);
+ const drafts = d.steps!.map((s) => s.request.params?.extra?.layout as LayoutDraft);
+ expect(drafts.map((x) => x.items[0].text)).toEqual(["30% OFF", "2 FOR $30"]);
+ expect(drafts.map((x) => x.items[1].caption)).toEqual(["Soy candles, lit, on a table", "Beeswax tapers, lit, on a table"]);
+ // The row's cells went into the layout, so they aren't added to the prompt as well.
+ expect(d.steps!.every((s) => !(s.request.prompt ?? "").includes("Soy candles, 30% OFF"))).toBe(true);
+ });
+ });
+
+ // ---------------------------------------------------------------------------
+
+ describe("Marketing Studio: Words drawn by the model", () => {
+ const ctx = { product, brand };
+ it("keeps the words on top by default and says which models draw them in place", () => {
+ expect([
+ wordsOnTop("open", MARKETING_IMAGE_MODEL),
+ wordsOnTop("open", MARKETING_IMAGE_MODEL, true),
+ wordsOnTop("cloud", MARKETING_IMAGE_MODEL, true),
+ wordsOnTop("cloud", "moss-image", true),
+ ]).toEqual([true, false, false, false]);
+ expect(formatModels(FORMATS.ads, "open", { product: true, avatar: false }, true).map((c) => c.id)).toEqual(["oss-moss-image"]);
+ expect(formatModels(FORMATS.poster, "cloud", { product: false, avatar: false }, true).map((c) => c.id)).toEqual(["moss-image", "ideogram-4-5", "flux-3"]);
+ // Formats without words don't change.
+ expect(formatModels(FORMATS["product-standalone"], "open", { product: true, avatar: false }, true)[0].id).toBe(MARKETING_IMAGE_MODEL);
+ for (const e of ["open", "cloud"] as const) for (const c of DRAWN_WORDS_MODELS[e]) expect(readsBoxes(getModel(c.id)), c.id).toBe(true);
+ expect(drawnWordsModel("cloud", "flux-3")).toBe("flux-3");
+ expect(drawnWordsModel("open", "flux-3")).toBe("oss-moss-image");
+ });
+
+ it("on your GPU: MOSS-Image draws the headline and button from the format's copy places", () => {
+ const run = mk.planMarketing({ engine: "open", format: "ads", templateId: "ad-hero-headline", headline: "Crunch, sorted", drawnWords: true }, ctx);
+ const r = run.steps[0].request;
+ expect(r).toMatchObject({ modelId: "oss-moss-image", op: "t2i" });
+ expect(r.inputs).toBeUndefined();
+ const layout = r.params?.extra?.layout as LayoutDraft;
+ expect(layout.items.filter((i) => i.label === "text").map((i) => i.text?.replace(/\n/g, " "))).toEqual(["Crunch, sorted", "Shop now"]);
+ expect(layout.items.some((i) => i.label === "object" && i.caption.startsWith("Autumn Soy Candle"))).toBe(true);
+ expect(r.prompt).not.toContain("“Crunch, sorted”");
+ expect(run.meta.overlay).toBeNull();
+ expect(run.notes.join(" ")).toMatch(/draws your product from its name and description/);
+ // The plan compiles it for MOSS-Image at the size it renders.
+ const p = planGeneration(r as GenerationRequest, getModel, getPreset);
+ expect(p.layout).toMatchObject({ format: "moss" });
+ expect(p.prompt).toMatch(/"text":"Crunch, sorted"/);
+ });
+
+ it("in the cloud: MOSS-Image hosted by default, FLUX.3 with the product photo", () => {
+ const moss = mk.planMarketing({ engine: "cloud", format: "poster", prompt: "Autumn launch", headline: "Autumn Glow", drawnWords: true }, { brand, product: null });
+ expect(moss.steps[0].request).toMatchObject({ modelId: "moss-image", op: "t2i" });
+ expect((moss.steps[0].request.params?.extra?.layout as LayoutDraft).items.some((i) => i.text === "Autumn Glow")).toBe(true);
+ const flux = mk.planMarketing({ engine: "cloud", format: "ads", templateId: "ad-hero-headline", modelId: "flux-3", drawnWords: true }, ctx);
+ expect(flux.steps[0].request).toMatchObject({ modelId: "flux-3", op: "edit", inputs: { images: [product.images[0], brand.logo] } });
+ expect((flux.steps[0].request.params?.extra?.layout as LayoutDraft).items.filter((i) => i.caption === LOGO_CAPTION)).toHaveLength(1);
+ // MOSS-Image can't take the logo: no logo box for it to make one up in.
+ expect((moss.steps[0].request.params?.extra?.layout as LayoutDraft).items.some((i) => /logo/i.test(i.caption))).toBe(false);
+ // Ideogram 4.5 edits: it keeps the product photo and takes the logo too.
+ const ideo = mk.planMarketing({ engine: "cloud", format: "ads", templateId: "ad-hero-headline", modelId: "ideogram-4-5", drawnWords: true }, ctx);
+ expect(ideo.steps[0].request).toMatchObject({ modelId: "ideogram-4-5", op: "edit", inputs: { images: [product.images[0], brand.logo] } });
+ expect(ideo.notes.join(" ")).not.toMatch(/draws your product from its name/);
+ // The estimate prices the drawing model.
+ const est = mk.estimateMarketing({ engine: "cloud", format: "ads", templateId: "ad-hero-headline", drawnWords: true, productImages: product.images });
+ expect(est.steps?.[0]?.modelId ?? JSON.stringify(est)).toMatch(/moss-image/);
+ });
+ });
+
+ // ---------------------------------------------------------------------------
+
+ describe("Ads Studio: drawn ads and the keep-clear layout", () => {
+ const concept = { visual: "three candles on an oak table", headline: "Autumn Glow", body: "Hand-poured soy.", cta: "Shop now" };
+ it("sends the words as a layout instead of the no-text instruction, on both engines", () => {
+ const open = ads.visualRequest(concept, product, brand, "open", null, true);
+ expect(open).toMatchObject({ modelId: "oss-moss-image", op: "t2i", params: { aspectRatio: "4:5" } });
+ expect(open.prompt).not.toMatch(/No text, letters/);
+ const layout = open.params?.extra?.layout as LayoutDraft;
+ expect(layout.items.filter((i) => i.label === "text").map((i) => i.text?.replace(/\n/g, " "))).toEqual([brand.name.toUpperCase(), "Autumn Glow", "Hand-poured soy.", "Shop now"]);
+ // MOSS-Image draws from words alone: it can't take the logo, so the brand's name is drawn in its place, not a made-up logo.
+ expect(layout.items.some((i) => /logo/i.test(i.caption))).toBe(false);
+ const cloud = ads.visualRequest(concept, product, brand, "cloud", "ideogram-4-5", true);
+ expect(cloud.modelId).toBe("ideogram-4-5");
+ expect(planGeneration(cloud, getModel, getPreset).layout?.format).toBe("ideogram");
+ });
+
+ it("a model that takes references keeps the product photo and gets the brand's own logo for its logo box", () => {
+ for (const id of ["ideogram-4-5", "flux-3"]) {
+ const r = ads.visualRequest(concept, product, brand, "cloud", id, true);
+ expect(r, id).toMatchObject({ modelId: id, op: "edit", inputs: { images: [product.images[0], brand.logo] } });
+ expect((r.params?.extra?.layout as LayoutDraft).items.filter((i) => i.caption === LOGO_CAPTION), id).toHaveLength(1);
+ expect(r.prompt, id).toMatch(/last reference image is the brand's logo/);
+ }
+ // No logo in the kit (or an SVG one): no logo box, the photo alone.
+ for (const logo of [undefined, "/api/files/logo.svg"]) {
+ const r = ads.visualRequest(concept, product, { ...brand, logo } as BrandKit, "cloud", "flux-3", true);
+ expect(r.inputs?.images).toEqual([product.images[0]]);
+ expect((r.params?.extra?.layout as LayoutDraft).items.some((i) => /logo/i.test(i.caption))).toBe(false);
+ }
+ // Without a product photo there is nothing to edit: drawn from words, no logo.
+ const bare = ads.visualRequest(concept, null, brand, "cloud", "ideogram-4-5", true);
+ expect(bare).toMatchObject({ op: "t2i", inputs: undefined });
+ expect((bare.params?.extra?.layout as LayoutDraft).items.some((i) => /logo/i.test(i.caption))).toBe(false);
+ });
+
+ it("without it: the visual alone, and a keep-clear layout only for a model that reads boxes", () => {
+ const plain = ads.visualRequest(concept, product, brand, "cloud");
+ expect(plain.params?.extra).toBeUndefined();
+ expect(plain.prompt).toMatch(/No text, letters/);
+ const flux = ads.visualRequest(concept, product, brand, "cloud", "flux-3");
+ const layout = flux.params?.extra?.layout as LayoutDraft;
+ expect(layout.items).toHaveLength(1);
+ expect(layout.items[0].label).toBe("object");
+ expect(flux.inputs?.images).toEqual(product.images);
+ expect(planGeneration(flux, getModel, getPreset).layout).toMatchObject({ format: "flux3", boxes: 1 });
+ });
+
+ it("an estimate for drawn ads prices the model that draws them", () => {
+ const e = ads.estimateBatch({ brandId: "b1", engine: "cloud", items: [{ productId: "p1", count: 2 }], drawnWords: true }, { brand, product });
+ expect(e.modelId).toBe("moss-image");
+ const draft = adDraft({ ratio: "4:5", layout: "overlay", content: { headline: "x" }, brand, mode: "clear", product: "y", caption: "" });
+ expect(draft.aspect).toBe("4:5");
+ });
+ });
+
+ // ---------------------------------------------------------------------------
+
+ describe("Plan layout and the Layout Poster skill", () => {
+ it("lays out a poster from the sentence when no text model is there, and the result passes validateLayout", () => {
+ const d = planByRules("a sale poster for my candle shop, 30% off", 768, 1024);
+ expect(d.items.find((i) => i.label === "text")?.text).toBe("30% OFF");
+ expect(d.items.map((i) => i.text).filter(Boolean)).toContain("Candle Shop");
+ expect(d.aspect).toBe("3:4");
+ expect(validateLayout(d, 768, 1024)).toEqual([]);
+ const quoted = planByRules('a launch poster for our bakery that says "Fresh at 7"', 1536, 1024);
+ expect(quoted.items[0].text).toBe("Fresh at 7");
+ expect(validateLayout(quoted, 1536, 1024)).toEqual([]);
+ });
+
+ it("reads the planner's pixel draft (MOSS's abs / xyxy) into a layout that passes validateLayout", () => {
+ const answer = JSON.stringify({
+ width: 768,
+ height: 1024,
+ bbox_coord_space: "abs",
+ bbox_format: "xyxy",
+ summary: { caption: "A warm autumn sale poster", meta: ["poster"], canvas: "single" },
+ items: [
+ { label: "text", caption: "Large cream serif", text: "Autumn Glow", bbox: [64, 48, 704, 200] },
+ { label: "object", caption: "Three lit candles", bbox: [112, 320, 656, 848] },
+ ],
+ });
+ const d = readPlanned(`Here it is:\n${answer}`, 768, 1024)!;
+ expect(d.items[0].box[0]).toBeCloseTo(64 / 768, 6);
+ expect(d.items[1].box[3]).toBeCloseTo(848 / 1024, 6);
+ expect(validateLayout(d, 768, 1024)).toEqual([]);
+ // A text box without words doesn't run: not a plan.
+ expect(readPlanned(answer.replace('"text":"Autumn Glow",', ""), 768, 1024)).toBeNull();
+ expect(readPlanned("no layout here", 768, 1024)).toBeNull();
+ });
+
+ it("asks the AI helper first and falls back to the rules", async () => {
+ setSetting("enhanceProvider", "local");
+ const good =
+ '{"width":1024,"height":1024,"bbox_coord_space":"abs","bbox_format":"xyxy","summary":{"caption":"x","meta":[],"canvas":"single"},"items":[{"label":"text","caption":"bold","text":"SALE","bbox":[100,50,900,250]}]}';
+ const asked: string[] = [];
+ const r = await planLayoutFromWords("a sale poster", 1024, 1024, async (system, user) => (asked.push(user), good));
+ expect(r.by).toBe("llm");
+ expect(asked[0]).toMatch(/Canvas: 1024 × 1024/);
+ expect((await planLayoutFromWords("a sale poster, 20% off", 1024, 1024, async () => "sorry")).by).toBe("rules");
+ setSetting("enhanceProvider", "none");
+ expect((await planLayoutFromWords("a sale poster", 1024, 1024, async () => good)).by).toBe("rules");
+ });
+
+ it("ships skills/layout-poster, which Assist's skill loader picks up with its reference and the Apache-2.0 notice", () => {
+ const s = skills.getSkill("layout-poster")!;
+ expect(s).toBeTruthy();
+ expect(s.source).toBe("builtin");
+ expect(s.files?.map((f) => f.path)).toContain("references/layout.md");
+ expect(skills.listSkills().some((x) => x.name === "layout-poster")).toBe(true);
+ const md = fs.readFileSync(path.join(process.cwd(), "skills/layout-poster/SKILL.md"), "utf8");
+ expect(md).toMatch(/Apache\s+License, Version 2\.0/);
+ expect(fs.readFileSync(path.join(process.cwd(), "skills/layout-poster/references/layout.md"), "utf8")).toMatch(/2b46b1e0e13b5aaec253879e0d006a42564b8b27/);
+ // The draft in its reference example is one the planner reads and validateLayout passes.
+ const example = /```json\n([\s\S]+?)```/.exec(fs.readFileSync(path.join(process.cwd(), "skills/layout-poster/references/layout.md"), "utf8"))![1];
+ expect(readPlanned(example, 768, 1024)?.items).toHaveLength(4);
+ });
+ });
+
+ // ---------------------------------------------------------------------------
+
+ describe("Assist: a generate job's layout", () => {
+ const pixel = (n: number) => ({
+ width: 896,
+ height: 1152,
+ bbox_coord_space: "abs",
+ bbox_format: "xyxy",
+ summary: { caption: "A sale poster", meta: ["poster"], canvas: "single" },
+ items: Array.from({ length: n }, (_, i) => ({ label: "text", caption: "Bold words", text: `Line ${i + 1}`, bbox: [16, 16 + (i % 60) * 16, 400, 30 + (i % 60) * 16] })),
+ });
+
+ it("runs in the nearest shape the model lists, and keeps at most 64 boxes", () => {
+ for (const id of ["flux-3", "ideogram-4-5"]) {
+ const r = tools.asRequest({ model_id: id, prompt: "A poster", layout: pixel(3) } as Parameters<typeof tools.asRequest>[0]);
+ const listed = getModel(id)!.options.aspectRatios!;
+ expect(listed, id).not.toContain("7:9");
+ expect(listed, id).toContain(r.params?.aspectRatio);
+ expect((r.params?.extra?.layout as LayoutDraft).aspect).toBe("7:9");
+ }
+ // An aspect the job names wins.
+ expect(tools.asRequest({ model_id: "flux-3", prompt: "x", layout: pixel(1), aspect_ratio: "1:1" } as Parameters<typeof tools.asRequest>[0]).params?.aspectRatio).toBe("1:1");
+ const many = tools.asRequest({ model_id: "flux-3", prompt: "x", layout: pixel(80) } as Parameters<typeof tools.asRequest>[0]);
+ expect((many.params?.extra?.layout as LayoutDraft).items).toHaveLength(64);
+ });
+ });
diff --cc tests/licences.test.ts
index 503a52e9,ae123257..72db2998
--- a/tests/licences.test.ts
+++ b/tests/licences.test.ts
@@@ -84,9 -84,9 +84,9 @@@ describe("licences", () =>
const list = buildLicenceList(MODELS, manifest.workflows);
expect(list.notices.find((n) => n.text === "Built with Llama")?.models).toEqual(["HiDream-I1 Dev"]);
expect(list.notices.find((n) => n.text === "Built with DINOv3")?.models.length).toBeGreaterThan(0);
- // TripoSplat (also inside Any Angle), Pixal3D and TRELLIS.2 (single and multi-view) encode with DINOv3; without them, no notice.
- expect(list.notices.find((n) => n.text === "Built with DINOv3")?.models).toEqual(expect.arrayContaining(["TripoSplat", "Pixal3D", "TRELLIS.2", "TRELLIS.2 Multi-view"]));
- const without = buildLicenceList(MODELS, manifest.workflows.filter((w) => !/triposplat|trellis2|pixal3d|any-angle/.test(w.id)));
- // TripoSplat, Idol 3D, Pixal3D and TRELLIS.2 (single and multi-view) encode with DINOv3; without them, no notice.
++ // TripoSplat (also inside Any Angle), Idol 3D, Pixal3D and TRELLIS.2 (single and multi-view) encode with DINOv3; without them, no notice.
+ expect(list.notices.find((n) => n.text === "Built with DINOv3")?.models).toEqual(expect.arrayContaining(["TripoSplat", "Idol 3D", "Pixal3D", "TRELLIS.2", "TRELLIS.2 Multi-view"]));
- const without = buildLicenceList(MODELS, manifest.workflows.filter((w) => !/triposplat|idol|trellis2|pixal3d/.test(w.id)));
++ const without = buildLicenceList(MODELS, manifest.workflows.filter((w) => !/triposplat|idol|trellis2|pixal3d|any-angle/.test(w.id)));
expect(without.notices.some((n) => n.text === "Built with DINOv3")).toBe(false);
});
diff --cc tests/lyrics.test.ts
index 00000000,e79f7cb4..b7a5f0e1
mode 000000,100644..100644
--- a/tests/lyrics.test.ts
+++ b/tests/lyrics.test.ts
@@@ -1,0 -1,102 +1,102 @@@
+ import { describe, expect, it } from "vitest";
+ import { insertTag, isInstrumental, lyricsOf, lyricsProblem, normalizeLyrics, parseLyrics, promptWithLyrics, songFromRun, songLength, structureOf, tagName, withSongId } from "@/lib/lyrics";
+ import { durationLabel } from "@/lib/composer";
+
-// nm10-music3: the lyrics editor's words and section tags, as every music model reads them.
++// The lyrics editor's words and section tags, as every music model reads them.
+ describe("lyrics with section tags", () => {
+ it("reads each tag with the lines under it, in title case, words after a tag moved below it", () => {
+ const text = "Intro hum\n[verse 1] Morning light\nacross the window\n\n[PRE CHORUS]\nhold on\n[chorus][Instrumental]";
+ expect(parseLyrics(text)).toEqual([
+ { tag: null, lines: ["Intro hum"] },
+ { tag: "Verse 1", lines: ["Morning light", "across the window"] },
+ { tag: "Pre-Chorus", lines: ["hold on"] },
+ { tag: "Chorus", lines: [] },
+ { tag: "Instrumental", lines: [] },
+ ]);
+ expect(structureOf(text)).toEqual(["Verse 1", "Pre-Chorus", "Chorus", "Instrumental"]);
+ });
+
+ it("writes one tag per line, the words below, a blank line between sections", () => {
+ expect(normalizeLyrics("[verse] Line one \r\nline two\n\n\n[chorus] sing it\n")).toBe("[Verse]\nLine one\nline two\n\n[Chorus]\nsing it");
+ expect(normalizeLyrics(" \n")).toBe("");
+ expect(normalizeLyrics(undefined)).toBe("");
+ expect(tagName("outro - final chord")).toBe("Outro - final chord");
+ expect(tagName("verse2")).toBe("Verse 2");
+ expect(tagName("hook")).toBe("Hook");
+ });
+
+ it("knows an instrumental from a song", () => {
+ expect(isInstrumental("")).toBe(true);
+ expect(isInstrumental("[Instrumental]")).toBe(true);
+ expect(isInstrumental("[Intro]\n[Solo]")).toBe(false);
+ expect(isInstrumental("[Instrumental]\n[Solo]")).toBe(true);
+ expect(isInstrumental("[Verse]\nla la")).toBe(false);
+ });
+
+ it("takes them from params.extra.lyrics, normalized", () => {
+ expect(lyricsOf({ lyrics: "[verse] hi" })).toBe("[Verse]\nhi");
+ expect(lyricsOf({ lyrics: 3 })).toBe("");
+ expect(lyricsOf(undefined)).toBe("");
+ });
+
+ it("says when they are longer than the model sings", () => {
+ expect(lyricsProblem("[Verse]\nshort", 3000)).toBeNull();
+ expect(lyricsProblem(`[Verse]\n${"la ".repeat(40)}`, 50, "Mureka Extend")).toMatch(/^Mureka Extend sings up to 50 characters of lyrics: these are \d+\./);
+ expect(lyricsProblem("x".repeat(9000), undefined)).toBeNull();
+ });
+
+ it("goes after the prompt for a model that reads both in one text (Lyria 3.5)", () => {
+ expect(promptWithLyrics("Indie pop, 96 BPM.", "[verse]\nhello")).toBe("Indie pop, 96 BPM.\n\nLyrics:\n[Verse]\nhello");
+ expect(promptWithLyrics("Ambient", "[Instrumental]")).toBe("Ambient. Instrumental, no vocals.");
+ expect(promptWithLyrics("Ambient", "")).toBe("Ambient");
+ });
+
+ it("puts a tag on a line of its own at the cursor, the cursor below it", () => {
+ expect(insertTag("", 0, "verse")).toEqual({ text: "[Verse]\n", cursor: 8 });
+ // At the end of a line: after it, a blank line between.
+ const a = insertTag("hello there", 5, "chorus");
+ expect(a.text).toBe("hello there\n\n[Chorus]\n");
+ expect(a.cursor).toBe(a.text.length);
+ // At the start of a line: before it.
+ const b = insertTag("one\ntwo", 4, "Bridge");
+ expect(b.text).toBe("one\n\n[Bridge]\n\ntwo");
+ expect(b.text.slice(b.cursor)).toBe("\ntwo");
+ expect(insertTag("words", 0, "Intro").text).toBe("[Intro]\n\nwords");
+ });
+
+ it("reads lengths as a song does", () => {
+ expect(songLength(300)).toBe("5:00");
+ expect(songLength(95)).toBe("1:35");
+ expect(durationLabel(10)).toBe("10s");
+ expect(durationLabel(120)).toBe("2:00");
+ expect(durationLabel(270)).toBe("4:30");
+ });
+ });
+
+ describe("a song's Mureka id on Reuse", () => {
+ it("comes back as the attached song's id, out of the settings, with the lyrics in the editor", () => {
+ const r = songFromRun({ lyrics: "[Verse]\nmore", songId: "song_1", extend_type: "tail" }, "/api/files/a.mp3");
+ expect(r).toEqual({ extra: { extend_type: "tail" }, lyrics: "[Verse]\nmore", song: { id: "song_1", url: "/api/files/a.mp3" } });
+ expect(songFromRun({ songId: "song_1" }, undefined)).toEqual({ extra: undefined });
+ expect(songFromRun({ seed: 1 }, "/api/files/a.mp3")).toEqual({ extra: { seed: 1 } });
+ });
+
+ it("goes with the song it names only: a song swapped in, or a stale id, is sent as the file", () => {
+ const song = { id: "song_1", url: "/api/files/a.mp3" };
+ expect(withSongId({ lyrics: "x" }, song, "/api/files/a.mp3", true)).toEqual({ lyrics: "x", songId: "song_1" });
+ expect(withSongId({ lyrics: "x", songId: "song_1" }, song, "/api/files/b.mp3", true)).toEqual({ lyrics: "x" });
+ expect(withSongId({ songId: "song_1" }, undefined, "/api/files/b.mp3", true)).toBeUndefined();
+ // A model that isn't Mureka's never gets one.
+ expect(withSongId({ lyrics: "x" }, song, "/api/files/a.mp3", false)).toEqual({ lyrics: "x" });
+ });
+ });
+
+ describe("written lyrics cut to a model's limit", () => {
+ it("at the last line break before it, or at the limit when there is none", async () => {
+ const { trimLyrics } = await import("@/server/enhance");
+ expect(trimLyrics("[Verse]\nabc def\nghi jkl", 16)).toBe("[Verse]\nabc def");
+ const one = `[Verse]\n${"a".repeat(50)}`;
+ expect(trimLyrics(one.replace("\n", " "), 20).length).toBeLessThanOrEqual(20);
+ expect(trimLyrics("x".repeat(40), 10)).toBe("x".repeat(10));
+ });
+ });
diff --cc tests/marketing-api.test.ts
index 8d8ac5d2,9d051032..3835de00
--- a/tests/marketing-api.test.ts
+++ b/tests/marketing-api.test.ts
@@@ -634,7 -634,9 +634,9 @@@ describe("Ads Studio", () =>
// In the cloud Nano Banana Pro and GPT Image 2.5 stay choices; a model the studio doesn't offer runs the Original.
expect((await (await adsEstimate.POST(json("POST", { brandId, engine: "cloud", items }))).json()).modelId).toBe("fuobe-marketing-image");
expect((await (await adsEstimate.POST(json("POST", { brandId, engine: "cloud", items, modelId: "nano-banana-pro" }))).json()).modelId).toBe("nano-banana-pro");
- expect((await (await adsEstimate.POST(json("POST", { brandId, engine: "cloud", items, modelId: "flux-3" }))).json()).modelId).toBe("fuobe-marketing-image");
+ expect((await (await adsEstimate.POST(json("POST", { brandId, engine: "cloud", items, modelId: "recraft-4-1" }))).json()).modelId).toBe("fuobe-marketing-image");
- // FLUX.3 is a choice too (N7-8): it reads a "keep clear" layout that keeps the product out of the words' space.
++ // FLUX.3 is a choice too: it reads a "keep clear" layout that keeps the product out of the words' space.
+ expect((await (await adsEstimate.POST(json("POST", { brandId, engine: "cloud", items, modelId: "flux-3" }))).json()).modelId).toBe("flux-3");
const { batchId, creatives, run } = ads.createBatch({ brandId, engine: "open", items });
expect(creatives).toHaveLength(5);
expect(creatives.every((c) => c.status === "writing")).toBe(true);
diff --cc tests/model-access-listings.test.ts
index 972f9503,8e05a787..2b1aa9bc
--- a/tests/model-access-listings.test.ts
+++ b/tests/model-access-listings.test.ts
@@@ -97,10 -97,10 +97,10 @@@ describe("Models & licences in listing
// The library's 118 LoRAs (Fuobe Try-On's try-on LoRA, the Storyboard's next-scene LoRA, and since O11 Fuobe Angles'
// Multiple-angles and Fuobe Speak's FusioniX among them), the preset LoRA map's files that aren't library files, and
// MiniMax H3's four (Akatz Labs' swap LoRA V1.5 and V1 and Person Remover V1, lightx2v's H3 Turbo), and Fuobe Restore's
- // two gated IC-LoRAs (Lightricks' Restore and Detail Refine), and Open-H3 Regenerate's merged refiner LoRA, each once. Qwen-Image 2.1's three speed LoRAs and its Next-Scene LoRA
- // (nm10-qwen21-fast) are four more, the QMA camera-angles LoRA (qma-angles) one more, and Fuobe Animation's AniSora 3.2
- // and lightx2v 4-step low-noise LoRAs (inbetweening) two more.
- expect(list.loras.length).toBe(184);
+ // two gated IC-LoRAs (Lightricks' Restore and Detail Refine), Open-H3 Regenerate's merged refiner LoRA, and Any Angle's
+ // AnyAngle LoRA for Qwen-Image 2.1, each once. Qwen-Image 2.1's three speed LoRAs and its Next-Scene LoRA are four more,
- // and the QMA camera-angles LoRA one more.
- expect(list.loras.length).toBe(183);
++ // the QMA camera-angles LoRA one more, and Fuobe Animation's AniSora 3.2 and lightx2v 4-step low-noise LoRAs two more.
++ expect(list.loras.length).toBe(185);
expect(list.loras.find((l) => l.file === "open_h3_regenerate_2k_lora.safetensors")).toMatchObject({ group: "adapter", base: "MiniMax H3", on: true, licence: { name: "MiniMax H3 Community License", class: "regions" } });
expect(list.packs.find((p) => p.name === "ComfyUI-Open-H3-Regenerate")).toMatchObject({ licence: { name: "Apache-2.0" }, on: true, models: 1 });
expect(list.packs.find((p) => p.name === "Comfyui_Minimax_h3_latent_Upscaler")).toMatchObject({ licence: { name: "MIT" }, on: true, models: 1 });
diff --cc tests/music3-cloud.test.ts
index 00000000,3779c502..0f8a559d
mode 000000,100644..100644
--- a/tests/music3-cloud.test.ts
+++ b/tests/music3-cloud.test.ts
@@@ -1,0 -1,283 +1,283 @@@
+ /**
- * nm10-music3 in the cloud: MiniMax Music 3 (the open model, hosted on fal), Mureka 9 / 9.5 songs and instrumentals,
++ * Full songs in the cloud: MiniMax Music 3 (the open model, hosted on fal), Mureka 9 / 9.5 songs and instrumentals,
+ * ElevenLabs Music v2.5 and Lyria 3.5, and Mureka's song tools (extend, remix, stems): payloads built from the research
+ * records, prices as fal's pages state them (2026-11-01), lyrics in each model's own form.
+ */
+ import fs from "node:fs";
+ import { describe, expect, it } from "vitest";
+ import { getModel, getPreset } from "@/lib/catalog";
+ import { buildPayload, extractOutputs } from "@/lib/catalog/payload";
+ import { estimateCost, planGeneration } from "@/lib/catalog/plan";
+ import type { GenerationRequest, ModelRoute, Operation } from "@/lib/catalog/types";
+ import { nextSteps, outputActions } from "@/lib/output-actions";
+ import { downloadName } from "@/lib/library";
+ import { songFormat, songToolProblem } from "@/lib/lyrics";
+ import { migrateRequest } from "@/lib/catalog/replaced";
+ import type { Generation } from "@/lib/catalog/types";
+
+ const route = (id: string, op?: Operation): ModelRoute => {
+ const r = getModel(id)?.routes.find((x) => !op || x.op === op);
+ if (!r?.map) throw new Error(`${id} has no ${op ?? ""} route`);
+ return r;
+ };
+ const payload = (id: string, input: Record<string, unknown>) => buildPayload(route(id).map!, { prompt: "", ...input } as never);
+ const plan = (req: Omit<GenerationRequest, "feature">) => planGeneration({ feature: "audio", ...req }, getModel, getPreset);
+ const planError = (req: Omit<GenerationRequest, "feature">) => {
+ try {
+ plan(req);
+ return null;
+ } catch (e) {
+ return (e as Error).message;
+ }
+ };
+ const cost = (id: string, params: Record<string, unknown> = {}, op: Operation = "music") => estimateCost(getModel(id)!, params, 1, op);
+
+ const research = JSON.parse(fs.readFileSync("docs/research/new-models-10.json", "utf8")) as { endpointRecords: { endpoint: string; inputs: Record<string, { required?: boolean }>; license?: string; status: string }[] };
+ const record = (ep: string) => research.endpointRecords.find((e) => e.endpoint === ep)!;
+
+ describe("the research records", () => {
+ it("hold every endpoint the cloud models call, read from fal on 11-01, with each one's licence or terms", () => {
+ for (const ep of ["minimax/music-3", "mureka/v9.5/generate/song", "mureka/v9/generate/song", "mureka/v9/generate/instrumental", "mureka/v8/song/extend", "mureka/v8/song/remix", "mureka/api/song/stem", "mureka/api/files/upload", "elevenlabs/music/v2.5", "google/lyria-3.5"]) {
+ const r = record(ep);
+ expect(r, ep).toBeTruthy();
+ expect(r.status, ep).toBe("active");
+ expect(r.license, ep).toBeTruthy();
+ }
+ // MiniMax Music 3's own licence and the Comfy-Org repack's tag are both on record.
+ expect(record("minimax/music-3").license).toMatch(/MiniMax-Music3 Community License.*Apache-2\.0/s);
+ });
+ });
+
+ describe("MiniMax Music 3 on fal (minimax-music-3)", () => {
+ it("is the open model's cloud line, with its licence as information", () => {
+ const m = getModel("minimax-music-3")!;
+ expect(m.name).toBe("MiniMax Music 3 · both engines");
+ expect(m.engine).toBe("cloud");
+ expect(m.licence?.licence).toBe("MiniMax-Music3 Community License");
+ expect(m.options.durations).toContain(300);
+ expect(getModel("oss-minimax-music-3")?.engine).toBe("open");
+ });
+
+ it("sends the style, the lyrics with their tags on lines of their own, the length and the seed", () => {
+ expect(payload("minimax-music-3", { prompt: "Acoustic pop, 96 BPM", duration: 180, seed: 7, extra: { lyrics: "[verse] Morning light\n[chorus]\nsing" } })).toEqual({
+ prompt: "Acoustic pop, 96 BPM",
+ lyrics: "[Verse]\nMorning light\n\n[Chorus]\nsing",
+ duration: 180,
+ seed: 7,
+ });
+ // Its lyrics are required: a run with none asks for an instrumental (so the lyrics stay optional in Fuobe).
+ expect(payload("minimax-music-3", { prompt: "Lo-fi" })).toEqual({ prompt: "Lo-fi", lyrics: "[instrumental]" });
+ expect(getModel("minimax-music-3")!.options.lyrics?.required).toBeUndefined();
+ expect(plan({ modelId: "minimax-music-3", prompt: "Lo-fi" }).op).toBe("music");
+ });
+
+ it("costs $0.002 a second of the length asked for", () => {
+ expect(cost("minimax-music-3", { duration: 300 })).toBe(0.6);
+ expect(cost("minimax-music-3")).toBe(0.24);
+ });
+ });
+
+ describe("Mureka 9 / 9.5", () => {
+ it("Mureka 9.5 runs on its own route: lyrics, a length of 2 to 5 minutes, no Version", () => {
+ expect(route("mureka-song").endpoint).toBe("mureka/v9.5/generate/song");
+ expect(payload("mureka-song", { prompt: "Synth pop", duration: 240, extra: { lyrics: "[Verse]\nhi", model: "mureka-8" } })).toEqual({ prompt: "Synth pop", lyrics: "[Verse]\nhi", duration: 240 });
+ expect(getModel("mureka-song")!.options.durations).toEqual([120, 180, 240, 300]);
+ });
+
+ it("prices a song by whether it brings its lyrics", () => {
+ expect(cost("mureka-song")).toBe(0.5);
+ expect(cost("mureka-song", { extra: { lyrics: "[Verse]\nhello" } })).toBe(0.15);
+ expect(cost("mureka-9")).toBe(0.3);
+ expect(cost("mureka-9", { extra: { lyrics: "[Verse]\nhello" } })).toBe(0.045);
+ expect(cost("mureka-9-instrumental")).toBe(0.045);
+ expect(route("mureka-9").endpoint).toBe("mureka/v9/generate/song");
+ expect(payload("mureka-9-instrumental", { prompt: "Calm piano bed", extra: { lyrics: "[Verse]\nx" } })).toEqual({ prompt: "Calm piano bed" });
+ });
+
+ it("keeps the song's id on the result, for its song tools", () => {
+ const out = extractOutputs({ audio: { url: "https://v3.fal.media/x.mp3", content_type: "audio/mpeg" }, song_id: "song_123", duration: 180000 }, "music");
+ expect(out).toHaveLength(1);
+ expect(out[0].meta).toMatchObject({ songId: "song_123" });
+ });
+ });
+
+ describe("Mureka's versions", () => {
+ it("Mureka 9.5 Instrumental: a description, $0.15 a track", () => {
+ expect(payload("mureka-9-5-instrumental", { prompt: "Warm lo-fi bed" })).toEqual({ prompt: "Warm lo-fi bed" });
+ expect(cost("mureka-9-5-instrumental")).toBe(0.15);
+ });
+
+ it("Mureka 8, O2 and 7.6 stay on the versioned route, the Version always sent", () => {
+ expect(route("mureka-8").endpoint).toBe("mureka/api/generate/song");
+ expect(payload("mureka-8", { prompt: "pop" })).toEqual({ prompt: "pop", model: "mureka-8" });
+ expect(payload("mureka-8", { prompt: "pop", duration: 180, extra: { model: "mureka-7.6", lyrics: "[Verse]\nla" } })).toEqual({ prompt: "pop", model: "mureka-7.6", lyrics: "[Verse]\nla" });
+ expect(cost("mureka-8")).toBe(0.3);
+ expect(cost("mureka-8", { extra: { lyrics: "[Verse]\nla" } })).toBe(0.045);
+ });
+
+ it("a song saved with its Version runs that version again", () => {
+ const saved = (model: string) => migrateRequest({ modelId: "mureka-song", prompt: "pop", params: { duration: 180, extra: { model, seed: 3 } } });
+ expect(saved("mureka-9")).toEqual({ request: { modelId: "mureka-9", prompt: "pop", params: { duration: 180, extra: { seed: 3 } } } });
+ expect(saved("mureka-9.5")).toEqual({ request: { modelId: "mureka-song", prompt: "pop", params: { duration: 180, extra: { seed: 3 } } } });
+ expect(saved("mureka-7.6").request).toMatchObject({ modelId: "mureka-8", params: { extra: { model: "mureka-7.6" } } });
+ expect(saved("mureka-o2").request.modelId).toBe("mureka-8");
+ expect(migrateRequest({ modelId: "mureka-song", params: { extra: { model: "mureka-9" } } }).request).toEqual({ modelId: "mureka-9", params: {} });
+ // Today's runs are left as they are.
+ const now = { modelId: "mureka-song", prompt: "pop" };
+ expect(migrateRequest(now).request).toBe(now);
+ });
+
+ it("a Mureka song sings words: an instrumental is its instrumental model", () => {
+ expect(planError({ modelId: "mureka-song", prompt: "pop", params: { extra: { lyrics: "[Instrumental]" } } })).toBe("Mureka 9.5 sings the lyrics you write: for an instrumental, pick Mureka 9.5 Instrumental");
+ expect(planError({ modelId: "mureka-9", prompt: "pop", params: { extra: { lyrics: "[Instrumental]" } } })).toBe("Mureka 9 sings the lyrics you write: for an instrumental, pick Mureka 9 Instrumental");
+ expect(getModel("mureka-song")!.options.lyrics).toEqual({ max: 5000, instrumentalModel: "mureka-9-5-instrumental" });
+ });
+
+ it("MiniMax Music 2.5 makes an instrumental by its own switch, with no words written for it", () => {
+ expect(payload("minimax-music-2-5", { prompt: "lo-fi", extra: { lyrics: "[Instrumental]" } })).toEqual({ prompt: "lo-fi", is_instrumental: true, lyrics_optimizer: false });
+ expect(payload("minimax-music-2-5", { prompt: "lo-fi", extra: { lyrics: "[Verse]\nla" } })).toEqual({ prompt: "lo-fi", lyrics: "[Verse]\nla", lyrics_optimizer: true });
+ });
+ });
+
+ describe("ElevenLabs Music v2.5 and Lyria 3.5", () => {
+ it("ElevenLabs takes a length in milliseconds and bills each started minute", () => {
+ expect(payload("elevenlabs-music-2-5", { prompt: "Synthwave", duration: 90, seed: 3 })).toEqual({ prompt: "Synthwave", music_length_ms: 90000 });
+ expect(cost("elevenlabs-music-2-5", { duration: 30 })).toBe(0.6);
+ expect(cost("elevenlabs-music-2-5", { duration: 90 })).toBe(1.2);
+ expect(getModel("elevenlabs-music-2-5")!.options.lyrics).toBeUndefined();
+ });
+
+ it("Lyria 3.5 counts the description and the lyrics together against its 5,000 characters", () => {
+ const lyrics = `[Verse]\n${"la la la la\n".repeat(380)}`.trim();
+ expect(plan({ modelId: "lyria-3-5", prompt: "x".repeat(200), params: { extra: { lyrics } } }).op).toBe("music");
+ expect(planError({ modelId: "lyria-3-5", prompt: "x".repeat(510), params: { extra: { lyrics } } })).toMatch(/^Lyria 3\.5 reads up to 5,000 characters of description and lyrics together: these are 5,\d{3}\. Shorten them or drop a verse$/);
+ });
+
+ it("Lyria 3.5 reads the lyrics after the description, takes a picture, and has no negative prompt", () => {
+ expect(payload("lyria-3-5", { prompt: "Uplifting pop, 120 BPM", images: ["https://x/p.png"], extra: { lyrics: "[chorus] rise up" } })).toEqual({
+ prompt: "Uplifting pop, 120 BPM.\n\nLyrics:\n[Chorus]\nrise up",
+ image_url: "https://x/p.png",
+ });
+ expect(getModel("lyria-3-5")!.options.negativePrompt).toBeUndefined();
+ expect(cost("lyria-3-5")).toBe(0.1);
+ });
+ });
+
+ describe("Mureka's song tools", () => {
+ it("extend: one of Mureka's own songs by its id, the new part's lyrics, where it starts in whole milliseconds", () => {
+ const sent = payload("mureka-extend", { audio: "https://x/song.mp3", startTime: 183.4567, extra: { lyrics: "[verse] more", songId: "song_9", extend_type: "tail" } });
+ expect(sent).toEqual({ song_id: "song_9", lyrics: "[Verse]\nmore", extend_at: 183457, extend_type: "tail" });
+ // Any other song: no id here, the fal provider sends it first through Mureka's files/upload (purpose "audio").
+ const other = payload("mureka-extend", { audio: "https://x/song.mp3", startTime: 10, extra: { lyrics: "[Verse]\nmore" } });
+ expect(other).toEqual({ lyrics: "[Verse]\nmore", extend_at: 10000 });
+ expect(route("mureka-extend").map!.songSource).toEqual({ songId: "song_id", uploadId: "upload_audio_id", upload: { endpoint: "mureka/api/files/upload", purpose: "audio" } });
+ expect(route("mureka-remix").map!.songSource?.upload.purpose).toBe("remix");
+ });
+
+ it("prices the upload a song that isn't Mureka's needs", () => {
+ expect(cost("mureka-extend", { extra: { songId: "song_9" } }, "song-extend")).toBe(0.004);
+ expect(cost("mureka-extend", {}, "song-extend")).toBe(0.014);
+ expect(cost("mureka-remix", {}, "song-remix")).toBe(0.21);
+ expect(cost("mureka-stems", {}, "song-stems")).toBe(0.2);
+ });
+
+ it("remix takes a style and the whole song's lyrics; stems take the song's address", () => {
+ expect(payload("mureka-remix", { prompt: "Jazz trio", extra: { lyrics: "[Verse]\nla", songId: "s1" } })).toEqual({ prompt: "Jazz trio", lyrics: "[Verse]\nla", song_id: "s1" });
+ expect(payload("mureka-stems", { audio: "https://x/song.mp3" })).toEqual({ audio_url: "https://x/song.mp3" });
+ });
+
+ it("plans each tool with what it needs, in plain words", () => {
+ const song = { audio: "/api/files/song.mp3" };
+ expect(planError({ modelId: "mureka-extend", inputs: song })).toBe("Write the lyrics of the new part");
+ expect(planError({ modelId: "mureka-extend", inputs: {}, params: { extra: { lyrics: "[Verse]\nx" } } })).toBe("Add the song to extend");
+ expect(planError({ modelId: "mureka-remix", inputs: song, params: { extra: { lyrics: "[Verse]\nx" } } })).toBe("Describe the remix: its genre, mood and instruments");
+ expect(planError({ modelId: "mureka-remix", prompt: "jazz", inputs: song })).toMatch(/^Write the remix's lyrics/);
+ expect(plan({ modelId: "mureka-stems", inputs: song }).op).toBe("song-stems");
+ expect(plan({ modelId: "mureka-extend", inputs: song, params: { extra: { lyrics: "[verse] x" } } }).params.extra).toEqual({ lyrics: "[Verse]\nx" });
+ });
+ });
+
+ describe("lyrics in the plan", () => {
+ it("normalizes them for a model that sings, refuses ones too long, and leaves them out for one that doesn't", () => {
+ expect(plan({ modelId: "minimax-music-3", prompt: "pop", params: { extra: { lyrics: "[verse] a" } } }).params.extra).toEqual({ lyrics: "[Verse]\na" });
+ expect(planError({ modelId: "mureka-extend", inputs: { audio: "/api/files/s.mp3" }, params: { extra: { lyrics: `[Verse]\n${"la ".repeat(1100)}` } } })).toMatch(/^Mureka Extend sings up to 3,000 characters/);
+ const sonilo = plan({ modelId: "sonilo-music", prompt: "beat", params: { duration: 30, extra: { lyrics: "[Verse]\nwords" } } });
+ expect(sonilo.params.extra).toBeUndefined();
+ expect(sonilo.notes?.[0]).toMatch(/writes its own words/);
+ // An instrumental bed (Faceless) on a model that doesn't sing: quietly left out.
+ expect(plan({ modelId: "sonilo-music", prompt: "beat", params: { duration: 30, extra: { lyrics: "[Instrumental]" } } }).notes).toBeUndefined();
+ });
+
+ it("YuE2 sings lyrics only, and covers a song; other models refuse a song to cover", () => {
+ expect(planError({ modelId: "oss-yue2", prompt: "pop" })).toMatch(/^YuE2 sings your lyrics/);
+ expect(planError({ modelId: "oss-yue2", prompt: "pop", params: { extra: { lyrics: "[Instrumental]" } } })).toMatch(/^YuE2 sings your lyrics/);
+ expect(plan({ modelId: "oss-yue2", prompt: "pop", inputs: { audio: "/api/files/s.mp3" }, params: { extra: { lyrics: "[Verse]\nla" } } }).op).toBe("music");
+ expect(planError({ modelId: "oss-minimax-music-3", prompt: "pop", inputs: { audio: "/api/files/s.mp3" } })).toBe("MiniMax Music 3 makes a new song: remove the song you added, or pick YuE2 to cover it");
+ });
+ });
+
+ describe("a music result's song tools", () => {
+ const gen = (o: Partial<Generation> = {}, meta: Record<string, unknown> = {}): Generation =>
+ ({ id: "g1", status: "succeeded", op: "music", feature: "audio", modelId: "mureka-song", request: { feature: "audio", modelId: "mureka-song" }, outputs: [{ url: "/api/files/song.mp3", kind: "audio", meta }], createdAt: 0, ...o }) as unknown as Generation;
+ const ids = (g: Generation, engineMode?: "both" | "open" | "cloud") => outputActions(g, 0, { engineMode }).filter((a) => ["extend-song", "remix-song", "song-stems"].includes(a.id));
+
+ it("Extend song, Remix and Stems open Extend & remix with the song (and Mureka's id for its own)", () => {
+ const acts = ids(gen({}, { songId: "song_1" }));
+ expect(acts.map((a) => a.label)).toEqual(["Extend song", "Remix", "Stems"]);
+ expect(acts[0].href).toBe("/audio/song?model=mureka-extend&audio=%2Fapi%2Ffiles%2Fsong.mp3&song=song_1");
+ expect(acts[2].href).toBe("/audio/song?model=mureka-stems&audio=%2Fapi%2Ffiles%2Fsong.mp3");
+ // Any song made in Fuobe (a song from your GPU too): sent to Mureka first, with its lyrics for the remix.
+ const sung = gen({ modelId: "oss-minimax-music-3", request: { feature: "audio", modelId: "oss-minimax-music-3", params: { extra: { lyrics: "[Verse]\nla la" } } } });
+ expect(ids(sung)[1].href).toBe("/audio/song?model=mureka-remix&audio=%2Fapi%2Ffiles%2Fsong.mp3&lyrics=%5BVerse%5D%0Ala%20la");
+ });
+
+ it("Remix only on a song with vocals; Stems only on an MP3 or M4A song", () => {
+ const labels = (g: Generation) => ids(g).map((a) => a.label);
+ // Instrumentals: Mureka's instrumental model, lyrics that are only [Instrumental], a model's own with no words.
+ expect(labels(gen({ modelId: "mureka-9-instrumental" }))).toEqual(["Extend song", "Stems"]);
+ expect(labels(gen({ modelId: "mureka-9-5-instrumental" }))).toEqual(["Extend song", "Stems"]);
+ expect(labels(gen({ request: { feature: "audio", modelId: "mureka-song", params: { extra: { lyrics: "[Instrumental]" } } } }))).toEqual(["Extend song", "Stems"]);
+ expect(labels(gen({ modelId: "minimax-music-3" }))).toEqual(["Extend song", "Stems"]);
+ expect(labels(gen({ modelId: "oss-ace-step" }))).toEqual(["Extend song", "Stems"]);
+ // A song Mureka writes words for from a description keeps Remix.
+ expect(labels(gen())).toEqual(["Extend song", "Remix", "Stems"]);
+ // An extension: its run's lyrics are the new part's only, so Remix stays and carries none.
+ const extended = gen({ op: "song-extend", modelId: "mureka-extend", request: { feature: "song-tools", modelId: "mureka-extend", params: { extra: { lyrics: "[Instrumental]" } } } });
+ expect(ids(extended).find((a) => a.id === "remix-song")!.href).toBe("/audio/song?model=mureka-remix&audio=%2Fapi%2Ffiles%2Fsong.mp3");
+ // A WAV song (fal's MiniMax Music 3 answers with one): no Stems.
+ const wav = { ...gen({ request: { feature: "audio", modelId: "minimax-music-3", params: { extra: { lyrics: "[Verse]\nla" } } } }), outputs: [{ url: "/api/files/song.wav", kind: "audio", contentType: "audio/wav" }] } as unknown as Generation;
+ expect(labels(wav)).toEqual(["Extend song", "Remix"]);
+ expect(nextSteps(wav, 0).map((a) => a.label)).toEqual(["Extend song", "Remix", "Split soundtrack"]);
+ });
+
+ it("says in plain words which songs the tools take", () => {
+ expect(songFormat("audio/mpeg", "x")).toBe("mp3");
+ expect(songFormat(undefined, "/api/files/a/song.M4A?x=1")).toBe("m4a");
+ expect(songFormat(undefined, "/api/files/abc")).toBeUndefined();
+ expect(songToolProblem("song-stems", { format: "flac" })).toBe("Stems take an MP3 or M4A song: this one is a FLAC file. Save it as an MP3 and add it again");
+ expect(songToolProblem("song-stems", { format: "mp3", bytes: 9_000_000 })).toBeNull();
+ expect(songToolProblem("song-remix", { seconds: 351 })).toBe("Remix takes a song of 0:10 to 5:50: this one is 5:51");
+ expect(songToolProblem("song-remix", { seconds: 120, format: "wav" })).toBeNull();
+ expect(songToolProblem("song-extend", { seconds: 900, format: "wav" })).toBeNull();
+ // The remix of an instrumental is refused in the plan.
+ expect(planError({ modelId: "mureka-remix", prompt: "jazz", inputs: { audio: "/api/files/s.mp3" }, params: { extra: { lyrics: "[Instrumental]" } } })).toMatch(/^Write the remix's lyrics.*not instrumentals\)$/);
+ });
+
+ it("names a stem's card and download for its track", () => {
+ const g = { ...gen({ op: "song-stems" }), outputs: [{ url: "/api/files/a.mp3", kind: "audio", meta: { stem: "vocals" } }, { url: "/api/files/b.mp3", kind: "audio", meta: { stem: "bass guitar" } }] } as unknown as Generation;
+ expect(downloadName(g, g.outputs[0], 0)).toMatch(/-g1-vocals\.mp3$/);
+ expect(downloadName(g, g.outputs[1], 1)).toMatch(/-g1-bass-guitar\.mp3$/);
+ });
+
+ it("are a song's next steps", () => {
+ expect(nextSteps(gen(), 0).map((a) => a.label)).toEqual(["Extend song", "Remix", "Stems"]);
+ expect(nextSteps(gen(), 0, 3, { engineMode: "open" }).map((a) => a.id)).toEqual(["lipsync", "voice-change", "split-soundtrack"]);
+ });
+
+ it("not on sound effects or speech, nor on an install that runs open models only", () => {
+ expect(ids(gen({ op: "sfx" }))).toEqual([]);
+ expect(ids(gen({ op: "tts" }))).toEqual([]);
+ expect(ids(gen(), "open")).toEqual([]);
+ expect(ids(gen({ op: "song-remix" }))).toHaveLength(3);
+ });
+ });
diff --cc tests/music3-faceless.test.ts
index 00000000,08f3f2c5..1885bf49
mode 000000,100644..100644
--- a/tests/music3-faceless.test.ts
+++ b/tests/music3-faceless.test.ts
@@@ -1,0 -1,50 +1,50 @@@
+ import { describe, expect, it } from "vitest";
+ import { getModel } from "@/lib/catalog";
+ import { buildEpisodeGraph, defaultSettings, genreInfo, MUSIC_MAX, pickerData, resolveModels, secondsFor, type EpisodeSettings, type ScriptBlock } from "@/lib/catalog/faceless";
+
-// nm10-music3: Faceless and Explainer's music bed can be MiniMax Music 3 (either engine) or ElevenLabs Music
++// Faceless and Explainer's music bed can be MiniMax Music 3 (either engine) or ElevenLabs Music
+ // v2.5 in the cloud, beside Sonilo and ACE-Step; each says the longest bed it makes.
+ const block = (i: number, words = 20): ScriptBlock => {
+ const narration = Array.from({ length: words }, (_, w) => `w${i}x${w}`).join(" ");
+ return { id: `b${i}`, narration, visual: `Scene ${i}`, motion: "slow push-in", seconds: secondsFor(narration) };
+ };
+ const settings = (s: Partial<EpisodeSettings>) => ({ ...defaultSettings(s.engine ?? "cloud", genreInfo("education")), ...s });
+ const graph = (s: Partial<EpisodeSettings>) =>
+ buildEpisodeGraph({ feature: "faceless", title: "Tides", genre: genreInfo("education"), settings: settings(s), blocks: [block(1), block(2)], fallbackVoice: "/api/files/uploads/demo-voice.wav" }, getModel);
+ const musicStep = (s: Partial<EpisodeSettings>) => graph(s).find((x) => x.key === "music")!;
+
+ describe("the music bed's model", () => {
+ it("lists each engine's choices with the longest bed each makes", () => {
+ const picks = pickerData(getModel).musicModels!;
+ expect(picks.filter((m) => m.engine === "cloud").map((m) => [m.id, m.name, m.maxSeconds])).toEqual([
+ ["sonilo-music", "Sonilo Music 1.1", 600],
+ ["minimax-music-3", "MiniMax Music 3", 300],
+ ["elevenlabs-music-2-5", "ElevenLabs Music v2.5", 600],
+ ]);
+ expect(picks.filter((m) => m.engine === "open").map((m) => [m.id, m.maxSeconds])).toEqual([
+ ["oss-ace-step", 240],
+ ["oss-minimax-music-3", 300],
+ ]);
+ expect(MUSIC_MAX["oss-minimax-music-3"]).toBe(300);
+ });
+
+ it("runs the one picked on its engine, else the engine's default", () => {
+ expect(resolveModels(settings({ musicModel: "minimax-music-3" }), 100, getModel).music).toBe("minimax-music-3");
+ expect(resolveModels(settings({ engine: "open", musicModel: "oss-minimax-music-3" }), 100, getModel).music).toBe("oss-minimax-music-3");
+ // A pick from the other engine (a channel moved to your GPU) falls back.
+ expect(resolveModels(settings({ engine: "open", musicModel: "minimax-music-3" }), 100, getModel).music).toBe("oss-ace-step");
+ expect(resolveModels(settings({ music: false, musicModel: "minimax-music-3" }), 100, getModel).music).toBeNull();
+ });
+
+ it("keeps the pick when the settings are saved", async () => {
+ const { SettingsSchema } = await import("@/server/faceless");
+ expect(SettingsSchema.parse(settings({ musicModel: "minimax-music-3" })).musicModel).toBe("minimax-music-3");
+ });
+
+ it("asks a model that sings for an instrumental bed", () => {
+ expect(musicStep({ musicModel: "minimax-music-3" }).request).toMatchObject({ modelId: "minimax-music-3", op: "music", params: { extra: { lyrics: "[Instrumental]" } } });
+ expect(musicStep({ engine: "open", musicModel: "oss-minimax-music-3" }).request.params?.extra).toEqual({ lyrics: "[Instrumental]" });
+ expect(musicStep({}).request.params?.extra).toBeUndefined();
+ expect(musicStep({ musicModel: "elevenlabs-music-2-5" }).request.params?.extra).toBeUndefined();
+ });
+ });
diff --cc tests/music3-hosted.test.ts
index 00000000,f2ec7ed9..a5cf6e06
mode 000000,100644..100644
--- a/tests/music3-hosted.test.ts
+++ b/tests/music3-hosted.test.ts
@@@ -1,0 -1,82 +1,82 @@@
+ import fs from "node:fs";
+ import http from "node:http";
+ import os from "node:os";
+ import path from "node:path";
+ import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
+ import { listenInRange, startFakeBilling, type FakeBilling } from "./helpers/fake-billing";
+ import { startFakeComfy, type FakeComfy } from "./helpers/fake-comfy-runner";
+
-// nm10-music3 under public sign-up: an account's song on this install's GPUs (hosted runs) plans and prices as any studio run
++// Full songs under public sign-up: an account's song on this install's GPUs (hosted runs) plans and prices as any studio run
+ // (MiniMax Music 3 and YuE2 are open models on core nodes); a model that needs words is refused before anything is
+ // priced or held.
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-music3-hosted-"));
+ process.env.FUOBE_DATA_DIR = dir;
+ process.env.FUOBE_PUBLIC_SIGNUP = "1";
+ delete process.env.FUOBE_PASSWORD;
+ delete process.env.FUOBE_HOSTED_RUNS;
+ delete process.env.FUOBE_BILLING_URL;
+ delete process.env.FUOBE_MODERATION_URL;
+ globalThis.__fuobeTestDiskFree = 1e13;
+
+ const probe = http.createServer();
+ const comfyPort = await listenInRange(probe);
+ await new Promise<void>((r) => probe.close(() => r()));
+ const comfy: FakeComfy = await startFakeComfy({ output: "image", delayMs: 0 }, comfyPort);
+ process.env.COMFYUI_URL = comfy.url;
+
+ const auth = await import("@/server/auth");
+ const generationsRoute = await import("@/app/api/generations/route");
+ const { resetRates } = await import("@/server/rate");
+ const billing = await import("@/server/billing");
+
+ let fake: FakeBilling;
+ let cookie = "";
+ beforeAll(async () => {
+ fake = await startFakeBilling();
+ auth.setPassword("install password");
+ const a = auth.createAccount("[email protected]", "long enough").id;
+ cookie = `${auth.SESSION_COOKIE}=${auth.createSession(a).value}`;
+ });
+ afterAll(async () => {
+ globalThis.__fuobeTestDiskFree = undefined;
+ for (const k of ["FUOBE_HOSTED_RUNS", "FUOBE_BILLING_URL", "FUOBE_BILLING_TOKEN"]) delete process.env[k];
+ await fake.close();
+ await comfy.close();
+ try {
+ fs.rmSync(dir, { recursive: true, force: true });
+ } catch {}
+ });
+ beforeEach(() => {
+ resetRates();
+ billing.resetBillingCache();
+ process.env.FUOBE_HOSTED_RUNS = "1";
+ process.env.FUOBE_BILLING_URL = fake.url;
+ process.env.FUOBE_BILLING_TOKEN = "test-billing-token";
+ fake.calls.length = 0;
+ fake.policy = { hosted: true, pool: {}, uploads: { image: true, video: false, audio: false }, limits: { activeRuns: 7, waiting: 7, runsPerHour: 70, outputsPerRun: 2, maxMegapixels: 7, maxSeconds: 600, keepDays: 7, spaceBytes: 7 }, ttlS: 0 };
+ });
+
+ const post = (body: unknown, query = "") => {
+ const text = JSON.stringify(body);
+ return generationsRoute.POST(
+ new Request(`http://localhost:3000/api/generations${query}`, { method: "POST", headers: { cookie, host: "localhost:3000", "content-type": "application/json", "content-length": String(Buffer.byteLength(text)) }, body: text }),
+ );
+ };
+ const song = { feature: "audio", modelId: "oss-minimax-music-3", op: "music", prompt: "Acoustic pop, 96 BPM", params: { duration: 180, extra: { lyrics: "[Verse]\nMorning light" } } };
+
+ describe("songs on this install's GPUs (hosted runs)", () => {
+ it("prices an account's MiniMax Music 3 song there, with its op, model and seconds", async () => {
+ const p = await post(song, "?preview=1");
+ expect(p.status).toBe(200);
+ expect(((await p.json()) as { place: string }).place).toBe("pool");
+ const quote = fake.calls_of("/v1/quote").at(-1)!.body as { run: { model: string; op: string; kind: string; seconds: number; engine: string } };
+ expect(quote.run).toMatchObject({ model: "oss-minimax-music-3", op: "music", kind: "audio", seconds: 180, engine: "open" });
+ });
+
+ it("YuE2 needs its lyrics before anything is priced or held", async () => {
+ const r = await post({ ...song, modelId: "oss-yue2", params: { duration: 120 } });
+ expect(r.status).toBe(422);
+ expect(((await r.json()) as { error: string }).error).toMatch(/^YuE2 sings your lyrics/);
+ expect(fake.calls_of("/v1/reserve")).toHaveLength(0);
+ });
+ });
diff --cc tests/music3-open.test.ts
index 00000000,274c439a..94454036
mode 000000,100644..100644
--- a/tests/music3-open.test.ts
+++ b/tests/music3-open.test.ts
@@@ -1,0 -1,296 +1,296 @@@
+ import fs from "node:fs";
+ import http from "node:http";
+ import os from "node:os";
+ import path from "node:path";
+ import zlib from "node:zlib";
+ import { afterAll, beforeAll, describe, expect, it } from "vitest";
+ import type { GenInput, ModelDef } from "@/lib/catalog/types";
+ import type { MediaInfo } from "@/lib/media-probe";
+
-// nm10-music3 on the open engine: MiniMax Music 3 and YuE2 (songs and covers) on core ComfyUI nodes, bound for real; and the
++// Full songs on the open engine: MiniMax Music 3 and YuE2 (songs and covers) on core ComfyUI nodes, bound for real; and the
+ // fal provider's song tools (a song sent first through Mureka's files/upload, stems unpacked from Mureka's zip) against a
+ // stand-in fal.ai on this machine.
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-music3-"));
+ process.env.FUOBE_DATA_DIR = dir;
+ process.env.COMFYUI_URL = "http://comfy.test:8188";
+
+ const { loadManifest, prepareWorkflow } = await import("@/server/providers/comfyui");
+ const { getModel } = await import("@/lib/catalog");
+ const { resolveWorkflowId } = await import("@/lib/comfy-variants");
+ const { buildLicenceList, licenceInfo, workflowLicence } = await import("@/lib/licences");
+ const { setSetting } = await import("@/server/settings");
+ const { falProvider, stemsFromZip } = await import("@/server/providers/fal");
+ const { zip } = await import("@/server/zip");
+ const { saveFile } = await import("@/server/storage");
+ const { createGenerations, getGeneration } = await import("@/server/generations");
+ const { unzip } = await import("@/server/unzip");
+
+ const requirements = JSON.parse(fs.readFileSync("workflows/comfyui/requirements.json", "utf8")) as { workflows: Record<string, { files: string[]; vramGb?: number | string }> };
+ const SONGS = ["music-minimax-3", "music-yue2-song", "music-yue2-cover"];
+
+ const song: MediaInfo = { container: "mp3", hasVideo: false, hasAudio: true, duration: 95, channels: 2 } as MediaInfo;
+ async function prepare(id: string, input: Partial<GenInput>) {
+ const uploads: string[] = [];
+ const res = await prepareWorkflow(id, { prompt: "", ...input } as GenInput, {
+ generationId: "gen1",
+ op: "music",
+ upload: async (_d, _t, name) => {
+ uploads.push(name);
+ return `up_${name}`;
+ },
+ media: (name) => (name === "song.mp3" ? song : undefined),
+ serverRam: async () => undefined,
+ });
+ return { ...res, uploads };
+ }
+
+ describe("the song graphs", () => {
+ it("are in the manifest, accepted by a live ComfyUI, with their licences, pinned files and a model that runs them", () => {
+ const byId = new Map(loadManifest().workflows.map((w) => [w.id, w]));
+ for (const id of SONGS) {
+ const wf = byId.get(id)!;
+ expect(wf, id).toBeTruthy();
+ expect(wf.validated, id).toBe(true);
+ expect(wf.capability).toBe("music");
+ expect(wf.customNodes, id).toEqual([]);
+ expect(requirements.workflows[id]?.files.length, id).toBeGreaterThan(0);
+ }
+ expect(byId.get("music-minimax-3")!.models.map((m) => [m.file, m.sizeGb])).toEqual([
+ ["minimax_music3_dit_int8_convrot.safetensors", 2.5],
+ ["minimax_music3_text_encoder_pruned_int8_convrot.safetensors", 9.2],
+ ["minimax_music3_dav.safetensors", 0.22],
+ ]);
+ expect(byId.get("music-minimax-3")!.vramGb).toBe(24);
+ expect(byId.get("music-yue2-cover")!.models.map((m) => m.file)).toEqual(["yue2_3b_int8_convrot.safetensors", "sheetsage2_bf16.safetensors"]);
+ expect(getModel("oss-minimax-music-3")!.routes[0].endpoint).toBe("music-minimax-3");
+ expect(getModel("oss-yue2")!.routes[0].endpoint).toBe("music-yue2-song");
+ });
+
+ it("show each licence as information: MiniMax-Music3's own (with its notice), YuE2's non-commercial", () => {
+ const wfs = loadManifest().workflows;
+ const mm = licenceInfo(workflowLicence(wfs.find((w) => w.id === "music-minimax-3")!));
+ expect(mm).toMatchObject({ name: "MiniMax-Music3 Community License", class: "conditions", notices: ["MiniMax-Music3"] });
+ expect(mm.url).toContain("MiniMaxAI/MiniMax-Music3/blob/1b525ccb");
+ expect(licenceInfo(workflowLicence(wfs.find((w) => w.id === "music-yue2-song")!)).class).toBe("non-commercial");
+ const rows = buildLicenceList([getModel("oss-yue2")!, getModel("oss-minimax-music-3")!] as ModelDef[], wfs).rows;
+ expect(rows.find((r) => r.id === "oss-yue2")).toMatchObject({ workflows: ["music-yue2-song"], flags: ["non-commercial"] });
+ });
+
+ it("MiniMax Music 3: the style, the lyrics, the length, the seed; long songs decode in tiles", async () => {
+ const { workflow: prompt } = await prepare("music-minimax-3", { prompt: "Acoustic pop, 96 BPM", duration: 180, seed: 5, extra: { lyrics: "[Verse]\nMorning light" } });
+ expect(prompt["4"].inputs).toMatchObject({ caption: "Acoustic pop, 96 BPM", lyrics: "[Verse]\nMorning light", max_duration: 180, seed: 5 });
+ expect(prompt["7"].inputs.seed).toBe(5);
+ expect(prompt["10"].inputs.switch).toBe(true);
+ const short = await prepare("music-minimax-3", { prompt: "Lo-fi", duration: 60 });
+ expect(short.workflow["10"].inputs.switch).toBe(false);
+ // No words: the graph's own instrumental.
+ expect(short.workflow["4"].inputs.lyrics).toBe("[Instrumental]");
+ await expect(prepare("music-minimax-3", { prompt: "x", duration: 330 })).rejects.toThrow("This model writes songs up to 5 minutes on your GPU: pick a shorter length");
+ });
+
+ it("ACE-Step: a song with no words is an instrumental, never the template's sample lyrics", async () => {
+ const plain = await prepare("music-ace-step-15", { prompt: "lo-fi beat", extra: {} });
+ expect(plain.workflow["94"].inputs.lyrics).toBe("[Instrumental]");
+ const sung = await prepare("music-ace-step-15", { prompt: "lo-fi beat", extra: { lyrics: "[Verse]\nnew words" } });
+ expect(sung.workflow["94"].inputs.lyrics).toBe("[Verse]\nnew words");
+ });
+
+ it("YuE2: the style and lyrics plan the song; a song added is covered from its melody", async () => {
+ const { workflow: prompt } = await prepare("music-yue2-song", { prompt: "English, warm female vocal, pop", duration: 120, seed: 9, extra: { lyrics: "[Verse]\nla la" } });
+ expect(prompt["2"].inputs).toMatchObject({ style: "English, warm female vocal, pop", lyrics: "[Verse]\nla la", seed: 9, mode: "full" });
+ expect(prompt["3"].inputs).toMatchObject({ abc: ["2", 0], max_duration: 120, seed: 9 });
+ const has = (id: string) => SONGS.includes(id);
+ const base = { op: "music", clips: 0, images: 0, audio2: false, extra: {}, has };
+ expect(resolveWorkflowId("music-yue2-song", base)).toBe("music-yue2-song");
+ expect(resolveWorkflowId("music-yue2-song", { ...base, audio: true })).toBe("music-yue2-cover");
+ expect(resolveWorkflowId("music-minimax-3", { ...base, audio: true })).toBe("music-minimax-3");
+ const cover = await prepare("music-yue2-song", { prompt: "Jazz, male vocal", audio: "song.mp3", extra: { lyrics: "[Verse]\nnew words" } });
+ expect(cover.workflow["9"].inputs.audio).toBe("song.mp3");
+ expect(cover.workflow["11"].inputs).toMatchObject({ audio: ["9", 0], mode: "melody" });
+ expect(cover.workflow["3"].inputs).toMatchObject({ style: "Jazz, male vocal", lyrics: "[Verse]\nnew words", abc: ["11", 0], mode: "melody" });
+ });
+ });
+
+ describe("the fal provider's song tools", () => {
+ let server: http.Server;
+ let base = "";
+ const log: { method: string; path: string; body: string }[] = [];
+ const stems = zip([
+ { name: "stems/vocals.mp3", data: Buffer.from("ID3vocals") },
+ { name: "stems/drums.wav", data: Buffer.from("RIFFdrums") },
+ { name: "__MACOSX/._vocals.mp3", data: Buffer.from("x") },
+ { name: "readme.txt", data: Buffer.from("hi") },
+ ]);
+ beforeAll(async () => {
+ server = http.createServer((req, res) => {
+ const chunks: Buffer[] = [];
+ req.on("data", (c: Buffer) => chunks.push(c));
+ req.on("end", () => {
+ const p = req.url ?? "/";
+ log.push({ method: req.method ?? "GET", path: p, body: Buffer.concat(chunks).toString() });
+ const json = (b: unknown) => {
+ res.writeHead(200, { "Content-Type": "application/json" });
+ res.end(JSON.stringify(b));
+ };
+ if (p === "/mureka/api/files/upload") return json({ id: "upload_7", purpose: "audio" });
+ if (p === "/stems.zip") {
+ res.writeHead(200, { "Content-Type": "application/zip" });
+ return res.end(stems);
+ }
+ if (p.startsWith("/requests/") && p.includes("/status")) return json({ status: "COMPLETED" });
+ if (p.startsWith("/requests/")) return json({ zip_url: `${base}/stems.zip`, midi_zip_url: null });
+ return json({ request_id: "r1", status_url: `${base}/requests/r1/status`, response_url: `${base}/requests/r1`, cancel_url: `${base}/requests/r1/cancel` });
+ });
+ });
+ await new Promise<void>((r) => server.listen(0, "127.0.0.1", r));
+ base = `http://127.0.0.1:${(server.address() as { port: number }).port}`;
+ globalThis.__fuobeTestFalUrl = base;
+ setSetting("falKey", "owner-fal-key");
+ });
+ afterAll(async () => {
+ globalThis.__fuobeTestFalUrl = undefined;
+ await new Promise<void>((r) => server.close(() => r()));
+ fs.rmSync(dir, { recursive: true, force: true });
+ });
+
+ const model = (id: string) => getModel(id)!;
+ it("sends a song Mureka didn't make through its files/upload first, then extends it by that id", async () => {
+ const m = model("mureka-extend");
+ const job = await falProvider.submit({ generationId: "g", model: m, route: m.routes[0], input: { prompt: "", audio: "https://files.test/song.mp3", startTime: 95, extra: { lyrics: "[Verse]\nmore" } } });
+ expect(JSON.parse(log.find((l) => l.path === "/mureka/api/files/upload")!.body)).toEqual({ file_url: "https://files.test/song.mp3", purpose: "audio" });
+ expect(job.payload).toEqual({ lyrics: "[Verse]\nmore", extend_at: 95000, upload_audio_id: "upload_7" });
+ // One of Mureka's own: no upload.
+ log.length = 0;
+ const own = await falProvider.submit({ generationId: "g", model: m, route: m.routes[0], input: { prompt: "", audio: "https://files.test/song.mp3", startTime: 95, extra: { lyrics: "[Verse]\nmore", songId: "song_1" } } });
+ expect(log.some((l) => l.path === "/mureka/api/files/upload")).toBe(false);
+ expect(own.payload).toMatchObject({ song_id: "song_1" });
+ });
+
+ it("refuses a song Mureka's tools can't take before anything is sent or paid for", async () => {
+ /** A WAV header of `seconds` at 8 kHz mono 8-bit, its samples silent. */
+ const wav = (seconds: number) => {
+ const h = Buffer.alloc(44);
+ h.write("RIFF", 0);
+ h.writeUInt32LE(36 + seconds * 8000, 4);
+ h.write("WAVEfmt ", 8);
+ h.writeUInt32LE(16, 16);
+ h.writeUInt16LE(1, 20);
+ h.writeUInt16LE(1, 22);
+ h.writeUInt32LE(8000, 24);
+ h.writeUInt32LE(8000, 28);
+ h.writeUInt16LE(1, 32);
+ h.writeUInt16LE(8, 34);
+ h.write("data", 36);
+ h.writeUInt32LE(seconds * 8000, 40);
+ return Buffer.concat([h, Buffer.alloc(seconds * 8000, 128)]);
+ };
+ const file = (name: string, contentType: string, data: Buffer) => saveFile({ name, contentType, source: "upload", data }).url;
+ const run = async (modelId: string, audio: string, extra: Record<string, unknown> = {}, prompt = "") => {
+ const [g] = createGenerations({ feature: "song-tools", modelId, engine: "cloud", prompt, inputs: { audio }, params: { extra } });
+ for (let i = 0; i < 200 && !["failed", "succeeded"].includes(getGeneration(g.id)!.status); i++) await new Promise((r) => setTimeout(r, 10));
+ return getGeneration(g.id)!;
+ };
+ log.length = 0;
+ const stems = await run("mureka-stems", file("bed.wav", "audio/wav", wav(3)));
+ expect(stems.status).toBe("failed");
+ expect(stems.error).toBe("Stems take an MP3 or M4A song: this one is a WAV file. Save it as an MP3 and add it again");
+ const big = await run("mureka-stems", file("big.mp3", "audio/mpeg", Buffer.concat([Buffer.from("ID3"), Buffer.alloc(10_500_000)])));
+ expect(big.error).toBe("Stems take a song of up to 10 MB: this one is 10.6 MB. Save it as a smaller MP3 and add it again");
+ const long = await run("mureka-remix", file("long.wav", "audio/wav", wav(400)), { lyrics: "[Verse]\nla" }, "jazz");
+ expect(long.error).toBe("Remix takes a song of 0:10 to 5:50: this one is 6:40");
+ const short = await run("mureka-remix", file("short.wav", "audio/wav", wav(5)), { lyrics: "[Verse]\nla" }, "jazz");
+ expect(short.error).toBe("Remix takes a song of 0:10 to 5:50: this one is 0:05");
+ // Nothing reached fal: no upload to Mureka, no run.
+ expect(log).toEqual([]);
+ });
+
+ it("unpacks the stems' zip into one result per track, named by its file", async () => {
+ const m = model("mureka-stems");
+ const job = await falProvider.submit({ generationId: "g", model: m, route: m.routes[0], input: { prompt: "", audio: "https://files.test/song.mp3" } });
+ expect(job.payload).toEqual({ audio_url: "https://files.test/song.mp3" });
+ const r = await falProvider.poll({ externalId: job.externalId, meta: job.meta!, route: m.routes[0], model: m, createdAt: Date.now() });
+ expect(r.state).toBe("succeeded");
+ if (r.state !== "succeeded") return;
+ expect(r.outputs.map((o) => [o.meta?.stem, o.contentType, o.kind])).toEqual([
+ ["vocals", "audio/mpeg", "audio"],
+ ["drums", "audio/wav", "audio"],
+ ]);
+ expect(Buffer.from(r.outputs[0].url.split(",")[1], "base64").toString()).toBe("ID3vocals");
+ });
+
+ it("reads an archive's files, and refuses a damaged or oversized one", async () => {
+ expect((await unzip(stems)).map((f) => f.name)).toEqual(["stems/vocals.mp3", "stems/drums.wav", "readme.txt"]);
+ await expect(unzip(Buffer.from("not a zip at all, just words"))).rejects.toThrow("Not a zip archive");
+ await expect(unzip(stems, { maxFiles: 2 })).rejects.toThrow(/more than 2/);
+ await expect(unzip(stems, { maxBytes: 4 })).rejects.toThrow(/more than Fuobe keeps/);
+ });
+
+ it("counts the bytes it unpacks, not the sizes a crafted archive declares", async () => {
+ const MiB = 1024 * 1024;
+ // One deflated entry (8 MiB of zeros in about 8 KB), listed `copies` times in the directory, each claiming `declared` bytes.
+ const crafted = (copies: number, declared: number, opts: { offsets?: number[] } = {}) => {
+ const data = zlib.deflateRawSync(Buffer.alloc(8 * MiB));
+ const name = Buffer.from("stems/vocals.wav");
+ const local = Buffer.alloc(30);
+ local.writeUInt32LE(0x04034b50, 0);
+ local.writeUInt16LE(8, 8);
+ local.writeUInt32LE(data.length, 18);
+ local.writeUInt32LE(declared, 22);
+ local.writeUInt16LE(name.length, 26);
+ const head = Buffer.concat([local, name, data]);
+ const dir = Array.from({ length: copies }, (_, i) => {
+ const c = Buffer.alloc(46);
+ c.writeUInt32LE(0x02014b50, 0);
+ c.writeUInt16LE(8, 10);
+ c.writeUInt32LE(data.length, 20);
+ c.writeUInt32LE(declared, 24);
+ c.writeUInt16LE(name.length, 28);
+ c.writeUInt32LE(opts.offsets?.[i] ?? 0, 42);
+ return Buffer.concat([c, name]);
+ });
+ const cd = Buffer.concat(dir);
+ const end = Buffer.alloc(22);
+ end.writeUInt32LE(0x06054b50, 0);
+ end.writeUInt16LE(copies, 8);
+ end.writeUInt16LE(copies, 10);
+ end.writeUInt32LE(cd.length, 12);
+ end.writeUInt32LE(head.length, 16);
+ return Buffer.concat([head, cd, end]);
+ };
+ // Twenty directory entries over one local entry: refused before a second inflate, not 160 MiB unpacked.
+ await expect(unzip(crafted(20, 0))).rejects.toThrow("damaged");
+ await expect(unzip(crafted(2, 8 * MiB, { offsets: [0, 4] }))).rejects.toThrow("damaged");
+ // A size declared as 0 that unpacks to 8 MiB: refused, and never past what is left of the budget.
+ await expect(unzip(crafted(1, 0))).rejects.toThrow("damaged");
+ await expect(unzip(crafted(1, 0), { maxBytes: 2 * MiB })).rejects.toThrow(/more than Fuobe keeps/);
+ // An honest entry still reads.
+ expect((await unzip(crafted(1, 8 * MiB)))[0].data.length).toBe(8 * MiB);
+ });
+
+ it("stops a stems download past its byte limit, with or without a declared length, and past its time limit", async () => {
+ const big = http.createServer((req, res) => {
+ if (req.url === "/declared") {
+ res.writeHead(200, { "Content-Length": String(4096) });
+ return res.end(Buffer.alloc(4096));
+ }
+ if (req.url === "/streamed") {
+ res.writeHead(200);
+ res.write(Buffer.alloc(3000));
+ res.write(Buffer.alloc(3000));
+ return res.end();
+ }
+ res.writeHead(200);
+ res.write(Buffer.alloc(10)); // then nothing more
+ });
+ await new Promise<void>((r) => big.listen(0, "127.0.0.1", r));
+ const at = `http://127.0.0.1:${(big.address() as { port: number }).port}`;
+ try {
+ await expect(stemsFromZip(`${at}/declared`, { maxBytes: 1024 })).rejects.toThrow(/larger than Fuobe keeps/);
+ await expect(stemsFromZip(`${at}/streamed`, { maxBytes: 4000 })).rejects.toThrow(/larger than Fuobe keeps/);
+ await expect(stemsFromZip(`${at}/stalls`, { waitMs: 300 })).rejects.toThrow(/took too long/);
+ } finally {
+ big.closeAllConnections();
+ await new Promise<void>((r) => big.close(() => r()));
+ }
+ });
+ });
diff --cc tests/open-minimax-h3.test.ts
index 39b64526,711666b6..39fd0187
--- a/tests/open-minimax-h3.test.ts
+++ b/tests/open-minimax-h3.test.ts
@@@ -77,6 -78,9 +78,9 @@@ describe("MiniMax H3 on your GPU: the c
});
expect(h3.options.controls).toEqual([
{ param: "quality", label: "Quality", values: ["fast", "best"], default: "fast", labels: { fast: "Fast · 8 steps", best: "Best · 20 steps, about 2.3x longer" } },
- // nm10-h3-any-gpu: the GPU tier (FastH3 V2 / Trim on smaller cards); Fast decode is held back until it validates
++ // The GPU tier (FastH3 V2 / Trim on smaller cards); Fast decode is held back until it validates
+ // (tests/h3-any-gpu.test.ts).
+ H3_GPU_TIER,
]);
expect(h3.options.negativePrompt).toBeUndefined();
expect(h3.options.multiShot).toBeUndefined();
diff --cc tests/person-remover-plus.test.ts
index 00000000,9f4644fb..ac065114
mode 000000,100644..100644
--- a/tests/person-remover-plus.test.ts
+++ b/tests/person-remover-plus.test.ts
@@@ -1,0 -1,218 +1,218 @@@
+ import fs from "node:fs";
+ import os from "node:os";
+ import path from "node:path";
+ import { afterAll, describe, expect, it, vi } from "vitest";
+ import { getModel, getPreset } from "@/lib/catalog";
+ import { h3Canvas, H3_REMOVAL_WORKFLOW } from "@/lib/catalog/character-swap";
+ import { planGeneration } from "@/lib/catalog/plan";
+ import {
+ getEraser,
+ maskGrowOf,
+ PERSON_REMOVAL_FPS,
+ PERSON_REMOVAL_TOOLS,
+ planMaskPreview,
+ planRemoval,
+ previewIsGreen,
+ REMOVE,
+ rerollControls,
+ rerollProblem,
+ reuseOf,
+ REVIEW_EXTRA,
+ reviewOfOutput,
+ reviewOfRun,
+ windowArtifact,
+ type RemovalPlanInput,
+ type RemovalReview,
+ } from "@/lib/catalog/remove-object";
+ import type { GenInput } from "@/lib/catalog/types";
+ import type { ManifestWorkflow } from "@/lib/comfy";
+
-// H3 Person Remover, everywhere (o/person-remover-plus): mask first, window review and "Redo from here".
++// H3 Person Remover, everywhere: mask first, window review and "Redo from here".
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-person-remover-plus-"));
+ process.env.FUOBE_DATA_DIR = tmp;
+ process.env.COMFYUI_URL = "http://127.0.0.1:8199";
+ const { prepareWorkflow, withRemovalReview } = await import("@/server/providers/comfyui");
+ const { runAsTenant } = await import("@/server/tenant");
+ afterAll(() => fs.rmSync(tmp, { recursive: true, force: true }));
+
+ const manifest = JSON.parse(fs.readFileSync(path.join(__dirname, "../workflows/comfyui/manifest.json"), "utf8")) as { workflows: ManifestWorkflow[] };
+ const src = { url: "/api/files/uploads/clip.mp4", duration: 12, fps: 30, width: 1280, height: 720, hasAudio: true };
+ const eraser = getEraser("oss-h3-person-remove")!;
+ const input = (over: Partial<RemovalPlanInput> = {}): RemovalPlanInput => ({
+ engine: "open",
+ mode: "type",
+ eraser,
+ title: "Remove · the man in the grey shirt",
+ source: src,
+ range: { start: 2, end: 9 },
+ prompt: "Remove the man in the grey shirt",
+ ...over,
+ });
+
+ describe("mask first: the green mask preview", () => {
+ it("fits the first seconds like the removal and runs the removal's own SAM 3.1 chain, filled green", () => {
+ expect(previewIsGreen(eraser)).toBe(true);
+ expect(previewIsGreen(getEraser("oss-vace-remove"))).toBe(false);
+ const steps = planMaskPreview(input({ maskGrow: 12 }))!;
+ expect(steps.map((s) => s.key)).toEqual(["cut", "preview"]);
+ expect(steps[0].request).toMatchObject({
+ modelId: PERSON_REMOVAL_TOOLS.fit,
+ op: "trim",
+ inputs: { video: src.url },
+ params: { startTime: 2, endTime: 2 + REMOVE.previewSeconds, fps: PERSON_REMOVAL_FPS, extra: h3Canvas(1280, 720, "768p") },
+ });
+ expect(steps[1].request).toMatchObject({
+ feature: REMOVE.previewFeature,
+ modelId: "oss-h3-removal-mask",
+ op: "bg-remove-video",
+ prompt: "the man in the grey shirt",
+ params: { extra: { maskPrompt: "the man in the grey shirt", maskGrow: 12 } },
+ });
+ expect(steps[1].chain).toEqual([{ slot: "video" }]);
+ for (const s of steps) {
+ const chained = s.chain?.length ? { video: "/api/files/x.mp4" } : {};
+ expect(() => planGeneration({ ...s.request, inputs: { ...s.request.inputs, ...chained } }, getModel, getPreset), s.key).not.toThrow();
+ }
+ });
+
+ it("the expansion is whole pixels within its range and reaches the removal", () => {
+ expect([maskGrowOf(undefined), maskGrowOf(-3), maskGrowOf(7.4), maskGrowOf(500)]).toEqual([undefined, 0, 7, REMOVE.maskGrow.max]);
+ const erase = planRemoval(input({ maskGrow: 9, seed: 3 })).steps.find((s) => s.key === "erase0")!;
+ expect(erase.request.params).toEqual({ seed: 3, extra: { maskGrow: 9 } });
+ expect(planRemoval(input()).steps.find((s) => s.key === "erase0")!.request.params).toBeUndefined();
+ });
+
+ it("the preview graph is the removal graph's SAM chain, node for node, and validated on core nodes", async () => {
+ const mask = manifest.workflows.find((w) => w.id === "video-person-remove-h3-mask")!;
+ expect(mask).toMatchObject({ capability: "person-mask", validated: true });
+ expect(mask.customNodes ?? []).toEqual([]);
+ const read = (id: string) => JSON.parse(fs.readFileSync(path.join(__dirname, `../workflows/comfyui/${id}.json`), "utf8"));
+ const a = read("video-person-remove-h3-mask");
+ const b = read(H3_REMOVAL_WORKFLOW);
+ for (const n of ["sam", "detect", "track", "mask", "binary_mask", "grow_mask", "green", "green_guide"]) expect(a[n], n).toEqual(b[n]);
+ const wf = (await prepareWorkflow("video-person-remove-h3-mask", { video: "fit.mp4", prompt: "the man", extra: { maskPrompt: "the man", maskGrow: 12 } } as GenInput, { generationId: "p1", op: "bg-remove-video", upload: async (_d, _t, n) => n })).workflow as Record<string, { inputs: Record<string, unknown> }>;
+ expect([wf.source.inputs.file, wf.subject.inputs.text, wf.grow_mask.inputs.expand, wf.save.inputs.filename_prefix]).toEqual(["fit.mp4", "the man", 12, "fuobe/p1"]);
+ });
+ });
+
+ const run = {
+ run_id: "a".repeat(32),
+ config_key: "c".repeat(64),
+ seed: "904234",
+ total: 3,
+ status: "complete",
+ segments: [
+ { index: 1, start: 22, frames: 22, record_id: "2".repeat(32), seed: "904235", reused: false, video: { filename: "window-002.mp4", subfolder: `__h3_removal_cache/previews/${"a".repeat(32)}`, type: "output" } },
+ { index: 0, start: 0, frames: 22, record_id: "1".repeat(32), seed: "904234", reused: true, poster: { filename: "window-001.jpg", subfolder: `__h3_removal_cache/previews/${"a".repeat(32)}`, type: "output" } },
+ { index: 2, start: 44, frames: 20, record_id: "3".repeat(32), seed: "904236", video: { filename: "../../etc/passwd", subfolder: "x", type: "output" } },
+ ],
+ };
+ const reuse = { video: "fuobe_abcdefgh.mp4", image: "fuobe_ijklmnop.png", prefix: "fuobe/g1" };
+
+ describe("window review: what the Relay reports", () => {
+ it("keeps each window's checkpoint, seed and preview, and only ComfyUI output files of the run", () => {
+ const read = reviewOfRun(run, reuse, (f) => `http://comfy/view?${new URLSearchParams(f)}`)!;
+ expect(read.review).toMatchObject({ runId: run.run_id, configKey: run.config_key, seed: "904234", total: 3, reuse });
+ expect(read.review.windows.map((w) => [w.index, w.recordId, w.seed, !!w.reused])).toEqual([
+ [0, "1".repeat(32), "904234", true],
+ [1, "2".repeat(32), "904235", false],
+ [2, "3".repeat(32), "904236", false],
+ ]);
+ expect(read.review.windows[0].poster).toBe(windowArtifact(0, "poster"));
+ expect(read.review.windows[1].video).toBe(windowArtifact(1, "video"));
+ expect(read.review.windows[2].video).toBeUndefined();
+ expect(Object.keys(read.artifacts).sort()).toEqual(["window-001-poster", "window-002"]);
+ expect(read.artifacts["window-002"]).toContain("subfolder=__h3_removal_cache");
+ expect(reviewOfRun({ nope: 1 }, reuse, () => "")).toBeNull();
+ expect(reviewOfOutput({ review: read.review, artifacts: { "window-002": "/api/files/w2.mp4" } })?.links).toEqual({ "window-002": "/api/files/w2.mp4" });
+ });
+
+ it("only plain ComfyUI names are sent again", () => {
+ expect(reuseOf(reuse)).toEqual(reuse);
+ expect(reuseOf({ ...reuse, video: "../secret.mp4" })).toBeNull();
+ expect(reuseOf({ ...reuse, prefix: "elsewhere/g1" })).toBeNull();
+ expect(reuseOf("x")).toBeNull();
+ });
+ });
+
+ describe("Redo from here", () => {
+ const review: RemovalReview = reviewOfRun(run, reuse, () => "x")!.review;
+
+ it("locks every window before it to its checkpoint and draws it with the new seed", () => {
+ expect(JSON.parse(rerollControls(review, 2, 42)!)).toEqual({
+ config_key: run.config_key,
+ windows: { "0": { seed: "904234", locked: true, record_id: "1".repeat(32) }, "1": { seed: "904235", locked: true, record_id: "2".repeat(32) }, "2": { seed: "42", locked: false } },
+ });
+ expect(JSON.parse(rerollControls(review, 0, 7)!).windows).toEqual({ "0": { seed: "7", locked: false } });
+ expect(rerollProblem(review, 1)).toBeNull();
+ expect(rerollProblem(review, 3)).toMatch(/Pick one/);
+ expect(rerollProblem(null, 0)).toMatch(/no window previews/);
+ const gap = { ...review, windows: review.windows.map((w) => (w.index === 0 ? { ...w, recordId: undefined } : w)) };
+ expect(rerollProblem(gap, 2)).toMatch(/redo from window 1/);
+ expect(rerollControls(gap, 2, 1)).toBeNull();
+ });
+
+ it("the graph gets the controls, and the original run's inputs and prefix so the Relay keeps its checkpoints", async () => {
+ const controls = rerollControls(review, 1, 42)!;
+ const prep = (extra: Record<string, unknown>) =>
+ prepareWorkflow(H3_REMOVAL_WORKFLOW, { video: "new_fit.mp4", images: ["new_clean.png"], prompt: "the man", seed: 904234, extra } as GenInput, { generationId: "g2", op: "remove-object", upload: async (_d, _t, n) => n });
+ const r = await prep({ [REVIEW_EXTRA.controls]: controls, [REVIEW_EXTRA.reuse]: reuse });
+ const wf = r.workflow as Record<string, { inputs: Record<string, unknown> }>;
+ expect(wf.review.inputs.window_controls).toBe(controls);
+ expect([wf.source.inputs.file, wf.anchor.inputs.image, wf.save.inputs.filename_prefix, wf.plan.inputs.seed]).toEqual([reuse.video, reuse.image, reuse.prefix, 904234]);
+ expect(r.meta.reviewInputs).toEqual(reuse);
+ // A first run: its own inputs and prefix are what a later reroll sends again.
+ const first = await prep({});
+ expect((first.workflow as Record<string, { inputs: Record<string, unknown> }>).review.inputs.window_controls).toBe("{}");
+ expect(first.meta.reviewInputs).toEqual({ video: "new_fit.mp4", image: "new_clean.png", prefix: "fuobe/g2" });
+ // Never another run's files for an account's run.
+ const account = await runAsTenant({ kind: "account", id: "acc1" }, () => prep({ [REVIEW_EXTRA.reuse]: reuse }));
+ expect((account.workflow as Record<string, { inputs: Record<string, unknown> }>).source.inputs.file).toBe("new_fit.mp4");
+ // ...and an account's run keeps no review (nothing on its GPU is fetched for it, and it can't be redone).
+ expect(account.meta.reviewInputs).toBeUndefined();
+ });
+ });
+
+ describe("window previews from the studio's ComfyUI", () => {
+ it("are copied into the result's files from a local ComfyUI, with its token, never left as ComfyUI links", async () => {
+ const asked: { url: string; auth?: string }[] = [];
+ const fetchMock = vi.fn(async (url: string, init?: RequestInit) => {
+ asked.push({ url, auth: (init?.headers as Record<string, string> | undefined)?.Authorization });
+ if (url.includes("/h3_relay/removal/previews")) return Response.json(run);
+ if (url.includes("window-002.mp4")) return new Response(Buffer.from("mp4-bytes"), { headers: { "content-type": "video/mp4" } });
+ if (url.includes("window-001.jpg")) return new Response(Buffer.from("jpg-bytes"), { headers: { "content-type": "image/jpeg" } });
+ return new Response("no", { status: 404 });
+ });
+ vi.stubGlobal("fetch", fetchMock);
+ const { setSetting } = await import("@/server/settings");
+ setSetting("comfyToken", "tok-123");
+ try {
+ const entry = { outputs: { review: { h3_removal_run: [run.run_id] } } };
+ const outputs = [{ url: "http://127.0.0.1:8199/view?filename=out.mp4", kind: "video" as const, contentType: "video/mp4" }];
+ const [out] = await withRemovalReview(entry, outputs, reuse, "main", "gen1");
+ const meta = out.meta as { review: RemovalReview; artifacts: Record<string, string> };
+ expect(asked[0].url).toBe(`http://127.0.0.1:8199/h3_relay/removal/previews?workflow_id=&node_id=review&run_id=${run.run_id}`);
+ expect(asked.every((a) => a.auth === "Bearer tok-123")).toBe(true);
+ expect(Object.keys(meta.artifacts).sort()).toEqual(["window-001-poster", "window-002"]);
+ for (const link of Object.values(meta.artifacts)) expect(link).toMatch(/^\/api\/files\//);
+ expect(meta.review.windows.map((w) => [w.index, w.poster, w.video])).toEqual([
+ [0, "window-001-poster", undefined],
+ [1, undefined, "window-002"],
+ [2, undefined, undefined],
+ ]);
+ // An account's run (its own GPU, or the hosted pool): no review is read.
+ const n = asked.length;
+ const acc = await runAsTenant({ kind: "account", id: "acc1" }, () => withRemovalReview(entry, outputs, reuse, "main", "gen2"));
+ expect(acc[0].meta).toBeUndefined();
+ expect(asked.length).toBe(n);
+ // A preview ComfyUI won't give is left out; the window can still be redone.
+ fetchMock.mockImplementation(async (url: string) => (url.includes("/previews") ? Response.json(run) : new Response("no", { status: 403 })));
+ const [bare] = await withRemovalReview(entry, outputs, reuse, "main", "gen3");
+ expect((bare.meta as { artifacts: Record<string, string> }).artifacts).toEqual({});
+ expect((bare.meta as { review: RemovalReview }).review.windows.every((w) => !w.video && !w.poster && w.recordId)).toBe(true);
+ } finally {
+ setSetting("comfyToken", "");
+ vi.unstubAllGlobals();
+ }
+ });
+ });
diff --cc tests/public-signup-tools.test.ts
index c9fd4c94,90d22021..d5321c96
--- a/tests/public-signup-tools.test.ts
+++ b/tests/public-signup-tools.test.ts
@@@ -169,6 -170,35 +170,35 @@@ describe("the proxy: PR #15's routes a
});
});
-describe("Fly around (N7-7) under the sign-up rules", () => {
++describe("Fly around under the sign-up rules", () => {
+ it("opens its price check to guests and accounts, and answers its run with own-gpu-tool", async () => {
+ process.env.FUOBE_PUBLIC_SIGNUP = "1";
+ expect(access.isPriceCheck("POST", "/api/fly-around", "?preview=1")).toBe(true);
+ expect(access.isPriceCheck("POST", "/api/fly-around", "")).toBe(false);
+ const a = newAccount();
+ auth.setAccountGpu(a.id, { url: "https://gpu.example" });
+ const cookie = auth.createSession(a.id).value;
+ for (const c of [undefined, cookie]) {
+ expect(passed(proxy(req("/api/fly-around?preview=1", { method: "POST", cookie: c })))).toBe(true);
+ const r = proxy(req("/api/fly-around", { method: "POST", cookie: c }));
+ expect(r.status).toBe(403);
+ expect((await r.json()).code).toBe("own-gpu-tool");
+ }
+ expect(passed(proxy(req("/api/fly-around", { method: "POST", cookie: auth.createSession().value })))).toBe(true);
+ });
+
+ it("prices a visitor's fly-around for its own GPU, never a demo", async () => {
+ process.env.FUOBE_PUBLIC_SIGNUP = "1";
+ const image = png("fly.png");
+ const account = auth.createSession(newAccount().id).value;
+ for (const cookie of [undefined, account]) {
+ const r = await flyAround.POST(call("/api/fly-around?preview=1", { engine: "open", image, orbit: { degrees: 90, direction: "cw" } }, cookie));
+ expect(r.status).toBe(200);
+ expect(await r.json()).toMatchObject({ engine: "open", demo: false, costUsd: 0, steps: 2 });
+ }
+ });
+ });
+
describe("the routes: a visitor's price is its own GPU's, and the owner's characters stay hidden", () => {
it("prices a guest's and an account's turnaround on their own GPU, never a demo; the owner's stays the install's", async () => {
process.env.FUOBE_PUBLIC_SIGNUP = "1";
diff --cc tests/public-signup.test.ts
index e7d2967c,ad74b5b1..3e0d6333
--- a/tests/public-signup.test.ts
+++ b/tests/public-signup.test.ts
@@@ -237,11 -237,16 +237,16 @@@ describe("accounts never run on the own
// A run route that ignores ?preview=1 isn't a price check.
"/api/cinema/projects/p1/generate?preview=1",
"/api/faceless/episodes/e1/estimate",
- // Restore & colourise (o/archive-restore): its run and its prompt writer.
+ // Restore & colourise: its run and its prompt writer.
"/api/restore",
"/api/restore/prompt",
- // Remove a person on H3 (o/person-remover-plus): its mask preview and "Redo from here".
++ // Remove a person on H3: its mask preview and "Redo from here".
+ "/api/remove-object/preview",
+ "/api/remove-object/reroll",
- // Character Swap Studio's Sharpen (n7-4): a studio job, like its assembly.
+ // Character Swap Studio's Sharpen: a studio job, like its assembly.
"/api/swap-studio/projects/p1/sharpen",
- // Plan layout (N7-8) plans with the studio's own AI helper.
++ // Plan layout plans with the studio's own AI helper.
+ "/api/layout/plan",
]) {
const r = proxy(req(p, { method: "POST", cookie }));
expect(r.status, p).toBe(403);
diff --cc tests/template-covers.test.ts
index 2629b550,f020ecff..0429228b
--- a/tests/template-covers.test.ts
+++ b/tests/template-covers.test.ts
@@@ -127,8 -99,8 +127,8 @@@ describe("the template covers manifest"
lines.push(` ${JSON.stringify(key)}: ${JSON.stringify(gen.slimEntry(key, { poster: e.poster, ...(e.video && { video: e.video }), ...(e.at && { at: e.at }), ...(e.frames && { frames: e.frames }) }))}`);
}
}
- // The studios' tiles (239), Fuobe Soul's looks (139), AI Influencer's types (9) and the empty pages' examples (6).
- expect(lines).toHaveLength(239 + 139 + 9 + 6);
- // 229 + Keyframes → animation (inbetweening).
- expect(lines).toHaveLength(230);
++ // The studios' tiles (240, with Keyframes → animation), Fuobe Soul's looks (139), AI Influencer's types (9) and the empty pages' examples (6).
++ expect(lines).toHaveLength(240 + 139 + 9 + 6);
const text = `{\n${lines.join(",\n")}\n}`;
expect(text.length).toBeLessThan(36_000);
expect(gzipSync(text).length).toBeLessThan(8_000);
diff --cc workflows/comfyui/manifest.json
index b444879c,e4cffdd4..98c12a40
--- a/workflows/comfyui/manifest.json
+++ b/workflows/comfyui/manifest.json
@@@ -20279,9 -21219,68 +21363,68 @@@
],
"vramGb": 24,
"license": "MiniMax H3 Community License (H3 Ref2VA, its video and audio VAEs, the packaged Qwen3-VL text encoder, Akatz Labs' Person Remover V1 LoRA): territory EXCLUDES the US, the EU, the UK and South Korea; commercial use above US$20M yearly revenue needs MiniMax's written authorization; show \"MiniMax H3\" on the product's interface; no outputs used to improve other AI models · Qwen3-VL-32B base Apache-2.0 · SAM 3.1 under Meta's SAM License (commercial use allowed under its terms) · H3 Relay nodes GPL-3.0 (Sendy Software LLC and contributors; vendored Context Loop and Spectrum GPL-3.0); the graph is H3 Relay's example workflow (GPL-3.0 repository)",
- "validated": false,
- "notes": "H3 Relay's toolkit H3-Person-Removal.api.json at e2a7665b (Akatz Labs' tool ships the same file). Changed: the clean first frame goes through an ImageScale (centre crop) to the video's exact size, so an edit that came back a little larger or smaller still fits; SAM 3.1's words default to \"person\"; the save prefix. video = the part already fitted to 24 fps on the 32-pixel grid (oss-fit-clip), image = the clean first frame (the app makes it with Qwen-Image-Edit from the part's first frame). 22-frame windows with 18 of history, 12 steps, er_sde / simple, CFG 1, LoRA 1.0, mask grown 5 px, seed 904234 by default (Akatz's settings). The output is silent: the app puts the clip's sound back. Needs the h3-relay pack (H3_RELAY=1) and FFmpeg.",
- "validationError": "HTTP 400: missing_node_type: Node 'H3RelayAppendWindow' not found. The custom node may not be installed. (Node ID '#append')"
+ "validated": true,
- "notes": "H3 Relay's toolkit H3-Person-Removal.api.json at e2a7665b (Akatz Labs' tool ships the same file). Changed: the clean first frame goes through an ImageScale (centre crop) to the video's exact size, so an edit that came back a little larger or smaller still fits; SAM 3.1's words default to \"person\"; the save prefix. video = the part already fitted to 24 fps on the 32-pixel grid (oss-fit-clip), image = the clean first frame (the app makes it with Qwen-Image-Edit from the part's first frame). 22-frame windows with 18 of history, 12 steps, er_sde / simple, CFG 1, LoRA 1.0, mask grown 5 px, seed 904234 by default (Akatz's settings). The output is silent: the app puts the clip's sound back. Needs the h3-relay pack (H3_RELAY=1) and FFmpeg. windowControls = H3 Relay's Review Windows controls (originals o/person-remover-plus): {config_key, windows: {index: {seed, locked, record_id}}}; locked windows come back exactly from the checkpoints the Relay keeps in ComfyUI's output/__h3_removal_cache, the first unlocked one is drawn again with its seed (Redo from here). The provider reads the run's window previews from /h3_relay/removal/previews."
++ "notes": "H3 Relay's toolkit H3-Person-Removal.api.json at e2a7665b (Akatz Labs' tool ships the same file). Changed: the clean first frame goes through an ImageScale (centre crop) to the video's exact size, so an edit that came back a little larger or smaller still fits; SAM 3.1's words default to \"person\"; the save prefix. video = the part already fitted to 24 fps on the 32-pixel grid (oss-fit-clip), image = the clean first frame (the app makes it with Qwen-Image-Edit from the part's first frame). 22-frame windows with 18 of history, 12 steps, er_sde / simple, CFG 1, LoRA 1.0, mask grown 5 px, seed 904234 by default (Akatz's settings). The output is silent: the app puts the clip's sound back. Needs the h3-relay pack (H3_RELAY=1) and FFmpeg. windowControls = H3 Relay's Review Windows controls: {config_key, windows: {index: {seed, locked, record_id}}}; locked windows come back exactly from the checkpoints the Relay keeps in ComfyUI's output/__h3_removal_cache, the first unlocked one is drawn again with its seed (Redo from here). The provider reads the run's window previews from /h3_relay/removal/previews."
+ },
+ {
+ "id": "video-person-remove-h3-mask",
+ "title": "Remove a person, mask first: SAM 3.1 finds who you name, thresholds and grows the mask and fills it green over the clip, as H3 Person Removal sees it (core nodes)",
+ "capability": "person-mask",
+ "file": "video-person-remove-h3-mask.json",
+ "source": "hand-built (scripts/comfy/hand-built/video-person-remove-h3-mask.json)",
+ "bindings": {
+ "video": [
+ {
+ "node": "source",
+ "input": "file"
+ }
+ ],
+ "maskPrompt": [
+ {
+ "node": "subject",
+ "input": "text"
+ }
+ ],
+ "maskGrow": [
+ {
+ "node": "grow_mask",
+ "input": "expand"
+ }
+ ],
+ "filenamePrefix": [
+ {
+ "node": "save",
+ "input": "filename_prefix"
+ }
+ ]
+ },
+ "outputs": [
+ {
+ "node": "save",
+ "kind": "video"
+ }
+ ],
+ "defaults": {
+ "maskGrow": 5,
+ "maskPrompt": "person"
+ },
+ "limits": {
+ "maxDurationSec": 10,
+ "maxFrames": 240
+ },
+ "models": [
+ {
+ "file": "sam3.1_multiplex_fp16.safetensors",
+ "folder": "checkpoints",
+ "url": "https://huggingface.co/Comfy-Org/sam3.1/resolve/7bb8374780a725b4353ed31f3a9395c9742b5621/checkpoints/sam3.1_multiplex_fp16.safetensors",
+ "sizeGb": 1.75
+ }
+ ],
+ "customNodes": [],
+ "vramGb": 6,
+ "license": "SAM 3.1 under Meta's SAM License (commercial use allowed under its terms); the chain is H3 Relay's Person Removal example (GPL-3.0 repository)",
+ "validated": true,
+ "notes": "The SAM 3.1 part of video-person-remove-h3-relay, node for node (detect 0.4 with 2 refinements, track 0.5 with 1 object and detection every 12 frames, threshold 0.5, grow maskGrow px, green 0x00FF00), saved as a video instead of sampled. video = the first seconds of the part, fitted to 24 fps on the 32-pixel grid like the removal (oss-fit-clip). Needs nothing but SAM 3.1."
},
{
"id": "video-character-swap-h3-segment",
@@@ -21602,12 -22601,156 +22745,156 @@@
"validated": true,
"notes": "Subject or product splat (3D Angles, 3D Jutsu props, a splat alternative to TRELLIS.2 spins). The official template 3d_triposplat_image_to_gaussian_splat (2026-06-02) with the UI-only live-preview patch removed and a 75-frame H.264 orbit (RenderSplat + CreateCameraInfo orbit yaw 35, pitch 30, distance 2.5; role turntable, 25 fps). Subject only: BiRefNet cuts it out first (cutout false = use the image's own alpha). Output 1 (role splat): splatFormat spz (Niantic, gzip, ~10x smaller, base colour), ply (full spherical harmonics) or ksplat, saved by SaveGLB under that extension. ComfyUI serves all three as application/octet-stream, so Fuobe goes by the extension: spz and ply are saved as 3D models (model/x-spz, model/ply), ksplat as a .bin file, and each output records its format. cutout is true by default (manifest defaults). numGaussians up to 1,048,576 (262,144 by default); seed drives both the sampler and the decoder. RenderSplat also takes a look_at camera, so a view picked in the browser can be rendered on the server. 3.78 GB of weights (TripoSplat 0.74, DINOv3 ViT-H 1.68, TripoSplat VAE decoder 0.58, FLUX.2 VAE 0.34, BiRefNet 0.44)."
},
+ {
+ "id": "image-to-splat-idol",
+ "title": "Image to a Gaussian splat of one object (Idol on the TripoSplat core nodes) + an orbit video",
+ "capability": "splat",
+ "file": "image-to-splat-idol.json",
+ "source": "hand-built (scripts/comfy/hand-built/image-to-splat-idol.json)",
+ "bindings": {
+ "image": [
+ {
+ "node": "99",
+ "input": "image"
+ }
+ ],
+ "cutout": [
+ {
+ "node": "88:35",
+ "input": "switch"
+ }
+ ],
+ "numGaussians": [
+ {
+ "node": "88:55",
+ "input": "num_gaussians"
+ }
+ ],
+ "steps": [
+ {
+ "node": "88:6",
+ "input": "steps"
+ }
+ ],
+ "cfg": [
+ {
+ "node": "88:6",
+ "input": "cfg"
+ }
+ ],
+ "sampler": [
+ {
+ "node": "88:6",
+ "input": "sampler_name"
+ }
+ ],
+ "photoCrop": [
+ {
+ "node": "88:104",
+ "input": "switch"
+ }
+ ],
+ "seed": [
+ {
+ "node": "88:6",
+ "input": "seed"
+ },
+ {
+ "node": "88:55",
+ "input": "seed"
+ }
+ ],
+ "splatFormat": [
+ {
+ "node": "92",
+ "input": "format"
+ }
+ ],
+ "orbitFrames": [
+ {
+ "node": "75",
+ "input": "frames"
+ }
+ ],
+ "filenamePrefix": [
+ {
+ "node": "51",
+ "input": "filename_prefix"
+ },
+ {
+ "node": "42",
+ "input": "filename_prefix"
+ }
+ ]
+ },
+ "outputs": [
+ {
+ "node": "51",
+ "kind": "model3d",
+ "role": "splat"
+ },
+ {
+ "node": "42",
+ "kind": "video",
+ "role": "turntable"
+ }
+ ],
+ "defaults": {
+ "steps": 50,
+ "cfg": 4,
+ "numGaussians": 262144,
+ "orbitFrames": 75,
+ "splatFormat": "spz",
+ "cutout": true,
+ "photoCrop": false
+ },
+ "limits": {
+ "maxGaussians": 1048576
+ },
+ "models": [
+ {
+ "file": "dino_v3_vit_h.safetensors",
+ "folder": "clip_vision",
+ "url": "https://huggingface.co/VAST-AI/TripoSplat/resolve/main/clip_vision/dino_v3_vit_h.safetensors",
+ "sizeGb": 1.68
+ },
+ {
+ "file": "flux2-vae.safetensors",
+ "folder": "vae",
+ "url": "https://huggingface.co/Comfy-Org/flux2-dev/resolve/main/split_files/vae/flux2-vae.safetensors",
+ "sizeGb": 0.34
+ },
+ {
+ "file": "idol_decoder_fp16.safetensors",
+ "folder": "vae",
+ "url": "https://huggingface.co/nynxz/Idol/resolve/c718f2b1b95b353edd07d17e845719fc10880a44/vae/idol_decoder_fp16.safetensors",
+ "sizeGb": 0.58
+ },
+ {
+ "file": "idol_fp16.safetensors",
+ "folder": "diffusion_models",
+ "url": "https://huggingface.co/nynxz/Idol/resolve/c718f2b1b95b353edd07d17e845719fc10880a44/diffusion_models/idol_fp16.safetensors",
+ "sizeGb": 0.74
+ },
+ {
+ "file": "birefnet.safetensors",
+ "folder": "background_removal",
+ "url": "https://huggingface.co/Comfy-Org/BiRefNet/resolve/main/background_removal/birefnet.safetensors",
+ "sizeGb": 0.44
+ }
+ ],
+ "customNodes": [],
+ "vramGb": 8,
+ "license": "Apache-2.0 (speridlabs/idol weights; the ComfyUI files are nynxz/Idol's conversion, Apache-2.0); Idol is VAST-AI-Research's TripoSplat architecture (MIT, code and weights); the dino_v3_vit_h image encoder is under the DINOv3 License (royalty-free, commercial use allowed, trade-control limits; the app must show a \"Built with DINOv3\" notice); FLUX.2 VAE Apache-2.0; BiRefNet MIT",
+ "validated": true,
+ "notes": "Idol 3D (Speridlabs): one object from one picture -> a Gaussian splat (role splat) + a 75-frame orbit video (role turntable). A copy of image-to-splat-triposplat with the same node ids. Reference settings (idol-sdk sampler.py L43-70): 50 Euler steps, simple schedule; Idol's CFG weight 3 in its (1+w)cond - w*uncond form is ComfyUI cfg 4.0, and its rescale_t 3 is TripoSplat's built-in shift 3 (comfy/supported_models.py), so no ModelSamplingSD3. Quick look (set by the page as params.extra): 20 dpmpp_2m steps, cfg 4, 65,536 Gaussians, the ComfyUI-Idol README's \"faster trade-off\" and \"fast preview\"; quality unmeasured. Photo crop (photoCrop, default false): TripoSplatPreprocessImage is Idol's \"synthetic\" 1.2 crop; scaled to 720 and centred on a black 1024 canvas (88:101-103) the object spans 600 px, where Idol's \"real\" 1.7 crop gives 602 px. ComfySwitchNode 88:104 picks it; its inputs are lazy, so the branch not taken does not run. Not yet compared with IdolPreprocessImage \"real\". About half the Gaussians are near-transparent: RenderSplat thresholds 0.05; the saved file is not pruned without the ComfyUI-Idol pack. 1.32 GB of new weights (idol_fp16 0.74, idol_decoder_fp16 0.58) plus the shared 2.46 GB (DINOv3 ViT-H 1.68, FLUX.2 VAE 0.34, BiRefNet 0.44). VRAM: vendor peak 7.2 GB in the SDK; unmeasured in ComfyUI."
+ },
{
- "id": "wan21-i2v-uni3c-path",
- "title": "Fly path: a still filmed along a camera path, Wan 2.1 I2V guided by Uni3C on a browser render of the path (core nodes)",
- "capability": "camera-path",
- "file": "wan21-i2v-uni3c-path.json",
- "source": "hand-built (scripts/comfy/hand-built/wan21-i2v-uni3c-path.json)",
+ "id": "any-angle-3d",
+ "title": "Any Angle: a photo to a 3D view of its subject (TripoSplat), with a turntable, the sweep its front view is measured on and a GLB",
+ "capability": "splat",
+ "file": "any-angle-3d.json",
+ "source": "hand-built (scripts/comfy/hand-built/any-angle-3d.json)",
"bindings": {
"image": [
{
diff --cc workflows/comfyui/model-pins.json
index 4e6694e8,617c0b10..061169f4
--- a/workflows/comfyui/model-pins.json
+++ b/workflows/comfyui/model-pins.json
@@@ -1060,23 -1050,69 +1060,93 @@@
"sizeBytes": 318820224,
"sha256": "ad2c20e0e103b6ad3ffffc56ab4e89c0822263c488aa4dd70e7e03091ff37b8d"
},
+ "https://huggingface.co/Kijai/MiniMax-H3-experimental/resolve/f5c3b1d5a63e008a691fca1b6096fd57a5307536/loras/minimax_h3_DMAD_4step_full_lora_avg_rank_39_bf16.safetensors": {
+ "revision": "f5c3b1d5a63e008a691fca1b6096fd57a5307536",
+ "sizeBytes": 366647000,
+ "sha256": "ddfdd94f4c9a0f32bf3649bb8e98ca20db572e4db6bcd9cca546a5b33ea32d11"
+ },
+ "https://huggingface.co/mdevoz/SolarRendererRank64/resolve/984a10b7c167bbb94614f9644d5fedbb93a8c6e6/solarrenderer_4step_lora_rank64.safetensors": {
+ "revision": "984a10b7c167bbb94614f9644d5fedbb93a8c6e6",
+ "sizeBytes": 691873992,
+ "sha256": "3ad1a6593813499bc351822062cc5f0b35ec761c69110614b2d2ccd7d34ae3e8"
+ },
+ "https://huggingface.co/mdevoz/SolarRendererRank64/resolve/984a10b7c167bbb94614f9644d5fedbb93a8c6e6/solarrenderer_control_lora_rank64.safetensors": {
+ "revision": "984a10b7c167bbb94614f9644d5fedbb93a8c6e6",
+ "sizeBytes": 691873968,
+ "sha256": "5ab559206030075e268b788547b9f3e420e6d96a4711a8f58a8fc7744c01365f"
+ },
+ "https://huggingface.co/black-forest-labs/flux-3-image-klein-comfy/resolve/feef60b0aaf63a4773ace96636ebbcf43b881312/text_encoders/qwen3.5_9b_flux3_prompt_upsampler_int8_convrot.safetensors": {
+ "revision": "feef60b0aaf63a4773ace96636ebbcf43b881312",
+ "sizeBytes": 9748113996
++ },
++ "https://huggingface.co/Kijai/WanVideo_comfy/resolve/main/LoRAs/AniSora/Wan2_2_I2V_AniSora_3_2_HIGH_rank_64_fp16.safetensors": {
++ "revision": "8260d429d19fd7a72304cad059160b95d843913f",
++ "sizeBytes": 630695648,
++ "sha256": "bdc68451d6bccd6efb70f6eb916ede7cc470e3b6dacd0273da528246334095da"
++ },
+ "https://huggingface.co/nynxz/Idol/resolve/c718f2b1b95b353edd07d17e845719fc10880a44/diffusion_models/idol_fp16.safetensors": {
+ "revision": "c718f2b1b95b353edd07d17e845719fc10880a44",
+ "sizeBytes": 741107210,
+ "sha256": "cf452146f78e23a0d34be8f9f79bcde642b9a40ef493046c8e9d5f79096f6dd0"
+ },
+ "https://huggingface.co/nynxz/Idol/resolve/c718f2b1b95b353edd07d17e845719fc10880a44/vae/idol_decoder_fp16.safetensors": {
+ "revision": "c718f2b1b95b353edd07d17e845719fc10880a44",
+ "sizeBytes": 576148658,
+ "sha256": "c511d99eb668ec4b06d883cb6e43770bc35e3864e16e7058e8d6211ba5c509aa"
+ },
+ "https://huggingface.co/Comfy-Org/MiniMax-H3/resolve/912b6e38b2092ec4d2e86d24183e0d59ea059d48/vae/minimax_h3_sol_vae_int8_convrot.safetensors": {
+ "revision": "912b6e38b2092ec4d2e86d24183e0d59ea059d48",
+ "sizeBytes": 1988306504,
+ "sha256": "a742069ba173bc3aba64cf8d8289d073e0818f2753f2fc2768f0342645089682"
+ },
+ "https://huggingface.co/FastVideo/FastVideo-FastH3-8-Step-V2-NVFP4-Comfy/resolve/994a40beb8c8f15739e4f0fad96aec101bb7123c/diffusion_models/fastvideo_fasth3_8step_v2_pruned_nvfp4.safetensors": {
+ "revision": "994a40beb8c8f15739e4f0fad96aec101bb7123c",
+ "sizeBytes": 13612462670,
+ "sha256": "49371f21b546e59813984938a1b4fbea9348eb5003e07a01d48083efcc5a1d94"
+ },
+ "https://huggingface.co/FastVideo/FastVideo-FastH3-Comfy/resolve/ec1e3aa374a91c57b0b94a1623b7e657c0498cf2/diffusion_models/fastvideo_fasth3_8step_v2_pruned_int8_convrot.safetensors": {
+ "revision": "ec1e3aa374a91c57b0b94a1623b7e657c0498cf2",
+ "sizeBytes": 22128378696,
+ "sha256": "0922785978dc9bfe1adf27d8b291b0ca763f9f165f882e6cb297c72fbb6deda8"
+ },
+ "https://huggingface.co/FastVideo/FastVideo-FastH3-Trim-Comfy/resolve/f66c13dc17391dd4da99242a407918b92bf7d5fc/diffusion_models/fastvideo_fasth3_trim_8step_fp8.safetensors": {
+ "revision": "f66c13dc17391dd4da99242a407918b92bf7d5fc",
+ "sizeBytes": 19683522390,
+ "sha256": "dbc05815de2f86a0028d10e4e90b19b759dd689078835a8c363706934d18f31a"
+ },
+ "https://huggingface.co/FastVideo/FastVideo-FastH3-Trim-Comfy/resolve/f66c13dc17391dd4da99242a407918b92bf7d5fc/diffusion_models/fastvideo_fasth3_trim_8step_int8_convrot.safetensors": {
+ "revision": "f66c13dc17391dd4da99242a407918b92bf7d5fc",
+ "sizeBytes": 18924757904,
+ "sha256": "ff6e40bc592f7362ea0d7bfcf4e0402bb2c26376d9d1bd4fffb047a5203c2153"
+ },
+ "https://huggingface.co/FastVideo/FastVideo-FastH3-Trim-Comfy/resolve/f66c13dc17391dd4da99242a407918b92bf7d5fc/diffusion_models/fastvideo_fasth3_trim_8step_nvfp4.safetensors": {
+ "revision": "f66c13dc17391dd4da99242a407918b92bf7d5fc",
+ "sizeBytes": 11894623166,
+ "sha256": "748b2bcc9c4b7bf7b23406987b42d4ac40362070c164cf11092482be6a863455"
+ },
+ "https://huggingface.co/Comfy-Org/MiniMax-Music-3/resolve/main/diffusion_models/minimax_music3_dit_int8_convrot.safetensors": {
+ "revision": "9e364ccd290a401561091fb441ed19cd7de92550",
+ "sizeBytes": 2502161682,
+ "sha256": "d6b959633e69899f99f3a92d6741c0fe79f26958a30811e50e372ef978b24d5f"
+ },
+ "https://huggingface.co/Comfy-Org/MiniMax-Music-3/resolve/main/text_encoders/minimax_music3_text_encoder_pruned_int8_convrot.safetensors": {
+ "revision": "9e364ccd290a401561091fb441ed19cd7de92550",
+ "sizeBytes": 9196611886,
+ "sha256": "010b7416d2336a08c711bc22ee65849c9623069ddb7d89bec011a75699e52014"
+ },
+ "https://huggingface.co/Comfy-Org/MiniMax-Music-3/resolve/main/vae/minimax_music3_dav.safetensors": {
+ "revision": "9e364ccd290a401561091fb441ed19cd7de92550",
+ "sizeBytes": 216696128,
+ "sha256": "2a32155b769be01445fcc2a8663b910fc9e1751e18dc1c3ec528064512d9ef0c"
+ },
+ "https://huggingface.co/Comfy-Org/YuE2/resolve/main/checkpoints/yue2_3b_int8_convrot.safetensors": {
+ "revision": "2f76ca75e6ee094169de899cc7fc99d6887e2196",
+ "sizeBytes": 3960938800,
+ "sha256": "96fe199377309001ed8cd26a944baeee8cc31a20ba7c36d1d3c0a7e1f4149db6"
+ },
+ "https://huggingface.co/Comfy-Org/YuE2/resolve/main/audio_encoders/sheetsage2_bf16.safetensors": {
+ "revision": "2f76ca75e6ee094169de899cc7fc99d6887e2196",
+ "sizeBytes": 1386868122,
+ "sha256": "5fd960ce3df281e3f3a889d174584d88f96247711480cf96377b12d7e8b6adc5"
}
}
diff --cc workflows/comfyui/object_info.subset.json
index 63f49e71,55e2b990..2e5d2448
--- a/workflows/comfyui/object_info.subset.json
+++ b/workflows/comfyui/object_info.subset.json
@@@ -7786,627 -7850,45 +7900,589 @@@
false
],
"output_name": [
- "MODEL"
- ],
- "output_tooltips": [
- null
+ "MODEL"
+ ],
+ "output_tooltips": [
+ null
+ ],
+ "output_matchtypes": null,
+ "name": "H3AdaLNLoRAFix",
+ "display_name": "H3 AdaLN LoRA Fix",
+ "description": "Rebases dense MiniMax-H3 LoRA AdaLN weights onto a pruned (curve-form) checkpoint, so they are applied instead of being skipped with 51 'ERROR lora ... adaln_proj' lines. Place it after your LoRA loader. Works in both directions: dense LoRA on a pruned base, or curve-form LoRA on a full one.",
+ "python_module": "custom_nodes.plaguekind-nodes",
+ "category": "PlagueKind/model_patches/minimax",
+ "output_node": false,
+ "deprecated": false,
+ "experimental": false,
+ "dev_only": false,
+ "api_node": false,
+ "price_badge": null,
+ "search_aliases": null,
+ "essentials_category": null,
+ "has_intermediate_output": false
+ },
+ "H3AdvancedSwapPlan": null,
+ "H3CharacterSwapAssemble": null,
+ "H3CharacterSwapController": null,
+ "H3CharacterSwapExpandMask": null,
+ "H3CharacterSwapModels": null,
+ "H3CharacterSwapPrepareVideo": null,
+ "H3CharacterSwapRecoverMasks": null,
+ "H3CharacterSwapSelectSubject": null,
+ "H3CharacterSwapSettings": null,
+ "H3CharacterSwapShot": null,
+ "H3CharacterSwapWindowPlan": null,
+ "H3ClipShots": null,
+ "H3FaceChunks": null,
+ "H3FaceJoin": null,
+ "H3FaceMaskSAM": {
+ "input": {
+ "required": {
+ "crops": [
+ "IMAGE",
+ {
+ "tooltip": "Wire the INPUT crops here - the 'crops' output of H3 Face Track + Crop - NOT the refined/decoded result.\n\nThis matches FaceDetailer: make_sam_mask() runs on the SOURCE image and the resulting mask is what the enhanced patch is later pasted through. Generation never feeds back into the mask.\n\nMasking the generated result instead is actively wrong: if the model nudges the face inward, the mask traces the NEW, smaller silhouette and the ORIGINAL face pokes out past it - most visibly the nose on profile shots. Masking the input covers where the face actually is in the footage being replaced.\n\nIt is also cheaper: no dependency on the sampler, so SAM need not be resident alongside the video model."
+ }
+ ],
+ "sam_model": [
+ "SAM_MODEL"
+ ],
+ "transform": [
+ "H3FACEXFORM"
+ ],
+ "threshold": [
+ "FLOAT",
+ {
+ "default": 0.93,
+ "min": 0,
+ "max": 1,
+ "step": 0.01
+ }
+ ],
+ "dilation": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 128,
+ "step": 2,
+ "tooltip": "Mirrors FaceDetailer's sam_dilation default of 0. SAM masks are accurate, so they rarely need growing."
+ }
+ ],
+ "temporal_smooth": [
+ "INT",
+ {
+ "default": 5,
+ "min": 1,
+ "max": 31,
+ "step": 2,
+ "tooltip": "Frames of averaging across the mask stack. 1 disables it and you will likely see the mask edge shimmer."
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "crops",
+ "sam_model",
+ "transform",
+ "threshold",
+ "dilation",
+ "temporal_smooth"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "MASK",
+ "STRING"
+ ],
+ "output_is_list": [
+ false,
+ false
+ ],
+ "output_name": [
+ "masks",
+ "report"
+ ],
+ "name": "H3FaceMaskSAM",
+ "display_name": "H3 Face Mask (SAM)",
+ "description": "Per-frame SAM face masks on the stabilised crops, temporally smoothed.",
+ "python_module": "custom_nodes.ComfyUI-H3-FaceRefine",
+ "category": "MiniMax H3/Face Refine",
+ "output_node": false,
+ "has_intermediate_output": false,
+ "search_aliases": []
+ },
+ "H3FaceStitch": {
+ "input": {
+ "required": {
+ "base_images": [
+ "IMAGE"
+ ],
+ "refined_crops": [
+ "IMAGE"
+ ],
+ "transform": [
+ "H3FACEXFORM"
+ ],
+ "paste_region": [
+ [
+ "face_only",
+ "face_ellipse",
+ "full_crop"
+ ],
+ {
+ "default": "face_only",
+ "tooltip": "WHAT gets composited back. face_only / face_ellipse paste just the detected face box (FaceDetailer's behaviour - the wider crop exists to give the sampler context, not to be pasted). full_crop pastes the whole crop including hair, shoulders and background, which risks a visible rectangle if H3 alters them."
+ }
+ ],
+ "mask_dilation": [
+ "INT",
+ {
+ "default": 16,
+ "min": 0,
+ "max": 256,
+ "step": 2,
+ "tooltip": "Grow the face box before blurring, in canvas px. Impact Pack dilates the same way so the blur has room and the blend does not eat into the face itself."
+ }
+ ],
+ "feather": [
+ "INT",
+ {
+ "default": 6,
+ "min": 0,
+ "max": 256,
+ "step": 2,
+ "tooltip": "Gaussian blur radius on the paste mask, in SOURCE pixels. Measured against the final frame, not the canvas, so the blend is the same physical width whatever this frame's magnification happens to be.\n\nCanvas-relative feather is a trap: a 75px crop blown up to 512 makes a 40px canvas feather only ~6 source px, while a 720px crop makes it ~56. The blend ends up TIGHTEST exactly where the face is smallest and the composite needs the most help - which reads as a hard edge appearing as a shot zooms out."
+ }
+ ],
+ "colour_match": [
+ "FLOAT",
+ {
+ "default": 1,
+ "min": 0,
+ "max": 1,
+ "step": 0.05,
+ "tooltip": "Match the refined crop's per-channel mean/std to the region it replaces. The crop and the full frame went through independent passes, so without this the face can come back subtly brighter or differently tinted and read as pasted on."
+ }
+ ],
+ "blend": [
+ "FLOAT",
+ {
+ "default": 1,
+ "min": 0,
+ "max": 1,
+ "step": 0.05,
+ "tooltip": "Global opacity of the refined face. Below 1.0 mixes back toward the original - useful to dial back over-sharpening."
+ }
+ ],
+ "undetected_frames": [
+ [
+ "fade_out",
+ "skip",
+ "composite_anyway"
+ ],
+ {
+ "default": "fade_out",
+ "tooltip": "What to do on frames where no FACE was found (turned away / occluded). ALL frames are still sent through H3 either way - that is what keeps it temporally consistent - this only controls whether the result is pasted back.\nfade_out: ramp the composite to zero across the gap (smooth, no pop, recommended).\nskip: hard cut - those frames keep original pixels exactly.\ncomposite_anyway: paste regardless. Risks H3 hallucinating a face onto the back of a head."
+ }
+ ]
+ },
+ "optional": {
+ "feather_scales_with_crop": [
+ "BOOLEAN",
+ {
+ "default": false,
+ "tooltip": "Old behaviour: treat feather as CANVAS pixels, so the blend narrows as the crop shrinks. Leave off."
+ }
+ ],
+ "masks": [
+ "MASK",
+ {
+ "tooltip": "Optional per-frame paste masks in CANVAS space, e.g. from H3 Face Mask (SAM). Overrides paste_region. This is the FaceDetailer bbox+SAM path: the mask follows the actual face so the blend falls on the jaw and hairline instead of an arbitrary rectangle. With a SAM mask use a SMALL feather (4-8); a rectangle needs much more."
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "base_images",
+ "refined_crops",
+ "transform",
+ "paste_region",
+ "mask_dilation",
+ "feather",
+ "colour_match",
+ "blend",
+ "undetected_frames"
+ ],
+ "optional": [
+ "feather_scales_with_crop",
+ "masks"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "IMAGE"
+ ],
+ "output_is_list": [
+ false
+ ],
+ "output_name": [
+ "images"
+ ],
+ "name": "H3FaceStitch",
+ "display_name": "H3 Face Stitch Back",
+ "description": "Composite H3-refined face crops back into the source frames.",
+ "python_module": "custom_nodes.ComfyUI-H3-FaceRefine",
+ "category": "MiniMax H3/Face Refine",
+ "output_node": false,
+ "has_intermediate_output": false,
+ "search_aliases": []
+ },
+ "H3FaceTrackCrop": {
+ "input": {
+ "required": {
+ "images": [
+ "IMAGE"
+ ],
+ "detector": [
+ [
+ "face_yolov8m.pt",
+ "bbox\\face_yolov8m.pt",
+ "segm\\person_yolov8m-seg.pt"
+ ]
+ ],
+ "confidence": [
+ "FLOAT",
+ {
+ "default": 0.35,
+ "min": 0.05,
+ "max": 0.95,
+ "step": 0.05
+ }
+ ],
+ "crop_factor": [
+ "FLOAT",
+ {
+ "default": 2.5,
+ "min": 1.2,
+ "max": 8,
+ "step": 0.1,
+ "tooltip": "Crop side as a multiple of detected face HEIGHT. 2.5 puts the face at ~40% of the crop, comfortably inside H3's good regime. Bigger = more context so the seam lands in hair/background, but less magnification. 2.0-3.0 is the useful range."
+ }
+ ],
+ "canvas_width": [
+ "INT",
+ {
+ "default": 768,
+ "min": 128,
+ "max": 1344,
+ "step": 32,
+ "tooltip": "Resolution H3 generates at. 768 is H3's native short edge and the default here; 512 is cheaper. In manual mode this is used exactly as typed, high or low. Ignored when canvas_mode is not 'manual', where the canvas comes from the crop instead and never falls below 512x512. Cost scales with area: 768 is 2.25x the latent tokens of 512."
+ }
+ ],
+ "canvas_height": [
+ "INT",
+ {
+ "default": 768,
+ "min": 128,
+ "max": 1344,
+ "step": 32
+ }
+ ],
+ "canvas_mode": [
+ [
+ "manual",
+ "auto_no_downscale",
+ "auto_capped_768"
+ ],
+ {
+ "default": "manual",
+ "tooltip": "manual: use canvas_width/height as given.\nauto_no_downscale: size the canvas from the LARGEST crop in the video so no frame is ever downscaled (magnification never drops below 1.0x). Can get expensive on videos that include close-ups.\nauto_capped_768: same, but clamped to 768 - H3's native short edge and a sane VRAM ceiling.\nBoth auto modes clamp UP to a minimum of 512x512, whatever the crop, so a small face in a low-resolution clip is still magnified. manual is not clamped - it uses canvas_width and canvas_height exactly as typed."
+ }
+ ],
+ "smooth_window": [
+ "INT",
+ {
+ "default": 21,
+ "min": 1,
+ "max": 201,
+ "step": 2,
+ "tooltip": "Frames of smoothing on the crop CENTRE. 21 at 24fps is ~0.9s. Raise if the box still shivers; lower if it lags behind fast head movement."
+ }
+ ],
+ "size_smooth_window": [
+ "INT",
+ {
+ "default": 51,
+ "min": 1,
+ "max": 201,
+ "step": 2,
+ "tooltip": "Frames of smoothing on the crop SIZE. Wants MORE than the centre: size jitter makes the crop breathe, which changes the resample factor every frame and reads as shimmer. Real zoom moves are slow, so heavy smoothing here costs nothing."
+ }
+ ],
+ "smooth_method": [
+ [
+ "gaussian",
+ "savgol",
+ "moving_average"
+ ],
+ {
+ "default": "gaussian",
+ "tooltip": "gaussian: best jitter rejection. savgol: preserves the shape of a push-in better at large windows. moving_average: the old boxcar, leaves residual jitter."
+ }
+ ],
+ "size_mode": [
+ [
+ "max_of_clip",
+ "per_frame"
+ ],
+ {
+ "default": "per_frame",
+ "tooltip": "per_frame: constant face-fraction in every crop (correct for push-ins). max_of_clip: one size for the whole video, only useful when the shot is genuinely static."
+ }
+ ]
+ },
+ "optional": {
+ "identity_reference": [
+ "IMAGE",
+ {
+ "tooltip": "A clear face image of the person to track. When supplied, the subject is chosen by FACE IDENTITY rather than by size, so a crowd scene locks onto the right person even when someone else is briefly larger or nearer.\n\nOPTIONAL on this node. identity_track works without it: the anchor is then built FROM THE CLIP, off frames where one face clearly dominates, which is usually the better anchor since a stylised reference sits in a different domain. Supply one only to name a specific person.\n\nRead only while identity_track is ON. With it off this input is ignored, and the report says so.\n\nWithout either, 'largest_face' has no notion of WHO it is following - it just takes the biggest box each frame, which switches subject whenever the framing changes.\n\nFOR MULTIPLE PEOPLE: run the pipeline once per subject, each with that person's reference here and their own refs on the H3 node, and chain them - feed run 1's stitched output in as run 2's base_images. The composites accumulate."
+ }
+ ],
+ "identity_track": [
+ "BOOLEAN",
+ {
+ "default": true,
+ "tooltip": "Hold one subject through a crowd. Continuity (nearest box to the previous position) decides most frames; the face-identity embedding is consulted only when two candidates are similarly plausible or their boxes overlap - which is both the accurate and the cheap arrangement, since the embedding model then runs on a handful of frames instead of all of them. The anchor is taken FROM THE CLIP by default (frames where one face clearly dominates), because an external stylised reference sits in a different domain - measured similarity between an illustration and a render of the same character was only 0.305, where same-domain faces score 0.5-0.7.\n\nThis switch also gates identity_reference: with it OFF a connected reference is not read at all, and the subject is chosen by select instead. The report says so when that happens."
+ }
+ ],
+ "identity_threshold": [
+ "FLOAT",
+ {
+ "default": 0.28,
+ "min": 0,
+ "max": 1,
+ "step": 0.01,
+ "tooltip": "Minimum score to accept a face as the reference person. Below this the frame falls back to continuity (nearest to the previous position at a similar size), which is what carries tracking through profiles and partial occlusion where embeddings become unreliable.\nThe scale depends on identity_model. 0.28 suits insightface cosine; clip_vision sits much higher (~0.80) because its similarities are compressed; ccip scores 0.5 at its own published operating point.\nSET 0 to use whichever default the chosen model recommends. The report prints the scores actually seen, so it can be tuned from evidence rather than guessed."
+ }
+ ],
+ "select": [
+ [
+ "largest_face",
+ "smallest_face",
+ "left_most",
+ "right_most",
+ "top_most",
+ "bottom_most",
+ "centre_most",
+ "closest_to_xy",
+ "detector_score"
+ ],
+ {
+ "default": "largest_face",
+ "tooltip": "How the subject is chosen. It is chosen ONCE per shot, on the first frame that holds it, and continuity follows that same face from there - it is NOT re-ranked each frame. A subject who walks from the left of frame to the right while someone else crosses the other way is still tracked correctly.\n\nlargest_face / smallest_face: biggest or smallest face by height.\nleft_most / right_most / top_most / bottom_most: by the CENTRE of the face box.\ncentre_most: nearest the centre of the frame.\nclosest_to_xy: nearest the X, Y you give, measured on frame_index.\ndetector_score: the detection the detector is most confident about.\n\nAT A HARD CUT a rank means nothing across the join - everyone is renumbered. With cut_detection ON, each shot chooses again by this rule, so a cut can land on a different person. With it OFF the video counts as one shot and continuity runs straight through a real cut onto whichever face is nearest the last position, which may be anyone.\n\nTo hold one person across cuts, wire identity_reference, or choose the face in H3 Load Video + Face Select.\n\nUsed only when no identity_reference is connected."
+ }
+ ],
+ "fallback_detector": [
+ [
+ "none",
+ "face_yolov8m.pt",
+ "bbox\\face_yolov8m.pt",
+ "segm\\person_yolov8m-seg.pt"
+ ],
+ {
+ "default": "none",
+ "tooltip": "Used only on frames where the FACE detector finds nothing (subject turned away). A person/body model such as segm\\person_yolov8m-seg.pt gives a real head position from the top of the body box, which beats interpolating blindly between the last and next face. Set 'none' to interpolate instead."
+ }
+ ],
+ "fallback_head_frac": [
+ "FLOAT",
+ {
+ "default": 0.5,
+ "min": 0,
+ "max": 1.5,
+ "step": 0.05,
+ "tooltip": "Head centre as a multiple of face height below the top of the person box. 0.5 puts it half a face-height down, which is about right for a head seen from behind."
+ }
+ ],
+ "select_index": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 63,
+ "tooltip": "Which face in that ranking to track. 0 is the first, 1 the second, and so on.\nThe subject is locked on the first frame that actually contains this index, so a video that opens on one face and only later shows a crowd still finds face 1. Frames before that lock-on are interpolated from it and faded out of the composite, the same as a detection dropout; the report counts them. Clamped, with a warning in the report, if the video never shows that many faces at once. Ignored entirely when identity_reference is connected.\nH3 Load Video + Face Select shows the faces numbered, if you need to see which number is who."
+ }
+ ],
+ "identity_model": [
+ [
+ "insightface",
+ "clip_vision",
+ "ccip"
+ ],
+ {
+ "default": "insightface",
+ "tooltip": "Which model decides that two faces are the same person.\ninsightface: ArcFace/buffalo_l. Photographed human faces. It reaches faces through its OWN detector, which does not fire on illustration - so on anime it finds no candidates at all and tracking quietly falls back to continuity.\nclip_vision: ComfyUI's CLIP vision, wired into identity_clip_vision from a CLIPVisionLoader. No extra install, works on any domain - anime, 3D, stylised - but it describes appearance rather than identity, so two characters with a similar palette can collide.\nccip: the illustration counterpart of ArcFace, purpose-built for 'same anime character?'. Best on anime. Needs 'pip install dghs-imgutils', which this pack deliberately does not install for you - it pins numpy<2 and pulls opencv-contrib-python.\nThe last two embed the boxes YOUR detector found, so pair them with an anime face model in the detector slot."
+ }
+ ],
+ "cut_detection": [
+ [
+ "none",
+ "auto (pyscenedetect)"
+ ],
+ {
+ "default": "none",
+ "tooltip": "Hard-cut detection, so the crop is not smoothed ACROSS a cut.\nnone: off. Correct for single-shot videos, which is what H3 generates.\nauto: split at the cuts and treat each shot as its own window for the smoothing, interpolation and composite fade. The canvas is still sized once for the whole video."
+ }
+ ],
+ "cut_threshold": [
+ "FLOAT",
+ {
+ "default": 3,
+ "min": 0.5,
+ "max": 20,
+ "step": 0.25,
+ "tooltip": "How far a frame has to stand out from its NEIGHBOURS to count as a cut. 3.0 is PySceneDetect's adaptive default.\nLower catches more and risks splitting a continuous shot, which costs smoothing on both sides. Higher takes only unambiguous cuts.\nOnly used when cut detection is on. The report says how many cuts were found and where, so tune it from that."
+ }
+ ],
+ "identity_clip_vision": [
+ "CLIP_VISION",
+ {
+ "tooltip": "A CLIP vision model from a CLIPVisionLoader, used only when identity_model is clip_vision. Any of the usual ComfyUI clip_vision checkpoints works; the bigger ViT-L/H models separate characters better than the small ones."
+ }
+ ],
+ "absent_shots": [
+ [
+ "off",
+ "by_identity"
+ ],
+ {
+ "default": "off",
+ "tooltip": "Find shots the subject is not in, so they are not rendered at all.\nby_identity: a shot where no sampled face matches the identity anchor above identity_threshold is treated as not containing the subject. Its frames keep their original pixels and drop out of the batch. Needs identity matching to be working - it does nothing without an anchor.\nSampled, not exhaustive, so a brief appearance can be missed. The report names every shot it drops and the score it saw."
+ }
+ ],
+ "X": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 16384,
+ "step": 1,
+ "tooltip": "Only used by select=closest_to_xy.\n\nHorizontal position in PIXELS of the source video frame, measured from the TOP-LEFT corner, increasing to the right. On a 960x544 clip, 0 is the left edge, 960 the right, 480 the middle.\n\nThe point does not have to sit on a face: the nearest face CENTRE wins, however far away it is."
+ }
+ ],
+ "Y": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 16384,
+ "step": 1,
+ "tooltip": "Only used by select=closest_to_xy.\n\nVertical position in PIXELS of the source video frame, measured from the TOP-LEFT corner, increasing DOWNWARD. On a 960x544 clip, 0 is the top edge, 544 the bottom, 272 the middle."
+ }
+ ],
+ "frame_index": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 999999,
+ "step": 1,
+ "tooltip": "Only used by select=closest_to_xy.\n\nThe frame the X, Y measurement is taken on, counting from 0 for the FIRST frame. It counts the frames this node loaded, so with skip_first_frames or select_every_nth set it counts from the first frame kept, not the first frame of the file.\n\nThe face found there is followed forwards and backwards through its shot, so pick a frame where the subject is clearly visible rather than one the detector may miss them on."
+ }
+ ],
+ "face_pick": [
+ "H3FACEPICK",
+ {
+ "tooltip": "The subject chosen upstream by H3 Load Video + Face Select.\nDecides who to follow, per shot, and carries the boxes and shot boundaries with it so this node does not detect the video again. select, select_index, cut_detection and cut_threshold are then unused, and detector and confidence are too unless a fallback_detector or a crop-based identity_model still needs them - they are then unused - the report names the detector that actually produced the boxes."
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "images",
+ "detector",
+ "confidence",
+ "crop_factor",
+ "canvas_width",
+ "canvas_height",
+ "canvas_mode",
+ "smooth_window",
+ "size_smooth_window",
+ "smooth_method",
+ "size_mode"
+ ],
+ "optional": [
+ "identity_reference",
+ "identity_track",
+ "identity_threshold",
+ "select",
+ "fallback_detector",
+ "fallback_head_frac",
+ "select_index",
+ "identity_model",
+ "cut_detection",
+ "cut_threshold",
+ "identity_clip_vision",
+ "absent_shots",
+ "X",
+ "Y",
+ "frame_index",
+ "face_pick"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "IMAGE",
+ "H3FACEXFORM",
+ "IMAGE",
+ "STRING",
+ "INT",
+ "INT",
+ "INT"
+ ],
+ "output_is_list": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "output_name": [
+ "crops",
+ "transform",
+ "preview",
+ "report",
+ "canvas_w",
+ "canvas_h",
+ "frame_count"
],
- "output_matchtypes": null,
- "name": "H3AdaLNLoRAFix",
- "display_name": "H3 AdaLN LoRA Fix",
- "description": "Rebases dense MiniMax-H3 LoRA AdaLN weights onto a pruned (curve-form) checkpoint, so they are applied instead of being skipped with 51 'ERROR lora ... adaln_proj' lines. Place it after your LoRA loader. Works in both directions: dense LoRA on a pruned base, or curve-form LoRA on a full one.",
- "python_module": "custom_nodes.plaguekind-nodes",
- "category": "PlagueKind/model_patches/minimax",
+ "name": "H3FaceTrackCrop",
+ "display_name": "H3 Face Track + Crop",
+ "description": "Per-frame face track -> smoothed, normalised crop -> constant-size batch for H3, plus the transform needed to paste the result back.",
+ "python_module": "custom_nodes.ComfyUI-H3-FaceRefine",
+ "category": "MiniMax H3/Face Refine",
"output_node": false,
- "deprecated": false,
- "experimental": false,
- "dev_only": false,
- "api_node": false,
- "price_badge": null,
- "search_aliases": null,
- "essentials_category": null,
- "has_intermediate_output": false
+ "has_intermediate_output": false,
+ "search_aliases": []
},
- "H3CharacterSwapAssemble": null,
- "H3CharacterSwapController": null,
- "H3CharacterSwapExpandMask": null,
- "H3CharacterSwapModels": null,
- "H3CharacterSwapPrepareVideo": null,
- "H3CharacterSwapRecoverMasks": null,
- "H3CharacterSwapSelectSubject": null,
- "H3CharacterSwapSettings": null,
- "H3CharacterSwapShot": null,
- "H3CharacterSwapWindowPlan": null,
+ "H3FillShots": null,
+ "H3GreyMannequins": null,
+ "H3ObjectSwapPlan": null,
+ "H3PeopleMask": null,
- "H3RelayAppendWindow": null,
- "H3RelayApplyEditMask": null,
- "H3RelayApplyHistory": null,
- "H3RelayExpandMask": null,
- "H3RelayFinishWindows": null,
- "H3RelayPrepareSource": null,
- "H3RelayRecoverMasks": null,
- "H3RelayReviewWindows": null,
- "H3RelaySamplingMemory": null,
- "H3RelaySelectMask": null,
- "H3RelayTextMemory": null,
- "H3RelayWindowInputs": null,
- "H3RelayWindowPlan": null,
- "H3RoleMask": null,
- "H3SLAAttention": {
+ "H3RelayAppendWindow": {
"input": {
"required": {
- "model": [
- "MODEL",
- {
- "tooltip": "MODEL,"
- }
- ],
- "sparsity_ratio": [
- "FLOAT",
- {
- "tooltip": "Fraction of key blocks skipped. 0.85 is the shipped default and what the SLA turbo LoRA was distilled against; 0.90 is the value validated here and is ~15% faster. Sparsity did NOT turn out to drive the speech artefacts on H3 -- step count did, so use 6 steps rather than lowering this. Break-even is about 0.60 -- below that this kernel is SLOWER than dense attention,0.0 disables sparsity without removing the node.",
- "default": 0.8,
- "min": 0,
- "max": 0.95,
- "step": 0.05,
- "round": false
- }
+ "frames": [
+ "IMAGE"
],
- "block_size": [
- "COMBO",
- {
- "tooltip": "How many sequence tokens share one key selection. Unrelated to the model's 128-wide heads. This matters far more for audio than video: H3 packs audio at 80 rows per second, so a 128-row block forces 1.6 s of audio down one attention pattern, while the same 128 rows are only 3% of a video frame. Speech came out robotic at 128 and clean at 64, for about 2% more time -- halving the block doubles the block count, so the attention work is identical and only the routing gets finer. Use 128 only if you generate without meaningful audio. Coming down to 32 has increased the quality even further for marginal slowdown ",
- "default": "32",
- "multiselect": false,
- "options": [
- "32",
- "64",
- "128"
- ]
- }
+ "window": [
+ "H3_RELAY_WINDOW"
]
},
"optional": {
@@@ -9252,22 -8649,1066 +9243,1072 @@@
false
],
"output_name": [
- "source_images",
- "start_images",
- "extended_images"
+ "source_window",
+ "edit_mask",
+ "target_audio",
+ "history",
+ "history_audio",
+ "reference_video",
+ "reference_audio",
+ "history_frames",
+ "conditioning_length",
+ "target_frames",
+ "seed",
+ "anchor",
+ "window"
],
- "name": "ImageBatchExtendWithOverlap",
- "display_name": "Image Batch Extend With Overlap",
- "description": "\nHelper node for video generation extension \nFirst input source and overlap amount to get the starting frames for the extension. \nThen on another copy of the node provide the newly generated frames and choose how to overlap them.\n",
- "python_module": "custom_nodes.ComfyUI-KJNodes",
- "category": "KJNodes/image",
+ "name": "H3RelayWindowInputs",
+ "display_name": "H3 · Window Inputs",
+ "description": "",
+ "python_module": "custom_nodes.h3-relay",
+ "category": "H3 Relay/timeline",
"output_node": false,
"has_intermediate_output": false,
- "output_tooltips": [
- "The original source images (passthrough)",
- "The input images used as the starting point for extension",
- "The extended images with overlap, if no new images are provided this will be empty"
- ],
+ "search_aliases": []
+ },
+ "H3RelayWindowPlan": {
+ "input": {
+ "required": {
+ "source_frames": [
+ "INT",
+ {
+ "default": 120,
+ "min": 1
+ }
+ ],
+ "window_frames": [
+ [
+ "22",
+ "39",
+ "56",
+ "73",
+ "90",
+ "107",
+ "124",
+ "141",
+ "158",
+ "175",
+ "192",
+ "209",
+ "226",
+ "243",
+ "260",
+ "277",
+ "294",
+ "311",
+ "328",
+ "345",
+ "362"
+ ],
+ {
+ "default": "124"
+ }
+ ],
+ "history_frames": [
+ [
+ "0",
+ "1",
+ "18",
+ "35",
+ "52",
+ "69",
+ "86",
+ "103",
+ "120",
+ "137",
+ "154",
+ "171",
+ "188",
+ "205",
+ "222",
+ "239",
+ "256",
+ "273",
+ "290",
+ "307",
+ "324",
+ "341"
+ ],
+ {
+ "default": "18"
+ }
+ ],
+ "seed": [
+ "INT",
+ {
+ "default": 194731,
+ "min": 0,
+ "max": 18446744073709552000
+ }
+ ],
+ "schedule": [
+ [
+ "adaptive",
+ "removal_v1",
+ "segment"
+ ],
+ {
+ "default": "adaptive"
+ }
+ ],
+ "seed_mode": [
+ [
+ "fixed",
+ "increment"
+ ],
+ {
+ "default": "fixed"
+ }
+ ]
+ },
+ "optional": {
+ "seed_overrides": [
+ "STRING",
+ {
+ "default": "{}"
+ }
+ ],
+ "initial_history": [
+ "IMAGE"
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "source_frames",
+ "window_frames",
+ "history_frames",
+ "seed",
+ "schedule",
+ "seed_mode"
+ ],
+ "optional": [
+ "seed_overrides",
+ "initial_history"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "H3_RELAY_WINDOW",
+ "STRING",
+ "INT",
+ "H3_RELAY_WINDOWS"
+ ],
+ "output_is_list": [
+ true,
+ false,
+ false,
+ false
+ ],
+ "output_name": [
+ "window_list",
+ "timeline",
+ "count",
+ "windows"
+ ],
+ "name": "H3RelayWindowPlan",
+ "display_name": "H3 · Plan Windows",
+ "description": "",
+ "python_module": "custom_nodes.h3-relay",
+ "category": "H3 Relay/timeline",
+ "output_node": false,
+ "has_intermediate_output": false,
+ "search_aliases": []
+ },
++ "H3RoleMask": null,
+ "H3SLAAttention": {
+ "input": {
+ "required": {
+ "model": [
+ "MODEL",
+ {
+ "tooltip": "MODEL,"
+ }
+ ],
+ "sparsity_ratio": [
+ "FLOAT",
+ {
+ "tooltip": "Fraction of key blocks skipped. 0.85 is the shipped default and what the SLA turbo LoRA was distilled against; 0.90 is the value validated here and is ~15% faster. Sparsity did NOT turn out to drive the speech artefacts on H3 -- step count did, so use 6 steps rather than lowering this. Break-even is about 0.60 -- below that this kernel is SLOWER than dense attention,0.0 disables sparsity without removing the node.",
+ "default": 0.8,
+ "min": 0,
+ "max": 0.95,
+ "step": 0.05,
+ "round": false
+ }
+ ],
+ "block_size": [
+ "COMBO",
+ {
+ "tooltip": "How many sequence tokens share one key selection. Unrelated to the model's 128-wide heads. This matters far more for audio than video: H3 packs audio at 80 rows per second, so a 128-row block forces 1.6 s of audio down one attention pattern, while the same 128 rows are only 3% of a video frame. Speech came out robotic at 128 and clean at 64, for about 2% more time -- halving the block doubles the block count, so the attention work is identical and only the routing gets finer. Use 128 only if you generate without meaningful audio. Coming down to 32 has increased the quality even further for marginal slowdown ",
+ "default": "32",
+ "multiselect": false,
+ "options": [
+ "32",
+ "64",
+ "128"
+ ]
+ }
+ ]
+ },
+ "optional": {
+ "min_seq_len": [
+ "INT",
+ {
+ "tooltip": "Sequences shorter than this stay dense. Guards two things: the short text-refiner attention, which must never be sparsified, and low-resolution or short clips, where block selection would cost more than it saves. Lower it only if you know your sequence is long enough to benefit.",
+ "default": 12228,
+ "min": 0,
+ "max": 1000000,
+ "step": 1024
+ }
+ ],
+ "dense_last_steps": [
+ "INT",
+ {
+ "tooltip": "Run the last N sampling steps at full attention. 0 matches the turbo LoRA's original distillation setup exactly. 1 costs a little speed and can recover fine detail, since the final step's error is the one you actually see. Stacks with dense_steps below rather than replacing it.",
+ "default": 0,
+ "min": 0,
+ "max": 8
+ }
+ ],
+ "protect_audio": [
+ "BOOLEAN",
+ {
+ "tooltip": "Always attend blocks overlapping actual language tokens, target audio, and audio-reference segments. Visual-reference blocks are controlled separately. Disable only for turbo-style uniform sparsity; testing found partial or unprotected audio unstable for very little speed gain.",
+ "default": false,
+ "label_on": "protect",
+ "label_off": "uniform (turbo parity)"
+ }
+ ],
+ "enabled": [
+ "BOOLEAN",
+ {
+ "tooltip": "Turn off to pass the model straight through, for a like-for-like speed baseline without rewiring.",
+ "default": true,
+ "label_on": "sparse",
+ "label_off": "dense (bypass)"
+ }
+ ],
+ "dense_steps": [
+ "STRING",
+ {
+ "tooltip": "Explicit 0-based step indices to force dense, on top of dense_last_steps -- e.g. '0,1' or '0-2'. Early steps set global composition and prompt adherence, so keeping just those exact and sparsifying the rest can fix prompt-following regressions without paying for full attention on every step. Blank = none.",
+ "default": "1",
+ "multiline": false
+ }
+ ],
+ "dense_backend": [
+ "COMBO",
+ {
+ "tooltip": "Attention kernel used on every dense fall-through (short sequences, dense_last_steps, dense_steps). 'comfy_kitchen' (default, Comfy Kitchen int8) is fast enough on the handful of dense steps this node runs to be worth its precision tradeoff there. 'pytorch' pins the plain reference kernel instead if you want zero quantization anywhere in the dense path, at real cost to dense-step speed -- dense steps are the ones this node already decided must be exact, so that's the safest choice if you're chasing maximum quality over speed there. The 'sage:*' modes match an existing sage-attention kernel dropdown one-for-one -- 'sage:auto' lets the sageattention package pick; the rest pin a specific kernel + pv_accum_dtype: fp16_cuda uses fp32 accum (safest), fp8_cuda uses fp32+fp32 (safest of the fp8 pair), fp8_cuda++ uses fp32+fp16 (faster, more overflow-prone -- try this first if fp8_cuda works but you want more speed). Needs the sageattention package installed; falls back to whatever's already active with a logged warning if it isn't, or if a specific kernel is missing from your installed version. 'auto' restores the old behaviour of using whatever backend is already active globally. The sparse path is unaffected by this setting either way -- it never goes through backend selection at all.",
+ "default": "comfy_kitchen",
+ "multiselect": false,
+ "options": [
+ "pytorch",
+ "comfy_kitchen",
+ "sage:auto",
+ "sage:qk_int8_pv_fp16_cuda",
+ "sage:qk_int8_pv_fp16_triton",
+ "sage:qk_int8_pv_fp8_cuda",
+ "sage:qk_int8_pv_fp8_cuda++",
+ "auto"
+ ]
+ }
+ ],
+ "disable_fp16_accum": [
+ "BOOLEAN",
+ {
+ "tooltip": "Force off the fp16/bf16 reduced-precision matmul reduction path for this model's sampling run, regardless of the global --fast fp16_accumulation flag. Measured to cost quality on H3 with no throughput gain. Turn off only to A/B against the global flag.",
+ "default": true,
+ "label_on": "disabled (recommended)",
+ "label_off": "follow --fast"
+ }
+ ],
+ "stabilize_motion": [
+ "BOOLEAN",
+ {
+ "tooltip": "Bias each layer's block selection toward what it picked last step, so a near-tie between two blocks doesn't flip for no reason and show up as a faint double-exposure on fast motion. Only target-video query rows are stabilized; text and audio choices remain step-local. It is a fix for that one specific symptom, not a general quality dial. - Uses more Vram ",
+ "default": false,
+ "label_on": "on",
+ "label_off": "off"
+ }
+ ],
+ "reference_protection": [
+ "COMBO",
+ {
+ "display_name": "Protect Vid/Ref",
+ "tooltip": "Protect Image/Video Reference. Heavy Enforcement guarantees every Qwen vision-token, conditioning/image-reference, and video-reference block, matching the broad legacy prefix protection -- this is a reinforcement of those blocks, not a protection tuned for reference quality, and is most likely unusable with max ref size mode. Light uses fixed 0.85 reference sparsity and guarantees the best-scoring 15% of each visual-reference range. Off adds no special quota; references still participate in ordinary top-k. Default Off preserves the precise audio patch's fastest behaviour.",
+ "default": "Off",
+ "multiselect": false,
+ "options": [
+ "Heavy Enforcement",
+ "Light",
+ "Off"
+ ]
+ }
+ ],
+ "tail_correction": [
+ "BOOLEAN",
+ {
+ "tooltip": "Instead of a hard zero for every key block topk left out, fold in one pooled term standing in for all of them, so nothing leaves the softmax -- same idea as a widely-used block-sparse kernel's tail handling. Scored from the same pooled centroids selection already computes, so the only added cost is one more mean-pool of V plus a small reduction per call, not a second attention pass. Should help most at high sparsity, where the discarded tail is largest. Off by default: new, and its effect on H3 output quality specifically hasn't been validated the way sparsity_ratio's defaults have -- test before trusting it in a real render.",
+ "default": false,
+ "label_on": "on (experimental)",
+ "label_off": "off"
+ }
+ ],
+ "use_int8_qk": [
+ "BOOLEAN",
+ {
+ "tooltip": "Quantize Q and K to int8 (per-token, dynamic scale) before the QK dot product on the selected topk blocks -- PV stays full precision (the mirror use_int8_pv toggle was removed from this node: its hidden widget could still be converted to an input socket and connected, which broke the node -- PV quantization is no longer exposed here). This is SageAttention's qk_int8_pv_fp16 split, not full int8 attention, and it's a different lever from dense_backend above: that setting only affects dense fall-through steps, this affects the sparse compute itself, on every sparse step. Ignored entirely when engine is comfy_kitchen, which quantizes internally regardless. UNTESTED ON HARDWARE: the quantize/dequantize math checks out against exact fp32 scores in isolation, but real speed, launch stability, and output quality on H3 have not been measured on a GPU. Try it against a known-good render before trusting it, and expect to possibly hit a launch failure on some GPU/Triton combinations before it's been shaken out.",
+ "default": true,
+ "label_on": "on (experimental)",
+ "label_off": "off"
+ }
+ ],
+ "engine": [
+ "COMBO",
+ {
+ "tooltip": "Which attention implementation runs the sparse path. triton (default) is this node pack's own kernel -- every other widget above applies to it fully. comfy_kitchen instead calls comfy_kitchen's real compiled sol_attn kernel (Comfy-Org/ComfyUI PR #16072, needs comfy-kitchen>=0.2.32 installed): genuine CUDA int8 compute and a built-in pooled tail term, but it can only express ONE contiguous protected range, has no reference-quota tier, and has no cross-step stabilize_motion -- reference_protection, multi-span protect_ranges, and stabilize_motion are silently disabled (one-time log warning each) rather than approximated, and tail_correction/use_int8_qk above are ignored since the real kernel quantizes internally regardless, but now honours tail_correction's on/off setting rather than always applying it. Both fall back to dense the same as any other kernel failure if their kernel is unavailable or throws.",
+ "default": "comfy_kitchen",
+ "multiselect": false,
+ "options": [
+ "triton",
+ "comfy_kitchen"
+ ]
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "model",
+ "sparsity_ratio",
+ "block_size"
+ ],
+ "optional": [
+ "min_seq_len",
+ "dense_last_steps",
+ "protect_audio",
+ "enabled",
+ "dense_steps",
+ "dense_backend",
+ "disable_fp16_accum",
+ "stabilize_motion",
+ "reference_protection",
+ "tail_correction",
+ "use_int8_qk",
+ "engine"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "MODEL"
+ ],
+ "output_is_list": [
+ false
+ ],
+ "output_name": [
+ "MODEL"
+ ],
+ "output_tooltips": [
+ null
+ ],
+ "output_matchtypes": null,
+ "name": "H3SLAAttention",
+ "display_name": "H3 SLA Attention",
+ "description": "Block-sparse attention for MiniMax-H3, matching the inference sequences benefit most, so the gain grows with resolution and duration; short ones fall back to dense automatically.",
+ "python_module": "custom_nodes.plaguekind-nodes",
+ "category": "PlagueKind/model_patches/minimax",
+ "output_node": false,
+ "deprecated": false,
+ "experimental": false,
+ "dev_only": false,
+ "api_node": false,
+ "price_badge": null,
+ "search_aliases": null,
+ "essentials_category": null,
+ "has_intermediate_output": false
+ },
++ "H3SoundtrackOrSilence": null,
++ "H3SourceSlice": null,
++ "H3SubjectPrompt": null,
++ "H3TrackCrops": null,
++ "H3TrackRoles": null,
+ "Hunyuan3Dv2Conditioning": {
+ "input": {
+ "required": {
+ "clip_vision_output": [
+ "CLIP_VISION_OUTPUT",
+ {}
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "clip_vision_output"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "CONDITIONING",
+ "CONDITIONING"
+ ],
+ "output_is_list": [
+ false,
+ false
+ ],
+ "output_name": [
+ "positive",
+ "negative"
+ ],
+ "output_tooltips": [
+ null,
+ null
+ ],
+ "output_matchtypes": null,
+ "name": "Hunyuan3Dv2Conditioning",
+ "display_name": null,
+ "description": "",
+ "python_module": "comfy_extras.nodes_hunyuan3d",
+ "category": "model/conditioning/hunyuan 3d",
+ "output_node": false,
+ "deprecated": false,
+ "experimental": false,
+ "dev_only": false,
+ "api_node": false,
+ "price_badge": null,
+ "search_aliases": null,
+ "essentials_category": null,
+ "has_intermediate_output": false
+ },
+ "HunyuanDependenciesLoader": {
+ "input": {
+ "required": {
+ "vae_name": [
+ []
+ ],
+ "synchformer_name": [
+ []
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "vae_name",
+ "synchformer_name"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "HUNYUAN_DEPS"
+ ],
+ "output_is_list": [
+ false
+ ],
+ "output_name": [
+ "HUNYUAN_DEPS"
+ ],
+ "name": "HunyuanDependenciesLoader",
+ "display_name": "Hunyuan-Foley Dependencies Loader",
+ "description": "",
+ "python_module": "custom_nodes.ComfyUI-HunyuanVideo-Foley",
+ "category": "audio/HunyuanFoley",
+ "output_node": false,
+ "has_intermediate_output": false,
+ "search_aliases": []
+ },
+ "HunyuanFoleySampler": {
+ "input": {
+ "required": {
+ "hunyuan_model": [
+ "HUNYUAN_MODEL"
+ ],
+ "hunyuan_deps": [
+ "HUNYUAN_DEPS"
+ ],
+ "frame_rate": [
+ "FLOAT",
+ {
+ "default": 16,
+ "min": 1,
+ "max": 120,
+ "step": 0.1,
+ "tooltip": "The framerate of the input image sequence"
+ }
+ ],
+ "duration": [
+ "FLOAT",
+ {
+ "default": 5,
+ "min": 1,
+ "max": 60,
+ "step": 0.1,
+ "tooltip": "Duration of the audio to generate in seconds"
+ }
+ ],
+ "prompt": [
+ "STRING",
+ {
+ "multiline": true,
+ "default": "A person walks on frozen ice"
+ }
+ ],
+ "negative_prompt": [
+ "STRING",
+ {
+ "multiline": true,
+ "default": "noisy, harsh"
+ }
+ ],
+ "cfg_scale": [
+ "FLOAT",
+ {
+ "default": 4.5,
+ "min": 1,
+ "max": 10,
+ "step": 0.1,
+ "tooltip": "Classifier-Free Guidance scale"
+ }
+ ],
+ "steps": [
+ "INT",
+ {
+ "default": 50,
+ "min": 10,
+ "max": 100,
+ "step": 1,
+ "tooltip": "Number of denoising steps"
+ }
+ ],
+ "sampler": [
+ [
+ "euler",
+ "heun-2",
+ "midpoint-2",
+ "kutta-4"
+ ],
+ {
+ "default": "euler",
+ "tooltip": "These were included with the official repo, but only Euler seems decent..."
+ }
+ ],
+ "batch_size": [
+ "INT",
+ {
+ "default": 1,
+ "min": 1,
+ "max": 6,
+ "step": 1,
+ "tooltip": "Number of audio variations to generate at once"
+ }
+ ],
+ "seed": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 18446744073709552000
+ }
+ ],
+ "force_offload": [
+ "BOOLEAN",
+ {
+ "default": true,
+ "tooltip": "Offload models from VRAM after generation"
+ }
+ ]
+ },
+ "optional": {
+ "image": [
+ "IMAGE"
+ ],
+ "torch_compile_cfg": [
+ "TORCH_COMPILE_CFG",
+ {
+ "tooltip": "Compile the model blocks with this configuration (applied lazily before denoising)."
+ }
+ ],
+ "block_swap_args": [
+ "BLOCKSWAPARGS",
+ {
+ "tooltip": "Enable BlockSwap VRAM optimization during sampling."
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "hunyuan_model",
+ "hunyuan_deps",
+ "frame_rate",
+ "duration",
+ "prompt",
+ "negative_prompt",
+ "cfg_scale",
+ "steps",
+ "sampler",
+ "batch_size",
+ "seed",
+ "force_offload"
+ ],
+ "optional": [
+ "image",
+ "torch_compile_cfg",
+ "block_swap_args"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "AUDIO",
+ "AUDIO"
+ ],
+ "output_is_list": [
+ false,
+ false
+ ],
+ "output_name": [
+ "audio_first",
+ "audio_batch"
+ ],
+ "name": "HunyuanFoleySampler",
+ "display_name": "Hunyuan-Foley Sampler",
+ "description": "",
+ "python_module": "custom_nodes.ComfyUI-HunyuanVideo-Foley",
+ "category": "audio/HunyuanFoley",
+ "output_node": false,
+ "has_intermediate_output": false,
+ "search_aliases": []
+ },
+ "HunyuanModelLoader": {
+ "input": {
+ "required": {
+ "model_name": [
+ []
+ ],
+ "precision": [
+ [
+ "auto",
+ "bf16",
+ "fp16",
+ "fp32"
+ ],
+ {
+ "default": "bf16",
+ "tooltip": "Compute dtype for non-quantized params and autocast (auto = detect from checkpoint)"
+ }
+ ],
+ "quantization": [
+ [
+ "none",
+ "fp8_e4m3fn",
+ "fp8_e5m2",
+ "auto"
+ ],
+ {
+ "default": "auto",
+ "tooltip": "FP8 weight-only storage for Linear layers, saves a few GB VRAM (compute still fp16/bf16)"
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "model_name",
+ "precision",
+ "quantization"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "HUNYUAN_MODEL"
+ ],
+ "output_is_list": [
+ false
+ ],
+ "output_name": [
+ "HUNYUAN_MODEL"
+ ],
+ "name": "HunyuanModelLoader",
+ "display_name": "Hunyuan-Foley Model Loader",
+ "description": "",
+ "python_module": "custom_nodes.ComfyUI-HunyuanVideo-Foley",
+ "category": "audio/HunyuanFoley",
+ "output_node": false,
+ "has_intermediate_output": false,
+ "search_aliases": []
+ },
+ "HunyuanVideo15ImageToVideo": {
+ "input": {
+ "required": {
+ "positive": [
+ "CONDITIONING",
+ {}
+ ],
+ "negative": [
+ "CONDITIONING",
+ {}
+ ],
+ "vae": [
+ "VAE",
+ {}
+ ],
+ "width": [
+ "INT",
+ {
+ "default": 848,
+ "min": 16,
+ "max": 16384,
+ "step": 16
+ }
+ ],
+ "height": [
+ "INT",
+ {
+ "default": 480,
+ "min": 16,
+ "max": 16384,
+ "step": 16
+ }
+ ],
+ "length": [
+ "INT",
+ {
+ "default": 33,
+ "min": 1,
+ "max": 16384,
+ "step": 4
+ }
+ ],
+ "batch_size": [
+ "INT",
+ {
+ "default": 1,
+ "min": 1,
+ "max": 4096
+ }
+ ]
+ },
+ "optional": {
+ "start_image": [
+ "IMAGE",
+ {}
+ ],
+ "clip_vision_output": [
+ "CLIP_VISION_OUTPUT",
+ {}
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "positive",
+ "negative",
+ "vae",
+ "width",
+ "height",
+ "length",
+ "batch_size"
+ ],
+ "optional": [
+ "start_image",
+ "clip_vision_output"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "CONDITIONING",
+ "CONDITIONING",
+ "LATENT"
+ ],
+ "output_is_list": [
+ false,
+ false,
+ false
+ ],
+ "output_name": [
+ "positive",
+ "negative",
+ "latent"
+ ],
+ "output_tooltips": [
+ null,
+ null,
+ null
+ ],
+ "output_matchtypes": null,
+ "name": "HunyuanVideo15ImageToVideo",
+ "display_name": null,
+ "description": "",
+ "python_module": "comfy_extras.nodes_hunyuan",
+ "category": "model/conditioning/hunyuan video",
+ "output_node": false,
+ "deprecated": false,
+ "experimental": false,
+ "dev_only": false,
+ "api_node": false,
+ "price_badge": null,
+ "search_aliases": null,
+ "essentials_category": null,
+ "has_intermediate_output": false
+ },
+ "INTConstant": {
+ "input": {
+ "required": {
+ "value": [
+ "INT",
+ {
+ "default": 0,
+ "min": -18446744073709552000,
+ "max": 18446744073709552000
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "value"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "INT"
+ ],
+ "output_is_list": [
+ false
+ ],
+ "output_name": [
+ "value"
+ ],
+ "name": "INTConstant",
+ "display_name": "INT Constant",
+ "description": "",
+ "python_module": "custom_nodes.ComfyUI-KJNodes",
+ "category": "KJNodes/constants",
+ "output_node": false,
+ "has_intermediate_output": false,
+ "search_aliases": [
+ "integer",
+ "value"
+ ]
+ },
+ "Ideogram4Scheduler": {
+ "input": {
+ "required": {
+ "steps": [
+ "INT",
+ {
+ "default": 20,
+ "min": 1,
+ "max": 200
+ }
+ ],
+ "width": [
+ "INT",
+ {
+ "default": 1024,
+ "min": 256,
+ "max": 8192,
+ "step": 16
+ }
+ ],
+ "height": [
+ "INT",
+ {
+ "default": 1024,
+ "min": 256,
+ "max": 8192,
+ "step": 16
+ }
+ ],
+ "mu": [
+ "FLOAT",
+ {
+ "default": 0,
+ "min": -10,
+ "max": 10,
+ "step": 0.05
+ }
+ ],
+ "std": [
+ "FLOAT",
+ {
+ "default": 1.75,
+ "min": 0.1,
+ "max": 5,
+ "step": 0.05
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "steps",
+ "width",
+ "height",
+ "mu",
+ "std"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "SIGMAS"
+ ],
+ "output_is_list": [
+ false
+ ],
+ "output_name": [
+ "SIGMAS"
+ ],
+ "output_tooltips": [
+ null
+ ],
+ "output_matchtypes": null,
+ "name": "Ideogram4Scheduler",
+ "display_name": "Ideogram 4 Scheduler",
+ "description": "",
+ "python_module": "comfy_extras.nodes_ideogram4",
+ "category": "model/sampling/schedulers",
+ "output_node": false,
+ "deprecated": false,
+ "experimental": false,
+ "dev_only": false,
+ "api_node": false,
+ "price_badge": null,
+ "search_aliases": null,
+ "essentials_category": null,
+ "has_intermediate_output": false
+ },
+ "ImageBatch": {
+ "input": {
+ "required": {
+ "image1": [
+ "IMAGE"
+ ],
+ "image2": [
+ "IMAGE"
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "image1",
+ "image2"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "IMAGE"
+ ],
+ "output_is_list": [
+ false
+ ],
+ "output_name": [
+ "IMAGE"
+ ],
+ "name": "ImageBatch",
+ "display_name": "Batch Images (DEPRECATED)",
+ "description": "",
+ "python_module": "nodes",
+ "category": "image/batch",
+ "output_node": false,
+ "has_intermediate_output": false,
+ "deprecated": true,
+ "search_aliases": [
+ "combine images",
+ "merge images",
+ "stack images"
+ ]
+ },
+ "ImageBatchExtendWithOverlap": {
+ "input": {
+ "required": {
+ "source_images": [
+ "IMAGE",
+ {
+ "tooltip": "The source images to extend"
+ }
+ ],
+ "overlap": [
+ "INT",
+ {
+ "default": 13,
+ "min": 1,
+ "max": 4096,
+ "step": 1,
+ "tooltip": "Number of overlapping frames between source and new images"
+ }
+ ],
+ "overlap_side": [
+ [
+ "source",
+ "new_images"
+ ],
+ {
+ "default": "source",
+ "tooltip": "Which side to overlap on"
+ }
+ ],
+ "overlap_mode": [
+ [
+ "cut",
+ "linear_blend",
+ "ease_in_out",
+ "filmic_crossfade",
+ "perceptual_crossfade"
+ ],
+ {
+ "default": "linear_blend",
+ "tooltip": "Method to use for overlapping frames"
+ }
+ ]
+ },
+ "optional": {
+ "new_images": [
+ "IMAGE",
+ {
+ "tooltip": "The new images to extend with"
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "source_images",
+ "overlap",
+ "overlap_side",
+ "overlap_mode"
+ ],
+ "optional": [
+ "new_images"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "IMAGE",
+ "IMAGE",
+ "IMAGE"
+ ],
+ "output_is_list": [
+ false,
+ false,
+ false
+ ],
+ "output_name": [
+ "source_images",
+ "start_images",
+ "extended_images"
+ ],
+ "name": "ImageBatchExtendWithOverlap",
+ "display_name": "Image Batch Extend With Overlap",
+ "description": "\nHelper node for video generation extension \nFirst input source and overlap amount to get the starting frames for the extension. \nThen on another copy of the node provide the newly generated frames and choose how to overlap them.\n",
+ "python_module": "custom_nodes.ComfyUI-KJNodes",
+ "category": "KJNodes/image",
+ "output_node": false,
+ "has_intermediate_output": false,
+ "output_tooltips": [
+ "The original source images (passthrough)",
+ "The input images used as the starting point for extension",
+ "The extended images with overlap, if no new images are provided this will be empty"
+ ],
"search_aliases": []
},
"ImageBlur": {
diff --cc workflows/comfyui/requirements.json
index 29416255,9e92f443..f12aefe8
--- a/workflows/comfyui/requirements.json
+++ b/workflows/comfyui/requirements.json
@@@ -1,18 -1,15 +1,18 @@@
{
"v": 1,
- "hash": "ecaaace204259341d971333e6a94f8027715e31f43bd1accc3d02a4df3d21ae0",
- "hash": "c3048d6ac483bc5ecfd763f654ac10b9bbb2601bd11bdf23a9f509b9c7bd410c",
- "comfyui": {"min":"0.41.0","testedCommit":"fc04da91"},
++ "hash": "a7256665fdb4c8673399cc1ae5160598835ce8b61c83f967d43c9b2dfff4d6d6",
+ "comfyui": {"min":"0.42.0","testedCommit":"5841c187"},
"folders": ["audio_encoders","background_removal","checkpoints","clip_vision","dbs","diffusion_models","facerestore_models","foley","frame_interpolation","geometry_estimation","insightface","latent_upscale_models","loras","mmaudio","model_patches","optical_flow","reuse","text_encoders","thinksound","upscale_models","vae"],
- "sentinels": ["AILab_Qwen3ASRSubtitle","AILab_Qwen3TTSVoiceClone_Advanced","AILab_Qwen3TTSVoiceDesign_Advanced","AUSBOSS_NODES_CropForInpaint","AUSBOSS_NODES_ImageCropRotatePad","AUSBOSS_NODES_StitchInpaint","Add Subtitles To Frames","Apply Whisper","CFGOverride","ClothesSegment","ComfyMathExpression","CropFuobeLive","DBSLoader","DBSSeparate","DownloadAndLoadWav2VecModel","DualModelGuider","FL_ChatterboxDialogTTS","FL_ChatterboxMultilingualTTS","FL_ChatterboxVC","GetImageRangeFromBatch","GetImageSizeAndCount","GrowMaskWithBlur","H3AdaLNLoRAFix","H3CharacterSwapAssemble","H3CharacterSwapController","H3CharacterSwapExpandMask","H3CharacterSwapModels","H3CharacterSwapPrepareVideo","H3CharacterSwapRecoverMasks","H3CharacterSwapSelectSubject","H3CharacterSwapSettings","H3CharacterSwapShot","H3CharacterSwapWindowPlan","H3RelayAppendWindow","H3RelayApplyEditMask","H3RelayApplyHistory","H3RelayExpandMask","H3RelayFinishWindows","H3RelayPrepareSource","H3RelayRecoverMasks","H3RelayReviewWindows","H3RelaySamplingMemory","H3RelaySelectMask","H3RelayTextMemory","H3RelayWindowInputs","H3RelayWindowPlan","H3SLAAttention","HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader","INTConstant","Ideogram4Scheduler","ImageBatchExtendWithOverlap","ImageGridtoBatch","ImageResizeKJv2","IndexTTS2Simple","Krea2EditGroundedEncode","Krea2EditModelPatch","Krea2OstrisEditModelPatch","LTXAVTextEncoderLoader","LTXAddVideoICLoRAGuide","LTXICLoRALoaderModelOnly","LTXVAddGuide","LTXVAudioVAEDecode","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVDualCFGGuider","LTXVEmptyLatentAudio","LTXVImgToVideoInplace","LTXVLatentUpsampler","LTXVPreprocess","LTXVScheduler","LTXVSeparateAVLatent","LTXVTiledFusionSampler","LatentSyncNode","LoadBackgroundRemovalModel","LoadImageFuobeLive","LoadVideoDepthAnythingModel","MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler","MelBandRoFormerModelLoader","MelBandRoFormerSampler","MiniMaxH3TurboLoRA","MiniMaxH3TurboSampler","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","OpenH3RegenFastVAEDecode","OpenH3RegenFinish","OpenH3RegenLora","OpenH3RegenPrepareDraft","OpenH3RegenRefineLatent","OpenH3RegenSigmas","OpenH3RegenUpscale","OpenH3SaveRefinedLatent","PasteBackFuobeLive","Qwen21EncodeFuobeLive","Qwen21ReferenceFuobeLive","QwenImage21Cache","REUSEEnhance","REUSELoader","RIFE VFI","RMBG","ReActorFaceSwap","RemoveBackground","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SaveImageFuobeLive","SeedVR2Conditioning","SeedVR2PostProcessing","SeedVR2Preprocess","TS_ImageToSVGStringColor_Vtracer","TS_SVGStringToSVGBytesIO","TextEncodeFibo2","TextEncodeKrea2OstrisEdit","TextEncodeQwenImage21","ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler","Trellis2Conditioning","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","VHS_BatchManager","VHS_LoadAudioUpload","VHS_LoadVideo","VHS_SelectEveryNthImage","VHS_VideoCombine","VHS_VideoInfo","VHS_VideoInfoLoaded","VideoDepthAnythingOutput","VideoDepthAnythingProcess","VideoLengthAdjuster","VoxCPM2_Clone","VoxCPM2_TTS","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoDecode","WanVideoEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader","ZenImage21AdapterLoader","ZenImage21TextEncode"],
+ "sentinels": ["AILab_Qwen3ASRSubtitle","AILab_Qwen3TTSVoiceClone_Advanced","AILab_Qwen3TTSVoiceDesign_Advanced","AUSBOSS_NODES_CropForInpaint","AUSBOSS_NODES_ImageCropRotatePad","AUSBOSS_NODES_StitchInpaint","Add Subtitles To Frames","Apply Whisper","CFGOverride","ClothesSegment","ComfyMathExpression","CropFuobeLive","DBSLoader","DBSSeparate","DownloadAndLoadWav2VecModel","DualModelGuider","FL_ChatterboxDialogTTS","FL_ChatterboxMultilingualTTS","FL_ChatterboxVC","GetImageRangeFromBatch","GetImageSizeAndCount","GrowMaskWithBlur","H3AdaLNLoRAFix","H3AdvancedSwapPlan","H3CharacterSwapAssemble","H3CharacterSwapController","H3CharacterSwapExpandMask","H3CharacterSwapModels","H3CharacterSwapPrepareVideo","H3CharacterSwapRecoverMasks","H3CharacterSwapSelectSubject","H3CharacterSwapSettings","H3CharacterSwapShot","H3CharacterSwapWindowPlan","H3ClipShots","H3FaceChunks","H3FaceJoin","H3FaceMaskSAM","H3FaceStitch","H3FaceTrackCrop","H3FillShots","H3GreyMannequins","H3ObjectSwapPlan","H3PeopleMask","H3RelayAppendWindow","H3RelayApplyEditMask","H3RelayApplyHistory","H3RelayExpandMask","H3RelayFinishWindows","H3RelayPrepareSource","H3RelayRecoverMasks","H3RelayReviewWindows","H3RelaySamplingMemory","H3RelaySelectMask","H3RelayTextMemory","H3RelayWindowInputs","H3RelayWindowPlan","H3RoleMask","H3SLAAttention","H3SoundtrackOrSilence","H3SourceSlice","H3SubjectPrompt","H3TrackCrops","H3TrackRoles","HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader","INTConstant","Ideogram4Scheduler","ImageBatchExtendWithOverlap","ImageDetailContrast","ImageGridtoBatch","ImageResizeKJv2","IndexTTS2Simple","Krea2EditGroundedEncode","Krea2EditModelPatch","Krea2OstrisEditModelPatch","LTXAVTextEncoderLoader","LTXAddVideoICLoRAGuide","LTXICLoRALoaderModelOnly","LTXVAddGuide","LTXVAudioVAEDecode","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVDualCFGGuider","LTXVEmptyLatentAudio","LTXVImgToVideoInplace","LTXVLatentUpsampler","LTXVPreprocess","LTXVScheduler","LTXVSeparateAVLatent","LTXVTiledFusionSampler","LatentSyncNode","LoadBackgroundRemovalModel","LoadImageFuobeLive","LoadVideoDepthAnythingModel","MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler","MelBandRoFormerModelLoader","MelBandRoFormerSampler","Metric3D-NormalMapPreprocessor","MiniMaxH3ChainAssemble","MiniMaxH3ChainContext","MiniMaxH3ChainCurrent","MiniMaxH3ChainLoopEnd","MiniMaxH3ChainLoopStart","MiniMaxH3ChainPlanModern","MiniMaxH3ChainReview","MiniMaxH3ChainSegmentSave","MiniMaxH3ContexMaskedTarget","MiniMaxH3FantasticVideoEditLatent","MiniMaxH3GenerationProfile","MiniMaxH3LoopTrim","MiniMaxH3SourceTimeline","MiniMaxH3TurboLoRA","MiniMaxH3TurboSampler","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","OpenH3RegenFastVAEDecode","OpenH3RegenFinish","OpenH3RegenLora","OpenH3RegenPrepareDraft","OpenH3RegenRefineLatent","OpenH3RegenSigmas","OpenH3RegenUpscale","OpenH3SaveRefinedLatent","Orion4D_FXMax_DCTLToneMapper","PasteBackFuobeLive","Qwen21EncodeFuobeLive","Qwen21ReferenceFuobeLive","QwenImage21Cache","REUSEEnhance","REUSELoader","RIFE VFI","RMBG","ReActorFaceSwap","RemoveBackground","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SAMLoader","SaveImageFuobeLive","SeedVR2Conditioning","SeedVR2PostProcessing","SeedVR2Preprocess","SolarRendererConditioning","SolarRendererLoraLoader","SolarRendererModel","SolarRendererSigmas","TS_ImageToSVGStringColor_Vtracer","TS_SVGStringToSVGBytesIO","TextEncodeFibo2","TextEncodeKrea2OstrisEdit","TextEncodeQwenImage21","ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler","Trellis2Conditioning","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","VHS_BatchManager","VHS_LoadAudioUpload","VHS_LoadVideo","VHS_SelectEveryNthImage","VHS_VideoCombine","VHS_VideoInfo","VHS_VideoInfoLoaded","VRAM_Debug","VideoDepthAnythingOutput","VideoDepthAnythingProcess","VideoLengthAdjuster","ViggleTurboLora","ViggleTurboSigmas","VoxCPM2_Clone","VoxCPM2_TTS","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoDecode","WanVideoEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader","ZenImage21AdapterLoader","ZenImage21TextEncode"],
"packs": {
"ComfyUI-DBS": {"repo":"https://github.com/hiroki-abe-58/ComfyUI-DBS","commit":"f656e53434b5485c148a2866fbd6ddc6b6152ed6","registry":{"id":"dbs-soundtrack-separation","version":""},"classes":["DBSLoader","DBSSeparate"],"folders":["dbs"],"isolated":false,"requirementsTxt":true,"install":"manual"},
+ "ComfyUI-Fantastic-MiniMaxH3-PromptBuilder": {"repo":"https://github.com/Adudeguyman/ComfyUI-Fantastic-MiniMaxH3-PromptBuilder","commit":"22e719fe89336c628383363182a4da3cb58d4f9b","classes":["MiniMaxH3FantasticVideoEditLatent"],"folders":[],"isolated":false,"requirementsTxt":false,"install":"manual"},
"ComfyUI-Frame-Interpolation": {"repo":"https://github.com/Fannovel16/ComfyUI-Frame-Interpolation","commit":"26545cc2dd95bc3d27f056016300673bdeee78f5","registry":{"id":"comfyui-frame-interpolation","version":""},"classes":["RIFE VFI"],"folders":[],"isolated":false,"requirementsTxt":false,"install":"manual"},
+ "ComfyUI-H3-FaceRefine": {"repo":"https://github.com/Carasibana/ComfyUI-H3-FaceRefine","commit":"","registry":{"id":"comfyui-h3-facerefine","version":"1.1.1"},"classes":["H3FaceMaskSAM","H3FaceStitch","H3FaceTrackCrop"],"folders":[],"isolated":false,"requirementsTxt":true,"install":"registry"},
"ComfyUI-HunyuanVideo-Foley": {"repo":"https://github.com/phazei/ComfyUI-HunyuanVideo-Foley","commit":"afd2960b8ad9036a9f55a15daf514112ff68e010","registry":{"id":"ComfyUI-HunyuanVideo-Foley","version":""},"classes":["HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader"],"folders":["foley"],"isolated":false,"requirementsTxt":true,"install":"manual"},
+ "ComfyUI-Impact-Pack": {"repo":"https://github.com/ltdrdata/ComfyUI-Impact-Pack","commit":"","registry":{"id":"comfyui-impact-pack","version":"8.28.3"},"classes":["SAMLoader"],"folders":[],"isolated":false,"requirementsTxt":true,"install":"registry"},
"ComfyUI-IndexTTS2": {"repo":"https://github.com/snicolast/ComfyUI-IndexTTS2","commit":"5b33e02bc0112b8aaf1fc823d5e5a609ca07fc27","classes":["IndexTTS2Simple"],"folders":[],"isolated":false,"requirementsTxt":true,"install":"manual"},
- "ComfyUI-KJNodes": {"repo":"https://github.com/kijai/ComfyUI-KJNodes","commit":"17195fcfa8a05f601b766a0f09c9733284f47416","registry":{"id":"comfyui-kjnodes","version":""},"classes":["GetImageRangeFromBatch","GetImageSizeAndCount","GrowMaskWithBlur","INTConstant","ImageBatchExtendWithOverlap","ImageGridtoBatch","ImageResizeKJv2"],"folders":[],"isolated":false,"requirementsTxt":true,"install":"manual"},
+ "ComfyUI-KJNodes": {"repo":"https://github.com/kijai/ComfyUI-KJNodes","commit":"17195fcfa8a05f601b766a0f09c9733284f47416","registry":{"id":"comfyui-kjnodes","version":""},"classes":["GetImageRangeFromBatch","GetImageSizeAndCount","GrowMaskWithBlur","INTConstant","ImageBatchExtendWithOverlap","ImageGridtoBatch","ImageResizeKJv2","VRAM_Debug"],"folders":[],"isolated":false,"requirementsTxt":true,"install":"manual"},
"ComfyUI-Krea2-Ostris-Edit": {"repo":"https://github.com/ostris/ComfyUI-Krea2-Ostris-Edit","commit":"7756566160c4a1b24bb1bd9f0ff3ced1a83d7547","registry":{"id":"comfyui-krea2-ostris-edit","version":""},"classes":["Krea2OstrisEditModelPatch","TextEncodeKrea2OstrisEdit"],"folders":[],"isolated":false,"requirementsTxt":false,"install":"manual"},
"ComfyUI-LTXVideo": {"repo":"https://github.com/Lightricks/ComfyUI-LTXVideo","commit":"220e1d45aa0469f518e982102fca4dca92a61862","registry":{"id":"ComfyUI-LTXVideo","version":""},"classes":["LTXAddVideoICLoRAGuide","LTXICLoRALoaderModelOnly","LTXVTiledFusionSampler"],"folders":[],"isolated":false,"requirementsTxt":true,"install":"manual"},
"ComfyUI-LatentSyncWrapper": {"repo":"https://github.com/ShmuelRonen/ComfyUI-LatentSyncWrapper","commit":"360d5283d7276aee68b4237b1387e594e4ce640e","classes":["LatentSyncNode","VideoLengthAdjuster"],"folders":[],"isolated":true,"requirementsTxt":true,"install":"manual"},