Skip to content

Commit 1fbaa42

Browse files
chengzeyiclaude
andcommitted
Kling 4.0: one 4k resolution list for every mode, as in the dashboard
Edit and extend take 4k now (checked live), so the per-mode lists are gone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent dfb1bd8 commit 1fbaa42

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

‎src/lib/media-models.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ export type VideoModel = {
7878
turbo: boolean
7979
modes: VideoMode[]
8080
resolutions: string[]
81-
/** Narrower lists for the modes that cannot take every generation resolution (Kling 4.0 edit and extend have no 4k). */
82-
modeResolutions?: Partial<Record<VideoMode, string[]>>
8381
defaultResolution: string
8482
durations: [number, number]
8583
aspectRatios: string[]
@@ -128,7 +126,7 @@ export const VIDEO_MODELS: Record<VideoModelKey, VideoModel> = {
128126
'seedance-2.0-mini': seedance('seedance-2.0-mini', 'Seedance 2.0 Mini', 'bytedance/seedance-2.0-mini', false, false),
129127
'kling-4.0': {
130128
id: 'kling-4.0', label: 'Kling 4.0', family: 'kling-4.0', base: 'kwaivgi/kling-v4.0', turbo: false, modes: ['generate', 'edit', 'extend'],
131-
resolutions: ['720p', '1080p', '4k'], modeResolutions: { edit: ['720p', '1080p'], extend: ['720p', '1080p'] }, defaultResolution: '720p', durations: [3, 30],
129+
resolutions: ['720p', '1080p', '4k'], defaultResolution: '720p', durations: [3, 30],
132130
// Sound is always generated with the picture; there is no switch.
133131
aspectRatios: ['16:9', '9:16', '1:1', '21:9'], audio: false, maxRefs: { images: 10, videos: 5, audios: 3 },
134132
},
@@ -170,11 +168,6 @@ export function videoEndpoints(m: VideoModel): VideoEndpoints {
170168
}
171169
}
172170

173-
/** The resolutions a model offers in a mode. */
174-
export function videoResolutions(m: VideoModel, mode: VideoMode): string[] {
175-
return m.modeResolutions?.[mode] ?? m.resolutions
176-
}
177-
178171
/** The input names a model takes its reference media under (Kling 4.0 drops the reference_ prefix). */
179172
export function referenceFields(m: VideoModel): { images: string; videos: string; audios: string } {
180173
return m.family === 'kling-4.0'

‎src/lib/media-plan.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('fitInput', () => {
129129
expect(await input('kwaivgi/kling-v4.0/reference-to-video', { aspect_ratio: '4:3' }, ratios)).toEqual({ aspect_ratio: '16:9' });
130130
});
131131

132-
it('keeps 4k when the live Kling 4.0 schema offers it, and rounds it down where it does not (edit, extend)', async () => {
132+
it('keeps 4k when the live Kling 4.0 schema offers it, and rounds it down to the nearest tier where it does not', async () => {
133133
const res = (values: string[]) =>
134134
catalog({ 'kwaivgi/kling-v4.0/text-to-video': { resolution: { type: 'string', enum: values } } });
135135
expect(await input('kwaivgi/kling-v4.0/text-to-video', { resolution: '4k' }, res(['720p', '1080p', '4k']))).toEqual({ resolution: '4k' });

0 commit comments

Comments
 (0)