Synthome Docs
Operations

Ease Curve

Apply smooth speed ramping effects to videos

easeCurve()

Apply ease curve timing to a video, creating smooth speed ramping effects like slow motion at the start/end with normal speed in the middle.

import { compose, easeCurve } from "@synthome/sdk";

const execution = await compose(
  easeCurve({
    video: "https://example.com/video.mp4",
    easeCurve: "easeInOutCubic",
  }),
).execute();

Basic Usage

Apply Default Easing

Apply the default easeInOutCubic curve (slow-fast-slow):

easeCurve({
  video: "https://example.com/video.mp4",
});

Choose Easing Intensity

Select from different easing presets based on how dramatic you want the effect:

// Subtle - gentle slow-fast-slow
easeCurve({
  video: "https://example.com/video.mp4",
  easeCurve: "easeInOutSine",
});

// Standard - balanced effect
easeCurve({
  video: "https://example.com/video.mp4",
  easeCurve: "easeInOutCubic",
});

// Extreme - almost frozen at start/end
easeCurve({
  video: "https://example.com/video.mp4",
  easeCurve: "easeInOutExpo",
});

Custom Duration

Stretch or compress the video to a specific duration while applying the easing:

easeCurve({
  video: "https://example.com/video.mp4",
  easeCurve: "easeInOutCubic",
  targetDuration: 5, // Output will be 5 seconds
});

Easing Presets

All presets create a slow-fast-slow effect with varying intensity:

PresetIntensityDescription
linearNoneNo easing, constant speed
easeInOutSineSubtleGentle slow-fast-slow
easeInOutCubicStandardBalanced effect (default)
easeInQuartOutQuadModerateMore pronounced than cubic
easeInExpoOutCubicDramaticStrong slowdown at start
easeInOutExpoExtremeAlmost frozen at start/end

With Generated Content

Apply to Generated Video

Chain with video generation:

import { compose, easeCurve, generateVideo, videoModel } from "@synthome/sdk";

const execution = await compose(
  easeCurve({
    video: generateVideo({
      model: videoModel("kwaivgi/kling-v2.1", "replicate"),
      prompt: "A dancer performing a graceful spin",
    }),
    easeCurve: "easeInOutExpo",
  }),
).execute();

The video is generated first, then the ease curve is applied.

Combine with Other Operations

Chain with merge and other operations:

import {
  compose,
  easeCurve,
  merge,
  generateVideo,
  videoModel,
} from "@synthome/sdk";

const execution = await compose(
  merge([
    easeCurve({
      video: generateVideo({
        model: videoModel("bytedance/seedance-1-pro", "replicate"),
        prompt: "Scene 1 - dramatic entrance",
      }),
      easeCurve: "easeInOutExpo",
    }),
    easeCurve({
      video: generateVideo({
        model: videoModel("bytedance/seedance-1-pro", "replicate"),
        prompt: "Scene 2 - action sequence",
      }),
      easeCurve: "easeInOutCubic",
    }),
  ]),
).execute();

Custom Bezier Curves

For precise control, use a custom cubic-bezier curve:

easeCurve({
  video: "https://example.com/video.mp4",
  easeCurve: "cubic-bezier(0.42, 0, 0.58, 1)",
});

The format is cubic-bezier(x1, y1, x2, y2) where:

  • x1, y1 control the curve at the start
  • x2, y2 control the curve at the end

API Reference

easeCurve(options)

ParameterTypeDescription
optionsEaseCurveOptionsConfiguration object

EaseCurveOptions

PropertyTypeDescription
videostring | VideoOperationURL or generated video to apply easing to
easeCurveEaseCurveType | stringEasing preset or custom bezier (default: "easeInOutCubic")
targetDurationnumberOptional target duration in seconds

EaseCurveType

type EaseCurveType =
  | "linear"
  | "easeInOutSine"
  | "easeInOutCubic"
  | "easeInQuartOutQuad"
  | "easeInExpoOutCubic"
  | "easeInOutExpo";

How is this guide?

On this page