src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const configSchematics = createConfigSchematics()
.field(
"samplingMode",
"select",
{
displayName: "Sampling mode",
subtitle: "How frames are picked out of the video.",
options: [
{ value: "fps", displayName: "Fixed FPS" },
{ value: "frameCount", displayName: "Fixed frame count (whole video)" },
],
},
"fps",
)
.field(
"fpsValue",
"numeric",
{
displayName: "FPS",
subtitle: "Frames per second to extract, in fixed FPS mode.",
min: 0.1,
max: 30,
step: 0.1,
slider: { min: 0.1, max: 30, step: 0.1 },
dependencies: [{ key: "samplingMode", condition: { type: "equals", value: "fps" } }],
},
1,
)
.field(
"frameCount",
"numeric",
{
displayName: "Frame count",
subtitle: "Total number of frames to extract across the whole video, in fixed frame count mode.",
int: true,
min: 1,
max: 100,
step: 1,
slider: { min: 1, max: 100, step: 1 },
dependencies: [{ key: "samplingMode", condition: { type: "equals", value: "frameCount" } }],
},
16,
)
.field(
"resolution",
"select",
{
displayName: "Resolution",
subtitle: "Maximum size per frame. Frames larger than this are downscaled (aspect ratio preserved).",
options: [
{ value: "300k", displayName: "~300k pixels" },
{ value: "600k", displayName: "~600k pixels" },
{ value: "1mpx", displayName: "~1 Mpx (default)" },
{ value: "2mpx", displayName: "~2 Mpx" },
{ value: "native", displayName: "Native (no downscale)" },
],
},
"1mpx",
)
.field(
"maxFramesPerVideo",
"numeric",
{
displayName: "Max frames per video",
subtitle:
"Safety cap. If the requested sampling would produce more frames, extraction is slowed down to stay under this limit.",
int: true,
min: 1,
max: 400,
step: 1,
},
100,
)
.build();
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const configSchematics = createConfigSchematics()
.field(
"samplingMode",
"select",
{
displayName: "Sampling mode",
subtitle: "How frames are picked out of the video.",
options: [
{ value: "fps", displayName: "Fixed FPS" },
{ value: "frameCount", displayName: "Fixed frame count (whole video)" },
],
},
"fps",
)
.field(
"fpsValue",
"numeric",
{
displayName: "FPS",
subtitle: "Frames per second to extract, in fixed FPS mode.",
min: 0.1,
max: 30,
step: 0.1,
slider: { min: 0.1, max: 30, step: 0.1 },
dependencies: [{ key: "samplingMode", condition: { type: "equals", value: "fps" } }],
},
1,
)
.field(
"frameCount",
"numeric",
{
displayName: "Frame count",
subtitle: "Total number of frames to extract across the whole video, in fixed frame count mode.",
int: true,
min: 1,
max: 100,
step: 1,
slider: { min: 1, max: 100, step: 1 },
dependencies: [{ key: "samplingMode", condition: { type: "equals", value: "frameCount" } }],
},
16,
)
.field(
"resolution",
"select",
{
displayName: "Resolution",
subtitle: "Maximum size per frame. Frames larger than this are downscaled (aspect ratio preserved).",
options: [
{ value: "300k", displayName: "~300k pixels" },
{ value: "600k", displayName: "~600k pixels" },
{ value: "1mpx", displayName: "~1 Mpx (default)" },
{ value: "2mpx", displayName: "~2 Mpx" },
{ value: "native", displayName: "Native (no downscale)" },
],
},
"1mpx",
)
.field(
"maxFramesPerVideo",
"numeric",
{
displayName: "Max frames per video",
subtitle:
"Safety cap. If the requested sampling would produce more frames, extraction is slowed down to stay under this limit.",
int: true,
min: 1,
max: 400,
step: 1,
},
100,
)
.build();