Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Catalog: FPS Boost, SDR to HDR and Export on both engines, and Higgsfield's four video upscalers with their options

Claudea44aff131cbd
diff --git a/scripts/gen-cloud-models.py b/scripts/gen-cloud-models.py
index 75f1dfcc..b49a81d1 100644
--- a/scripts/gen-cloud-models.py
+++ b/scripts/gen-cloud-models.py
@@ -56,7 +56,7 @@ 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, formats=None, ranged_durations=False, fit_values=False):
+ sliders=None, controls=None, api_defaults=None, formats=None, ranged_durations=False, fit_values=False, fps_targets=None, upscale_tiers=None):
"""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).
@@ -64,11 +64,15 @@ def model(id, name, vendor, family, kind, tagline, routes, badges=None, pricing=
ranged_durations: a duration that takes any whole second in a range gets the usual picks inside it.
fit_values: the model offers the union of its routes' aspect ratios and resolutions, so each route lists the
ones it takes (EnumField.accepts) and gets the closest of them (Grok Imagine on fal and Higgsfield).
+ controls entries may carry a third item: labels for values that read badly ({0: "Precise", 1: "Creative"}).
+ fps_targets: frame rates offered for the API's target_fps (params.targetFps; ModelOptions.fpsTargets).
+ upscale_tiers: resolutions offered to an upscaler that takes a factor ("Original", "1080p", "4K"): FieldMap.upscaleFactor
+ turns the tier into target ÷ the clip's shorter edge, within the factor field's limits.
A route's options dict may also set max_images (FieldMap.maxImages) and note."""
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 {}, formats=formats or {},
- ranged_durations=ranged_durations, fit_values=fit_values))
+ ranged_durations=ranged_durations, fit_values=fit_values, fps_targets=fps_targets or [], upscale_tiers=upscale_tiers or []))
# ----- Image
@@ -415,10 +419,39 @@ model("seedvr-image", "SeedVR2 Upscale", "ByteDance Seed", "seedvr", "image", "O
[("upscale-image", "fal-ai/seedvr/upscale/image")])
model("recraft-crisp", "Recraft Crisp Upscale", "Recraft", "recraft", "image", "Clean, crisp upscale for design work",
[("upscale-image", "fal-ai/recraft/upscale/crisp")])
-model("topaz-video", "Topaz Video Upscale", "Topaz Labs", "topaz", "video", "Upscale and smooth any clip to 4K / 60fps",
- [("upscale-video", "fal-ai/topaz/upscale/video")], pricing=("second", 0.02), fixed={"upscale_factor": 2})
+# Higgsfield's four video upscalers (higgsfield-delta-4.md §4.3), each with the options its API takes.
+# Topaz Video: the precision models (Proteus by default, Artemis / Iris for faces, Rhea for 4K+, Gaia for animation,
+# Theia for fine detail), Original / 1080p / 1440p / 4K (a factor of the clip's size), frame rate Original / 24 / 30 / 60
+# (the API's 16-60; Higgsfield's 120 is FPS Boost's) and the enhancement sliders. H.264 so it plays in every browser.
+model("topaz-video", "Topaz Video", "Topaz Labs", "topaz", "video", "Enhance and upscale low- to medium-quality footage, up to 4K and 60 fps",
+ [("upscale-video", "topaz/upscale/video/precision")], badges=["4k"],
+ pricing=("second", 0.02, "1080p at 30 fps; 720p $0.01/s, above 1080p $0.06/s; 60 fps doubles", {"byResolution": {"1080p": 0.02, "1440p": 0.06, "4K": 0.06}}),
+ defaults={"resolution": "1080p"}, upscale_tiers=["Original", "1080p", "1440p", "4K"], fps_targets=[24, 30, 60],
+ api_defaults={"H264_output": True}, controls=[("model", "Model")],
+ sliders=[("recover_detail", "Recover details"), ("noise", "Reduce noise"), ("compression", "Revert compression"), ("halo", "Reduce halo"), ("grain", "Grain")])
+# Topaz Starlight Precise: the generative models (Starlight Precise 2.6 by default; HQ, Mini, Sharp, Fast 2 at half the price).
+model("topaz-starlight", "Topaz Starlight", "Topaz Labs", "topaz", "video", "Recover natural detail in faces, textures and text: generative upscale to 1080p or 4K",
+ [("upscale-video", "topaz/upscale/video/generative")], badges=["new", "4k"],
+ pricing=("second", 0.26, "4K at 30 fps; up to 1080p $0.12/s; 60 fps doubles; Starlight Fast 2 is half", {"byResolution": {"1080p": 0.12, "4K": 0.26}}),
+ defaults={"resolution": "4K"}, upscale_tiers=["1080p", "4K"], fps_targets=[24, 30, 60],
+ api_defaults={"H264_output": True}, controls=[("model", "Model")], sliders=[("softness", "Softness")])
+# ByteDance Upscale: up to 8K with scene presets ("Common" is the API's general preset).
+model("bytedance-video-upscale", "ByteDance Upscale", "ByteDance", "bytedance-upscaler", "video", "High-fidelity upscaling up to 8K with scene presets",
+ [("upscale-video", "fal-ai/bytedance-upscaler/upscale/video")], badges=["new"],
+ pricing=("second", 0.0072, "1080p at 30 fps; 2K $0.0144/s, 4K $0.0288/s (6K / 8K estimated from 4K by pixel count); 60 fps doubles; Pro is 10x", {"byResolution": {"1080p": 0.0072, "2k": 0.0144, "4k": 0.0288, "6k": 0.0648, "8k": 0.1152}}),
+ defaults={"resolution": "1080p", "targetFps": 30}, fps_targets=[30, 60],
+ controls=[("enhancement_preset", "Preset", {"general": "Common", "ugc": "UGC (social clips)", "short_series": "Short series", "aigc": "AI-generated video", "old_film": "Old film"}),
+ ("enhancement_tier", "Model version"), ("fidelity", "Fidelity"), ("bit_depth", "Bit depth")])
+# FLUX.3 Upscale: Precise (source-faithful, Higgsfield's default) or Creative detail, guided by an optional prompt; 1.5-3x of the clip.
+model("flux-video-upscale", "FLUX.3 Upscale", "Black Forest Labs", "flux", "video", "Preserve the original or creatively enhance detail (MP4, up to 20 s)",
+ [("upscale-video", "blackforestlabs/flux-video-upscale")], badges=["new"],
+ pricing=("second", 0.15, "2K, precise; 1080p $0.084/s, 4K $0.33/s; Creative about 1.4x", {"byResolution": {"1080p": 0.084, "1440p": 0.15, "4K": 0.33}}),
+ defaults={"resolution": "1440p"}, upscale_tiers=["1080p", "1440p", "4K"], options={"promptOptional": True},
+ api_defaults={"creativity": 0}, controls=[("creativity", "Creativity", {0: "Precise", 1: "Creative"})])
+# SeedVR2: target_resolution only applies in "target" mode (the API's default mode is a 2x factor).
model("seedvr-video", "SeedVR2 Video Upscale", "ByteDance Seed", "seedvr", "video", "Restore and upscale video",
- [("upscale-video", "fal-ai/seedvr/upscale/video")])
+ [("upscale-video", "fal-ai/seedvr/upscale/video")], fixed={"upscale_mode": "target"}, defaults={"resolution": "1080p"},
+ sliders=[("noise_scale", "Noise")])
model("birefnet-cloud", "BiRefNet background removal", "ZhengPeng7", "birefnet", "image", "Clean cut-outs with hair detail",
[("bg-remove", "fal-ai/birefnet/v2")], pricing=("image", 0.0), fixed={"operating_resolution": "2048x2048", "output_format": "png"})
model("elevenlabs-tts", "ElevenLabs v3", "ElevenLabs", "elevenlabs", "audio", "Most expressive speech — audio tags like [whispers] and [laughs]",
@@ -654,7 +687,9 @@ model("topaz-fps-boost", "Topaz FPS Boost", "Topaz Labs", "topaz", "video",
[("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")])
+ api_defaults={"H264_output": True}, controls=[("model", "Model")],
+ # Higgsfield's FPS Boost chips (60 by default) and slow motion (the API takes 1-8).
+ fps_targets=[24, 30, 60, 90, 120], defaults={"targetFps": 60}, options={"slowdowns": [1, 2, 4, 8]})
# 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)", "Open source", "rife", "video",
@@ -898,7 +933,9 @@ def add_slider(opts, param, label, spec):
if not spec or "minimum" not in spec or "maximum" not in spec or any(s["param"] == param for s in opts.get("sliders", [])):
return
lo, hi = spec["minimum"], spec["maximum"]
- opts.setdefault("sliders", []).append({"param": param, "label": label, "min": lo, "max": hi, "step": 0.05 if hi - lo <= 4 else 1,
+ # Narrow ranges (Topaz grain 0-0.1) get a step that still gives them about twenty stops.
+ step = 1 if hi - lo > 4 else 0.05 if hi - lo > 0.2 else round((hi - lo) / 20, 4)
+ opts.setdefault("sliders", []).append({"param": param, "label": label, "min": lo, "max": hi, "step": step,
"default": spec.get("default", lo)})
@@ -908,14 +945,17 @@ def is_sentinel(v, default):
return s == "auto" or (s == "none" and str(default).strip().lower() == "none")
-def add_control(opts, param, label, spec, fallback=None):
- """fallback: what Fuobe sends when the control is left on Auto (a FieldMap default), shown as the control's default."""
+def add_control(opts, param, label, spec, fallback=None, labels=None):
+ """fallback: what Fuobe sends when the control is left on Auto (a FieldMap default), shown as the control's default.
+ labels: names for values that read badly, only for values the enum has."""
default = fallback if fallback is not None else (spec or {}).get("default")
vals = [v for v in ((spec or {}).get("values") or []) if v != "" and not is_sentinel(v, default)]
if not vals or any(c["param"] == param for c in opts.get("controls", [])):
return
keep = default is not None and not is_sentinel(default, default)
- opts.setdefault("controls", []).append({"param": param, "label": label, "values": vals, **({"default": default} if keep else {})})
+ named = {str(k): v for k, v in (labels or {}).items() if k in vals}
+ opts.setdefault("controls", []).append({"param": param, "label": label, "values": vals, **({"default": default} if keep else {}),
+ **({"labels": named} if named else {})})
def map_fields(fmap):
@@ -1150,8 +1190,8 @@ def build_route(op, ep, provider, m, opts, ropts=None):
# The model's own slider/control labels win over the generic voice-setting labels below.
for path, label in m.get("sliders") or []:
add_slider(opts, path, label, spec_at(inputs, path))
- for path, label in m.get("controls") or []:
- add_control(opts, path, label, spec_at(inputs, path), (m.get("api_defaults") or {}).get(path))
+ for path, label, *labels in m.get("controls") or []:
+ add_control(opts, path, label, spec_at(inputs, path), (m.get("api_defaults") or {}).get(path), labels[0] if labels else None)
for k, v in inputs.items():
# Voice settings belong to speech models; a transcriber's "temperature" is not a voice's variety.
if k in SLIDER_LABELS and isinstance(v, dict) and (op in ("tts", "voice-change", "dialogue") or k == "strength"):
@@ -1214,6 +1254,25 @@ def build_route(op, ep, provider, m, opts, ropts=None):
if "numLayers" in kf:
fmap["numLayers"] = kf["numLayers"]
part4_slots(op, kf, inputs, m, opts, fmap)
+ # Frame rates an upscaler (or FPS Boost) can reach: params.targetFps -> its target_fps field.
+ if m.get("fps_targets") and op in ("interpolate", "upscale-video"):
+ key = fmap.get("targetFps") or ("target_fps" if "target_fps" in inputs else None)
+ spec = inputs.get(key) or {}
+ lo, hi = num(spec.get("minimum")), num(spec.get("maximum"))
+ bad = [v for v in m["fps_targets"] if (lo is not None and v < lo) or (hi is not None and v > hi)]
+ if key and not bad:
+ fmap["targetFps"] = key
+ opts["fpsTargets"] = union(opts.get("fpsTargets", []), m["fps_targets"])
+ else:
+ warn(f"{m['id']}: frame rates {bad or m['fps_targets']} don't fit {ep}'s target_fps")
+ # Upscalers that take a factor: the resolution tier becomes target / the clip's shorter edge.
+ if m.get("upscale_tiers") and op == "upscale-video":
+ spec = inputs.get("upscale_factor") or {}
+ if spec.get("type") in ("number", "integer"):
+ fmap["upscaleFactor"] = {"key": "upscale_factor", **{k: num(spec[f]) for k, f in (("min", "minimum"), ("max", "maximum")) if num(spec.get(f)) is not None}}
+ opts["resolutions"] = union(opts.get("resolutions", []), m["upscale_tiers"])
+ else:
+ warn(f"{m['id']}: {ep} has no numeric upscale_factor for its tiers")
# 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"]
diff --git a/src/lib/av/formats.ts b/src/lib/av/formats.ts
new file mode 100644
index 00000000..0dc4fef3
--- /dev/null
+++ b/src/lib/av/formats.ts
@@ -0,0 +1,32 @@
+import type { VideoFormat } from "@/lib/catalog/types";
+
+/**
+ * How each output format reads in the composer (Higgsfield's SDR to HDR copy for the three it offers),
+ * and the file it makes. Pure data, client and server.
+ */
+export const FORMAT_INFO: Record<VideoFormat, { label: string; short: string; hint: string; ext: string }> = {
+ h264: { label: "H.264", short: "H.264", hint: "Plays everywhere. 8-bit, the smallest files.", ext: "mp4" },
+ h265_10bit: {
+ label: "H.265 10-bit",
+ short: "H.265 10-bit",
+ hint: "Higher fidelity at a similar size, with less playback support than H.264.",
+ ext: "mp4",
+ },
+ prores_422_hq: { label: "ProRes 422 HQ", short: "ProRes 422 HQ", hint: "Editing-friendly intermediate codec, 10-bit. Much larger files.", ext: "mov" },
+ prores_4444: { label: "ProRes 4444", short: "ProRes 4444", hint: "ProRes with full colour detail (4:4:4) for finishing and keying. Larger still.", ext: "mov" },
+ ffv1: { label: "FFV1 (lossless)", short: "FFV1", hint: "Lossless archive copy in a .mkv. Very large; few players open it.", ext: "mkv" },
+ exr: { label: "EXR frames, 16-bit", short: "EXR 16-bit", hint: "Uncompressed frame sequence for compositing, zipped. Largest files.", ext: "zip" },
+ hlg_10bit: { label: "HLG, 10-bit MP4", short: "HLG 10-bit", hint: "BT.2020 HLG: looks right on SDR screens too, and brighter on HDR ones.", ext: "mp4" },
+ pq_10bit: { label: "HDR10 (PQ), 10-bit MP4", short: "HDR10 (PQ)", hint: "BT.2020 with the PQ curve of HDR10, in H.264: for HDR displays.", ext: "mp4" },
+};
+
+/** The formats offered across `models` (the studio's models on one engine), in their catalog order. */
+export function formatsOf(models: { options: { formats?: VideoFormat[] } }[]): VideoFormat[] {
+ return [...new Set(models.flatMap((m) => m.options.formats ?? []))];
+}
+
+/** "ProRes 422 HQ or H.265 10-bit": a list of formats in words. */
+export function formatList(formats: VideoFormat[]): string {
+ const names = formats.map((f) => FORMAT_INFO[f]?.short ?? f);
+ return names.length < 2 ? (names[0] ?? "") : `${names.slice(0, -1).join(", ")} or ${names[names.length - 1]}`;
+}
diff --git a/src/lib/av/fps.ts b/src/lib/av/fps.ts
new file mode 100644
index 00000000..6617cd37
--- /dev/null
+++ b/src/lib/av/fps.ts
@@ -0,0 +1,75 @@
+/**
+ * FPS Boost and slow motion, as plain math shared by the composer and the ComfyUI provider.
+ *
+ * Higgsfield's FPS Boost reaches 24, 30, 60, 90 or 120 fps (60 by default). Topaz takes the target
+ * itself; the open engine interpolates by a whole multiplier m (core FrameInterpolate, 2–16) and keeps
+ * every n-th frame (VHS Select Every Nth), so that source fps × m / n = target × slowdown
+ * (docs/research/comfyui-oss-4.md §i: 24 → 30 is m 5, n 4; 24 → 90 is m 15, n 4).
+ */
+
+/** The frame rates FPS Boost offers (Higgsfield's chips); 60 is the default. */
+export const FPS_TARGETS = [24, 30, 60, 90, 120] as const;
+export const DEFAULT_FPS_TARGET = 60;
+/** Slow-motion factors offered: 1 = the clip's own speed, 2 = twice as long. Topaz takes 1–8. */
+export const SLOW_MOTION = [1, 2, 4, 8] as const;
+
+export interface FpsPlan {
+ /** Frames made for each source frame (1 = no interpolation, only dropping frames). */
+ multiplier: number;
+ /** Keep every n-th of those frames. */
+ every: number;
+ /** The frame rate the result plays at: the target when `exact`, else the nearest the clip allows. */
+ fps: number;
+ exact: boolean;
+}
+
+/** FrameInterpolate's largest multiplier. */
+export const MAX_MULTIPLIER = 16;
+const MAX_EVERY = 64;
+/** Relative error below which a ratio counts as exact (header frame rates like 29.97002997…). */
+const EXACT = 1e-4;
+
+const round3 = (n: number) => Math.round(n * 1000) / 1000;
+
+/**
+ * The multiplier m and selection n that turn `sourceFps` into `targetFps`, `slowdown` times slower:
+ * source × m / n = target × slowdown. The cheapest exact pair wins (the fewest frames interpolated);
+ * when none is exact (29.97 fps → 60), the closest pair, and the result plays at
+ * source × m / (n × slowdown) so its length is still exactly slowdown × the clip's.
+ */
+export function fpsPlan(sourceFps: number, targetFps: number, slowdown = 1, maxMultiplier = MAX_MULTIPLIER): FpsPlan {
+ if (!(sourceFps > 0) || !(targetFps > 0)) throw new Error("Frame rates must be positive");
+ const s = Math.max(1, slowdown);
+ const want = (targetFps * s) / sourceFps;
+ let best: { m: number; n: number; err: number } | null = null;
+ for (let m = 1; m <= maxMultiplier; m++) {
+ // The n closest to m / want, and its neighbour (the ratio sits between them).
+ const guess = m / want;
+ for (const n of [Math.floor(guess), Math.ceil(guess)]) {
+ if (n < 1 || n > MAX_EVERY) continue;
+ const err = Math.abs((m / n) / want - 1);
+ const exact = err < EXACT;
+ if (!best) best = { m, n, err };
+ else {
+ const bestExact = best.err < EXACT;
+ // An exact pair beats an approximate one; among exact pairs the first (smallest m) stays;
+ // among approximate ones the closest wins.
+ if ((exact && !bestExact) || (!exact && !bestExact && err < best.err - 1e-12)) best = { m, n, err };
+ }
+ }
+ }
+ if (!best) return { multiplier: 1, every: 1, fps: round3(sourceFps / s), exact: false };
+ const fps = (sourceFps * best.m) / (best.n * s);
+ return { multiplier: best.m, every: best.n, fps: round3(fps), exact: best.err < EXACT };
+}
+
+/** How many frames the open graph writes for `frames` source frames (the last frame is held once more, so ≈ frames × m / n). */
+export function fpsFrames(frames: number, plan: Pick<FpsPlan, "multiplier" | "every">): number {
+ return Math.ceil((frames * plan.multiplier + 1) / plan.every);
+}
+
+/** "24 → 60 fps", "24 → 60 fps · 2× slow motion": the one-line summary under the clip. */
+export function fpsSummary(sourceFps: number | undefined, targetFps: number, slowdown = 1): string {
+ const from = sourceFps ? `${round3(sourceFps)} → ` : "";
+ return `${from}${targetFps} fps${slowdown > 1 ? ` · ${slowdown}× slow motion` : ""}`;
+}
diff --git a/src/lib/av/upscale.ts b/src/lib/av/upscale.ts
new file mode 100644
index 00000000..fb8dbfa5
--- /dev/null
+++ b/src/lib/av/upscale.ts
@@ -0,0 +1,40 @@
+/**
+ * Upscale targets as plain math: a resolution tier names the result's shorter edge (1080p = 1080 px,
+ * 4K = 2160 px, whatever the shape), and APIs that take a factor get target ÷ the clip's shorter edge.
+ */
+
+/** The shorter edge a tier asks for: "720p" 720, "1080p" 1080, "1440p" / "2K" 1440, "2160p" / "4K" 2160, "8K" 4320. */
+export function targetShortEdge(resolution: string | undefined): number | undefined {
+ const v = resolution?.trim().toLowerCase();
+ if (!v) return undefined;
+ const p = /^(\d{3,4})p$/.exec(v);
+ if (p) return Number(p[1]);
+ const k = /^(\d+(?:\.\d+)?)k$/.exec(v);
+ if (!k) return undefined;
+ // Marketing "K" tiers: 1K = 1080p, 2K = 1440p, 4K = 2160p, 6K = 3240p, 8K = 4320p.
+ const n = Number(k[1]);
+ return n === 1 ? 1080 : n === 2 ? 1440 : Math.round(n * 540);
+}
+
+/**
+ * The factor an upscaler that takes one needs to reach `resolution` from a clip of `source` size: target ÷
+ * shorter edge, kept within the API's min–max and rounded to 2 decimals. "Original" is 1 (enhance only).
+ * Undefined when the size or the tier is unknown.
+ */
+export function upscaleFactorFor(resolution: string | undefined, source: { width: number; height: number } | undefined, min = 1, max = 4): number | undefined {
+ const lo = Math.min(min, max);
+ if (resolution?.trim().toLowerCase() === "original") return Math.max(lo, 1);
+ const target = targetShortEdge(resolution);
+ const short = source ? Math.min(source.width, source.height) : 0;
+ if (!target || !(short > 0)) return undefined;
+ return Math.round(Math.max(lo, Math.min(max, target / short)) * 100) / 100;
+}
+
+/** The size a clip comes out at for `resolution` (its shape kept, even numbers), or undefined when unknown. */
+export function upscaledSize(source: { width: number; height: number } | undefined, resolution: string | undefined, factor?: number): { width: number; height: number } | undefined {
+ if (!source?.width || !source.height) return undefined;
+ const k = factor ?? (resolution?.trim().toLowerCase() === "original" ? 1 : (targetShortEdge(resolution) ?? 0) / Math.min(source.width, source.height));
+ if (!(k > 0)) return undefined;
+ const even = (n: number) => Math.max(2, Math.round(n / 2) * 2);
+ return { width: even(source.width * k), height: even(source.height * k) };
+}
diff --git a/src/lib/catalog/canvas.ts b/src/lib/catalog/canvas.ts
index d077c7ee..f4b40212 100644
--- a/src/lib/catalog/canvas.ts
+++ b/src/lib/catalog/canvas.ts
@@ -862,7 +862,7 @@ export function describeNode(graph: CanvasGraph, n: CanvasNode, ctx: DescribeCon
if ("error" in built) return { model, costUsd: null, error: built.error };
try {
const plan = planGeneration(withPlaceholders(built.request), getModel, getPreset);
- return { ...built, model, plan, costUsd: estimateCost(plan.model, plan.params, plan.jobs) };
+ return { ...built, model, plan, costUsd: estimateCost(plan.model, plan.params, plan.jobs, plan.op) };
} catch (e) {
return { ...built, model, costUsd: null, error: (e as Error).message };
}
diff --git a/src/lib/catalog/cloud-models.generated.ts b/src/lib/catalog/cloud-models.generated.ts
index ff6affab..d11b764b 100644
--- a/src/lib/catalog/cloud-models.generated.ts
+++ b/src/lib/catalog/cloud-models.generated.ts
@@ -6668,32 +6668,406 @@ export const CLOUD_MODELS: ModelDef[] = [
},
{
"id": "topaz-video",
- "name": "Topaz Video Upscale",
+ "name": "Topaz Video",
"vendor": "Topaz Labs",
"family": "topaz",
"engine": "cloud",
"kind": "video",
- "tagline": "Upscale and smooth any clip to 4K / 60fps",
+ "tagline": "Enhance and upscale low- to medium-quality footage, up to 4K and 60 fps",
"routes": [
{
"op": "upscale-video",
"provider": "fal",
- "endpoint": "fal-ai/topaz/upscale/video",
+ "endpoint": "topaz/upscale/video/precision",
"map": {
"prompt": false,
"video": "video_url",
- "fixed": {
- "upscale_factor": 2
+ "targetFps": "target_fps",
+ "upscaleFactor": {
+ "key": "upscale_factor",
+ "min": 1,
+ "max": 4
+ },
+ "ranges": {
+ "target_fps": {
+ "min": 16,
+ "max": 60,
+ "integer": true
+ }
+ },
+ "defaults": {
+ "H264_output": true
}
}
}
],
"options": {
+ "sliders": [
+ {
+ "param": "recover_detail",
+ "label": "Recover details",
+ "min": 0,
+ "max": 1,
+ "step": 0.05,
+ "default": 0
+ },
+ {
+ "param": "noise",
+ "label": "Reduce noise",
+ "min": 0,
+ "max": 1,
+ "step": 0.05,
+ "default": 0
+ },
+ {
+ "param": "compression",
+ "label": "Revert compression",
+ "min": 0,
+ "max": 1,
+ "step": 0.05,
+ "default": 0
+ },
+ {
+ "param": "halo",
+ "label": "Reduce halo",
+ "min": 0,
+ "max": 1,
+ "step": 0.05,
+ "default": 0
+ },
+ {
+ "param": "grain",
+ "label": "Grain",
+ "min": 0,
+ "max": 0.1,
+ "step": 0.005,
+ "default": 0
+ }
+ ],
+ "controls": [
+ {
+ "param": "model",
+ "label": "Model",
+ "values": [
+ "Proteus",
+ "Proteus Natural",
+ "Iris",
+ "Iris Low Quality",
+ "Dione DV",
+ "Dione TV",
+ "Dione Robust",
+ "Dione Dehalo",
+ "Dione Robust Dehalo",
+ "Artemis High Quality",
+ "Artemis Medium Quality",
+ "Artemis Low Quality",
+ "Artemis Strong Halo",
+ "Artemis Medium Halo",
+ "Artemis Aliasing & Moire",
+ "Gaia HQ",
+ "Gaia CG",
+ "Gaia 2",
+ "Rhea",
+ "Theia Fine Tune Detail",
+ "Theia Fine Tune Fidelity"
+ ],
+ "default": "Proteus"
+ }
+ ],
+ "fpsTargets": [
+ 24,
+ 30,
+ 60
+ ],
+ "resolutions": [
+ "Original",
+ "1080p",
+ "1440p",
+ "4K"
+ ],
"promptless": true
},
+ "badges": [
+ "4k"
+ ],
+ "defaults": {
+ "resolution": "1080p"
+ },
"pricing": {
"unit": "second",
- "usd": 0.02
+ "usd": 0.02,
+ "note": "1080p at 30 fps; 720p $0.01/s, above 1080p $0.06/s; 60 fps doubles",
+ "byResolution": {
+ "1080p": 0.02,
+ "1440p": 0.06,
+ "4K": 0.06
+ }
+ }
+ },
+ {
+ "id": "topaz-starlight",
+ "name": "Topaz Starlight",
+ "vendor": "Topaz Labs",
+ "family": "topaz",
+ "engine": "cloud",
+ "kind": "video",
+ "tagline": "Recover natural detail in faces, textures and text: generative upscale to 1080p or 4K",
+ "routes": [
+ {
+ "op": "upscale-video",
+ "provider": "fal",
+ "endpoint": "topaz/upscale/video/generative",
+ "map": {
+ "prompt": false,
+ "video": "video_url",
+ "targetFps": "target_fps",
+ "upscaleFactor": {
+ "key": "upscale_factor",
+ "min": 1,
+ "max": 4
+ },
+ "ranges": {
+ "target_fps": {
+ "min": 16,
+ "max": 60,
+ "integer": true
+ }
+ },
+ "defaults": {
+ "H264_output": true
+ }
+ }
+ }
+ ],
+ "options": {
+ "sliders": [
+ {
+ "param": "softness",
+ "label": "Softness",
+ "min": 1,
+ "max": 5,
+ "step": 0.05,
+ "default": 1
+ }
+ ],
+ "controls": [
+ {
+ "param": "model",
+ "label": "Model",
+ "values": [
+ "Starlight Precise 2.6",
+ "Starlight HQ",
+ "Starlight Mini",
+ "Starlight Sharp",
+ "Starlight Fast 2"
+ ],
+ "default": "Starlight Precise 2.6"
+ }
+ ],
+ "fpsTargets": [
+ 24,
+ 30,
+ 60
+ ],
+ "resolutions": [
+ "1080p",
+ "4K"
+ ],
+ "promptless": true
+ },
+ "badges": [
+ "new",
+ "4k"
+ ],
+ "defaults": {
+ "resolution": "4K"
+ },
+ "pricing": {
+ "unit": "second",
+ "usd": 0.26,
+ "note": "4K at 30 fps; up to 1080p $0.12/s; 60 fps doubles; Starlight Fast 2 is half",
+ "byResolution": {
+ "1080p": 0.12,
+ "4K": 0.26
+ }
+ }
+ },
+ {
+ "id": "bytedance-video-upscale",
+ "name": "ByteDance Upscale",
+ "vendor": "ByteDance",
+ "family": "bytedance-upscaler",
+ "engine": "cloud",
+ "kind": "video",
+ "tagline": "High-fidelity upscaling up to 8K with scene presets",
+ "routes": [
+ {
+ "op": "upscale-video",
+ "provider": "fal",
+ "endpoint": "fal-ai/bytedance-upscaler/upscale/video",
+ "map": {
+ "prompt": false,
+ "video": "video_url",
+ "targetFps": "target_fps",
+ "resolution": "target_resolution",
+ "ranges": {
+ "target_fps": {
+ "min": 24,
+ "max": 120
+ }
+ }
+ }
+ }
+ ],
+ "options": {
+ "controls": [
+ {
+ "param": "enhancement_preset",
+ "label": "Preset",
+ "values": [
+ "general",
+ "ugc",
+ "short_series",
+ "aigc",
+ "old_film"
+ ],
+ "default": "general",
+ "labels": {
+ "general": "Common",
+ "ugc": "UGC (social clips)",
+ "short_series": "Short series",
+ "aigc": "AI-generated video",
+ "old_film": "Old film"
+ }
+ },
+ {
+ "param": "enhancement_tier",
+ "label": "Model version",
+ "values": [
+ "fast",
+ "standard",
+ "pro"
+ ],
+ "default": "standard"
+ },
+ {
+ "param": "fidelity",
+ "label": "Fidelity",
+ "values": [
+ "high",
+ "medium"
+ ],
+ "default": "high"
+ },
+ {
+ "param": "bit_depth",
+ "label": "Bit depth",
+ "values": [
+ 8,
+ 10,
+ 12
+ ],
+ "default": 8
+ }
+ ],
+ "fpsTargets": [
+ 30,
+ 60
+ ],
+ "resolutions": [
+ "1080p",
+ "2k",
+ "4k",
+ "6k",
+ "8k"
+ ],
+ "promptless": true
+ },
+ "badges": [
+ "new"
+ ],
+ "defaults": {
+ "resolution": "1080p",
+ "targetFps": 30
+ },
+ "pricing": {
+ "unit": "second",
+ "usd": 0.0072,
+ "note": "1080p at 30 fps; 2K $0.0144/s, 4K $0.0288/s (6K / 8K estimated from 4K by pixel count); 60 fps doubles; Pro is 10x",
+ "byResolution": {
+ "1080p": 0.0072,
+ "2k": 0.0144,
+ "4k": 0.0288,
+ "6k": 0.0648,
+ "8k": 0.1152
+ }
+ }
+ },
+ {
+ "id": "flux-video-upscale",
+ "name": "FLUX.3 Upscale",
+ "vendor": "Black Forest Labs",
+ "family": "flux",
+ "engine": "cloud",
+ "kind": "video",
+ "tagline": "Preserve the original or creatively enhance detail (MP4, up to 20 s)",
+ "routes": [
+ {
+ "op": "upscale-video",
+ "provider": "fal",
+ "endpoint": "blackforestlabs/flux-video-upscale",
+ "map": {
+ "omitEmptyPrompt": true,
+ "video": "video_url",
+ "upscaleFactor": {
+ "key": "upscale_factor",
+ "min": 1.5,
+ "max": 3
+ },
+ "defaults": {
+ "creativity": 0
+ }
+ }
+ }
+ ],
+ "options": {
+ "controls": [
+ {
+ "param": "creativity",
+ "label": "Creativity",
+ "values": [
+ 0,
+ 1
+ ],
+ "default": 0,
+ "labels": {
+ "0": "Precise",
+ "1": "Creative"
+ }
+ }
+ ],
+ "resolutions": [
+ "1080p",
+ "1440p",
+ "4K"
+ ],
+ "promptOptional": true
+ },
+ "badges": [
+ "new"
+ ],
+ "defaults": {
+ "resolution": "1440p"
+ },
+ "pricing": {
+ "unit": "second",
+ "usd": 0.15,
+ "note": "2K, precise; 1080p $0.084/s, 4K $0.33/s; Creative about 1.4x",
+ "byResolution": {
+ "1080p": 0.084,
+ "1440p": 0.15,
+ "4K": 0.33
+ }
}
},
{
@@ -6713,11 +7087,24 @@ export const CLOUD_MODELS: ModelDef[] = [
"prompt": false,
"video": "video_url",
"seed": "seed",
- "resolution": "target_resolution"
+ "resolution": "target_resolution",
+ "fixed": {
+ "upscale_mode": "target"
+ }
}
}
],
"options": {
+ "sliders": [
+ {
+ "param": "noise_scale",
+ "label": "Noise",
+ "min": 0,
+ "max": 1,
+ "step": 0.05,
+ "default": 0.1
+ }
+ ],
"seed": true,
"resolutions": [
"720p",
@@ -6727,6 +7114,9 @@ export const CLOUD_MODELS: ModelDef[] = [
],
"promptless": true
},
+ "defaults": {
+ "resolution": "1080p"
+ },
"pricing": {
"unit": "megapixel",
"usd": 0.001
@@ -12378,11 +12768,27 @@ export const CLOUD_MODELS: ModelDef[] = [
"default": "Apollo"
}
],
- "promptless": true
+ "fpsTargets": [
+ 24,
+ 30,
+ 60,
+ 90,
+ 120
+ ],
+ "promptless": true,
+ "slowdowns": [
+ 1,
+ 2,
+ 4,
+ 8
+ ]
},
"badges": [
"new"
],
+ "defaults": {
+ "targetFps": 60
+ },
"pricing": {
"unit": "second",
"usd": 0.03,
diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.ts
index dc7abc9f..ee6e458b 100644
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@ -1,6 +1,7 @@
import { CLOUD_MODELS } from "./cloud-models.generated";
import { HIGGSFIELD_MODELS, HIGGSFIELD_ROUTES } from "./higgsfield-models.generated";
import { pricingAt } from "./plan";
+import { DEFAULT_FPS_TARGET, FPS_TARGETS, SLOW_MOTION } from "@/lib/av/fps";
import { LAST_FRAME_CHAIN, type ModelDef, type ModelRoute, type Operation } from "./types";
/*
@@ -29,6 +30,8 @@ const CONCAT_SHOTS = { mode: "concat", maxShots: 4 } as const;
const IMG_AR = ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "21:9", "5:4", "4:5"];
const VID_AR = ["16:9", "9:16", "1:1"];
+/** Open video upscalers: the result's shorter edge (1080p = 1080 px in any shape). */
+const VIDEO_UPSCALE_TIERS = ["720p", "1080p", "1440p", "2160p"];
// ---------------------------------------------------------------------------
@@ -373,15 +376,18 @@ const open: ModelDef[] = [
options: { aspectRatios: VID_AR, seed: true, negativePrompt: true },
defaults: { aspectRatio: "9:16" },
}),
+ // Video upscalers run in passes of a few frames (VHS meta-batch), so memory stays flat whatever the clip's
+ // length (the whole-clip graphs held about 38 GB of frames for 30 s at 480p). params.resolution = the shorter edge.
o({
id: "oss-seedvr2",
name: "SeedVR2 (video)",
vendor: "ByteDance Seed",
family: "seedvr",
kind: "video",
- tagline: "One-step diffusion upscaler for video",
- routes: [comfy("upscale-video", "upscale-video-seedvr2")],
- options: { seed: true },
+ tagline: "One-step diffusion restoration and upscale, in passes so long clips fit",
+ routes: [comfy("upscale-video", "upscale-video-seedvr2-chunked", "33 frames per pass; each pass restored on its own")],
+ options: { seed: true, resolutions: VIDEO_UPSCALE_TIERS },
+ defaults: { resolution: "1080p" },
}),
o({
id: "oss-upscale-video-esrgan",
@@ -389,19 +395,57 @@ const open: ModelDef[] = [
vendor: "Open source",
family: "esrgan",
kind: "video",
- tagline: "Fast frame-by-frame 4x upscale",
- routes: [comfy("upscale-video", "upscale-video-esrgan")],
- options: {},
+ tagline: "Fast frame-by-frame 4x upscale, in passes: any length fits in memory",
+ routes: [comfy("upscale-video", "upscale-video-esrgan-chunked", "Real-ESRGAN x4, then scaled to the size asked for")],
+ options: { resolutions: VIDEO_UPSCALE_TIERS },
+ defaults: { resolution: "1080p" },
}),
+ // FPS Boost: interpolate by m and keep every n-th frame (src/lib/av/fps.ts), for an exact target and slow motion.
o({
id: "oss-rife",
name: "RIFE interpolation",
vendor: "Open source",
family: "rife",
kind: "video",
- tagline: "Smooth slow motion and 2x/4x frame rate",
- routes: [comfy("interpolate", "interpolate-rife")],
- options: {},
+ tagline: "FPS Boost to 24–120 fps and slow motion; FILM for large motion",
+ routes: [comfy("interpolate", "interpolate-rife-fps", "frame rate from the clip's header: interpolate by m, keep every n-th")],
+ options: {
+ fpsTargets: [...FPS_TARGETS],
+ slowdowns: [...SLOW_MOTION],
+ controls: [
+ {
+ param: "checkpoint",
+ label: "Model",
+ values: ["rife_v4.26.safetensors", "film_net_fp16.safetensors"],
+ default: "rife_v4.26.safetensors",
+ labels: { "rife_v4.26.safetensors": "RIFE 4.26 (fast)", "film_net_fp16.safetensors": "FILM (large motion, slower)" },
+ },
+ ],
+ },
+ defaults: { targetFps: DEFAULT_FPS_TARGET },
+ }),
+ // SDR to HDR and pro export formats (core ComfyUI and VideoHelperSuite, no model weights).
+ o({
+ id: "oss-sdr-to-hdr",
+ name: "SDR to HDR",
+ vendor: "ComfyUI",
+ family: "utility",
+ kind: "video",
+ tagline: "SDR footage expanded to 10-bit HDR: HLG or HDR10 (PQ) MP4, or 16-bit EXR frames",
+ routes: [comfy("sdr-to-hdr", "video-sdr-to-hdr", "an inverse tone map (core ImageSDRToHDR), not a learned model")],
+ options: { formats: ["hlg_10bit", "pq_10bit", "exr"], sliders: [{ param: "peakNits", label: "Peak brightness (nits)", min: 200, max: 2000, step: 50, default: 650 }] },
+ defaults: { format: "hlg_10bit" },
+ }),
+ o({
+ id: "oss-export-video",
+ name: "Pro export",
+ vendor: "ComfyUI",
+ family: "utility",
+ kind: "video",
+ tagline: "ProRes 422 HQ or 4444, H.265 10-bit, lossless FFV1 or 16-bit EXR frames, made on your machine",
+ routes: [comfy("export-video", "video-export-pro-chunked", "VideoHelperSuite with the server's ffmpeg, in passes; EXR: core SaveImageAdvanced")],
+ options: { formats: ["prores_422_hq", "prores_4444", "h265_10bit", "ffv1", "h264", "exr"] },
+ defaults: { format: "prores_422_hq" },
}),
o({
id: "oss-mmaudio",
diff --git a/src/lib/catalog/payload.ts b/src/lib/catalog/payload.ts
index 01072ec7..108f6331 100644
--- a/src/lib/catalog/payload.ts
+++ b/src/lib/catalog/payload.ts
@@ -1,4 +1,5 @@
import { readTimeline, timelineTracks } from "@/lib/av/timeline";
+import { upscaleFactorFor } from "@/lib/av/upscale";
import { OPERATION_OUTPUT, type DurationField, type EnumField, type FieldMap, type GenInput, type MediaKind, type Operation, type PixelPoint } from "./types";
function enumValue(field: string | EnumField, value: string): [string, unknown] {
@@ -344,6 +345,11 @@ export function buildPayload(map: FieldMap, input: GenInput): Record<string, unk
const n = numFramesValue(map.numFrames, input);
if (n !== undefined) out[map.numFrames.key] = n;
}
+ // Upscalers that take a factor: the tier asked for over the clip's shorter edge (unknown size: the API's default).
+ if (map.upscaleFactor && input.resolution) {
+ const f = upscaleFactorFor(input.resolution, input.sourceSize, map.upscaleFactor.min, map.upscaleFactor.max);
+ if (f !== undefined) out[map.upscaleFactor.key] = f;
+ }
// The API's limits on what Fuobe filled in (params.extra below is sent as given).
for (const [k, r] of Object.entries(map.ranges ?? {})) if (typeof out[k] === "number") out[k] = inRange(out[k] as number, r);
diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.ts
index c31d731c..ffc7c156 100644
--- a/src/lib/catalog/plan.ts
+++ b/src/lib/catalog/plan.ts
@@ -1,3 +1,4 @@
+import { FORMAT_INFO, formatList } from "@/lib/av/formats";
import type {
Engine,
GenerationRequest,
@@ -230,6 +231,11 @@ export function planGeneration(
}
if (op === "dub" && !req.inputs?.video && !req.inputs?.audio) throw new Error("Add the video to translate");
if (op === "keyframes") checkKeyframes(model, req.inputs?.images?.length ?? 0, params);
+ // A format the model doesn't write (an API caller, or a request moved to another model).
+ const formats = model.options.formats;
+ if (params.format && formats?.length && !formats.includes(params.format)) {
+ throw new Error(`${model.name} writes ${formatList(formats)}, not ${FORMAT_INFO[params.format]?.short ?? params.format}`);
+ }
// A join takes as many clips as the API's list does (fal merge-audios: 5); longer joins run in steps.
const maxAudios = model.options.maxAudios;
if (op === "audio-join" && maxAudios && (req.inputs?.audios?.length ?? 0) > maxAudios) throw new Error(`${model.name} joins up to ${maxAudios} clips at a time — join the rest in a second step`);
@@ -398,16 +404,24 @@ export function pricingAt(p: Pricing, now = Date.now()): Pricing {
return { ...list, usd: promo.usd, ...(promo.byResolution ? { byResolution: promo.byResolution } : {}) };
}
+/**
+ * Operations whose result is as long as the clip they're given (upscale, FPS Boost, HDR, export): a per-second
+ * price counts the clip's seconds (params.sourceDuration) when the caller knows them, and slow motion bills
+ * the whole stretched result.
+ */
+const CLIP_LENGTH_OPS = new Set<Operation>(["upscale-video", "interpolate", "sdr-to-hdr", "export-video"]);
+
/** Rough USD estimate for a plan (BYO-key cloud runs). Open-source runs are free. */
-export function estimateCost(model: ModelDef, params: GenParams, jobs = 1): number | null {
+export function estimateCost(model: ModelDef, params: GenParams, jobs = 1, op?: Operation): number | null {
if (model.engine === "open" || !model.pricing) return model.engine === "open" ? 0 : null;
const p = model.pricing;
const n = params.numOutputs ?? 1;
const res = params.resolution ?? model.defaults?.resolution;
const usd = (res && p.byResolution && (p.byResolution[res] ?? p.byResolution[res.toLowerCase()])) || p.usd;
let per = usd;
+ const clip = op && CLIP_LENGTH_OPS.has(op) && params.sourceDuration && params.sourceDuration > 0 ? params.sourceDuration * (op === "interpolate" ? Math.max(1, params.slowdown ?? 1) : 1) : undefined;
if (p.unit === "image") per = usd * n;
- if (p.unit === "second") per = usd * (params.duration ?? model.defaults?.duration ?? 5) * (p.inputSeconds ? 2 : 1);
+ if (p.unit === "second") per = usd * (clip ?? params.duration ?? model.defaults?.duration ?? 5) * (p.inputSeconds ? 2 : 1);
if (p.unit === "minute") per = (usd * (params.duration ?? 60)) / 60;
if (params.generateAudio === false && model.options.audio === true && p.note?.includes("audio-off-half")) per /= 2;
return Math.round(per * jobs * 1000) / 1000;
diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.ts
index b63b8a82..9c19282f 100644
--- a/src/lib/catalog/types.ts
+++ b/src/lib/catalog/types.ts
@@ -219,8 +219,10 @@ export const OPERATION_OUTPUT: Record<Operation, MediaKind> = {
/**
* Video codecs and containers an export or HDR job can write (params.format): H.264 MP4, 10-bit H.265
* MP4, ProRes 422 HQ or 4444 in a .mov, lossless FFV1 in a .mkv, or a 16-bit EXR frame sequence.
+ * The open engine's HDR is also written as 10-bit H.264 in BT.2020 with the HLG or PQ (HDR10) curve
+ * (core ComfyUI has no H.265 encoder).
*/
-export type VideoFormat = "h264" | "h265_10bit" | "prores_422_hq" | "prores_4444" | "ffv1" | "exr";
+export type VideoFormat = "h264" | "h265_10bit" | "prores_422_hq" | "prores_4444" | "ffv1" | "exr" | "hlg_10bit" | "pq_10bit";
/** A point on a picture in its own pixels (the first frame of a video). Negative points mark what to keep. */
export interface PixelPoint {
@@ -409,6 +411,12 @@ export interface FieldMap {
omitEmptyPrompt?: boolean;
/** params.extra keys this route has no field for (a model-wide control only its other routes read): left out. */
ignore?: string[];
+ /**
+ * An upscaler that takes a factor, not a size (Topaz, FLUX Upscale): params.resolution ("1080p", "4K",
+ * "Original" = 1) becomes target ÷ the clip's shorter edge (GenInput.sourceSize), kept within min–max.
+ * Nothing is sent when the clip's size is unknown (the API's default factor applies).
+ */
+ upscaleFactor?: { key: string; min?: number; max?: number };
}
export interface ModelRoute {
@@ -454,8 +462,8 @@ export interface ModelOptions {
languages?: string[];
/** Numeric settings sent as-is (stability, similarity, speed, exaggeration…). */
sliders?: { param: string; label: string; min: number; max: number; step: number; default: number }[];
- /** Extra enum settings sent as-is (Cinema Studio's genre, lens, light, grade, camera move…). */
- controls?: { param: string; label: string; values: (string | number)[]; default?: string | number }[];
+ /** Extra enum settings sent as-is (Cinema Studio's genre, lens, light, grade, camera move…); `labels` names values that read badly (FLUX Upscale's creativity 0 / 1). */
+ controls?: { param: string; label: string; values: (string | number)[]; default?: string | number; labels?: Record<string, string> }[];
/** Images it needs before it can run (try-on: the person and the garment). */
minImages?: number;
/** What each image is, in order ("person photo", "garment"): blockers and slot labels. */
@@ -477,6 +485,13 @@ export interface ModelOptions {
requires?: { images?: number; prompt?: boolean; mask?: boolean; points?: boolean; msg: string };
/** Output formats it can write (params.format: SDR to HDR, export). */
formats?: VideoFormat[];
+ /**
+ * Frame rates it can reach (params.targetFps): FPS Boost's 24–120, an upscaler's 24 / 30 / 60. Without a
+ * default target (`defaults.targetFps`) the clip's own frame rate is the first choice ("Original").
+ */
+ fpsTargets?: number[];
+ /** Slow-motion factors it takes (params.slowdown; 1 = the clip's speed). */
+ slowdowns?: number[];
}
export interface Pricing {
@@ -505,7 +520,7 @@ export interface ModelDef {
badges?: Badge[];
routes: ModelRoute[];
options: ModelOptions;
- defaults?: Partial<Pick<GenParams, "aspectRatio" | "resolution" | "duration" | "numOutputs" | "generateAudio" | "voice">>;
+ defaults?: Partial<Pick<GenParams, "aspectRatio" | "resolution" | "duration" | "numOutputs" | "generateAudio" | "voice" | "targetFps" | "format">>;
pricing?: Pricing;
/** Trained identities this model accepts by id (Higgsfield Soul ID). */
identity?: { provider: "higgsfield"; version: "v1" | "v2" | "cinema" };
@@ -689,6 +704,9 @@ export interface GenInput extends GenParams {
audios?: string[];
model3d?: string;
loras?: LoraRef[];
+ /** Server-filled from the input clip's header (generations.ts submit): its displayed size and frame rate. */
+ sourceSize?: { width: number; height: number };
+ sourceFps?: number;
}
export type GenerationStatus = "queued" | "running" | "succeeded" | "failed" | "canceled";