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:
| Preset | Intensity | Description |
|---|---|---|
linear | None | No easing, constant speed |
easeInOutSine | Subtle | Gentle slow-fast-slow |
easeInOutCubic | Standard | Balanced effect (default) |
easeInQuartOutQuad | Moderate | More pronounced than cubic |
easeInExpoOutCubic | Dramatic | Strong slowdown at start |
easeInOutExpo | Extreme | Almost 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, y1control the curve at the startx2, y2control the curve at the end
API Reference
easeCurve(options)
| Parameter | Type | Description |
|---|---|---|
options | EaseCurveOptions | Configuration object |
EaseCurveOptions
| Property | Type | Description |
|---|---|---|
video | string | VideoOperation | URL or generated video to apply easing to |
easeCurve | EaseCurveType | string | Easing preset or custom bezier (default: "easeInOutCubic") |
targetDuration | number | Optional target duration in seconds |
EaseCurveType
type EaseCurveType =
| "linear"
| "easeInOutSine"
| "easeInOutCubic"
| "easeInQuartOutQuad"
| "easeInExpoOutCubic"
| "easeInOutExpo";How is this guide?