Temporal frame interpolation using FILM. Synthesizes num_intermediate in-between Image frames per input, multiplying frame rate for slow-motion, fps boost, or smoothing a low-fps source before display or recording. Licences, as published: FILM (google-research/frame-interpolation) and the TorchScript port its weights come from (Hugging Face jkawamoto/frame-interpolation-pytorch, film_net_fp32.pt) are Apache-2.0.
Typical backends
Smooth a video file for playback — interpolated frames written back to disk.
Higher-fps live preview — a network stream is up-sampled and shown in the browser.
Caveats
- Parameter interactionBind
input_fps to the actual source rate (default 24). Measurement playback rate is input_fps times one plus num_intermediate; frames are not paced or resampled. - CostPPL_GENERATION_METRICS strict JSON v4 is printed to component stdout and captured in deployment logs, the Python API logging channel. A startup record is emitted when loading finishes (status ready), even with no input, or on startup failure; each job emits a record including on failure. Envelope fields: schema_version, component, worker_id, job_index (null for startup; increasing per worker for jobs), phase (startup/job), worker_started_unix_ns, started_unix_ns, finished_unix_ns. recipe: model, checkpoints (loaded artifact role to hf:commit or sha256:file/tree identity), steps, width, height (working grid), frames, guidance, precision, device, cpu_offload, vae_tiling, fps, inputs, seed, rng_state_sha256, options (component-specific settings). inputs maps roles to descriptors: text has kind=text, sha256 of exact UTF-8 bytes passed to the model, and length in Unicode codepoints; absent text has null sha256/length. Pixel descriptors have kind=pixels, sha256, shape and dtype, using the same shape/dtype-prefixed digest below. The pixel roles are current, the received frame, and previous, the held frame it is interpolated from; no text input exists. Unused inputs are omitted. seed is the explicit initializer, null when absent; negative values retain the component random-mode convention. Global stochastic draws also record CPU/CUDA RNG-state byte digests in rng_state_sha256 (null when unavailable), without advancing them; a startup initializer alone does not pin every later draw. sources: list of pixels_sha256 and position (the received picture's position when its PictureIdentity is wired, else null). timing_s: startup, model_load, total, encode, denoise, decode, in synchronized wall seconds. Startup includes imports, configuration and loading; job total excludes startup and includes hot loading. Stage/load times are diagnostic subsets, never additive billing. Denoise times model forwards and scheduler steps; denoise times each FILM forward pass, encode the conversion of padded RGB frames to tensors and decode the conversion back to cropped pixels. Stages a job does not reach are zero. memory: gpu_allocated_peak_bytes, gpu_reserved_peak_bytes, gpu_name, host_rss_peak_bytes, host_sample_interval_ms (10 ms sampled process RSS). Peaks are scoped to loading or a job; GPU peaks cover the PyTorch allocator, excluding driver/external allocations. Unavailable probes are null. result: status, error_type (class only), output_count, generated_count, output_bytes, duration_s, outputs. Each outputs entry contains worker_id, job_index, zero-based sequence, pixels_sha256, position, generated, width, height, bytes. Bytes are raw emitted pixels, not compressed files. The digest is SHA-256 of sorted-key JSON {"shape":[height,width,3],"dtype":"uint8"} serialized with Python json.dumps(sort_keys=True) using its default comma-space and colon-space separators, a NUL byte, then decoded RGB bytes, matching ClipPosition picture digests. A picture that cannot be decoded to RGB fails the job, so a digest is never null; sinks must hash decoded pixels before lossy re-encoding. A position is clip_name, clip_sha256, frame_index, made_id, crop_id and position_ns of the PictureIdentity emitted with the picture, so it names the picture key a dataset shard saves the picture under; made_id and crop_id are each empty or a lowercase UUIDv4, and no generated_index is printed. It is null when no PictureIdentity is emitted. The attempt key is (worker_id, job_index); its output key adds sequence. Every output entry repeats this key. Positions and digests link an attempt to saved pictures; both can repeat for identical deterministic jobs and do not identify attempts. The backend must retain the association of each sink/save decision with the attempt/output key to attribute duplicate acceptance or rejection; content equality alone cannot recover it. Measuring changes no emitted position or output pixel. Status: ready (startup), generated, passthrough or failed. Passthrough is a job with no previous frame to interpolate from, the first input or one that does not continue the same traversal; it emits only the received frame. Only interpolated frames count: the received frame is emitted last with generated false, so a job's generated count is
num_intermediate or zero. Outputs are one clip's frames, so duration_s = output_count/fps at the playback rate stated above. Usable, rejected, accepted and audited counts are decided downstream by the sink or review, not by the generator; the backend attributes those decisions through the output join keys, and no usable count is fabricated. The Python worker API has no documented stop hook: hard termination cannot emit a final summary. The backend must use deployment/vertex log context and actual lease reservations to account for startup, inter-job and post-job idle, shutdown and interruption capacity. No prompts or credentials are logged. Live tests assert startup before input, real GPU timings/peaks, output joins and cold/warm successful samples with matching configured recipe and input digests, retained as PPL_GENERATION_BASELINE in lease verifier stdout. Stochastic draws retain separate RNG-state digests; they are repeat samples, not claims of identical noise. Baselines are recorded when GPU tests run; no timing or PLC is inferred from offline fake pipelines. - I/O contract
PictureIdentity is optional for ordinary interpolation: unwired inputs emit pictures and no positions. A connected position stream must pair every picture or fail. Endpoints preserve all fields; intermediates retain the earlier source root and frame, mint made_id, clear crop_id and preserve the endpoints' sequence_id. Only consecutive positions in the same clip group and pass are paired; group changes and reversed sequence coordinates reset history. Both endpoints and all their ancestors are parents. position_ns is interpolated even when endpoint times tie or decrease; sequence_index reserves 2^32 units per generated frame, with intermediate coordinates strictly between endpoints. Ungrouped real footage uses frame_index plus a fractional sequence_index below 2^32. Endpoint metadata is unchanged. Exhausted coordinate precision or UInt64 range fails. Dataset paths require paired provenance throughout. Known ancestry is an ordered set of at most 64 complete picture keys with source times: all immediate parents in input order, then the history of each parent in that order, deduplicated by key. Shared history is retained once; conflicting times, invalid keys, self references or overflow fail. Replay and no-ops preserve the set. New pictures include every contributing picture parent; the primary clip remains the source root. Records persist the set as a flat derived_from array, never a fabricated chain. - State lifetimeThe component is STATEFUL: it holds the previous
Image across calls. The very first Image has no predecessor and passes straight through, so num_intermediate only inserts frames from the second frame onward.
- Hard constraintThe
model file slot MUST be a serialized TorchScript FILM checkpoint (a single `.pt`; a slot holding zero or several `.pt` files stops the worker at startup, naming the files found). A filename containing `fp16` runs at half precision and needs a tensor-core GPU; otherwise it runs at full precision.
- Accuracy
num_intermediate frames are produced by recursive midpoint subdivision. Powers of two minus one (1, 3, 7, 15) split each interval exactly in half and give the cleanest spacing; any other count emits exactly that many frames on an uneven time grid.
- LatencyPer-input latency scales linearly with
num_intermediate — each inserted frame is one FILM forward pass. - AccuracyVery large motion between two consecutive input frames can produce ghosting; FILM is tuned for moderate inter-frame motion.
- Hard constraintA
device of `cuda` or `cuda:N` without a visible CUDA GPU stops the worker at startup with "device <the requested value> is requested, but CUDA is not available", for example "device cuda:1 is requested, but CUDA is not available"; it never runs on the CPU instead. Only an explicit `cpu` runs on the CPU. - Hard constraintThe
model checkpoint, device, and num_intermediate are captured once at startup; changing any requires a redeploy.