The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Catalog: round-4 cloud models from paid-model-apis-4 and Genjutsu Lite
Claudedc9ad930e783
diff --git a/docs/research/paid-model-apis-4.json b/docs/research/paid-model-apis-4.jsonindex 2fd4f3a7..8818a2d1 100644--- a/docs/research/paid-model-apis-4.json+++ b/docs/research/paid-model-apis-4.json@@ -14136,7 +14136,7 @@},"replicateEquivalent": null,"license": "commercial",- "notes": "1-4 images, instruction edits, optional mask_url (polarity not stated). $0.04 per image.",+ "notes": "1-4 images, instruction edits, optional mask_url (white = edit, black = keep, per the schema's field description; single-image requests only). $0.04 per image.","verified": true,"sourceUrl": "https://fal.ai/models/bria/fibo-2/edit/api","schemaUrl": "https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=bria/fibo-2/edit",diff --git a/docs/research/paid-model-apis-4.md b/docs/research/paid-model-apis-4.mdindex 36ca01c8..5921ab73 100644--- a/docs/research/paid-model-apis-4.md+++ b/docs/research/paid-model-apis-4.md@@ -276,7 +276,7 @@ This is the cloud twin of the open plan (Depth Anything 3 point cloud, then Qwen| `krea/v3/text-to-image` | fal | t2i | `prompt`*, `image_size`, `negative_prompt`, `seed`, `model`, `reasoning_level` | `images[].url` | $0.025/megapixel | New 2026-10-14. model berry\|jam (two variants; difference not documented), reasoning_level low\|medium. $0.025/MP counting the output plus each reference. || `krea/v3/edit` | fal | edit | `prompt`*, `image_urls`*, `image_size`, `negative_prompt`, `seed`, `model`, `reasoning_level` | `images[].url` | $0.025/megapixel | 1-8 reference images, reasoning_level low\|medium\|high\|ultra. $0.025/MP (output + references). || `bria/fibo-2/generate` | fal | t2i | `prompt`, `style`, `image_url`, `aspect_ratio`, `seed`, `vgl` | `image.url` | $0.04/image | New 2026-10-19. Trained on licensed data (Bria's commercial-safety pitch). Text or a structured VGL JSON prompt (objects, lighting, photographic characteristics, text_render...) returned with each result for exact re-runs. 4 style presets. $0.04 per image. |-| `bria/fibo-2/edit` | fal | edit | `image_urls`*, `instruction`, `mask_url`, `aspect_ratio`, `seed`, `vgl` | `image.url` | $0.04/image | 1-4 images, instruction edits, optional mask_url (polarity not stated). $0.04 per image. |+| `bria/fibo-2/edit` | fal | edit | `image_urls`*, `instruction`, `mask_url`, `aspect_ratio`, `seed`, `vgl` | `image.url` | $0.04/image | 1-4 images, instruction edits, optional mask_url (white = edit, black = keep, per the schema's field description; single-image requests only). $0.04 per image. || `ideogram/vector/text-to-vector` | fal | t2svg | `prompt`*, `quality`, `num_images`, `aspect_ratio`, `seed`, `image_urls` | `images[].url` | $0.16/SVG (medium) | New 2026-10-22. Editable SVGs from text, 1-8 per call, up to 5 reference images. $0.13 low, $0.16 medium, $0.20 high ($0.32 high with references). || `ideogram/vector/image-to-vector` | fal | vectorize | `image_url`*, `mode` | `images[].url` | $0.1/SVG | New 2026-10-22. Raster -> SVG, mode default\|simple. $0.10 (Recraft Vectorize is $0.01). || `xai/grok-imagine-video/v1.5/text-to-video` | fal | t2v | `prompt`*, `duration`, `resolution`, `aspect_ratio` | `video.url` | $0.14/second (720p) | Grok Imagine Video 1.5 is in Higgsfield's lineup (pricing API slug xai/grok-imagine-video/v1.5/reference-to-video); Fuobe reaches it only through a Higgsfield key today. This fal route fills that gap. Released on fal before 2026-09-15, recorded here because no earlier part has it. |diff --git a/scripts/gen-cloud-models.py b/scripts/gen-cloud-models.pyindex c98736ed..a31c27e3 100644--- a/scripts/gen-cloud-models.py+++ b/scripts/gen-cloud-models.py@@ -1,7 +1,7 @@#!/usr/bin/env python3"""Generate src/lib/catalog/cloud-models.generated.ts from docs/research/paid-model-apis.json-(merged with parts 2 and 3: paid-model-apis-2.json, paid-model-apis-3.json).+(merged with parts 2, 3 and 4: paid-model-apis-2.json, paid-model-apis-3.json, paid-model-apis-4.json).The research file holds verified fal/Replicate input schemas (field names, enums, defaults,prices). This script turns a curated list of models (MODELS below, mirroring Higgsfield's@@ -31,6 +31,12 @@ RESEARCH_3 = json.loads((ROOT / "docs/research/paid-model-apis-3.json").read_texfor e in RESEARCH_3["endpoints"]:prev = EPS.get((e["provider"], e["endpoint"]))EPS[(e["provider"], e["endpoint"])] = {**e, "keyFields": {**((prev or {}).get("keyFields") or {}), **(e.get("keyFields") or {})}}+# Part 4 (video erase / swap, FPS / HDR / codecs, FFmpeg compose, OCR, 3D scenes, new models): same merge.+# Its Higgsfield records (Genjutsu Light) are copied into higgsfield-api.json for gen-higgsfield-models.py.+RESEARCH_4 = json.loads((ROOT / "docs/research/paid-model-apis-4.json").read_text())+for e in RESEARCH_4["endpoints"]:+ prev = EPS.get((e["provider"], e["endpoint"]))+ EPS[(e["provider"], e["endpoint"])] = {**e, "keyFields": {**((prev or {}).get("keyFields") or {}), **(e.get("keyFields") or {})}}IMG_AR = ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "21:9", "5:4", "4:5"]IMAGE_SIZE_MAP = {@@ -39,6 +45,8 @@ IMAGE_SIZE_MAP = {"5:4": "landscape_4_3", "4:5": "portrait_4_3",}RATIO = re.compile(r"^\d+(\.\d+)?:\d+(\.\d+)?$")+# Duration picks for APIs that take any whole number of seconds in a range (the Higgsfield generator's list).+NICE_DURATIONS = [3, 4, 5, 6, 8, 10, 12, 15, 20, 30]# ---------------------------------------------------------------------------# Curated catalog. routes: list of (op, endpoint) or (op, endpoint, provider).@@ -48,13 +56,16 @@ M = []def model(id, name, vendor, family, kind, tagline, routes, badges=None, pricing=None, defaults=None, options=None, fixed=None, hidden=False,- sliders=None, controls=None, api_defaults=None):+ sliders=None, controls=None, api_defaults=None, formats=None, ranged_durations=False):"""sliders / controls: [(field, label)] read from each route's research inputs (dotted = nested field):numeric fields with minimum/maximum become sliders, enums become composer controls; both travel as params.extra.- fixed: fields always sent. api_defaults: fields sent unless the request sets them (FieldMap.defaults)."""+ fixed: fields always sent. api_defaults: fields sent unless the request sets them (FieldMap.defaults).+ formats: {canonical VideoFormat: the API's value} for its output-format field (params.format), checked against the enum.+ ranged_durations: a duration that takes any whole second in a range gets the usual picks inside it."""M.append(dict(id=id, name=name, vendor=vendor, family=family, kind=kind, tagline=tagline, routes=routes,badges=badges or [], pricing=pricing, defaults=defaults or {}, options=options or {}, fixed=fixed or {}, hidden=hidden,- sliders=sliders or [], controls=controls or [], api_defaults=api_defaults or {}))+ sliders=sliders or [], controls=controls or [], api_defaults=api_defaults or {}, formats=formats or {},+ ranged_durations=ranged_durations))# ----- Image@@ -249,7 +260,11 @@ model("kling-3-4k", "Kling 3.0 4K", "Kuaishou", "kling", "video", "Native 4K Klimodel("kling-o3", "Kling O3 Omni", "Kuaishou", "kling", "video","One model for text, image, reference and video edits",[("t2v", "fal-ai/kling-video/o3/pro/text-to-video"), ("i2v", "fal-ai/kling-video/o3/pro/image-to-video", "fal", "+flf2v"),- ("ref2v", "fal-ai/kling-video/o3/pro/reference-to-video"), ("v2v", "fal-ai/kling-video/o3/pro/video-to-video/edit")],+ ("ref2v", "fal-ai/kling-video/o3/pro/reference-to-video"), ("v2v", "fal-ai/kling-video/o3/pro/video-to-video/edit"),+ # Higgsfield's Remove Object page runs exactly this edit with a removal prompt (research part 4 §3); swaps and+ # inserts name @Image1 in the prompt. Same endpoint, so the studios can list Kling O3 under those tools.+ ("remove-object", "fal-ai/kling-video/o3/pro/video-to-video/edit"), ("video-swap", "fal-ai/kling-video/o3/pro/video-to-video/edit"),+ ("video-insert", "fal-ai/kling-video/o3/pro/video-to-video/edit")],badges=["new"], defaults={"aspectRatio": "16:9", "duration": 5})model("kling-o1", "Kling O1 Omni", "Kuaishou", "kling", "video","Reference-driven video and natural-language video editing",@@ -360,7 +375,10 @@ model("runway-aleph-2", "Runway Aleph 2", "Runway", "runway", "video",[("v2v", "runwayml/aleph-2", "replicate")], badges=["pro"])model("kling-o3-4k-edit", "Kling O3 4K Edit", "Kuaishou", "kling", "video","Kling O3 video edits rendered in native 4K, keeps the original audio",- [("v2v", "fal-ai/kling-video/o3/4k/video-to-video/edit")], badges=["4k"], pricing=("second", 0.42))+ [("v2v", "fal-ai/kling-video/o3/4k/video-to-video/edit"),+ # "Need more detail? Run Kling 3.0 Omni Edit in 4K mode" (Higgsfield's Remove Object page).+ ("remove-object", "fal-ai/kling-video/o3/4k/video-to-video/edit"), ("video-swap", "fal-ai/kling-video/o3/4k/video-to-video/edit"),+ ("video-insert", "fal-ai/kling-video/o3/4k/video-to-video/edit")], badges=["4k"], pricing=("second", 0.42))model("grok-imagine-video-edit", "Grok Imagine Video Edit", "xAI", "grok", "video","Edit clips up to 8 s with a sentence",[("v2v", "xai/grok-imagine-video/edit-video")], badges=["fast"],@@ -474,7 +492,9 @@ model("bria-video-bg", "Bria video background removal", "Bria", "bria", "video",[("bg-remove-video", "bria/video/background-removal/v3")], pricing=("second", 0.05),fixed={"background_color": "Transparent", "output_container_and_codec": "webm_vp9"})model("depth-anything-video-cloud", "Video Depth Anything (hosted)", "ByteDance", "depth-anything", "video", "Stable depth maps for every frame",- [("depth-video", "fal-ai/depth-anything-video")], pricing=("second", 0.04), fixed={"model": "VDA-Base", "colormap": "grayscale"})+ # The colour map follows params.colormap (Higgsfield's Depth Map picker); grayscale unless asked.+ [("depth-video", "fal-ai/depth-anything-video", "fal", {"keys": {"colormap": "colormap"}})], pricing=("second", 0.04),+ fixed={"model": "VDA-Base"}, api_defaults={"colormap": "grayscale"})model("lightx-relight", "LightX Relight", "LightX", "lightx", "video", "Relight a video from a description and a light direction",[("relight-video", "fal-ai/lightx/relight")], pricing=("second", 0.1),fixed={"relit_cond_type": "ic", "relight_parameters.bg_source": "Left"},@@ -558,6 +578,219 @@ model("meshy-7-1", "Meshy 7.1", "Meshy", "meshy", "model3d", "Textured models wicontrols=[("model_type", "Mesh"), ("topology", "Topology")])+# ---------------------------------------------------------------------------+# Round 4 (research part 4): video erase / swap / insert, FPS boost, SDR to HDR, FFmpeg-style tools, OCR, 3D+# and the models released between 2026-09-15 and 2026-10-22.+#+# TODO(kling-4): Kling 4.0 (kling/v4/text-to-video, image-to-video, reference-to-video, video-to-video/edit) has+# schemas in paid-model-apis-4.json but status "playground-only": fal's pages say "Kling 4.0 is available in the+# playground and fal Agent. API access is coming soon." (re-checked 2026-10-22). Add a "kling-4" model here+# (t2v / i2v + keyframes / ref2v / v2v + remove-object / video-swap / video-insert) once the API opens.++# What VOID and VACE regenerate in the masked area when Fuobe's prompt names the thing to remove.+SCENE_AFTER_REMOVAL = "The same shot with nothing there: the background continues naturally, matching the light, texture and motion around it"++# ----- Remove an object from a video (Bria under 5 s; VOID also removes shadows and reflections; LTX clean plate removes people)+model("bria-video-erase", "Bria Video Eraser", "Bria", "bria", "video",+ "Name what to remove from a clip under 5 s — sound kept",+ [("remove-object", "bria/video/erase/prompt")], badges=["new"], pricing=("second", 0.14, "clips under 5 s; longer ones are cut to their first 5 s"))+model("bria-video-erase-points", "Bria Video Eraser · points", "Bria", "bria", "video",+ "Remove what you click on the first frame (under 5 s)",+ [("remove-object", "bria/video/erase/keypoints")], pricing=("second", 0.14, "clips under 5 s"), hidden=True,+ options={"requires": {"points": True, "msg": "Click what to remove on the first frame"}})+# A mask *video* (white = erase), e.g. from SAM 3.1 video: Fuobe's painted first-frame mask is not one.+model("bria-video-erase-mask", "Bria Video Eraser · mask video", "Bria", "bria", "video",+ "Remove what a mask video marks (white), under 5 s",+ [("remove-object", "bria/video/erase/mask"), ("remove-object", "bria/video-erase-object", "replicate", {"fixed": {"auto_trim": True}})],+ pricing=("second", 0.14, "fal; $0.05/s on Replicate"), hidden=True,+ options={"requires": {"mask": True, "msg": "Add the mask video (white = what to remove)"}})+model("void-video-inpainting", "VOID Video Eraser", "fal", "void", "video",+ "Removes an object and what it causes — shadows, reflections, ripples — from clips up to ~8 s",+ [("remove-object", "fal-ai/void-video-inpainting", "fal", {"drop": ["mask"]})], badges=["new"],+ pricing=("request", 0.1, "$0.05 per clip + $0.05 for the mask made from your words; Pass 2 refinement doubles the first part; up to 197 frames"),+ api_defaults={"prompt": SCENE_AFTER_REMOVAL})+model("ltx-2-3-clean-plate", "LTX 2.3 Clean Plate", "Lightricks", "ltx", "video",+ "Removes every person from a shot for a clean background plate",+ [("remove-object", "fal-ai/ltx-2.3-quality/clean-plate", "fal", {"drop": ["prompt"]})],+ pricing=("video", 0.27, "121 frames at 720p; billed per megapixel of video"), defaults={"resolution": "720p"})+# Hosted Wan 2.2 VACE Fun: the painted first-frame mask is tracked through the clip (mask_image_url). Erase with a+# description of the background (SCENE_AFTER_REMOVAL unless params.extra.prompt says otherwise); swap and insert+# regenerate the masked area as the reference image(s), following the prompt.+_VACE = "fal-ai/wan-22-vace-fun-a14b/inpainting"+_VACE_KEYS = {"keys": {"mask": "mask_image_url"}, "drop": ["image", "endImage"]}+model("wan-22-vace-inpaint", "Wan 2.2 VACE Fun Inpaint (hosted)", "Alibaba Wan", "wan", "video",+ "Paint an area on the first frame: erase it, or swap or add something from a reference image",+ [("remove-object", _VACE, "fal", {**_VACE_KEYS, "drop": ["image", "endImage", "images", "prompt"], "defaults": {"prompt": SCENE_AFTER_REMOVAL}}),+ ("video-swap", _VACE, "fal", _VACE_KEYS), ("video-insert", _VACE, "fal", _VACE_KEYS)],+ pricing=("second", 0.1, "720p, counted at 16 fps; 580p $0.075, 480p $0.05", {"byResolution": {"720p": 0.1, "580p": 0.075, "480p": 0.05}}),+ api_defaults={"match_input_num_frames": True, "match_input_frames_per_second": True},+ options={"requires": {"mask": True, "msg": "Paint the area to change on the first frame"}})+# The mask maker for the erase and swap chains: what you name or click becomes a black-and-white mask video+# (apply_mask off; whether the matte is clean black and white is unverified without a run).+model("sam-3-1-video-mask", "SAM 3.1 video mask", "Meta", "sam", "video",+ "A mask video of what you name or click, tracked through the clip",+ [("bg-remove-video", "fal-ai/sam-3-1/video")], fixed={"apply_mask": False}, hidden=True,+ pricing=("second", 0.015, "$0.01 per 16 input frames (24 fps)"))++# ----- Swap who or what is on camera+model("p-video-replace", "P-Video Replace", "Pruna AI", "p-video", "video",+ "Put the people from 1–3 photos into a clip — same motion, timing, camera and sound",+ [("video-swap", "prunaai/p-video-replace", "replicate", {"drop": ["fps"]})], badges=["new"],+ pricing=("second", 0.03, "720p; 1080p $0.06", {"byResolution": {"720p": 0.03, "1080p": 0.06}}), defaults={"resolution": "720p"},+ # "Identity reference image(s) (1-3)".+ options={"maxImages": 3})++# ----- FPS boost, slow motion and SDR to HDR (Higgsfield's Upscale tools)+model("topaz-fps-boost", "Topaz FPS Boost", "Topaz Labs", "topaz", "video",+ "Smooth frame interpolation to 16–120 fps, or up to 8× slow motion",+ [("interpolate", "topaz/interpolate/video")], badges=["new"],+ pricing=("second", 0.03, "1080p 30→60 fps with Apollo or Chronos; 4K $0.06; Aion $0.05 / $0.17; slow motion bills the whole output"),+ # H.265 unless asked: H.264 plays in every browser.+ api_defaults={"H264_output": True}, controls=[("model", "Model")])+# Doubles the frame rate (one new frame per pair) at the clip's own speed; its fps field only applies with+# use_calculated_fps off, so a target frame rate is not sent.+model("rife-video-cloud", "RIFE (hosted)", "fal", "rife", "video",+ "Cheap frame interpolation: twice the frames, same speed",+ [("interpolate", "fal-ai/rife/video", "fal", {"drop": ["fps"]})], badges=["fast"], pricing=("request", 0.001, "billed per compute second ($0.0013/s)"))+model("topaz-sdr-to-hdr", "Topaz SDR to HDR", "Topaz Labs", "topaz", "video",+ "Hyperion 2.5: SDR footage to 10-bit HDR10 (H.265) or ProRes 422 HQ",+ [("sdr-to-hdr", "topaz/sdr-to-hdr/video")], badges=["new"], formats={"h265_10bit": "mp4", "prores_422_hq": "prores"},+ pricing=("second", 0.24, "up to 1080p at 30 fps; 4K $0.51"))+# EXR frames only (a ZIP, kept as a link on the SDR preview); prompt = how to see the shot, defaulted.+model("ltx-2-3-hdr", "LTX 2.3 HDR (EXR frames)", "Lightricks", "ltx", "video",+ "SDR to 16-bit EXR frames for compositing, with an SDR preview",+ [("sdr-to-hdr", "fal-ai/ltx-2.3-quality/hdr", "fal", {"drop": ["prompt", "resolution"]})], options={"formats": ["exr"]},+ api_defaults={"prompt": "The same shot in high dynamic range: deeper shadows and brighter highlights, every detail and movement unchanged"},+ pricing=("video", 0.3, "121 frames at 720p; billed per megapixel of HDR video"))++# ----- FFmpeg-style tools for chains (Ken Burns, end cards, per-frame Mixed Media, audio): hidden utilities+model("ken-burns", "Ken Burns", "fal", "utility", "video", "A slow zoom into (or out of) a still, toward a focal point",+ [("still-motion", "fal-ai/workflow-utilities/image-to-video")], pricing=("request", 0.001, "billed per compute second"), hidden=True)+model("overlay-image", "Overlay image", "fal", "utility", "image", "Places a logo or picture on another, at a position and size",+ [("overlay", "fal-ai/workflow-utilities/overlay-image")], pricing=("request", 0.001, "billed per compute second"), hidden=True)+model("extract-frames", "Extract frames", "fal", "utility", "image", "Every Nth frame of a video as images (up to 500 a call)",+ # max_frames defaults to 100 at the API: ask for its most (500), so a clip is not cut short silently.+ [("extract-frames", "fal-ai/workflow-utilities/extract-nth-frame")], pricing=("request", 0.001, "billed per compute second"), hidden=True,+ api_defaults={"max_frames": 500})+model("images-to-video", "Images to video", "fal", "utility", "video", "Images in order as the frames of a video",+ [("images-to-video", "fal-ai/ffmpeg-api/images-to-video")], pricing=("request", 0.001, "billed per compute second"), hidden=True)+# Concatenates 2–5 files (no crossfade on the cloud: hard joins); a loop repeats the clip, up to 5 plays a call.+model("join-audio", "Join audio", "fal", "utility", "audio", "Audio clips one after another, or one clip played several times",+ [("audio-join", "fal-ai/ffmpeg-api/merge-audios"), ("audio-loop", "fal-ai/ffmpeg-api/merge-audios")],+ pricing=("request", 0.001, "billed per compute second"), hidden=True)++# ----- Read text with its boxes (Layers)+model("florence-2-ocr", "Florence-2 OCR", "Microsoft", "florence", "text", "Every line of text in an image, with its box",+ [("ocr", "fal-ai/florence-2-large/ocr-with-region")], pricing=("request", 0.001, "billed per compute second"))++# ----- 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")])+# 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",+ [("image-to-3d", "fal-ai/sam-3/3d-objects")], badges=["new"], pricing=("request", 0.02, "per unit; fal does not say what a unit is"),+ options={"requires": {"prompt": True, "msg": "Name the objects to rebuild, e.g. “chair, lamp”"}})+model("tripo-h3-1-text", "Tripo H3.1 Text to 3D", "Tripo", "tripo", "model3d", "A textured 3D model from a description",+ [("text-to-3d", "tripo3d/h3.1/text-to-3d")], pricing=("request", 0.2, "standard textures; untextured $0.10, HD $0.30"),+ controls=[("texture_quality", "Texture"), ("geometry_quality", "Geometry")])+model("meshy-7-1-multi", "Meshy 7.1 Multi-view", "Meshy", "meshy", "model3d", "One object from up to 4 photos of different sides",+ [("image-to-3d", "meshy/v7.1/multi-image-to-3d")], pricing=("request", 1.2, "textured; untextured $0.80, rigging +$0.20"),+ controls=[("topology", "Topology")])+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"))++# ----- New video models+model("flux-3-max", "FLUX 3 Max", "Black Forest Labs", "flux", "video",+ "BFL's top video model: 5–20 s with sound, start and end frames, or up to 10 keyframes",+ [("t2v", "blackforestlabs/flux-3-max/text-to-video"), ("i2v", "blackforestlabs/flux-3-max/image-to-video", "fal", "+flf2v"),+ ("keyframes", "blackforestlabs/flux-3-max/keyframes-to-video")],+ badges=["new", "audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "720p"},+ # The research's explicit promo-then-list prices ("75% off ... from October 15 to November 7"): parse_price would+ # read only the promo rate. The catalog switches to the list price after the promo's last day (Pricing.promo).+ pricing=("second", 0.17, "720p; 1080p $0.29 — launch price $0.0425 (1080p $0.0725) until 2026-11-07",+ {"byResolution": {"720p": 0.17, "1080p": 0.29},+ "promo": {"until": "2026-11-07", "usd": 0.0425, "byResolution": {"720p": 0.0425, "1080p": 0.0725}}}),+ controls=[("reasoning_level", "Reasoning")])+model("heygen-video", "HeyGen Video", "HeyGen", "heygen", "video",+ "HeyGen's model on MiniMax H3 — cheap 768p clips, references with sound",+ [("t2v", "heygen/heygen-video/text-to-video"), ("i2v", "heygen/heygen-video/image-to-video"), ("ref2v", "heygen/heygen-video/reference-to-video")],+ badges=["new", "fast"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "768p"}, ranged_durations=True,+ pricing=("second", 0.02, "480p and 768p; 1080p and 2K $0.06", {"byResolution": {"480p": 0.02, "768p": 0.02, "1080p": 0.06, "2k": 0.06}}),+ controls=[("prompt_enhancement", "Prompt boost")])+# Higgsfield offers Grok Imagine Video 1.5 too (its Higgsfield route is added by gen-higgsfield-models.py).+model("grok-imagine-video-1-5", "Grok Imagine Video 1.5", "xAI", "grok", "video", "xAI's video model with references and audio",+ [("t2v", "xai/grok-imagine-video/v1.5/text-to-video"), ("i2v", "xai/grok-imagine-video/v1.5/image-to-video"),+ ("ref2v", "xai/grok-imagine-video/v1.5/reference-to-video")],+ defaults={"aspectRatio": "16:9", "duration": 6, "resolution": "720p"}, ranged_durations=True,+ pricing=("second", 0.14, "720p; 480p $0.08, 1080p $0.25; +$0.01 per input image", {"byResolution": {"480p": 0.08, "720p": 0.14, "1080p": 0.25}}))+model("grok-imagine-video-1-5-lite", "Grok Imagine Video 1.5 Lite", "xAI", "grok", "video", "One of the cheapest 720p video models, 1–15 s",+ [("t2v", "xai/grok-imagine-video/v1.5/lite/text-to-video"), ("i2v", "xai/grok-imagine-video/v1.5/lite/image-to-video")],+ badges=["new", "fast"], defaults={"aspectRatio": "16:9", "duration": 6, "resolution": "720p"}, ranged_durations=True,+ pricing=("second", 0.03, "720p; 480p $0.02, 1080p $0.14; +$0.01 per input image", {"byResolution": {"480p": 0.02, "720p": 0.03, "1080p": 0.14}}))+model("pixverse-v6-max", "PixVerse V6 Max", "PixVerse", "pixverse", "video", "PixVerse's top model — up to 15 s 1080p with sound and dialogue",+ [("t2v", "pixverse/pixverse-v6-max", "replicate"), ("i2v", "pixverse/pixverse-v6-max", "replicate")],+ badges=["new", "audio"], defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "720p"},+ # Sound is on by default in Fuobe (off at the API), so the estimate uses the with-sound rates.+ pricing=("second", 0.15, "720p with sound; without $0.11; 1080p $0.28 / $0.22",+ {"byResolution": {"360p": 0.09, "540p": 0.11, "720p": 0.15, "1080p": 0.28}}))+model("p-video-2-pro-reference", "P-Video 2 Pro Reference", "Pruna AI", "p-video", "video",+ "MiniMax H3 reference-to-video: images, clips and sound to follow, optional first and last frame",+ [("ref2v", "prunaai/p-video-2-pro-reference", "replicate")], badges=["new"],+ defaults={"aspectRatio": "16:9", "duration": 5, "resolution": "768p"}, ranged_durations=True,+ pricing=("second", 0.035, "768p speed mode; cost mode $0.025; + reference clips and images", {"byResolution": {"480p": 0.02, "768p": 0.035}}),+ controls=[("mode", "Mode")])+model("creatify-boreal", "Creatify Boreal", "Creatify", "creatify", "video",+ "UGC, product and presenter clips with sound for a cent a second",+ [("t2v", "creatify/boreal"), ("i2v", "creatify/boreal")], badges=["new", "audio", "fast"],+ defaults={"aspectRatio": "16:9", "duration": 10, "resolution": "720p"}, ranged_durations=True,+ pricing=("second", 0.01, "720p; 1080p $0.03, 2K $0.12", {"byResolution": {"720p": 0.01, "1080p": 0.03, "2k": 0.12}}))+model("pixelcut-looping-video", "Pixelcut Looping Video", "Pixelcut", "pixelcut", "video",+ "A product photo as a seamless 5–15 s loop, camera locked",+ [("i2v", "pixelcut/looping-video")], badges=["new"], defaults={"duration": 5, "resolution": "768p", "generateAudio": False}, ranged_durations=True,+ pricing=("second", 0.16, "768p; 480p $0.08, 1080p $0.32", {"byResolution": {"480p": 0.08, "768p": 0.16, "1080p": 0.32}}),+ # "Optional creative direction for the motion. Camera stays locked regardless."+ controls=[("motion", "Motion")], options={"promptOptional": True})+model("minimax-h3-max-reframe", "MiniMax H3 Max Reframe", "MiniMax", "hailuo", "video",+ "Outpaints a clip to a new shape — 9:16, 1:1, 21:9 and more — sound and timing kept",+ [("reframe", "minimax/h3-max/reframe-video")], badges=["new"], defaults={"aspectRatio": "9:16", "resolution": "768p"},+ pricing=("second", 0.08, "768p; 480p $0.05; long clips run in overlapping windows, and the overlap is billed", {"byResolution": {"480p": 0.05, "768p": 0.08}}))+# A script-spoken avatar needs no audio file, but Fuobe's avatar flow brings the voice: the TTS fields stay out.+model("p-video-2-pro-avatar", "P-Video 2 Pro Avatar", "Pruna AI", "p-video", "video",+ "A portrait and a voice track → a talking video up to 3 minutes",+ [("avatar", "prunaai/p-video-2-pro-avatar", "replicate", {"drop": ["voice", "script", "language"]})], badges=["new"],+ defaults={"resolution": "768p"}, pricing=("second", 0.04, "768p; 480p $0.02", {"byResolution": {"480p": 0.02, "768p": 0.04}}))++# ----- New image models+model("krea-3", "Krea 3", "Krea", "krea", "image", "Krea's new image model — generate or edit with up to 8 references",+ [("t2i", "krea/v3/text-to-image"), ("edit", "krea/v3/edit"), ("t2i", "krea/krea-3", "replicate"), ("edit", "krea/krea-3", "replicate")],+ badges=["new"], defaults={"aspectRatio": "1:1"}, pricing=("megapixel", 0.025, "output + each reference; Replicate $0.03–0.08 per image"),+ # Both APIs take up to 8 images.+ options={"maxImages": 8})+# Higgsfield offers Grok Imagine Image 2.0 too (its Higgsfield route is added by gen-higgsfield-models.py).+model("grok-imagine-image-2", "Grok Imagine Image 2.0", "xAI", "grok", "image", "xAI's image model — bold, fast, few refusals",+ [("t2i", "xai/grok-imagine-image/v2.0/text-to-image"), ("edit", "xai/grok-imagine-image/v2.0/edit")],+ defaults={"aspectRatio": "1:1", "resolution": "1k"},+ pricing=("image", 0.06, "1K medium; low $0.04; 2K $0.06–0.08; +$0.01 per input image", {"byResolution": {"1k": 0.06, "2k": 0.08}}),+ # fal's edit takes "a maximum of 5 images" (Higgsfield's route 10).+ controls=[("quality", "Quality")], options={"maxImages": 5})+model("bria-fibo-2", "Bria FIBO 2", "Bria", "bria", "image", "Trained on licensed data only — safe for commercial work, with structured prompts",+ [("t2i", "bria/fibo-2/generate"), ("edit", "bria/fibo-2/edit")], badges=["new"], defaults={"aspectRatio": "1:1"})+model("ideogram-vector", "Ideogram Vector", "Ideogram", "ideogram", "image", "Editable SVGs from a prompt, or any image traced to SVG",+ [("t2i", "ideogram/vector/text-to-vector"), ("vectorize", "ideogram/vector/image-to-vector")], badges=["new"],+ defaults={"aspectRatio": "1:1"}, pricing=("image", 0.16, "per SVG at medium quality (low $0.13, high $0.20); image to SVG $0.10"),+ controls=[("quality", "Quality")])+# Its negative_prompt is refused, not ignored: never sent.+model("bria-expand", "Bria Expand", "Bria", "bria", "image", "Extend a picture to a new aspect ratio, edges filled to match",+ # Words for the new area are optional ("Omit it and the model is asked only to extend the image").+ [("outpaint", "bria/fibo-edit-1.5/expand", "fal", {"drop": ["negativePrompt"]})], badges=["new"], options={"promptOptional": True})++# ----- New speech models+model("heygen-voice-turbo", "HeyGen Voice Turbo", "HeyGen", "heygen", "audio", "24 voices or an instant clone of yours, in 39 languages, for almost nothing",+ [("tts", "heygen/heygen-voice/turbo")], badges=["new", "fast"], pricing=("request", 0.004, "per 1k chars"))+model("gemini-3-8-flash-tts", "Gemini 3.8 Flash TTS", "Google", "gemini-tts", "audio", "30 Gemini voices with inline <laugh> and <sigh>",+ [("tts", "google/gemini-3.8-flash-tts")], badges=["new"], pricing=("request", 0.045, "per 1k chars"))++# ---------------------------------------------------------------------------# Numeric voice settings exposed as sliders.@@ -683,7 +916,9 @@ def map_fields(fmap):elif isinstance(v, str):out.append(v)elif isinstance(v, dict):- out += [v[f] for f in ("key", "background", "shotType", "flag") if isinstance(v.get(f), str)]+ out += [v[f] for f in ("key", "background", "shotType", "flag", "factor", "x", "y") if isinstance(v.get(f), str)]+ # Ken Burns: the zoom direction and easing are fields of their own.+ out += [v[f]["key"] for f in ("direction", "easing") if isinstance(v.get(f), dict) and isinstance(v[f].get("key"), str)]return [f.split(".")[0] for f in out]@@ -692,6 +927,94 @@ def mask_format(ep):return "black" if "ideogram" in ep else "alpha" if ("gpt-image" in ep or ep.startswith("openai/")) else None+def enum_of(inputs, key):+ return [v for v in ((inputs.get(key) or {}).get("values") or [])]+++def part4_slots(op, kf, inputs, m, opts, fmap):+ """Research part 4 slots, each read only for the operations it belongs to (parts 2-3 use some of the same+ names: Qwen angles' "zoom", Luma's and Runway's "keyframes")."""+ if "points" in kf and op in ("remove-object", "video-swap", "video-insert", "bg-remove-video", "image-to-3d"):+ spec = inputs.get(kf["points"]) or {}+ item = spec.get("itemSchema") or {}+ fmt = "bria" if spec.get("items") == "string" else "sam" if "label" in item else None+ if fmt:+ fmap["points"] = {"key": kf["points"], "format": fmt}+ else:+ warn(f"{m['id']}: {kf['points']} has an unknown point shape")+ if "keyframes" in kf and op == "keyframes":+ spec = inputs.get(kf["keyframes"]) or {}+ item = spec.get("itemSchema") or {}+ image = next((k for k in item if k.endswith("url")), None)+ frame = next((k for k in item if "frame" in k), None)+ # "Frame position of this keyframe in the generated 24 fps video."+ fps = num((re.search(r"(\d+)\s*fps", (item.get(frame) or {}).get("desc") or "") or [None, None])[1]) if frame else None+ if image and frame and fps:+ fmap["keyframes"] = {"key": kf["keyframes"], "image": image, "frame": frame, "fps": fps}+ opts["maxImages"] = max(opts.get("maxImages", 1), num(spec.get("maxItems")) or 1)+ else:+ warn(f"{m['id']}: can't read the keyframe shape of {kf['keyframes']}")+ if m.get("formats") and op in ("sdr-to-hdr", "export-video"):+ key = kf.get("outputFormat") or kf.get("codec")+ enum = enum_of(inputs, key) if key else []+ bad = [v for v in m["formats"].values() if v not in enum]+ if key and not bad:+ fmap["format"] = {"key": key, "values": dict(m["formats"])}+ opts["formats"] = union(opts.get("formats", []), list(m["formats"]))+ else:+ warn(f"{m['id']}: format values {bad or list(m['formats'].values())} not in its output-format enum")+ if "crossfade" in kf and op in ("audio-loop", "audio-join"):+ fmap["crossfade"] = kf["crossfade"]+ if "zoom" in kf and op == "still-motion":+ z = {"factor": kf["zoom"]}+ # The furthest it zooms (fal: 2x); a steeper move is sent at that.+ if num((inputs.get(kf["zoom"]) or {}).get("maximum")):+ z["max"] = num(inputs[kf["zoom"]]["maximum"])+ d = kf.get("zoomDirection")+ vals = enum_of(inputs, d) if d else []+ zin, zout = (next((v for v in vals if str(v).lower() == w), None) for w in ("in", "out"))+ if zin and zout:+ z["direction"] = {"key": d, "in": zin, "out": zout}+ if "zoomX" in kf and "zoomY" in kf:+ z["x"], z["y"] = kf["zoomX"], kf["zoomY"]+ if num((inputs.get(kf["zoomX"]) or {}).get("maximum")) == 100:+ z["percent"] = True+ # Fuobe's easing names ("ease-in-out") against the API's ("ease_in_out").+ ease = {c: v for v in enum_of(inputs, kf.get("easing")) for c in ("linear", "ease-in-out") if str(v).replace("_", "-") == c}+ if ease:+ z["easing"] = {"key": kf["easing"], "values": ease}+ fmap["zoom"] = z+ if op == "overlay":+ if "x" in kf and "y" in kf:+ pct = num((inputs.get(kf["x"]) or {}).get("maximum")) == 100+ fmap["position"] = {"x": kf["x"], "y": kf["y"], **({"percent": True} if pct else {})}+ if "scale" in kf:+ # "Scale of overlay image as percentage (25-200)": Fuobe's scale 1 = 100%.+ pct = (num((inputs.get(kf["scale"]) or {}).get("maximum")) or 0) > 10+ fmap["scale"] = {"key": kf["scale"], **({"multiplier": 100} if pct else {})}+ if op == "interpolate":+ if "slowdown" in kf:+ fmap["slowdown"] = kf["slowdown"]+ if "targetFps" in kf:+ fmap["targetFps"] = kf["targetFps"]+ if "frameInterval" in kf and op == "extract-frames":+ fmap["frameInterval"] = kf["frameInterval"]+ if "colormap" in kf and op == "depth-video":+ fmap["colormap"] = kf["colormap"]+ if "frames" in kf and op == "images-to-video":+ item = (inputs.get(kf["frames"]) or {}).get("itemSchema") or {}+ url, frames = next((k for k in item if "url" in k), None), next((k for k in item if "frame" in k), None)+ if url and frames:+ fmap["frames"] = {"key": kf["frames"], "url": url, "frames": frames}+ opts["maxImages"] = max(opts.get("maxImages", 1), num((inputs.get(kf["frames"]) or {}).get("maxItems")) or 1)+ if op == "rig-3d":+ if "model3d" in kf:+ fmap["model3d"] = kf["model3d"]+ if "animation" in kf:+ flag = next((k for k, v in inputs.items() if k.startswith("enable_") and "animation" in k and (v or {}).get("type") == "boolean"), None)+ fmap["animation"] = {"key": kf["animation"], **({"flag": flag} if flag else {})}++def build_route(op, ep, provider, m, opts, ropts=None):ropts = ropts or {}e = EPS.get((provider, ep))@@ -702,7 +1025,13 @@ def build_route(op, ep, provider, m, opts, ropts=None):warn(f"{m['id']}: {ep} is not verified")inputs = e.get("inputs") or {}kf = dict(e.get("keyFields") or {})- # A route can ignore key fields whose meaning doesn't fit Fuobe's slot (e.g. Ideogram edit's style refs).+ # A route can point a slot at another field of the same schema (VACE's first-frame mask is mask_image_url)…+ for k, f in (ropts.get("keys") or {}).items():+ if f.split(".")[0] not in inputs:+ warn(f"{m['id']}: {ep} has no field {f} for {k}")+ continue+ kf[k] = f+ # …or ignore key fields whose meaning doesn't fit Fuobe's slot (e.g. Ideogram edit's style refs).for k in ropts.get("drop") or []:kf.pop(k, None)# Part 3 slot names that are the same canonical input: the person in a try-on is the main image,@@ -717,6 +1046,9 @@ def build_route(op, ep, provider, m, opts, ropts=None):if k in kf and "image2" not in kf and (inputs.get(kf[k]) or {}).get("type") != "array":kf["image2"] = kf[k]labels[1] = label+ # An overlay goes on a picture (a logo on an end card).+ if op == "overlay":+ labels = ["picture", "logo or overlay"]# Two-image APIs whose second image is required (try-on garments) can't run on one picture.if "image2" in kf and (inputs.get(kf["image2"]) or {}).get("required") and (inputs.get(kf.get("image", "")) or {}).get("required"):opts["minImages"] = 2@@ -734,6 +1066,13 @@ def build_route(op, ep, provider, m, opts, ropts=None):# Relight endpoints take the lighting description as the prompt.if "lightingPrompt" in kf:fmap["prompt"] = kf["lightingPrompt"]+ # Erasers that build their own mask from words (VOID's mask_prompt) take Fuobe's prompt, which names+ # what to remove or replace; their own prompt (the scene afterwards) comes from api_defaults or params.extra.+ if "maskPrompt" in kf and op in ("remove-object", "video-swap", "video-insert"):+ fmap["prompt"] = kf["maskPrompt"]+ # Swaps whose references say what goes in may also take words (P-Video Replace's instruction): optional.+ elif op in ("video-swap", "video-insert") and "prompt" in kf and not (inputs.get(kf["prompt"]) or {}).get("required"):+ opts["promptOptional"] = True# Zero-shot TTS takes its reference voice in the "audio" field; voice conversion names it separately.if op == "tts" and "audio" in kf:kf["referenceVoice"] = kf.pop("audio")@@ -784,6 +1123,9 @@ def build_route(op, ep, provider, m, opts, ropts=None):opts[key] = max(opts.get(key, 0), cap)continuefmap[k] = kf[k]+ # A loop by repetition (fal merge-audios): the one clip, listed as many times as the length needs.+ if op == "audio-loop" and "audios" in fmap:+ fmap["loop"] = {"key": fmap.pop("audios"), "max": num((inputs.get(kf["audio"]) or {}).get("maxItems")) or 2}# Multi-shot, draft mode and draft completion (research part 2 key fields).if "multiShot" in kf and op in ("t2v", "i2v", "ref2v") and (inputs.get(kf["multiShot"]) or {}).get("type") in ("array", "string"):item = (inputs.get(kf["multiShot"]) or {}).get("itemSchema") or {}@@ -800,6 +1142,9 @@ def build_route(op, ep, provider, m, opts, ropts=None):opts["draft"] = Trueif "draftId" in kf:fmap["draftId"] = kf["draftId"]+ # Frame interpolation's "fps" is the frame rate to reach (params.targetFps), not a sampling rate.+ if op == "interpolate" and "fps" in kf:+ kf["targetFps"] = kf.pop("fps")# Research part 3 slots.if "image2" in kf:fmap["image2"] = kf["image2"]@@ -812,6 +1157,7 @@ def build_route(op, ep, provider, m, opts, ropts=None):fmap["styleId"] = kf["styleId"]if "numLayers" in kf:fmap["numLayers"] = kf["numLayers"]+ part4_slots(op, kf, inputs, m, opts, fmap)# fal compose: the timeline's tracks are built from the clips and their start times (FieldMap.timeline).if "tracks" in kf and op == "timeline":fmap["timeline"] = kf["tracks"]@@ -892,6 +1238,9 @@ def build_route(op, ep, provider, m, opts, ropts=None):fmap["duration"] = {"key": key, "type": dtype}if str(spec.get("default", "")).endswith("s") and dtype == "string":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])if key.endswith("_ms"):fmap["duration"]["multiplier"] = 1000# Text-to-speech etc. carry the prompt in "text".@@ -904,6 +1253,9 @@ def build_route(op, ep, provider, m, opts, ropts=None):warn(f"{m['id']}: fixed fields {missing} not in {ep} inputs")if not fmap["fixed"]:del fmap["fixed"]+ # A route's own fallbacks (VACE's background prompt applies to its erase route only).+ if ropts.get("defaults"):+ m = {**m, "api_defaults": {**m["api_defaults"], **ropts["defaults"]}}if m.get("api_defaults"):fmap["defaults"] = {k: v for k, v in m["api_defaults"].items() if k.split(".")[0] in inputs}missing = [k for k in m["api_defaults"] if k.split(".")[0] not in inputs]@@ -1022,7 +1374,7 @@ for m in M:out.append(d)ts = (- "// Generated by scripts/gen-cloud-models.py from docs/research/paid-model-apis(-2,-3).json — do not edit by hand.\n"+ "// Generated by scripts/gen-cloud-models.py from docs/research/paid-model-apis(-2,-3,-4).json — do not edit by hand.\n"'import type { ModelDef } from "./types";\n\n'f"export const CLOUD_MODELS: ModelDef[] = {json.dumps(out, indent=2)};\n")diff --git a/scripts/gen-higgsfield-models.py b/scripts/gen-higgsfield-models.pyindex 7e82be86..882a5fa8 100644--- a/scripts/gen-higgsfield-models.py+++ b/scripts/gen-higgsfield-models.py@@ -3,11 +3,11 @@Generate src/lib/catalog/higgsfield-models.generated.ts from docs/research/higgsfield-api.json.Two outputs:- HIGGSFIELD_MODELS — models only Higgsfield hosts (Soul, Soul Cinema, Genjutsu, Cinema Studio,- Marketing/Ads Studio, Grok Imagine, Happy Horse)+ HIGGSFIELD_MODELS — models only Higgsfield hosts (Soul, Soul Cinema, Genjutsu and Genjutsu Lite, Cinema+ Studio, Marketing/Ads Studio, Happy Horse)HIGGSFIELD_ROUTES — extra `higgsfield` routes for models Fuobe already offers through fal /- Replicate (Seedance, Kling, Wan, MiniMax, LTX, PixVerse…), so a Higgsfield- key alone can run them.+ Replicate (Seedance, Kling, Wan, MiniMax, LTX, PixVerse, Grok Imagine…), so a+ Higgsfield key alone can run them.Field names, enums, defaults and prices come from the verified research file; nothing is typedby hand except the curated list below.@@ -38,10 +38,19 @@ CONTROL_LABELS = {}+# Operations that edit the one video they are given (the clip goes in video_urls, not the reference clips).+EDIT_OPS = ("v2v", "extend", "remove-object", "video-swap", "video-insert")++def field_map(op, ep, inputs, opts):+ # Read-only fields (Genjutsu Light's duration, computed from the source) are never sent.+ inputs = {k: v for k, v in inputs.items() if not v.get("readOnly")}fm = {}if "prompt" not in inputs:fm["prompt"] = False+ elif op in ("video-swap", "video-insert") and not inputs["prompt"].get("required"):+ # The references say what goes in; words are optional (Genjutsu object swap).+ opts["promptOptional"] = Truepick = lambda *names: next((n for n in names if n in inputs), None) # noqa: E731img = pick("image_url", "first_frame_url")imgs = "image_urls" if "image_urls" in inputs else None@@ -61,7 +70,7 @@ def field_map(op, ep, inputs, opts):# Seedance 2.5 edit / extend take reference clips beside the video they work on.if "video_urls" in inputs and clips:fm["videos"] = "video_urls"- elif "video_urls" in inputs and op in ("v2v", "extend"):+ elif "video_urls" in inputs and op in EDIT_OPS:fm["videoArray"] = "video_urls"elif "video_urls" in inputs and clips:# Reference videos (Cinema Studio 4.0, Seedance, Wan, MiniMax reference-to-video): inputs.videos.@@ -197,9 +206,6 @@ EXCLUSIVE = [dict(id="ads-studio", name="Ads Studio", vendor="Higgsfield", family="ads-studio", kind="image",tagline="A brief and a product photo in, a batch of static ad concepts out",routes=[("t2i", "higgsfield/ads-studio/v1.0"), ("edit", "higgsfield/ads-studio/v1.0")], defaults={"aspectRatio": "1:1"}),- dict(id="grok-imagine-image-2", name="Grok Imagine Image 2.0", vendor="xAI", family="grok", kind="image",- tagline="xAI's image model — bold, fast, few refusals",- routes=[("t2i", "xai/grok-imagine-image-2.0"), ("edit", "xai/grok-imagine-image-2.0")], defaults={"aspectRatio": "1:1"}),dict(id="cinema-studio-4", name="Cinema Studio 4.0", vendor="Higgsfield", family="cinema-studio", kind="video",tagline="Higgsfield's director model on Seedance 2.5 — genre, lens, light, grade and camera move controls",badges=["top", "audio", "new"], routes=[("t2v", "higgsfield/cinema-studio/4.0"), ("ref2v", "higgsfield/cinema-studio/4.0")],@@ -209,15 +215,20 @@ EXCLUSIVE = [badges=["new"], routes=[("motion-transfer", "higgsfield/genjutsu/motion-transfer/v1.0")], defaults={"resolution": "720p"}),dict(id="genjutsu-object-swap", name="Genjutsu Object Swap", vendor="Higgsfield", family="genjutsu", kind="video",tagline="Replace one thing in a video and keep everything else",- routes=[("v2v", "higgsfield/genjutsu/object-swap/v1.0")], defaults={"resolution": "720p"}),+ # Also listed as round 4's video-swap, beside Genjutsu Lite, for the swap tools that pick models by operation.+ routes=[("v2v", "higgsfield/genjutsu/object-swap/v1.0"), ("video-swap", "higgsfield/genjutsu/object-swap/v1.0")],+ defaults={"resolution": "720p"}),dict(id="genjutsu-restyle", name="Genjutsu Restyle", vendor="Higgsfield", family="genjutsu", kind="video",tagline="Restyle footage with 30+ looks while keeping motion and audio",routes=[("v2v", "higgsfield/genjutsu/restyle/v1.0")],presets={"source": "genjutsu-restyle", "param": "preset_id", "label": "Style", "required": True}, defaults={"resolution": "720p"}),- dict(id="grok-imagine-video-1-5", name="Grok Imagine Video 1.5", vendor="xAI", family="grok", kind="video",- tagline="xAI's video model with references and audio",- routes=[("t2v", "xai/grok-imagine-video/v1.5/reference-to-video"), ("i2v", "xai/grok-imagine-video/v1.5/reference-to-video"),- ("ref2v", "xai/grok-imagine-video/v1.5/reference-to-video")], defaults={"aspectRatio": "16:9", "duration": 6}),+ # Genjutsu Lite (API name Genjutsu Light, 2026-10-20): the first 15 s of the source at a fraction of the price.+ dict(id="genjutsu-lite-object-swap", name="Genjutsu Lite Object Swap", vendor="Higgsfield", family="genjutsu", kind="video",+ tagline="Swap objects, characters or clothes from 1–8 references in clips up to 15 s",+ badges=["new"], routes=[("video-swap", "higgsfield/genjutsu-light/object-swap/v1.0")], defaults={"resolution": "720p"}),+ dict(id="genjutsu-lite-motion-transfer", name="Genjutsu Lite Motion Transfer", vendor="Higgsfield", family="genjutsu", kind="video",+ tagline="A clip's motion on your characters, for clips up to 15 s",+ badges=["new"], routes=[("motion-transfer", "higgsfield/genjutsu-light/motion-transfer/v1.0")], defaults={"resolution": "720p"}),dict(id="happy-horse-1-1", name="Happy Horse 1.1", vendor="Alibaba", family="happy-horse", kind="video",tagline="Alibaba's expressive character-animation video model",routes=[("t2v", "alibaba/happy-horse/v1.1/text-to-video"), ("i2v", "alibaba/happy-horse/v1.1/image-to-video"),@@ -234,7 +245,9 @@ EXTRA = {"kling-3": [("t2v", "kling-video/v3.0/pro/text-to-video"), ("i2v", "kling-video/v3.0/pro/image-to-video")],"kling-3-4k": [("t2v", "kling-video/v3.0/4k/text-to-video"), ("i2v", "kling-video/v3.0/4k/image-to-video")],"kling-3-turbo": [("t2v", "kling-video/v3.0-turbo/text-to-video"), ("i2v", "kling-video/v3.0-turbo/image-to-video")],- "kling-o3": [("flf2v", "kling-video/o3/first-last-frame"), ("ref2v", "kling-video/o3/image-reference"), ("v2v", "kling-video/o3/video-edit")],+ # Higgsfield's Remove Object page is this edit with a removal prompt (research part 4); swaps and inserts too.+ "kling-o3": [("flf2v", "kling-video/o3/first-last-frame"), ("ref2v", "kling-video/o3/image-reference"), ("v2v", "kling-video/o3/video-edit"),+ ("remove-object", "kling-video/o3/video-edit"), ("video-swap", "kling-video/o3/video-edit"), ("video-insert", "kling-video/o3/video-edit")],"kling-o1": [("flf2v", "kling-video/omni/first-last-frame"), ("ref2v", "kling-video/omni/image-reference"), ("v2v", "kling-video/omni/video-edit")],"kling-motion-control": [("motion-transfer", "kling-video/v3/motion-control/pro")],"kling-2-6-pro": [("t2v", "kling-video/v2.6/pro/text-to-video"), ("i2v", "kling-video/v2.6/pro/image-to-video")],@@ -252,6 +265,10 @@ EXTRA = {"z-image-turbo-cloud": [("t2i", "z-image/turbo")],"recraft-4-1": [("t2i", "recraft/v4.1/text-to-image")],"recraft-4-1-pro": [("t2i", "recraft/v4.1/pro/text-to-image")],+ # Grok Imagine on fal since round 4 (gen-cloud-models.py); Higgsfield is the second route.+ "grok-imagine-video-1-5": [("t2v", "xai/grok-imagine-video/v1.5/reference-to-video"), ("i2v", "xai/grok-imagine-video/v1.5/reference-to-video"),+ ("ref2v", "xai/grok-imagine-video/v1.5/reference-to-video")],+ "grok-imagine-image-2": [("t2i", "xai/grok-imagine-image-2.0"), ("edit", "xai/grok-imagine-image-2.0")],}models = []diff --git a/src/lib/catalog/cloud-models.generated.ts b/src/lib/catalog/cloud-models.generated.tsindex 08b5734d..369767f8 100644--- a/src/lib/catalog/cloud-models.generated.ts+++ b/src/lib/catalog/cloud-models.generated.ts@@ -1,4 +1,4 @@-// Generated by scripts/gen-cloud-models.py from docs/research/paid-model-apis(-2,-3).json — do not edit by hand.+// Generated by scripts/gen-cloud-models.py from docs/research/paid-model-apis(-2,-3,-4).json — do not edit by hand.import type { ModelDef } from "./types";export const CLOUD_MODELS: ModelDef[] = [@@ -3730,6 +3730,33 @@ export const CLOUD_MODELS: ModelDef[] = ["images": "image_urls","video": "video_url"}+ },+ {+ "op": "remove-object",+ "provider": "fal",+ "endpoint": "fal-ai/kling-video/o3/pro/video-to-video/edit",+ "map": {+ "images": "image_urls",+ "video": "video_url"+ }+ },+ {+ "op": "video-swap",+ "provider": "fal",+ "endpoint": "fal-ai/kling-video/o3/pro/video-to-video/edit",+ "map": {+ "images": "image_urls",+ "video": "video_url"+ }+ },+ {+ "op": "video-insert",+ "provider": "fal",+ "endpoint": "fal-ai/kling-video/o3/pro/video-to-video/edit",+ "map": {+ "images": "image_urls",+ "video": "video_url"+ }}],"options": {@@ -6142,6 +6169,33 @@ export const CLOUD_MODELS: ModelDef[] = ["images": "image_urls","video": "video_url"}+ },+ {+ "op": "remove-object",+ "provider": "fal",+ "endpoint": "fal-ai/kling-video/o3/4k/video-to-video/edit",+ "map": {+ "images": "image_urls",+ "video": "video_url"+ }+ },+ {+ "op": "video-swap",+ "provider": "fal",+ "endpoint": "fal-ai/kling-video/o3/4k/video-to-video/edit",+ "map": {+ "images": "image_urls",+ "video": "video_url"+ }+ },+ {+ "op": "video-insert",+ "provider": "fal",+ "endpoint": "fal-ai/kling-video/o3/4k/video-to-video/edit",+ "map": {+ "images": "image_urls",+ "video": "video_url"+ }}],"options": {@@ -9743,9 +9797,12 @@ export const CLOUD_MODELS: ModelDef[] = ["map": {"prompt": false,"video": "video_url",+ "colormap": "colormap","resolution": "resolution","fixed": {- "model": "VDA-Base",+ "model": "VDA-Base"+ },+ "defaults": {"colormap": "grayscale"}}@@ -11834,5 +11891,2563 @@ export const CLOUD_MODELS: ModelDef[] = ["usd": 1.2,"note": "textured; untextured $0.80, rigging +$0.20"}+ },+ {+ "id": "bria-video-erase",+ "name": "Bria Video Eraser",+ "vendor": "Bria",+ "family": "bria",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Name what to remove from a clip under 5 s \u2014 sound kept",+ "routes": [+ {+ "op": "remove-object",+ "provider": "fal",+ "endpoint": "bria/video/erase/prompt",+ "map": {+ "video": "video_url"+ }+ }+ ],+ "options": {},+ "badges": [+ "new"+ ],+ "pricing": {+ "unit": "second",+ "usd": 0.14,+ "note": "clips under 5 s; longer ones are cut to their first 5 s"+ }+ },+ {+ "id": "bria-video-erase-points",+ "name": "Bria Video Eraser \u00b7 points",+ "vendor": "Bria",+ "family": "bria",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Remove what you click on the first frame (under 5 s)",+ "routes": [+ {+ "op": "remove-object",+ "provider": "fal",+ "endpoint": "bria/video/erase/keypoints",+ "map": {+ "prompt": false,+ "video": "video_url",+ "points": {+ "key": "keypoints",+ "format": "bria"+ }+ }+ }+ ],+ "options": {+ "promptless": true,+ "requires": {+ "points": true,+ "msg": "Click what to remove on the first frame"+ }+ },+ "pricing": {+ "unit": "second",+ "usd": 0.14,+ "note": "clips under 5 s"+ },+ "hidden": true+ },+ {+ "id": "bria-video-erase-mask",+ "name": "Bria Video Eraser \u00b7 mask video",+ "vendor": "Bria",+ "family": "bria",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Remove what a mask video marks (white), under 5 s",+ "routes": [+ {+ "op": "remove-object",+ "provider": "fal",+ "endpoint": "bria/video/erase/mask",+ "map": {+ "prompt": false,+ "mask": "mask_video_url",+ "video": "video_url"+ }+ },+ {+ "op": "remove-object",+ "provider": "replicate",+ "endpoint": "bria/video-erase-object",+ "map": {+ "prompt": false,+ "mask": "mask_url",+ "video": "video_url",+ "fixed": {+ "auto_trim": true+ }+ }+ }+ ],+ "options": {+ "promptless": true,+ "requires": {+ "mask": true,+ "msg": "Add the mask video (white = what to remove)"+ }+ },+ "pricing": {+ "unit": "second",+ "usd": 0.14,+ "note": "fal; $0.05/s on Replicate"+ },+ "hidden": true+ },+ {+ "id": "void-video-inpainting",+ "name": "VOID Video Eraser",+ "vendor": "fal",+ "family": "void",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Removes an object and what it causes \u2014 shadows, reflections, ripples \u2014 from clips up to ~8 s",+ "routes": [+ {+ "op": "remove-object",+ "provider": "fal",+ "endpoint": "fal-ai/void-video-inpainting",+ "map": {+ "prompt": "mask_prompt",+ "negativePrompt": "negative_prompt",+ "video": "video_url",+ "seed": "seed",+ "defaults": {+ "prompt": "The same shot with nothing there: the background continues naturally, matching the light, texture and motion around it"+ }+ }+ }+ ],+ "options": {+ "sliders": [+ {+ "param": "strength",+ "label": "Strength",+ "min": 0,+ "max": 1,+ "step": 0.05,+ "default": 1+ }+ ],+ "negativePrompt": true,+ "seed": true+ },+ "badges": [+ "new"+ ],+ "pricing": {+ "unit": "request",+ "usd": 0.1,+ "note": "$0.05 per clip + $0.05 for the mask made from your words; Pass 2 refinement doubles the first part; up to 197 frames"+ }+ },+ {+ "id": "ltx-2-3-clean-plate",+ "name": "LTX 2.3 Clean Plate",+ "vendor": "Lightricks",+ "family": "ltx",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Removes every person from a shot for a clean background plate",+ "routes": [+ {+ "op": "remove-object",+ "provider": "fal",+ "endpoint": "fal-ai/ltx-2.3-quality/clean-plate",+ "map": {+ "prompt": false,+ "negativePrompt": "negative_prompt",+ "video": "video_url",+ "seed": "seed",+ "generateAudio": "generate_audio",+ "fps": "frames_per_second",+ "resolution": "resolution"+ }+ }+ ],+ "options": {+ "negativePrompt": true,+ "seed": true,+ "audio": true,+ "resolutions": [+ "480p",+ "720p"+ ],+ "promptless": true+ },+ "defaults": {+ "resolution": "720p",+ "generateAudio": true+ },+ "pricing": {+ "unit": "video",+ "usd": 0.27,+ "note": "121 frames at 720p; billed per megapixel of video"+ }+ },+ {+ "id": "wan-22-vace-inpaint",+ "name": "Wan 2.2 VACE Fun Inpaint (hosted)",+ "vendor": "Alibaba Wan",+ "family": "wan",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Paint an area on the first frame: erase it, or swap or add something from a reference image",+ "routes": [+ {+ "op": "remove-object",+ "provider": "fal",+ "endpoint": "fal-ai/wan-22-vace-fun-a14b/inpainting",+ "map": {+ "prompt": false,+ "negativePrompt": "negative_prompt",+ "mask": "mask_image_url",+ "video": "video_url",+ "seed": "seed",+ "fps": "frames_per_second",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "defaults": {+ "match_input_num_frames": true,+ "match_input_frames_per_second": true,+ "prompt": "The same shot with nothing there: the background continues naturally, matching the light, texture and motion around it"+ }+ }+ },+ {+ "op": "video-swap",+ "provider": "fal",+ "endpoint": "fal-ai/wan-22-vace-fun-a14b/inpainting",+ "map": {+ "negativePrompt": "negative_prompt",+ "images": "ref_image_urls",+ "mask": "mask_image_url",+ "video": "video_url",+ "seed": "seed",+ "fps": "frames_per_second",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "defaults": {+ "match_input_num_frames": true,+ "match_input_frames_per_second": true+ }+ }+ },+ {+ "op": "video-insert",+ "provider": "fal",+ "endpoint": "fal-ai/wan-22-vace-fun-a14b/inpainting",+ "map": {+ "negativePrompt": "negative_prompt",+ "images": "ref_image_urls",+ "mask": "mask_image_url",+ "video": "video_url",+ "seed": "seed",+ "fps": "frames_per_second",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "defaults": {+ "match_input_num_frames": true,+ "match_input_frames_per_second": true+ }+ }+ }+ ],+ "options": {+ "negativePrompt": true,+ "seed": true,+ "aspectRatios": [+ "auto",+ "16:9",+ "1:1",+ "9:16"+ ],+ "resolutions": [+ "auto",+ "240p",+ "360p",+ "480p",+ "580p",+ "720p"+ ],+ "maxImages": 4,+ "requires": {+ "mask": true,+ "msg": "Paint the area to change on the first frame"+ }+ },+ "pricing": {+ "unit": "second",+ "usd": 0.1,+ "note": "720p, counted at 16 fps; 580p $0.075, 480p $0.05",+ "byResolution": {+ "720p": 0.1,+ "580p": 0.075,+ "480p": 0.05+ }+ }+ },+ {+ "id": "sam-3-1-video-mask",+ "name": "SAM 3.1 video mask",+ "vendor": "Meta",+ "family": "sam",+ "engine": "cloud",+ "kind": "video",+ "tagline": "A mask video of what you name or click, tracked through the clip",+ "routes": [+ {+ "op": "bg-remove-video",+ "provider": "fal",+ "endpoint": "fal-ai/sam-3-1/video",+ "map": {+ "video": "video_url",+ "points": {+ "key": "point_prompts",+ "format": "sam"+ },+ "fixed": {+ "apply_mask": false+ }+ }+ }+ ],+ "options": {},+ "pricing": {+ "unit": "second",+ "usd": 0.015,+ "note": "$0.01 per 16 input frames (24 fps)"+ },+ "hidden": true+ },+ {+ "id": "p-video-replace",+ "name": "P-Video Replace",+ "vendor": "Pruna AI",+ "family": "p-video",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Put the people from 1\u20133 photos into a clip \u2014 same motion, timing, camera and sound",+ "routes": [+ {+ "op": "video-swap",+ "provider": "replicate",+ "endpoint": "prunaai/p-video-replace",+ "map": {+ "prompt": "instruction_prompt",+ "images": "images",+ "video": "video",+ "seed": "seed",+ "resolution": "resolution"+ }+ }+ ],+ "options": {+ "promptOptional": true,+ "seed": true,+ "resolutions": [+ "720p",+ "1080p"+ ],+ "maxImages": 3+ },+ "badges": [+ "new"+ ],+ "defaults": {+ "resolution": "720p"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.03,+ "note": "720p; 1080p $0.06",+ "byResolution": {+ "720p": 0.03,+ "1080p": 0.06+ }+ }+ },+ {+ "id": "topaz-fps-boost",+ "name": "Topaz FPS Boost",+ "vendor": "Topaz Labs",+ "family": "topaz",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Smooth frame interpolation to 16\u2013120 fps, or up to 8\u00d7 slow motion",+ "routes": [+ {+ "op": "interpolate",+ "provider": "fal",+ "endpoint": "topaz/interpolate/video",+ "map": {+ "prompt": false,+ "video": "video_url",+ "slowdown": "slowdown_factor",+ "targetFps": "target_fps",+ "defaults": {+ "H264_output": true+ }+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "model",+ "label": "Model",+ "values": [+ "Apollo",+ "Chronos",+ "Aion"+ ],+ "default": "Apollo"+ }+ ],+ "promptless": true+ },+ "badges": [+ "new"+ ],+ "pricing": {+ "unit": "second",+ "usd": 0.03,+ "note": "1080p 30\u219260 fps with Apollo or Chronos; 4K $0.06; Aion $0.05 / $0.17; slow motion bills the whole output"+ }+ },+ {+ "id": "rife-video-cloud",+ "name": "RIFE (hosted)",+ "vendor": "fal",+ "family": "rife",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Cheap frame interpolation: twice the frames, same speed",+ "routes": [+ {+ "op": "interpolate",+ "provider": "fal",+ "endpoint": "fal-ai/rife/video",+ "map": {+ "prompt": false,+ "video": "video_url"+ }+ }+ ],+ "options": {+ "promptless": true+ },+ "badges": [+ "fast"+ ],+ "pricing": {+ "unit": "request",+ "usd": 0.001,+ "note": "billed per compute second ($0.0013/s)"+ }+ },+ {+ "id": "topaz-sdr-to-hdr",+ "name": "Topaz SDR to HDR",+ "vendor": "Topaz Labs",+ "family": "topaz",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Hyperion 2.5: SDR footage to 10-bit HDR10 (H.265) or ProRes 422 HQ",+ "routes": [+ {+ "op": "sdr-to-hdr",+ "provider": "fal",+ "endpoint": "topaz/sdr-to-hdr/video",+ "map": {+ "prompt": false,+ "video": "video_url",+ "format": {+ "key": "output_format",+ "values": {+ "h265_10bit": "mp4",+ "prores_422_hq": "prores"+ }+ }+ }+ }+ ],+ "options": {+ "formats": [+ "h265_10bit",+ "prores_422_hq"+ ],+ "promptless": true+ },+ "badges": [+ "new"+ ],+ "pricing": {+ "unit": "second",+ "usd": 0.24,+ "note": "up to 1080p at 30 fps; 4K $0.51"+ }+ },+ {+ "id": "ltx-2-3-hdr",+ "name": "LTX 2.3 HDR (EXR frames)",+ "vendor": "Lightricks",+ "family": "ltx",+ "engine": "cloud",+ "kind": "video",+ "tagline": "SDR to 16-bit EXR frames for compositing, with an SDR preview",+ "routes": [+ {+ "op": "sdr-to-hdr",+ "provider": "fal",+ "endpoint": "fal-ai/ltx-2.3-quality/hdr",+ "map": {+ "prompt": false,+ "negativePrompt": "negative_prompt",+ "video": "video_url",+ "seed": "seed",+ "generateAudio": "generate_audio",+ "fps": "frames_per_second",+ "defaults": {+ "prompt": "The same shot in high dynamic range: deeper shadows and brighter highlights, every detail and movement unchanged"+ }+ }+ }+ ],+ "options": {+ "negativePrompt": true,+ "seed": true,+ "audio": true,+ "promptless": true,+ "formats": [+ "exr"+ ]+ },+ "defaults": {+ "generateAudio": true+ },+ "pricing": {+ "unit": "video",+ "usd": 0.3,+ "note": "121 frames at 720p; billed per megapixel of HDR video"+ }+ },+ {+ "id": "ken-burns",+ "name": "Ken Burns",+ "vendor": "fal",+ "family": "utility",+ "engine": "cloud",+ "kind": "video",+ "tagline": "A slow zoom into (or out of) a still, toward a focal point",+ "routes": [+ {+ "op": "still-motion",+ "provider": "fal",+ "endpoint": "fal-ai/workflow-utilities/image-to-video",+ "map": {+ "prompt": false,+ "image": "image_url",+ "fps": "frames_per_second",+ "zoom": {+ "factor": "zoom_factor",+ "max": 2,+ "direction": {+ "key": "zoom_direction",+ "in": "in",+ "out": "out"+ },+ "x": "zoom_x",+ "y": "zoom_y",+ "percent": true,+ "easing": {+ "key": "easing",+ "values": {+ "linear": "linear",+ "ease-in-out": "ease_in_out"+ }+ }+ },+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "options": {+ "maxImages": 1,+ "promptless": true+ },+ "pricing": {+ "unit": "request",+ "usd": 0.001,+ "note": "billed per compute second"+ },+ "hidden": true+ },+ {+ "id": "overlay-image",+ "name": "Overlay image",+ "vendor": "fal",+ "family": "utility",+ "engine": "cloud",+ "kind": "image",+ "tagline": "Places a logo or picture on another, at a position and size",+ "routes": [+ {+ "op": "overlay",+ "provider": "fal",+ "endpoint": "fal-ai/workflow-utilities/overlay-image",+ "map": {+ "prompt": false,+ "image": "background_image_url",+ "image2": "overlay_image_url",+ "position": {+ "x": "x_percent",+ "y": "y_percent",+ "percent": true+ },+ "scale": {+ "key": "scale_percent",+ "multiplier": 100+ }+ }+ }+ ],+ "options": {+ "minImages": 2,+ "imageLabels": [+ "picture",+ "logo or overlay"+ ],+ "maxImages": 2,+ "promptless": true+ },+ "pricing": {+ "unit": "request",+ "usd": 0.001,+ "note": "billed per compute second"+ },+ "hidden": true+ },+ {+ "id": "extract-frames",+ "name": "Extract frames",+ "vendor": "fal",+ "family": "utility",+ "engine": "cloud",+ "kind": "image",+ "tagline": "Every Nth frame of a video as images (up to 500 a call)",+ "routes": [+ {+ "op": "extract-frames",+ "provider": "fal",+ "endpoint": "fal-ai/workflow-utilities/extract-nth-frame",+ "map": {+ "prompt": false,+ "video": "video_url",+ "frameInterval": "frame_interval",+ "defaults": {+ "max_frames": 500+ }+ }+ }+ ],+ "options": {+ "promptless": true+ },+ "pricing": {+ "unit": "request",+ "usd": 0.001,+ "note": "billed per compute second"+ },+ "hidden": true+ },+ {+ "id": "images-to-video",+ "name": "Images to video",+ "vendor": "fal",+ "family": "utility",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Images in order as the frames of a video",+ "routes": [+ {+ "op": "images-to-video",+ "provider": "fal",+ "endpoint": "fal-ai/ffmpeg-api/images-to-video",+ "map": {+ "prompt": false,+ "fps": "fps",+ "frames": {+ "key": "images",+ "url": "url",+ "frames": "frames"+ }+ }+ }+ ],+ "options": {+ "maxImages": 200,+ "promptless": true+ },+ "pricing": {+ "unit": "request",+ "usd": 0.001,+ "note": "billed per compute second"+ },+ "hidden": true+ },+ {+ "id": "join-audio",+ "name": "Join audio",+ "vendor": "fal",+ "family": "utility",+ "engine": "cloud",+ "kind": "audio",+ "tagline": "Audio clips one after another, or one clip played several times",+ "routes": [+ {+ "op": "audio-join",+ "provider": "fal",+ "endpoint": "fal-ai/ffmpeg-api/merge-audios",+ "map": {+ "prompt": false,+ "audios": "audio_urls"+ }+ },+ {+ "op": "audio-loop",+ "provider": "fal",+ "endpoint": "fal-ai/ffmpeg-api/merge-audios",+ "map": {+ "prompt": false,+ "loop": {+ "key": "audio_urls",+ "max": 5+ }+ }+ }+ ],+ "options": {+ "maxAudios": 5,+ "promptless": true+ },+ "pricing": {+ "unit": "request",+ "usd": 0.001,+ "note": "billed per compute second"+ },+ "hidden": true+ },+ {+ "id": "florence-2-ocr",+ "name": "Florence-2 OCR",+ "vendor": "Microsoft",+ "family": "florence",+ "engine": "cloud",+ "kind": "text",+ "tagline": "Every line of text in an image, with its box",+ "routes": [+ {+ "op": "ocr",+ "provider": "fal",+ "endpoint": "fal-ai/florence-2-large/ocr-with-region",+ "map": {+ "prompt": false,+ "image": "image_url"+ }+ }+ ],+ "options": {+ "maxImages": 1,+ "promptless": true+ },+ "pricing": {+ "unit": "request",+ "usd": 0.001,+ "note": "billed per compute second"+ }+ },+ {+ "id": "triposplat",+ "name": "TripoSplat",+ "vendor": "Tripo",+ "family": "tripo",+ "engine": "cloud",+ "kind": "model3d",+ "tagline": "A Gaussian splat of the subject in one photo (background removed)",+ "routes": [+ {+ "op": "splat",+ "provider": "fal",+ "endpoint": "tripo3d/triposplat",+ "map": {+ "prompt": false,+ "image": "image_url",+ "seed": "seed",+ "fixed": {+ "output_format": "ply"+ }+ }+ }+ ],+ "options": {+ "sliders": [+ {+ "param": "num_gaussians",+ "label": "Gaussians",+ "min": 32768,+ "max": 262144,+ "step": 1,+ "default": 262144+ }+ ],+ "seed": true,+ "maxImages": 1,+ "promptless": true+ },+ "badges": [+ "new"+ ],+ "pricing": {+ "unit": "request",+ "usd": 0.05+ }+ },+ {+ "id": "sam-3d-objects",+ "name": "SAM 3D Objects",+ "vendor": "Meta",+ "family": "sam",+ "engine": "cloud",+ "kind": "model3d",+ "tagline": "The objects you name, rebuilt in 3D where they stand in the photo",+ "routes": [+ {+ "op": "image-to-3d",+ "provider": "fal",+ "endpoint": "fal-ai/sam-3/3d-objects",+ "map": {+ "image": "image_url",+ "seed": "seed",+ "points": {+ "key": "point_prompts",+ "format": "sam"+ }+ }+ }+ ],+ "options": {+ "seed": true,+ "maxImages": 1,+ "requires": {+ "prompt": true,+ "msg": "Name the objects to rebuild, e.g. \u201cchair, lamp\u201d"+ }+ },+ "badges": [+ "new"+ ],+ "pricing": {+ "unit": "request",+ "usd": 0.02,+ "note": "per unit; fal does not say what a unit is"+ }+ },+ {+ "id": "tripo-h3-1-text",+ "name": "Tripo H3.1 Text to 3D",+ "vendor": "Tripo",+ "family": "tripo",+ "engine": "cloud",+ "kind": "model3d",+ "tagline": "A textured 3D model from a description",+ "routes": [+ {+ "op": "text-to-3d",+ "provider": "fal",+ "endpoint": "tripo3d/h3.1/text-to-3d",+ "map": {+ "negativePrompt": "negative_prompt",+ "seed": "model_seed"+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "texture_quality",+ "label": "Texture",+ "values": [+ "standard",+ "detailed"+ ],+ "default": "standard"+ },+ {+ "param": "geometry_quality",+ "label": "Geometry",+ "values": [+ "standard",+ "detailed"+ ],+ "default": "standard"+ }+ ],+ "negativePrompt": true,+ "seed": true+ },+ "pricing": {+ "unit": "request",+ "usd": 0.2,+ "note": "standard textures; untextured $0.10, HD $0.30"+ }+ },+ {+ "id": "meshy-7-1-multi",+ "name": "Meshy 7.1 Multi-view",+ "vendor": "Meshy",+ "family": "meshy",+ "engine": "cloud",+ "kind": "model3d",+ "tagline": "One object from up to 4 photos of different sides",+ "routes": [+ {+ "op": "image-to-3d",+ "provider": "fal",+ "endpoint": "meshy/v7.1/multi-image-to-3d",+ "map": {+ "prompt": "texture_prompt",+ "images": "image_urls"+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "topology",+ "label": "Topology",+ "values": [+ "quad",+ "triangle"+ ],+ "default": "triangle"+ }+ ],+ "maxImages": 4+ },+ "pricing": {+ "unit": "request",+ "usd": 1.2,+ "note": "textured; untextured $0.80, rigging +$0.20"+ }+ },+ {+ "id": "meshy-rigging",+ "name": "Meshy Rigging",+ "vendor": "Meshy",+ "family": "meshy",+ "engine": "cloud",+ "kind": "model3d",+ "tagline": "Rig a humanoid GLB with a skeleton, walk and run cycles, or an animation preset",+ "routes": [+ {+ "op": "rig-3d",+ "provider": "fal",+ "endpoint": "fal-ai/meshy/rigging",+ "map": {+ "prompt": false,+ "model3d": "model_url",+ "animation": {+ "key": "animation_action_id",+ "flag": "enable_animation"+ }+ }+ }+ ],+ "options": {+ "promptless": true+ },+ "badges": [+ "new"+ ],+ "pricing": {+ "unit": "request",+ "usd": 0.2,+ "note": "+$0.12 with an animation preset"+ }+ },+ {+ "id": "flux-3-max",+ "name": "FLUX 3 Max",+ "vendor": "Black Forest Labs",+ "family": "flux",+ "engine": "cloud",+ "kind": "video",+ "tagline": "BFL's top video model: 5\u201320 s with sound, start and end frames, or up to 10 keyframes",+ "routes": [+ {+ "op": "t2v",+ "provider": "fal",+ "endpoint": "blackforestlabs/flux-3-max/text-to-video",+ "map": {+ "seed": "seed",+ "generateAudio": "generate_audio",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "i2v",+ "provider": "fal",+ "endpoint": "blackforestlabs/flux-3-max/image-to-video",+ "map": {+ "image": "image_url",+ "endImage": "end_image_url",+ "seed": "seed",+ "generateAudio": "generate_audio",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "flf2v",+ "provider": "fal",+ "endpoint": "blackforestlabs/flux-3-max/image-to-video",+ "map": {+ "image": "image_url",+ "endImage": "end_image_url",+ "seed": "seed",+ "generateAudio": "generate_audio",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "keyframes",+ "provider": "fal",+ "endpoint": "blackforestlabs/flux-3-max/keyframes-to-video",+ "map": {+ "seed": "seed",+ "generateAudio": "generate_audio",+ "keyframes": {+ "key": "keyframes",+ "image": "image_url",+ "frame": "frame_index",+ "fps": 24+ },+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "reasoning_level",+ "label": "Reasoning",+ "values": [+ "low",+ "high"+ ],+ "default": "high"+ }+ ],+ "seed": true,+ "audio": true,+ "aspectRatios": [+ "auto",+ "21:9",+ "2:1",+ "16:9",+ "4:3",+ "1:1",+ "3:4",+ "9:16"+ ],+ "resolutions": [+ "720p",+ "1080p"+ ],+ "durations": [+ 5,+ 6,+ 8,+ 10,+ 12,+ 15,+ 20+ ],+ "endFrame": true,+ "maxImages": 10+ },+ "badges": [+ "new",+ "audio"+ ],+ "defaults": {+ "aspectRatio": "16:9",+ "duration": 5,+ "resolution": "720p",+ "generateAudio": true+ },+ "pricing": {+ "unit": "second",+ "usd": 0.17,+ "note": "720p; 1080p $0.29 \u2014 launch price $0.0425 (1080p $0.0725) until 2026-11-07",+ "byResolution": {+ "720p": 0.17,+ "1080p": 0.29+ },+ "promo": {+ "until": "2026-11-07",+ "usd": 0.0425,+ "byResolution": {+ "720p": 0.0425,+ "1080p": 0.0725+ }+ }+ }+ },+ {+ "id": "heygen-video",+ "name": "HeyGen Video",+ "vendor": "HeyGen",+ "family": "heygen",+ "engine": "cloud",+ "kind": "video",+ "tagline": "HeyGen's model on MiniMax H3 \u2014 cheap 768p clips, references with sound",+ "routes": [+ {+ "op": "t2v",+ "provider": "fal",+ "endpoint": "heygen/heygen-video/text-to-video",+ "map": {+ "seed": "seed",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "i2v",+ "provider": "fal",+ "endpoint": "heygen/heygen-video/image-to-video",+ "map": {+ "image": "image_url",+ "seed": "seed",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "ref2v",+ "provider": "fal",+ "endpoint": "heygen/heygen-video/reference-to-video",+ "map": {+ "images": "reference_image_urls",+ "videos": "reference_video_urls",+ "audios": "reference_audio_urls",+ "seed": "seed",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "prompt_enhancement",+ "label": "Prompt boost",+ "values": [+ "turbo",+ "quality",+ "ultraquality",+ "disabled"+ ],+ "default": "turbo"+ }+ ],+ "seed": true,+ "aspectRatios": [+ "21:9",+ "16:9",+ "4:3",+ "1:1",+ "3:4",+ "9:16"+ ],+ "resolutions": [+ "480p",+ "768p",+ "1080p",+ "2k"+ ],+ "durations": [+ 5,+ 6,+ 8,+ 10,+ 12,+ 15+ ],+ "maxImages": 9,+ "maxVideos": 3,+ "maxAudios": 3+ },+ "badges": [+ "new",+ "fast"+ ],+ "defaults": {+ "aspectRatio": "16:9",+ "duration": 5,+ "resolution": "768p"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.02,+ "note": "480p and 768p; 1080p and 2K $0.06",+ "byResolution": {+ "480p": 0.02,+ "768p": 0.02,+ "1080p": 0.06,+ "2k": 0.06+ }+ }+ },+ {+ "id": "grok-imagine-video-1-5",+ "name": "Grok Imagine Video 1.5",+ "vendor": "xAI",+ "family": "grok",+ "engine": "cloud",+ "kind": "video",+ "tagline": "xAI's video model with references and audio",+ "routes": [+ {+ "op": "t2v",+ "provider": "fal",+ "endpoint": "xai/grok-imagine-video/v1.5/text-to-video",+ "map": {+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "i2v",+ "provider": "fal",+ "endpoint": "xai/grok-imagine-video/v1.5/image-to-video",+ "map": {+ "image": "image_url",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "ref2v",+ "provider": "fal",+ "endpoint": "xai/grok-imagine-video/v1.5/reference-to-video",+ "map": {+ "images": "reference_image_urls",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "options": {+ "aspectRatios": [+ "16:9",+ "4:3",+ "3:2",+ "1:1",+ "2:3",+ "3:4",+ "9:16"+ ],+ "resolutions": [+ "480p",+ "720p",+ "1080p"+ ],+ "durations": [+ 3,+ 4,+ 5,+ 6,+ 8,+ 10,+ 12,+ 15+ ],+ "maxImages": 7+ },+ "defaults": {+ "aspectRatio": "16:9",+ "duration": 6,+ "resolution": "720p"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.14,+ "note": "720p; 480p $0.08, 1080p $0.25; +$0.01 per input image",+ "byResolution": {+ "480p": 0.08,+ "720p": 0.14,+ "1080p": 0.25+ }+ }+ },+ {+ "id": "grok-imagine-video-1-5-lite",+ "name": "Grok Imagine Video 1.5 Lite",+ "vendor": "xAI",+ "family": "grok",+ "engine": "cloud",+ "kind": "video",+ "tagline": "One of the cheapest 720p video models, 1\u201315 s",+ "routes": [+ {+ "op": "t2v",+ "provider": "fal",+ "endpoint": "xai/grok-imagine-video/v1.5/lite/text-to-video",+ "map": {+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "i2v",+ "provider": "fal",+ "endpoint": "xai/grok-imagine-video/v1.5/lite/image-to-video",+ "map": {+ "image": "image_url",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "options": {+ "aspectRatios": [+ "16:9",+ "4:3",+ "3:2",+ "1:1",+ "2:3",+ "3:4",+ "9:16"+ ],+ "resolutions": [+ "480p",+ "720p",+ "1080p"+ ],+ "durations": [+ 3,+ 4,+ 5,+ 6,+ 8,+ 10,+ 12,+ 15+ ],+ "maxImages": 1+ },+ "badges": [+ "new",+ "fast"+ ],+ "defaults": {+ "aspectRatio": "16:9",+ "duration": 6,+ "resolution": "720p"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.03,+ "note": "720p; 480p $0.02, 1080p $0.14; +$0.01 per input image",+ "byResolution": {+ "480p": 0.02,+ "720p": 0.03,+ "1080p": 0.14+ }+ }+ },+ {+ "id": "pixverse-v6-max",+ "name": "PixVerse V6 Max",+ "vendor": "PixVerse",+ "family": "pixverse",+ "engine": "cloud",+ "kind": "video",+ "tagline": "PixVerse's top model \u2014 up to 15 s 1080p with sound and dialogue",+ "routes": [+ {+ "op": "t2v",+ "provider": "replicate",+ "endpoint": "pixverse/pixverse-v6-max",+ "map": {+ "negativePrompt": "negative_prompt",+ "image": "image",+ "seed": "seed",+ "generateAudio": "generate_audio_switch",+ "aspectRatio": "aspect_ratio",+ "resolution": "quality",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "i2v",+ "provider": "replicate",+ "endpoint": "pixverse/pixverse-v6-max",+ "map": {+ "negativePrompt": "negative_prompt",+ "image": "image",+ "seed": "seed",+ "generateAudio": "generate_audio_switch",+ "aspectRatio": "aspect_ratio",+ "resolution": "quality",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "options": {+ "negativePrompt": true,+ "seed": true,+ "audio": true,+ "aspectRatios": [+ "16:9",+ "9:16",+ "1:1"+ ],+ "resolutions": [+ "360p",+ "540p",+ "720p",+ "1080p"+ ],+ "durations": [+ 5,+ 8,+ 10,+ 15+ ],+ "maxImages": 1+ },+ "badges": [+ "new",+ "audio"+ ],+ "defaults": {+ "aspectRatio": "16:9",+ "duration": 5,+ "resolution": "720p",+ "generateAudio": true+ },+ "pricing": {+ "unit": "second",+ "usd": 0.15,+ "note": "720p with sound; without $0.11; 1080p $0.28 / $0.22",+ "byResolution": {+ "360p": 0.09,+ "540p": 0.11,+ "720p": 0.15,+ "1080p": 0.28+ }+ }+ },+ {+ "id": "p-video-2-pro-reference",+ "name": "P-Video 2 Pro Reference",+ "vendor": "Pruna AI",+ "family": "p-video",+ "engine": "cloud",+ "kind": "video",+ "tagline": "MiniMax H3 reference-to-video: images, clips and sound to follow, optional first and last frame",+ "routes": [+ {+ "op": "ref2v",+ "provider": "replicate",+ "endpoint": "prunaai/p-video-2-pro-reference",+ "map": {+ "images": "image",+ "endImage": "last_frame_image",+ "videos": "video",+ "audios": "audio",+ "seed": "seed",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "mode",+ "label": "Mode",+ "values": [+ "speed",+ "cost"+ ],+ "default": "speed"+ }+ ],+ "maxVideos": 3,+ "maxAudios": 3,+ "seed": true,+ "endFrame": true,+ "aspectRatios": [+ "16:9",+ "9:16",+ "4:3",+ "3:4",+ "3:2",+ "2:3",+ "1:1"+ ],+ "resolutions": [+ "768p",+ "480p"+ ],+ "durations": [+ 5,+ 6,+ 8,+ 10,+ 12,+ 15+ ],+ "maxImages": 4+ },+ "badges": [+ "new"+ ],+ "defaults": {+ "aspectRatio": "16:9",+ "duration": 5,+ "resolution": "768p"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.035,+ "note": "768p speed mode; cost mode $0.025; + reference clips and images",+ "byResolution": {+ "480p": 0.02,+ "768p": 0.035+ }+ }+ },+ {+ "id": "creatify-boreal",+ "name": "Creatify Boreal",+ "vendor": "Creatify",+ "family": "creatify",+ "engine": "cloud",+ "kind": "video",+ "tagline": "UGC, product and presenter clips with sound for a cent a second",+ "routes": [+ {+ "op": "t2v",+ "provider": "fal",+ "endpoint": "creatify/boreal",+ "map": {+ "negativePrompt": "negative_prompt",+ "image": "image_url",+ "audio": "audio_url",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "i2v",+ "provider": "fal",+ "endpoint": "creatify/boreal",+ "map": {+ "negativePrompt": "negative_prompt",+ "image": "image_url",+ "audio": "audio_url",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "options": {+ "negativePrompt": true,+ "aspectRatios": [+ "auto",+ "16:9",+ "9:16",+ "1:1",+ "4:3",+ "3:4"+ ],+ "resolutions": [+ "720p",+ "1080p",+ "2k"+ ],+ "durations": [+ 3,+ 4,+ 5,+ 6,+ 8,+ 10,+ 12,+ 15,+ 20+ ],+ "maxImages": 1+ },+ "badges": [+ "new",+ "audio",+ "fast"+ ],+ "defaults": {+ "aspectRatio": "16:9",+ "duration": 10,+ "resolution": "720p"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.01,+ "note": "720p; 1080p $0.03, 2K $0.12",+ "byResolution": {+ "720p": 0.01,+ "1080p": 0.03,+ "2k": 0.12+ }+ }+ },+ {+ "id": "pixelcut-looping-video",+ "name": "Pixelcut Looping Video",+ "vendor": "Pixelcut",+ "family": "pixelcut",+ "engine": "cloud",+ "kind": "video",+ "tagline": "A product photo as a seamless 5\u201315 s loop, camera locked",+ "routes": [+ {+ "op": "i2v",+ "provider": "fal",+ "endpoint": "pixelcut/looping-video",+ "map": {+ "image": "image_url",+ "generateAudio": "include_audio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "motion",+ "label": "Motion",+ "values": [+ "subtle",+ "spin"+ ],+ "default": "subtle"+ }+ ],+ "audio": true,+ "resolutions": [+ "480p",+ "768p",+ "1080p"+ ],+ "durations": [+ 5,+ 6,+ 8,+ 10,+ 12,+ 15+ ],+ "maxImages": 1,+ "promptOptional": true+ },+ "badges": [+ "new"+ ],+ "defaults": {+ "duration": 5,+ "resolution": "768p",+ "generateAudio": false+ },+ "pricing": {+ "unit": "second",+ "usd": 0.16,+ "note": "768p; 480p $0.08, 1080p $0.32",+ "byResolution": {+ "480p": 0.08,+ "768p": 0.16,+ "1080p": 0.32+ }+ }+ },+ {+ "id": "minimax-h3-max-reframe",+ "name": "MiniMax H3 Max Reframe",+ "vendor": "MiniMax",+ "family": "hailuo",+ "engine": "cloud",+ "kind": "video",+ "tagline": "Outpaints a clip to a new shape \u2014 9:16, 1:1, 21:9 and more \u2014 sound and timing kept",+ "routes": [+ {+ "op": "reframe",+ "provider": "fal",+ "endpoint": "minimax/h3-max/reframe-video",+ "map": {+ "video": "video_url",+ "seed": "seed",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution"+ }+ }+ ],+ "options": {+ "seed": true,+ "aspectRatios": [+ "16:9",+ "9:16",+ "1:1",+ "4:3",+ "3:4",+ "21:9",+ "9:21"+ ],+ "resolutions": [+ "480p",+ "768p",+ "1080p"+ ]+ },+ "badges": [+ "new"+ ],+ "defaults": {+ "aspectRatio": "9:16",+ "resolution": "768p"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.08,+ "note": "768p; 480p $0.05; long clips run in overlapping windows, and the overlap is billed",+ "byResolution": {+ "480p": 0.05,+ "768p": 0.08+ }+ }+ },+ {+ "id": "p-video-2-pro-avatar",+ "name": "P-Video 2 Pro Avatar",+ "vendor": "Pruna AI",+ "family": "p-video",+ "engine": "cloud",+ "kind": "video",+ "tagline": "A portrait and a voice track \u2192 a talking video up to 3 minutes",+ "routes": [+ {+ "op": "avatar",+ "provider": "replicate",+ "endpoint": "prunaai/p-video-2-pro-avatar",+ "map": {+ "image": "image",+ "audio": "audio",+ "seed": "seed",+ "resolution": "resolution"+ }+ }+ ],+ "options": {+ "seed": true,+ "resolutions": [+ "480p",+ "768p"+ ],+ "maxImages": 1+ },+ "badges": [+ "new"+ ],+ "defaults": {+ "resolution": "768p"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.04,+ "note": "768p; 480p $0.02",+ "byResolution": {+ "480p": 0.02,+ "768p": 0.04+ }+ }+ },+ {+ "id": "krea-3",+ "name": "Krea 3",+ "vendor": "Krea",+ "family": "krea",+ "engine": "cloud",+ "kind": "image",+ "tagline": "Krea's new image model \u2014 generate or edit with up to 8 references",+ "routes": [+ {+ "op": "t2i",+ "provider": "fal",+ "endpoint": "krea/v3/text-to-image",+ "map": {+ "negativePrompt": "negative_prompt",+ "seed": "seed",+ "aspectRatio": {+ "key": "image_size",+ "values": {+ "1:1": "square_hd",+ "4:3": "landscape_4_3",+ "3:4": "portrait_4_3",+ "16:9": "landscape_16_9",+ "9:16": "portrait_16_9",+ "3:2": "landscape_4_3",+ "2:3": "portrait_4_3",+ "21:9": "landscape_16_9",+ "5:4": "landscape_4_3",+ "4:5": "portrait_4_3"+ }+ }+ }+ },+ {+ "op": "edit",+ "provider": "fal",+ "endpoint": "krea/v3/edit",+ "map": {+ "negativePrompt": "negative_prompt",+ "images": "image_urls",+ "seed": "seed",+ "aspectRatio": {+ "key": "image_size",+ "values": {+ "1:1": "square_hd",+ "4:3": "landscape_4_3",+ "3:4": "portrait_4_3",+ "16:9": "landscape_16_9",+ "9:16": "portrait_16_9",+ "3:2": "landscape_4_3",+ "2:3": "portrait_4_3",+ "21:9": "landscape_16_9",+ "5:4": "landscape_4_3",+ "4:5": "portrait_4_3"+ }+ }+ }+ },+ {+ "op": "t2i",+ "provider": "replicate",+ "endpoint": "krea/krea-3",+ "map": {+ "negativePrompt": "negative_prompt",+ "images": "images",+ "seed": "seed",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution"+ }+ },+ {+ "op": "edit",+ "provider": "replicate",+ "endpoint": "krea/krea-3",+ "map": {+ "negativePrompt": "negative_prompt",+ "images": "images",+ "seed": "seed",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution"+ }+ }+ ],+ "options": {+ "negativePrompt": true,+ "seed": true,+ "aspectRatios": [+ "1:1",+ "4:3",+ "3:4",+ "16:9",+ "9:16",+ "3:2",+ "2:3",+ "21:9",+ "5:4",+ "4:5",+ "auto"+ ],+ "maxImages": 8,+ "resolutions": [+ "1k",+ "2k"+ ]+ },+ "badges": [+ "new"+ ],+ "defaults": {+ "aspectRatio": "1:1"+ },+ "pricing": {+ "unit": "megapixel",+ "usd": 0.025,+ "note": "output + each reference; Replicate $0.03\u20130.08 per image"+ }+ },+ {+ "id": "grok-imagine-image-2",+ "name": "Grok Imagine Image 2.0",+ "vendor": "xAI",+ "family": "grok",+ "engine": "cloud",+ "kind": "image",+ "tagline": "xAI's image model \u2014 bold, fast, few refusals",+ "routes": [+ {+ "op": "t2i",+ "provider": "fal",+ "endpoint": "xai/grok-imagine-image/v2.0/text-to-image",+ "map": {+ "numOutputs": "num_images",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution"+ }+ },+ {+ "op": "edit",+ "provider": "fal",+ "endpoint": "xai/grok-imagine-image/v2.0/edit",+ "map": {+ "images": "image_urls",+ "numOutputs": "num_images",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution"+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "quality",+ "label": "Quality",+ "values": [+ "low",+ "medium"+ ],+ "default": "medium"+ }+ ],+ "aspectRatios": [+ "2:1",+ "20:9",+ "19.5:9",+ "16:9",+ "4:3",+ "3:2",+ "1:1",+ "2:3",+ "3:4",+ "9:16",+ "9:19.5",+ "9:20",+ "1:2",+ "auto"+ ],+ "resolutions": [+ "1k",+ "2k"+ ],+ "maxOutputs": 4,+ "maxImages": 5+ },+ "defaults": {+ "aspectRatio": "1:1",+ "resolution": "1k"+ },+ "pricing": {+ "unit": "image",+ "usd": 0.06,+ "note": "1K medium; low $0.04; 2K $0.06\u20130.08; +$0.01 per input image",+ "byResolution": {+ "1k": 0.06,+ "2k": 0.08+ }+ }+ },+ {+ "id": "bria-fibo-2",+ "name": "Bria FIBO 2",+ "vendor": "Bria",+ "family": "bria",+ "engine": "cloud",+ "kind": "image",+ "tagline": "Trained on licensed data only \u2014 safe for commercial work, with structured prompts",+ "routes": [+ {+ "op": "t2i",+ "provider": "fal",+ "endpoint": "bria/fibo-2/generate",+ "map": {+ "image": "image_url",+ "seed": "seed",+ "aspectRatio": "aspect_ratio"+ }+ },+ {+ "op": "edit",+ "provider": "fal",+ "endpoint": "bria/fibo-2/edit",+ "map": {+ "prompt": "instruction",+ "images": "image_urls",+ "seed": "seed",+ "aspectRatio": "aspect_ratio"+ }+ },+ {+ "op": "inpaint",+ "provider": "fal",+ "endpoint": "bria/fibo-2/edit",+ "map": {+ "prompt": "instruction",+ "images": "image_urls",+ "seed": "seed",+ "aspectRatio": "aspect_ratio",+ "mask": "mask_url"+ }+ }+ ],+ "options": {+ "seed": true,+ "aspectRatios": [+ "1:1",+ "1:2",+ "1:3",+ "1:4",+ "1:5",+ "2:1",+ "2:3",+ "3:1",+ "3:2",+ "3:4",+ "4:1",+ "4:3",+ "4:5",+ "5:1",+ "5:4",+ "9:16",+ "9:21",+ "10:16",+ "16:9",+ "16:10",+ "21:9"+ ],+ "maxImages": 4+ },+ "badges": [+ "new"+ ],+ "defaults": {+ "aspectRatio": "1:1"+ },+ "pricing": {+ "unit": "image",+ "usd": 0.04+ }+ },+ {+ "id": "ideogram-vector",+ "name": "Ideogram Vector",+ "vendor": "Ideogram",+ "family": "ideogram",+ "engine": "cloud",+ "kind": "image",+ "tagline": "Editable SVGs from a prompt, or any image traced to SVG",+ "routes": [+ {+ "op": "t2i",+ "provider": "fal",+ "endpoint": "ideogram/vector/text-to-vector",+ "map": {+ "images": "image_urls",+ "numOutputs": "num_images",+ "seed": "seed",+ "aspectRatio": "aspect_ratio"+ }+ },+ {+ "op": "vectorize",+ "provider": "fal",+ "endpoint": "ideogram/vector/image-to-vector",+ "map": {+ "prompt": false,+ "image": "image_url"+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "quality",+ "label": "Quality",+ "values": [+ "low",+ "medium",+ "high"+ ],+ "default": "medium"+ }+ ],+ "seed": true,+ "aspectRatios": [+ "auto",+ "1:1",+ "1:4",+ "1:3",+ "1:2",+ "9:16",+ "10:16",+ "2:3",+ "3:4",+ "4:5",+ "5:4",+ "4:3",+ "3:2",+ "16:10",+ "16:9",+ "2:1",+ "3:1",+ "4:1"+ ],+ "maxOutputs": 4,+ "maxImages": 5+ },+ "badges": [+ "new"+ ],+ "defaults": {+ "aspectRatio": "1:1"+ },+ "pricing": {+ "unit": "image",+ "usd": 0.16,+ "note": "per SVG at medium quality (low $0.13, high $0.20); image to SVG $0.10"+ }+ },+ {+ "id": "bria-expand",+ "name": "Bria Expand",+ "vendor": "Bria",+ "family": "bria",+ "engine": "cloud",+ "kind": "image",+ "tagline": "Extend a picture to a new aspect ratio, edges filled to match",+ "routes": [+ {+ "op": "outpaint",+ "provider": "fal",+ "endpoint": "bria/fibo-edit-1.5/expand",+ "map": {+ "image": "image_url",+ "seed": "seed",+ "aspectRatio": "aspect_ratio"+ }+ }+ ],+ "options": {+ "seed": true,+ "aspectRatios": [+ "1:1",+ "2:3",+ "3:2",+ "3:4",+ "4:3",+ "4:5",+ "5:4",+ "9:16",+ "16:9"+ ],+ "maxImages": 1,+ "promptOptional": true+ },+ "badges": [+ "new"+ ],+ "pricing": {+ "unit": "image",+ "usd": 0.04+ }+ },+ {+ "id": "heygen-voice-turbo",+ "name": "HeyGen Voice Turbo",+ "vendor": "HeyGen",+ "family": "heygen",+ "engine": "cloud",+ "kind": "audio",+ "tagline": "24 voices or an instant clone of yours, in 39 languages, for almost nothing",+ "routes": [+ {+ "op": "tts",+ "provider": "fal",+ "endpoint": "heygen/heygen-voice/turbo",+ "map": {+ "prompt": "text",+ "voiceAudio": "reference_audio_url",+ "voice": "voice"+ }+ }+ ],+ "options": {+ "voiceClone": true,+ "voices": [+ {+ "id": "Jonah",+ "name": "Jonah"+ },+ {+ "id": "Nadine",+ "name": "Nadine"+ },+ {+ "id": "Tabitha",+ "name": "Tabitha"+ },+ {+ "id": "Soren",+ "name": "Soren"+ },+ {+ "id": "Elowen",+ "name": "Elowen"+ },+ {+ "id": "Vincent",+ "name": "Vincent"+ },+ {+ "id": "Jocelyn",+ "name": "Jocelyn"+ },+ {+ "id": "Marielle",+ "name": "Marielle"+ },+ {+ "id": "Corinne",+ "name": "Corinne"+ },+ {+ "id": "Lucian",+ "name": "Lucian"+ },+ {+ "id": "Kieran",+ "name": "Kieran"+ },+ {+ "id": "Hugh",+ "name": "Hugh"+ },+ {+ "id": "Noelle",+ "name": "Noelle"+ },+ {+ "id": "Bram",+ "name": "Bram"+ },+ {+ "id": "Ewan",+ "name": "Ewan"+ },+ {+ "id": "Iona",+ "name": "Iona"+ },+ {+ "id": "Cecily",+ "name": "Cecily"+ },+ {+ "id": "Simon",+ "name": "Simon"+ },+ {+ "id": "Weston",+ "name": "Weston"+ },+ {+ "id": "Felicity",+ "name": "Felicity"+ },+ {+ "id": "Gareth",+ "name": "Gareth"+ },+ {+ "id": "Rory",+ "name": "Rory"+ },+ {+ "id": "Meredith",+ "name": "Meredith"+ },+ {+ "id": "Sabrina",+ "name": "Sabrina"+ }+ ]+ },+ "badges": [+ "new",+ "fast"+ ],+ "pricing": {+ "unit": "request",+ "usd": 0.004,+ "note": "per 1k chars"+ }+ },+ {+ "id": "gemini-3-8-flash-tts",+ "name": "Gemini 3.8 Flash TTS",+ "vendor": "Google",+ "family": "gemini-tts",+ "engine": "cloud",+ "kind": "audio",+ "tagline": "30 Gemini voices with inline <laugh> and <sigh>",+ "routes": [+ {+ "op": "tts",+ "provider": "fal",+ "endpoint": "google/gemini-3.8-flash-tts",+ "map": {+ "voice": "voice"+ }+ }+ ],+ "options": {+ "voices": [+ {+ "id": "Achernar",+ "name": "Achernar"+ },+ {+ "id": "Achird",+ "name": "Achird"+ },+ {+ "id": "Algenib",+ "name": "Algenib"+ },+ {+ "id": "Algieba",+ "name": "Algieba"+ },+ {+ "id": "Alnilam",+ "name": "Alnilam"+ },+ {+ "id": "Aoede",+ "name": "Aoede"+ },+ {+ "id": "Autonoe",+ "name": "Autonoe"+ },+ {+ "id": "Callirrhoe",+ "name": "Callirrhoe"+ },+ {+ "id": "Charon",+ "name": "Charon"+ },+ {+ "id": "Despina",+ "name": "Despina"+ },+ {+ "id": "Enceladus",+ "name": "Enceladus"+ },+ {+ "id": "Erinome",+ "name": "Erinome"+ },+ {+ "id": "Fenrir",+ "name": "Fenrir"+ },+ {+ "id": "Gacrux",+ "name": "Gacrux"+ },+ {+ "id": "Iapetus",+ "name": "Iapetus"+ },+ {+ "id": "Kore",+ "name": "Kore"+ },+ {+ "id": "Laomedeia",+ "name": "Laomedeia"+ },+ {+ "id": "Leda",+ "name": "Leda"+ },+ {+ "id": "Orus",+ "name": "Orus"+ },+ {+ "id": "Pulcherrima",+ "name": "Pulcherrima"+ },+ {+ "id": "Puck",+ "name": "Puck"+ },+ {+ "id": "Rasalgethi",+ "name": "Rasalgethi"+ },+ {+ "id": "Sadachbia",+ "name": "Sadachbia"+ },+ {+ "id": "Sadaltager",+ "name": "Sadaltager"+ },+ {+ "id": "Schedar",+ "name": "Schedar"+ },+ {+ "id": "Sulafat",+ "name": "Sulafat"+ },+ {+ "id": "Umbriel",+ "name": "Umbriel"+ },+ {+ "id": "Vindemiatrix",+ "name": "Vindemiatrix"+ },+ {+ "id": "Zephyr",+ "name": "Zephyr"+ },+ {+ "id": "Zubenelgenubi",+ "name": "Zubenelgenubi"+ }+ ]+ },+ "badges": [+ "new"+ ],+ "pricing": {+ "unit": "request",+ "usd": 0.045,+ "note": "per 1k chars"+ }}];diff --git a/src/lib/catalog/higgsfield-models.generated.ts b/src/lib/catalog/higgsfield-models.generated.tsindex 83b657e5..861ee287 100644--- a/src/lib/catalog/higgsfield-models.generated.ts+++ b/src/lib/catalog/higgsfield-models.generated.ts@@ -328,75 +328,6 @@ export const HIGGSFIELD_MODELS: ModelDef[] = ["note": "Higgsfield list price"}},- {- "id": "grok-imagine-image-2",- "name": "Grok Imagine Image 2.0",- "vendor": "xAI",- "family": "grok",- "engine": "cloud",- "kind": "image",- "tagline": "xAI's image model — bold, fast, few refusals",- "badges": [],- "routes": [- {- "op": "t2i",- "provider": "higgsfield",- "endpoint": "xai/grok-imagine-image-2.0",- "map": {- "aspectRatio": "aspect_ratio",- "resolution": "resolution"- }- },- {- "op": "edit",- "provider": "higgsfield",- "endpoint": "xai/grok-imagine-image-2.0",- "map": {- "images": "image_urls",- "aspectRatio": "aspect_ratio",- "resolution": "resolution"- }- }- ],- "options": {- "aspectRatios": [- "auto",- "1:1",- "1:2",- "2:1",- "3:2",- "2:3",- "4:3",- "3:4",- "16:9",- "9:16"- ],- "resolutions": [- "1k",- "2k"- ],- "controls": [- {- "param": "quality",- "label": "Detail",- "values": [- "low",- "medium"- ],- "default": "medium"- }- ],- "maxImages": 10- },- "defaults": {- "aspectRatio": "1:1"- },- "pricing": {- "unit": "image",- "usd": 0.04,- "note": "Higgsfield list price"- }- },{"id": "cinema-studio-4","name": "Cinema Studio 4.0",@@ -714,6 +645,16 @@ export const HIGGSFIELD_MODELS: ModelDef[] = ["video": "video_url","resolution": "resolution"}+ },+ {+ "op": "video-swap",+ "provider": "higgsfield",+ "endpoint": "higgsfield/genjutsu/object-swap/v1.0",+ "map": {+ "images": "image_urls",+ "video": "video_url",+ "resolution": "resolution"+ }}],"options": {@@ -722,7 +663,8 @@ export const HIGGSFIELD_MODELS: ModelDef[] = ["480p","1080p"],- "maxImages": 8+ "maxImages": 8,+ "promptOptional": true},"defaults": {"resolution": "720p"@@ -773,94 +715,83 @@ export const HIGGSFIELD_MODELS: ModelDef[] = [}},{- "id": "grok-imagine-video-1-5",- "name": "Grok Imagine Video 1.5",- "vendor": "xAI",- "family": "grok",+ "id": "genjutsu-lite-object-swap",+ "name": "Genjutsu Lite Object Swap",+ "vendor": "Higgsfield",+ "family": "genjutsu","engine": "cloud","kind": "video",- "tagline": "xAI's video model with references and audio",- "badges": [],+ "tagline": "Swap objects, characters or clothes from 1–8 references in clips up to 15 s",+ "badges": [+ "new"+ ],"routes": [{- "op": "t2v",- "provider": "higgsfield",- "endpoint": "xai/grok-imagine-video/v1.5/reference-to-video",- "map": {- "aspectRatio": "aspect_ratio",- "resolution": "resolution",- "duration": {- "key": "duration",- "type": "number"- }- }- },- {- "op": "i2v",+ "op": "video-swap","provider": "higgsfield",- "endpoint": "xai/grok-imagine-video/v1.5/reference-to-video",+ "endpoint": "higgsfield/genjutsu-light/object-swap/v1.0","map": {- "image": "image_url","images": "image_urls",- "aspectRatio": "aspect_ratio",- "resolution": "resolution",- "duration": {- "key": "duration",- "type": "number"- }+ "video": "video_url",+ "resolution": "resolution"}- },+ }+ ],+ "options": {+ "promptOptional": true,+ "resolutions": [+ "720p",+ "480p",+ "1080p"+ ],+ "maxImages": 8+ },+ "defaults": {+ "resolution": "720p"+ },+ "pricing": {+ "unit": "second",+ "usd": 0.1,+ "note": "Higgsfield list price"+ }+ },+ {+ "id": "genjutsu-lite-motion-transfer",+ "name": "Genjutsu Lite Motion Transfer",+ "vendor": "Higgsfield",+ "family": "genjutsu",+ "engine": "cloud",+ "kind": "video",+ "tagline": "A clip's motion on your characters, for clips up to 15 s",+ "badges": [+ "new"+ ],+ "routes": [{- "op": "ref2v",+ "op": "motion-transfer","provider": "higgsfield",- "endpoint": "xai/grok-imagine-video/v1.5/reference-to-video",+ "endpoint": "higgsfield/genjutsu-light/motion-transfer/v1.0","map": {- "image": "image_url","images": "image_urls",- "aspectRatio": "aspect_ratio",- "resolution": "resolution",- "duration": {- "key": "duration",- "type": "number"- }+ "video": "video_url",+ "resolution": "resolution"}}],"options": {- "aspectRatios": [- "auto",- "1:1",- "16:9",- "9:16",- "4:3",- "3:4",- "3:2",- "2:3"- ],"resolutions": [- "480p","720p",+ "480p","1080p"],- "durations": [- 3,- 4,- 5,- 6,- 8,- 10,- 12,- 15- ],- "maxImages": 7+ "maxImages": 8},"defaults": {- "aspectRatio": "16:9",- "duration": 6+ "resolution": "720p"},"pricing": {"unit": "second",- "usd": 0.08,+ "usd": 0.1,"note": "Higgsfield list price"}},@@ -1348,6 +1279,33 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"images": "image_urls","videoArray": "video_urls"}+ },+ {+ "op": "remove-object",+ "provider": "higgsfield",+ "endpoint": "kling-video/o3/video-edit",+ "map": {+ "images": "image_urls",+ "videoArray": "video_urls"+ }+ },+ {+ "op": "video-swap",+ "provider": "higgsfield",+ "endpoint": "kling-video/o3/video-edit",+ "map": {+ "images": "image_urls",+ "videoArray": "video_urls"+ }+ },+ {+ "op": "video-insert",+ "provider": "higgsfield",+ "endpoint": "kling-video/o3/video-edit",+ "map": {+ "images": "image_urls",+ "videoArray": "video_urls"+ }}],"kling-o1": [@@ -1975,5 +1933,71 @@ export const HIGGSFIELD_ROUTES: Record<string, ModelRoute[]> = {"resolution": "resolution"}}+ ],+ "grok-imagine-video-1-5": [+ {+ "op": "t2v",+ "provider": "higgsfield",+ "endpoint": "xai/grok-imagine-video/v1.5/reference-to-video",+ "map": {+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "i2v",+ "provider": "higgsfield",+ "endpoint": "xai/grok-imagine-video/v1.5/reference-to-video",+ "map": {+ "image": "image_url",+ "images": "image_urls",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ },+ {+ "op": "ref2v",+ "provider": "higgsfield",+ "endpoint": "xai/grok-imagine-video/v1.5/reference-to-video",+ "map": {+ "image": "image_url",+ "images": "image_urls",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution",+ "duration": {+ "key": "duration",+ "type": "number"+ }+ }+ }+ ],+ "grok-imagine-image-2": [+ {+ "op": "t2i",+ "provider": "higgsfield",+ "endpoint": "xai/grok-imagine-image-2.0",+ "map": {+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution"+ }+ },+ {+ "op": "edit",+ "provider": "higgsfield",+ "endpoint": "xai/grok-imagine-image-2.0",+ "map": {+ "images": "image_urls",+ "aspectRatio": "aspect_ratio",+ "resolution": "resolution"+ }+ }]};diff --git a/tests/cloud-catalog-4.test.ts b/tests/cloud-catalog-4.test.tsnew file mode 100644index 00000000..d50c5781--- /dev/null+++ b/tests/cloud-catalog-4.test.ts@@ -0,0 +1,463 @@+import fs from "node:fs";+import { describe, expect, it } from "vitest";+import { getModel, getPreset, MODELS, modelsFor } from "@/lib/catalog";+import { CLOUD_MODELS } from "@/lib/catalog/cloud-models.generated";+import { buildPayload, keyframesValue, pointsValue } from "@/lib/catalog/payload";+import { estimateCost, inferOperation, planGeneration, pricingAt, promptOptional } from "@/lib/catalog/plan";+import { OPERATION_LABELS, OPERATION_OUTPUT, type GenerationRequest, type ModelRoute, type Operation } from "@/lib/catalog/types";++type Endpoint = { provider: string; endpoint: string; status?: string; verified?: boolean };+const research4 = (JSON.parse(fs.readFileSync("docs/research/paid-model-apis-4.json", "utf8")) as { endpoints: Endpoint[] }).endpoints;+const byId = new Map(research4.map((e) => [`${e.provider}:${e.endpoint}`, e]));++/** The models round 4 added (research part 4), with the operation each is for. */+const ROUND4: Record<string, Operation> = {+ "bria-video-erase": "remove-object",+ "bria-video-erase-points": "remove-object",+ "bria-video-erase-mask": "remove-object",+ "void-video-inpainting": "remove-object",+ "ltx-2-3-clean-plate": "remove-object",+ "wan-22-vace-inpaint": "remove-object",+ "sam-3-1-video-mask": "bg-remove-video",+ "p-video-replace": "video-swap",+ "topaz-fps-boost": "interpolate",+ "rife-video-cloud": "interpolate",+ "topaz-sdr-to-hdr": "sdr-to-hdr",+ "ltx-2-3-hdr": "sdr-to-hdr",+ "ken-burns": "still-motion",+ "overlay-image": "overlay",+ "extract-frames": "extract-frames",+ "images-to-video": "images-to-video",+ "join-audio": "audio-join",+ "florence-2-ocr": "ocr",+ triposplat: "splat",+ "sam-3d-objects": "image-to-3d",+ "tripo-h3-1-text": "text-to-3d",+ "meshy-7-1-multi": "image-to-3d",+ "meshy-rigging": "rig-3d",+ "flux-3-max": "keyframes",+ "heygen-video": "ref2v",+ "grok-imagine-video-1-5": "ref2v",+ "grok-imagine-video-1-5-lite": "t2v",+ "pixverse-v6-max": "t2v",+ "p-video-2-pro-reference": "ref2v",+ "creatify-boreal": "t2v",+ "pixelcut-looping-video": "i2v",+ "minimax-h3-max-reframe": "reframe",+ "p-video-2-pro-avatar": "avatar",+ "krea-3": "t2i",+ "grok-imagine-image-2": "edit",+ "bria-fibo-2": "inpaint",+ "ideogram-vector": "vectorize",+ "bria-expand": "outpaint",+ "heygen-voice-turbo": "tts",+ "gemini-3-8-flash-tts": "tts",+ // Higgsfield (gen-higgsfield-models.py)+ "genjutsu-lite-object-swap": "video-swap",+ "genjutsu-lite-motion-transfer": "motion-transfer",+};++/** Chain helpers that never show in a picker. */+const HIDDEN = ["bria-video-erase-points", "bria-video-erase-mask", "sam-3-1-video-mask", "ken-burns", "overlay-image", "extract-frames", "images-to-video", "join-audio"];++const NEW_OPS: Operation[] = [+ "remove-object", "video-swap", "video-insert", "keyframes", "sdr-to-hdr", "export-video", "ocr", "still-motion", "audio-loop", "audio-join",+ "scene-3d", "splat", "text-to-3d", "rig-3d", "extract-frames", "images-to-video", "overlay",+];++const route = (id: string, op?: Operation, provider = "fal"): ModelRoute => {+ const m = getModel(id);+ if (!m) throw new Error(`no model ${id}`);+ const r = m.routes.find((x) => (!op || x.op === op) && x.provider === provider);+ if (!r) throw new Error(`${id} has no ${provider} ${op} route`);+ return r;+};+const map = (id: string, op?: Operation, provider = "fal") => route(id, op, provider).map!;+const plan = (req: Omit<GenerationRequest, "feature">) => planGeneration({ feature: "x", ...req }, getModel, getPreset);+const fails = (req: Omit<GenerationRequest, "feature">) => {+ try {+ plan(req);+ } catch (e) {+ return (e as Error).message;+ }+ return null;+};++describe("round-4 operations", () => {+ it("every new operation has a label and an output kind", () => {+ for (const op of NEW_OPS) {+ expect(OPERATION_LABELS[op], op).toBeTruthy();+ expect(OPERATION_OUTPUT[op], op).toBeTruthy();+ }+ expect(OPERATION_OUTPUT.ocr).toBe("text");+ expect(OPERATION_OUTPUT.splat).toBe("model3d");+ expect(OPERATION_OUTPUT["scene-3d"]).toBe("model3d");+ expect(OPERATION_OUTPUT["extract-frames"]).toBe("image");+ expect(OPERATION_OUTPUT["audio-loop"]).toBe("audio");+ expect(OPERATION_OUTPUT.overlay).toBe("image");+ });+});++describe("round-4 cloud models", () => {+ it("every new model resolves, is cloud, of its operation's kind, on active researched endpoints", () => {+ for (const [id, op] of Object.entries(ROUND4)) {+ const m = getModel(id);+ expect(m, id).toBeDefined();+ expect(m!.engine, id).toBe("cloud");+ expect(m!.routes.some((r) => r.op === op), `${id} ${op}`).toBe(true);+ // SAM 3.1's mask video is a video; every other model's kind is what its operation makes.+ expect(m!.kind, id).toBe(OPERATION_OUTPUT[op]);+ for (const r of m!.routes.filter((x) => x.provider === "fal" || x.provider === "replicate")) {+ const e = byId.get(`${r.provider}:${r.endpoint}`);+ if (!e) continue; // parts 1-3 (Kling O3 edit, extract-nth-frame): cloud-catalog.test.ts checks those+ expect(["active", "unlisted"], `${id} ${r.endpoint} ${e.status}`).toContain(e.status);+ }+ }+ });++ it("leaves Kling 4.0 out until its API opens", () => {+ const routes = MODELS.flatMap((m) => m.routes);+ expect(routes.filter((r) => r.endpoint.startsWith("kling/v4/"))).toEqual([]);+ expect(research4.filter((e) => e.endpoint.startsWith("kling/v4/")).every((e) => e.status === "playground-only")).toBe(true);+ expect(fs.readFileSync("scripts/gen-cloud-models.py", "utf8")).toMatch(/TODO\(kling-4\)/);+ });++ it("hides chain helpers and shows the new models in their studios' pickers", () => {+ for (const id of HIDDEN) expect(getModel(id)!.hidden, id).toBe(true);+ for (const id of Object.keys(ROUND4).filter((x) => !HIDDEN.includes(x))) expect(getModel(id)!.hidden, id).toBeFalsy();+ const ids = (kind: Parameters<typeof modelsFor>[0]["kind"], ops: Operation[]) => modelsFor({ kind, ops, engine: "cloud" }).map((m) => m.id);+ // Video studio (t2v / i2v / flf2v / ref2v), lipsync & avatars, reframe, motion transfer.+ expect(ids("video", ["t2v", "i2v", "flf2v", "ref2v"])).toEqual(+ expect.arrayContaining(["flux-3-max", "heygen-video", "grok-imagine-video-1-5", "grok-imagine-video-1-5-lite", "pixverse-v6-max", "p-video-2-pro-reference", "creatify-boreal", "pixelcut-looping-video"]),+ );+ expect(ids("video", ["t2v", "i2v", "flf2v", "ref2v"])).not.toEqual(expect.arrayContaining(["wan-22-vace-inpaint"]));+ expect(ids("video", ["avatar", "lipsync"])).toContain("p-video-2-pro-avatar");+ expect(ids("video", ["reframe"])).toContain("minimax-h3-max-reframe");+ expect(ids("video", ["motion-transfer"])).toContain("genjutsu-lite-motion-transfer");+ // Image studio (t2i), Edit (edit), Inpaint, Vectorize, Audio (tts).+ expect(ids("image", ["t2i"])).toEqual(expect.arrayContaining(["krea-3", "grok-imagine-image-2", "bria-fibo-2", "ideogram-vector"]));+ expect(ids("image", ["edit"])).toEqual(expect.arrayContaining(["krea-3", "grok-imagine-image-2", "bria-fibo-2"]));+ expect(ids("image", ["inpaint"])).toContain("bria-fibo-2");+ expect(ids("image", ["vectorize"])[0]).toBe("recraft-vectorize");+ expect(ids("audio", ["tts"])).toEqual(expect.arrayContaining(["heygen-voice-turbo", "gemini-3-8-flash-tts"]));+ // The round-4 tools by operation (their studios come with the feature packages).+ expect(ids("video", ["remove-object"])).toEqual(expect.arrayContaining(["kling-o3", "kling-o3-4k-edit", "bria-video-erase", "void-video-inpainting", "ltx-2-3-clean-plate", "wan-22-vace-inpaint"]));+ expect(ids("video", ["video-swap"])).toEqual(expect.arrayContaining(["kling-o3", "wan-22-vace-inpaint", "p-video-replace", "genjutsu-lite-object-swap", "genjutsu-object-swap"]));+ expect(ids("video", ["video-insert"])).toEqual(expect.arrayContaining(["kling-o3", "wan-22-vace-inpaint"]));+ expect(ids("video", ["interpolate"])).toEqual(["topaz-fps-boost", "rife-video-cloud"]);+ expect(ids("video", ["sdr-to-hdr"])).toEqual(["topaz-sdr-to-hdr", "ltx-2-3-hdr"]);+ expect(ids("text", ["ocr"])).toEqual(["florence-2-ocr"]);+ expect(ids("model3d", ["splat"])).toEqual(["triposplat"]);+ expect(ids("model3d", ["text-to-3d"])).toEqual(["tripo-h3-1-text"]);+ expect(ids("model3d", ["rig-3d"])).toEqual(["meshy-rigging"]);+ expect(ids("video", ["keyframes"])).toEqual(["flux-3-max"]);+ });++ it("keeps the Higgsfield routes of the Grok models now generated from fal, and adds Genjutsu Lite", () => {+ for (const [id, ops] of [+ ["grok-imagine-video-1-5", ["t2v", "i2v", "ref2v"]],+ ["grok-imagine-image-2", ["t2i", "edit"]],+ ] as const) {+ const m = getModel(id)!;+ for (const op of ops) {+ expect(m.routes.some((r) => r.op === op && r.provider === "fal"), `${id} fal ${op}`).toBe(true);+ expect(m.routes.some((r) => r.op === op && r.provider === "higgsfield"), `${id} higgsfield ${op}`).toBe(true);+ }+ }+ expect(MODELS.filter((m) => m.id === "grok-imagine-video-1-5")).toHaveLength(1);+ const lite = getModel("genjutsu-lite-object-swap")!;+ expect(lite.routes).toEqual([+ { op: "video-swap", provider: "higgsfield", endpoint: "higgsfield/genjutsu-light/object-swap/v1.0", map: { images: "image_urls", video: "video_url", resolution: "resolution" } },+ ]);+ // Duration is read-only on Genjutsu Light (taken from the source): never sent, never offered.+ expect(lite.options.durations).toBeUndefined();+ expect(lite.options.maxImages).toBe(8);+ expect(lite.pricing).toMatchObject({ unit: "second", usd: 0.1 });+ expect(getModel("genjutsu-lite-motion-transfer")!.routes[0]).toMatchObject({ op: "motion-transfer", endpoint: "higgsfield/genjutsu-light/motion-transfer/v1.0" });+ expect(route("kling-o3", "remove-object", "higgsfield").endpoint).toBe("kling-video/o3/video-edit");+ });++ it("prices FLUX 3 Max at its launch rate until 2026-11-07, then at the list price", () => {+ const raw = CLOUD_MODELS.find((m) => m.id === "flux-3-max")!.pricing!;+ expect(raw).toMatchObject({ unit: "second", usd: 0.17, byResolution: { "720p": 0.17, "1080p": 0.29 }, promo: { until: "2026-11-07", usd: 0.0425 } });+ expect(pricingAt(raw, Date.parse("2026-10-22T12:00:00Z"))).toMatchObject({ usd: 0.0425, byResolution: { "720p": 0.0425, "1080p": 0.0725 } });+ expect(pricingAt(raw, Date.parse("2026-11-07T23:00:00Z")).usd).toBe(0.0425);+ const after = pricingAt(raw, Date.parse("2026-11-08T00:00:01Z"));+ expect(after).toMatchObject({ usd: 0.17, byResolution: { "720p": 0.17, "1080p": 0.29 } });+ expect(after.promo).toBeUndefined();+ // The catalog holds the price that applies today, without the promo record.+ const live = getModel("flux-3-max")!;+ expect(live.pricing!.promo).toBeUndefined();+ expect(live.pricing!.usd).toBe(pricingAt(raw).usd);+ expect(estimateCost({ ...live, pricing: pricingAt(raw, Date.parse("2026-10-22T00:00:00Z")) }, { duration: 10, resolution: "1080p" })).toBe(0.725);+ expect(estimateCost({ ...live, pricing: after }, { duration: 10, resolution: "1080p" })).toBe(2.9);+ });++ it("reads the new research slots: points, keyframes, formats, zoom, overlay, retiming, frames, loops and rigging", () => {+ expect(map("bria-video-erase-points").points).toEqual({ key: "keypoints", format: "bria" });+ expect(map("sam-3-1-video-mask").points).toEqual({ key: "point_prompts", format: "sam" });+ expect(map("flux-3-max", "keyframes").keyframes).toEqual({ key: "keyframes", image: "image_url", frame: "frame_index", fps: 24 });+ expect(getModel("flux-3-max")!.options.maxImages).toBe(10);+ expect(map("topaz-sdr-to-hdr").format).toEqual({ key: "output_format", values: { h265_10bit: "mp4", prores_422_hq: "prores" } });+ expect(getModel("topaz-sdr-to-hdr")!.options.formats).toEqual(["h265_10bit", "prores_422_hq"]);+ expect(getModel("ltx-2-3-hdr")!.options.formats).toEqual(["exr"]);+ expect(map("ken-burns").zoom).toMatchObject({ factor: "zoom_factor", max: 2, direction: { key: "zoom_direction", in: "in", out: "out" }, x: "zoom_x", y: "zoom_y", percent: true });+ expect(map("overlay-image")).toMatchObject({ image: "background_image_url", image2: "overlay_image_url", position: { x: "x_percent", y: "y_percent", percent: true }, scale: { key: "scale_percent", multiplier: 100 } });+ expect(map("topaz-fps-boost")).toMatchObject({ targetFps: "target_fps", slowdown: "slowdown_factor", defaults: { H264_output: true } });+ expect(map("rife-video-cloud").targetFps).toBeUndefined();+ expect(map("images-to-video").frames).toEqual({ key: "images", url: "url", frames: "frames" });+ expect(map("join-audio", "audio-loop").loop).toEqual({ key: "audio_urls", max: 5 });+ expect(map("join-audio", "audio-join").audios).toBe("audio_urls");+ expect(map("meshy-rigging")).toMatchObject({ model3d: "model_url", animation: { key: "animation_action_id", flag: "enable_animation" } });+ expect(map("extract-frames")).toMatchObject({ frameInterval: "frame_interval", defaults: { max_frames: 500 } });+ expect(map("depth-anything-video-cloud").colormap).toBe("colormap");+ });+});++describe("round-4 payloads", () => {+ it("sends clicked points in each API's own shape", () => {+ const points = [+ { x: 100.4, y: 220.6 },+ { x: 40, y: 50, label: "negative" as const },+ ];+ expect(pointsValue("bria", points)).toEqual(["{'x':100, 'y':221, 'type':'positive'}", "{'x':40, 'y':50, 'type':'negative'}"]);+ expect(buildPayload(map("bria-video-erase-points"), { video: "v.mp4", points })).toEqual({+ video_url: "v.mp4",+ keypoints: ["{'x':100, 'y':221, 'type':'positive'}", "{'x':40, 'y':50, 'type':'negative'}"],+ });+ expect(buildPayload(map("sam-3-1-video-mask"), { prompt: "", video: "v.mp4", points })).toEqual({+ prompt: "",+ video_url: "v.mp4",+ point_prompts: [+ { x: 100, y: 221, label: 1 },+ { x: 40, y: 50, label: 0 },+ ],+ apply_mask: false,+ });+ // SAM 3D Objects: words and clicks together; its prompt is always sent (the API's default is "car").+ expect(buildPayload(map("sam-3d-objects"), { prompt: "chair, lamp", images: ["room.png"], points: [{ x: 10, y: 20 }] })).toEqual({+ prompt: "chair, lamp",+ image_url: "room.png",+ point_prompts: [{ x: 10, y: 20, label: 1 }],+ });+ });++ it("pins keyframes to frame indexes at the API's frame rate", () => {+ const kf = map("flux-3-max", "keyframes").keyframes!;+ expect(buildPayload(map("flux-3-max", "keyframes"), { prompt: "p", images: ["a.png", "b.png", "c.png"], keyframeTimes: [0, 2.5, 5], duration: 5 })).toMatchObject({+ prompt: "p",+ duration: 5,+ keyframes: [+ { image_url: "a.png", frame_index: 0 },+ { image_url: "b.png", frame_index: 60 },+ { image_url: "c.png", frame_index: 120 },+ ],+ });+ // No times: spread over the clip, last on its final frame (at most duration × 24).+ expect(keyframesValue(kf, ["a", "b", "c"], undefined, 10).map((k) => k.frame_index)).toEqual([0, 120, 240]);+ // Times past the end are held at the end; equal frames are nudged apart (the API wants them unique).+ expect(keyframesValue(kf, ["a", "b", "c"], [0, 0.01, 9], 5).map((k) => k.frame_index)).toEqual([0, 1, 120]);+ expect(keyframesValue(kf, ["a"], undefined, 5)).toEqual([{ image_url: "a", frame_index: 0 }]);+ // The keyframes route takes no start or end image fields.+ expect(map("flux-3-max", "keyframes").image).toBeUndefined();+ });++ it("writes params.format as each API's own value and leaves out what it can't write", () => {+ expect(buildPayload(map("topaz-sdr-to-hdr"), { video: "v.mp4", format: "h265_10bit" })).toEqual({ video_url: "v.mp4", output_format: "mp4" });+ expect(buildPayload(map("topaz-sdr-to-hdr"), { video: "v.mp4", format: "prores_422_hq" })).toEqual({ video_url: "v.mp4", output_format: "prores" });+ expect(buildPayload(map("topaz-sdr-to-hdr"), { video: "v.mp4", format: "ffv1" })).toEqual({ video_url: "v.mp4" });+ });++ it("sends crossfades in seconds and loops a clip by repeating it", () => {+ expect(buildPayload({ prompt: false, audios: "audio_urls", crossfade: "crossfade" }, { audios: ["a.wav", "b.wav"], crossfade: 0.75 })).toEqual({ audio_urls: ["a.wav", "b.wav"], crossfade: 0.75 });+ // fal's merge-audios has no crossfade field: hard joins.+ expect(buildPayload(map("join-audio", "audio-join"), { audios: ["a.wav", "b.wav", "c.wav"], crossfade: 1 })).toEqual({ audio_urls: ["a.wav", "b.wav", "c.wav"] });+ const loop = map("join-audio", "audio-loop");+ expect(buildPayload(loop, { audio: "bed.mp3", duration: 30, sourceDuration: 8 }).audio_urls).toEqual(["bed.mp3", "bed.mp3", "bed.mp3", "bed.mp3"]);+ expect(buildPayload(loop, { audio: "bed.mp3", duration: 5, sourceDuration: 8 }).audio_urls).toHaveLength(2);+ expect(buildPayload(loop, { audio: "bed.mp3", duration: 600, sourceDuration: 8 }).audio_urls).toHaveLength(5);+ expect(buildPayload(loop, { audio: "bed.mp3" }).audio_urls).toHaveLength(5);+ });++ it("turns a Ken Burns move into one zoom toward a focal point", () => {+ const m = map("ken-burns");+ expect(buildPayload(m, { images: ["s.png"], duration: 6, fps: 30, zoomFrom: 1, zoomTo: 1.15, panTo: { x: 0.4, y: 0.45 }, easing: "ease-in-out" })).toEqual({+ image_url: "s.png",+ duration: 6,+ frames_per_second: 30,+ zoom_factor: 1.15,+ zoom_direction: "in",+ zoom_x: 40,+ zoom_y: 45,+ easing: "ease_in_out",+ });+ // Zooming out looks from the start point; the factor is the larger zoom over the smaller, at most 2x.+ expect(buildPayload(m, { images: ["s.png"], zoomFrom: 1.5, zoomTo: 1.2, panFrom: { x: 0.1, y: 0.9 }, panTo: { x: 0.5, y: 0.5 }, easing: "linear" })).toEqual({+ image_url: "s.png",+ zoom_factor: 1.25,+ zoom_direction: "out",+ zoom_x: 10,+ zoom_y: 90,+ easing: "linear",+ });+ expect(buildPayload(m, { images: ["s.png"], zoomTo: 3 }).zoom_factor).toBe(2);+ // A static hold for an end card, and nothing said about the move: the API's own defaults.+ expect(buildPayload(m, { images: ["s.png"], zoomFrom: 1, zoomTo: 1 })).toMatchObject({ zoom_factor: 1, zoom_direction: "in" });+ expect(buildPayload(m, { images: ["s.png"], duration: 3 })).toEqual({ image_url: "s.png", duration: 3 });+ });++ it("places an overlay and retimes a clip", () => {+ expect(buildPayload(map("overlay-image"), { images: ["card.png", "logo.png"], position: { x: 0.5, y: 0.82 }, scale: 0.6 })).toEqual({+ background_image_url: "card.png",+ overlay_image_url: "logo.png",+ x_percent: 50,+ y_percent: 82,+ scale_percent: 60,+ });+ expect(buildPayload(map("topaz-fps-boost"), { video: "v.mp4", targetFps: 120, slowdown: 4 })).toEqual({ H264_output: true, video_url: "v.mp4", target_fps: 120, slowdown_factor: 4 });+ expect(buildPayload(map("rife-video-cloud"), { video: "v.mp4", targetFps: 60 })).toEqual({ video_url: "v.mp4" });+ expect(buildPayload(map("extract-frames"), { video: "v.mp4", frameInterval: 2 })).toEqual({ max_frames: 500, video_url: "v.mp4", frame_interval: 2 });+ expect(buildPayload(map("images-to-video"), { images: ["1.png", "2.png"], fps: 12 })).toEqual({+ fps: 12,+ images: [+ { url: "1.png", frames: 1 },+ { url: "2.png", frames: 1 },+ ],+ });+ expect(buildPayload(map("depth-anything-video-cloud"), { video: "v.mp4", colormap: "turbo" })).toMatchObject({ colormap: "turbo", model: "VDA-Base" });+ expect(buildPayload(map("depth-anything-video-cloud"), { video: "v.mp4" })).toMatchObject({ colormap: "grayscale" });+ });++ it("rigs a model with an animation preset, and builds 3D from words", () => {+ expect(buildPayload(map("meshy-rigging"), { model3d: "char.glb", animation: 12 })).toEqual({ model_url: "char.glb", animation_action_id: 12, enable_animation: true });+ expect(buildPayload(map("meshy-rigging"), { model3d: "char.glb", animation: "30" })).toMatchObject({ animation_action_id: 30 });+ expect(buildPayload(map("meshy-rigging"), { model3d: "char.glb" })).toEqual({ model_url: "char.glb" });+ expect(buildPayload(map("tripo-h3-1-text"), { prompt: "a brass lantern", seed: 7 })).toEqual({ prompt: "a brass lantern", model_seed: 7 });+ });++ it("erases with words, masks or a background description", () => {+ expect(buildPayload(map("bria-video-erase"), { prompt: "the man in the red jacket", video: "v.mp4" })).toEqual({ prompt: "the man in the red jacket", video_url: "v.mp4" });+ // VOID: Fuobe's words name what to remove (mask_prompt); its own prompt is the scene afterwards.+ const voidOut = buildPayload(map("void-video-inpainting"), { prompt: "the coffee cup", video: "v.mp4" });+ expect(voidOut).toMatchObject({ mask_prompt: "the coffee cup", video_url: "v.mp4" });+ expect(String(voidOut.prompt)).toMatch(/background continues/);+ expect(buildPayload(map("void-video-inpainting"), { prompt: "the cup", video: "v.mp4", extra: { prompt: "an empty table" } }).prompt).toBe("an empty table");+ // VACE: a painted first-frame mask is tracked through the clip; the erase route says what fills it.+ const erase = buildPayload(map("wan-22-vace-inpaint", "remove-object"), { prompt: "ignored", video: "v.mp4", mask: "m.png", images: ["x.png"] });+ expect(erase).toMatchObject({ video_url: "v.mp4", mask_image_url: "m.png", match_input_num_frames: true });+ expect(erase.ref_image_urls).toBeUndefined();+ expect(String(erase.prompt)).toMatch(/nothing there/);+ expect(buildPayload(map("wan-22-vace-inpaint", "video-swap"), { prompt: "a red vintage car", video: "v.mp4", mask: "m.png", images: ["car.png"] })).toEqual({+ match_input_num_frames: true,+ match_input_frames_per_second: true,+ prompt: "a red vintage car",+ video_url: "v.mp4",+ mask_image_url: "m.png",+ ref_image_urls: ["car.png"],+ });+ expect(buildPayload(map("bria-video-erase-mask", "remove-object", "replicate"), { video: "v.mp4", mask: "mask.mp4" })).toEqual({ video_url: "v.mp4", mask_url: "mask.mp4", auto_trim: true });+ expect(buildPayload(map("p-video-replace", "video-swap", "replicate"), { prompt: "", video: "v.mp4", images: ["me.png"] })).toEqual({ instruction_prompt: "", video: "v.mp4", images: ["me.png"] });+ });+});++describe("round-4 planning", () => {+ const video = "/v.mp4";+ it("infers each new operation from what is attached", () => {+ const op = (id: string, inputs: GenerationRequest["inputs"], params?: GenerationRequest["params"]) => inferOperation(getModel(id)!, { inputs, params });+ expect(op("wan-22-vace-inpaint", { video, images: ["/r.png"] })).toBe("video-swap");+ expect(op("wan-22-vace-inpaint", { video, mask: "/m.png" })).toBe("remove-object");+ expect(op("bria-video-erase", { video })).toBe("remove-object");+ expect(op("genjutsu-lite-object-swap", { video, images: ["/r.png"] })).toBe("video-swap");+ expect(op("genjutsu-lite-motion-transfer", { video, images: ["/r.png"] })).toBe("motion-transfer");+ // A general video editor keeps plain edits unless the studio asks for the tool.+ expect(op("kling-o3", { video })).toBe("v2v");+ expect(op("flux-3-max", { images: ["/a.png", "/b.png", "/c.png"] })).toBe("keyframes");+ expect(op("flux-3-max", { images: ["/a.png"], endImage: "/z.png" })).toBe("flf2v");+ expect(op("flux-3-max", { images: ["/a.png"] })).toBe("i2v");+ expect(op("flux-3-max", {})).toBe("t2v");+ // A model with references takes several stills as references, unless they come with times.+ expect(op("heygen-video", { images: ["/a.png", "/b.png"] })).toBe("ref2v");+ expect(op("topaz-sdr-to-hdr", { video })).toBe("sdr-to-hdr");+ expect(op("topaz-fps-boost", { video })).toBe("interpolate");+ expect(op("ken-burns", { images: ["/s.png"] })).toBe("still-motion");+ expect(op("images-to-video", { images: ["/1.png", "/2.png"] })).toBe("images-to-video");+ expect(op("overlay-image", { images: ["/1.png", "/2.png"] })).toBe("overlay");+ expect(op("extract-frames", { video })).toBe("extract-frames");+ expect(op("florence-2-ocr", { images: ["/a.png"] })).toBe("ocr");+ expect(op("join-audio", { audios: ["/a.wav", "/b.wav"] })).toBe("audio-join");+ expect(op("join-audio", { audio: "/a.wav" })).toBe("audio-loop");+ expect(op("triposplat", { images: ["/a.png"] })).toBe("splat");+ expect(op("tripo-h3-1-text", {})).toBe("text-to-3d");+ expect(op("meshy-7-1-multi", { images: ["/a.png", "/b.png"] })).toBe("image-to-3d");+ expect(op("meshy-rigging", { model3d: "/m.glb" })).toBe("rig-3d");+ });++ it("asks for each operation's inputs", () => {+ expect(fails({ modelId: "bria-video-erase", prompt: "the cup" })).toBe("Add the video to remove something from");+ expect(fails({ modelId: "p-video-replace", op: "video-swap", inputs: { video } })).toBe("Add the video and a picture of what goes in");+ expect(fails({ modelId: "wan-22-vace-inpaint", op: "video-insert", prompt: "a lamp", inputs: { video, mask: "/m.png" } })).toBe("Add the video and a picture of what to add");+ expect(fails({ modelId: "topaz-sdr-to-hdr" })).toBe("Add the video to convert");+ expect(fails({ modelId: "florence-2-ocr" })).toBe("Add the image to read");+ expect(fails({ modelId: "ken-burns" })).toBe("Add the still to move over");+ expect(fails({ modelId: "join-audio", op: "audio-join", inputs: { audios: ["/a.wav"] } })).toBe("Add at least two audio clips to join");+ expect(fails({ modelId: "join-audio", op: "audio-loop" })).toBe("Add the audio to loop");+ expect(fails({ modelId: "triposplat" })).toBe("Add a photo of the subject");+ expect(fails({ modelId: "meshy-rigging" })).toBe("Add the 3D model to rig");+ expect(fails({ modelId: "extract-frames" })).toBe("Add the video to take frames from");+ expect(fails({ modelId: "images-to-video" })).toBe("Add the images, in order");+ expect(fails({ modelId: "overlay-image", inputs: { images: ["/card.png"] } })).toBe("Add the picture and the overlay to put on it");+ expect(fails({ modelId: "flux-3-max", op: "keyframes", prompt: "p" })).toBe("Add the keyframes, in order");+ // Promptless tools run on their inputs alone.+ const runs: [string, GenerationRequest["inputs"]][] = [+ ["topaz-sdr-to-hdr", { video }],+ ["topaz-fps-boost", { video }],+ ["florence-2-ocr", { images: ["/a.png"] }],+ ["ken-burns", { images: ["/a.png"] }],+ ["overlay-image", { images: ["/a.png", "/b.png"] }],+ ["extract-frames", { video }],+ ["join-audio", { audios: ["/a.wav", "/b.wav"] }],+ ["triposplat", { images: ["/a.png"] }],+ ["meshy-rigging", { model3d: "/m.glb" }],+ ];+ for (const [modelId, inputs] of runs) expect(fails({ modelId, inputs }), modelId).toBeNull();+ });++ it("removes what is named, painted or clicked", () => {+ expect(fails({ modelId: "bria-video-erase", inputs: { video } })).toBe("Say what to remove, e.g. “the coffee cup in her hand”");+ expect(plan({ modelId: "bria-video-erase", prompt: "the cup", inputs: { video } }).op).toBe("remove-object");+ expect(fails({ modelId: "bria-video-erase-points", inputs: { video } })).toBe("Click what to remove on the first frame");+ expect(plan({ modelId: "bria-video-erase-points", inputs: { video }, params: { points: [{ x: 1, y: 2 }] } }).op).toBe("remove-object");+ expect(fails({ modelId: "wan-22-vace-inpaint", op: "remove-object", inputs: { video } })).toBe("Paint the area to change on the first frame");+ expect(plan({ modelId: "wan-22-vace-inpaint", op: "remove-object", inputs: { video, mask: "/m.png" } }).op).toBe("remove-object");+ // Kling O3 erases from words only: a mask can't stand in for them.+ expect(fails({ modelId: "kling-o3", op: "remove-object", inputs: { video, mask: "/m.png" } })).toBe("Say what to remove, e.g. “the coffee cup in her hand”");+ expect(plan({ modelId: "kling-o3", op: "remove-object", prompt: "Remove the coffee cup, keep everything else the same", inputs: { video } }).op).toBe("remove-object");+ // On the client (no field maps) a mask or points are enough to try.+ const full = getModel("bria-video-erase")!;+ const slim = { ...full, routes: full.routes.map((r) => ({ op: r.op, provider: r.provider, endpoint: r.endpoint })) };+ expect(planGeneration({ feature: "x", modelId: slim.id, inputs: { video, mask: "/m.png" } }, () => slim, getPreset).op).toBe("remove-object");+ });++ it("lets a swap run without words where the API does, and asks for words where it doesn't", () => {+ expect(promptOptional(getModel("p-video-replace")!, "video-swap")).toBe(true);+ expect(promptOptional(getModel("genjutsu-lite-object-swap")!, "video-swap")).toBe(true);+ expect(promptOptional(getModel("genjutsu-object-swap")!, "video-swap")).toBe(true);+ expect(getModel("p-video-replace")!.options.promptless).toBeFalsy();+ expect(plan({ modelId: "genjutsu-lite-object-swap", inputs: { video, images: ["/r.png"] } }).op).toBe("video-swap");+ expect(fails({ modelId: "kling-o3", op: "video-swap", inputs: { video, images: ["/r.png"] } })).toBe("Write a prompt first");+ expect(fails({ modelId: "sam-3d-objects", inputs: { images: ["/room.png"] } })).toBe("Name the objects to rebuild, e.g. “chair, lamp”");+ expect(plan({ modelId: "pixelcut-looping-video", inputs: { images: ["/bottle.png"] } }).op).toBe("i2v");+ expect(plan({ modelId: "bria-expand", inputs: { images: ["/a.png"] }, params: { aspectRatio: "16:9" } }).op).toBe("outpaint");+ });++ it("checks keyframe times", () => {+ const imgs = ["/a.png", "/b.png", "/c.png"];+ expect(plan({ modelId: "flux-3-max", prompt: "p", inputs: { images: imgs }, params: { keyframeTimes: [0, 2, 5] } }).op).toBe("keyframes");+ expect(fails({ modelId: "flux-3-max", prompt: "p", inputs: { images: imgs }, params: { keyframeTimes: [0, 2] } })).toBe("Give each of the 3 keyframes a time");+ expect(fails({ modelId: "flux-3-max", prompt: "p", inputs: { images: imgs }, params: { keyframeTimes: [0, 3, 2] } })).toBe("Keyframe times start at 0 or later and go up");+ expect(fails({ modelId: "flux-3-max", prompt: "p", inputs: { images: imgs }, params: { keyframeTimes: [0, 2, 8] } })).toBe("The last keyframe is at 8s — make the clip at least that long");+ expect(plan({ modelId: "flux-3-max", prompt: "p", inputs: { images: imgs }, params: { keyframeTimes: [0, 2, 8], duration: 8 } }).params.duration).toBe(8);+ const eleven = Array.from({ length: 11 }, (_, i) => `/${i}.png`);+ expect(fails({ modelId: "flux-3-max", op: "keyframes", prompt: "p", inputs: { images: eleven } })).toBe("FLUX 3 Max takes up to 10 keyframes");+ });+});diff --git a/tests/cloud-catalog.test.ts b/tests/cloud-catalog.test.tsindex 88b9ad34..c97817b5 100644--- a/tests/cloud-catalog.test.ts+++ b/tests/cloud-catalog.test.ts@@ -6,7 +6,7 @@ import { planGeneration } from "@/lib/catalog/plan";import { OPERATION_OUTPUT, type FieldMap, type ModelRoute, type Operation } from "@/lib/catalog/types";type Endpoint = { provider: string; endpoint: string; inputs?: Record<string, unknown>; verified?: boolean };-const research = ["paid-model-apis.json", "paid-model-apis-2.json", "paid-model-apis-3.json"].flatMap(+const research = ["paid-model-apis.json", "paid-model-apis-2.json", "paid-model-apis-3.json", "paid-model-apis-4.json"].flatMap((f) => (JSON.parse(fs.readFileSync(`docs/research/${f}`, "utf8")) as { endpoints: Endpoint[] }).endpoints,);const byId = new Map<string, Endpoint>();@@ -20,7 +20,9 @@ function fieldsOf(map: FieldMap): string[] {if (typeof v === "string") out.push(v);else if (v && typeof v === "object") {const o = v as Record<string, unknown>;- for (const f of ["key", "background", "shotType", "flag"]) if (typeof o[f] === "string") out.push(o[f] as string);+ // Round 4: a Ken Burns zoom's factor and focal point, an overlay's position, and their nested enum keys.+ for (const f of ["key", "background", "shotType", "flag", "factor", "x", "y"]) if (typeof o[f] === "string") out.push(o[f] as string);+ for (const f of ["direction", "easing"]) if (o[f] && typeof (o[f] as { key?: unknown }).key === "string") out.push((o[f] as { key: string }).key);}}return [...out, ...Object.keys(map.fixed ?? {}), ...Object.keys(map.defaults ?? {})].map((f) => f.split(".")[0].replace("[]", ""));diff --git a/tests/pipeline.test.ts b/tests/pipeline.test.tsindex 0a767873..60933780 100644--- a/tests/pipeline.test.ts+++ b/tests/pipeline.test.ts@@ -257,3 +257,62 @@ describe("one mode per chain at launch (S9)", () => {}});});++describe("round-4 inputs and params", () => {+ const providerInput = (id: string) => JSON.parse((db().prepare("SELECT provider_input_json FROM generations WHERE id = ?").get(id) as { provider_input_json: string }).provider_input_json) as Record<string, unknown>;+ const png = Buffer.from("89504e470d0a1a0a0000000d49484452000000010000000108060000001f15c4890000000d49444154789c63f8cfc0f01f0005000201a2e2b6a40000000049454e44ae426082", "hex");++ it("chains a mesh into the rigging step through the model3d slot", async () => {+ const photo = saveFile({ data: png, contentType: "image/png", source: "upload" }).url;+ const p = createPipeline([+ { key: "mesh", request: { feature: "3d", modelId: "test-3d", op: "image-to-3d", inputs: { images: [photo] } } },+ { key: "rig", request: { feature: "3d", modelId: "meshy-rigging", op: "rig-3d", params: { animation: 12 } }, after: "mesh", chain: [{ slot: "model3d" }] },+ ]);+ const mesh = await settle(p.byKey.mesh.id);+ const rig = await settle(p.byKey.rig.id);+ expect(rig.status, rig.error ?? "").toBe("succeeded");+ const glb = mesh.outputs.find((o) => o.kind === "model3d")!.url;+ expect(rig.request.inputs?.model3d).toBe(glb);+ expect(rig.kind).toBe("model3d");+ expect(providerInput(rig.id)).toMatchObject({ model3d: expect.stringMatching(/^data:model\/gltf-binary/), animation: 12 });+ });++ it("keeps the round-4 params and the 3D input on POST /api/generations", async () => {+ const { POST } = await import("@/app/api/generations/route");+ const post = async (body: unknown) => {+ const res = await POST(new Request("http://localhost/api/generations", { method: "POST", body: JSON.stringify(body) }));+ expect(res.status, await res.clone().text()).toBe(201);+ const { items } = (await res.json()) as { items: Generation[] };+ for (const g of items) await gens.cancelGeneration(g.id);+ return items[0];+ };+ const kf = await post({ feature: "video", modelId: "flux-3-max", prompt: "she puts on the hat", inputs: { images: ["/api/files/a.png", "/api/files/b.png"] }, params: { keyframeTimes: [0, 4], duration: 5 } });+ expect(kf.op).toBe("keyframes");+ expect(kf.request.params?.keyframeTimes).toEqual([0, 4]);+ const params = {+ points: [{ x: 10, y: 20, label: "negative" }],+ format: "prores_422_hq",+ zoomFrom: 1,+ zoomTo: 1.2,+ panFrom: { x: 0.5, y: 0.5 },+ panTo: { x: 0.3, y: 0.4 },+ easing: "ease-in-out",+ crossfade: 0.5,+ sourceDuration: 8,+ frameInterval: 2,+ targetFps: 60,+ slowdown: 2,+ colormap: "turbo",+ position: { x: 0.5, y: 0.8 },+ scale: 0.5,+ animation: 12,+ };+ const erase = await post({ feature: "video-tools", modelId: "bria-video-erase-points", inputs: { video: "/api/files/v.mp4" }, params });+ expect(erase.request.params).toMatchObject(params);+ const rig = await post({ feature: "3d", modelId: "meshy-rigging", inputs: { model3d: "/api/files/m.glb" } });+ expect(rig.request.inputs?.model3d).toBe("/api/files/m.glb");+ // Values outside the contract are refused, not passed on.+ const bad = await POST(new Request("http://localhost/api/generations", { method: "POST", body: JSON.stringify({ feature: "x", modelId: "topaz-sdr-to-hdr", inputs: { video: "/v.mp4" }, params: { format: "mpeg2" } }) }));+ expect(bad.status).toBe(400);+ });+});