samsar-js 0.48.32 → 0.48.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/index.d.ts +57 -2
- package/dist/index.js +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,10 @@ const video = await samsar.createVideoFromText(
|
|
|
37
37
|
image_model: 'GPTIMAGE2',
|
|
38
38
|
video_model: 'RUNWAYML',
|
|
39
39
|
duration: 30,
|
|
40
|
+
backingtrack_model: 'LYRIA3',
|
|
41
|
+
tts_model: 'OPENAI',
|
|
42
|
+
speakerOptions: { openAISpeakers: ['nova'] },
|
|
43
|
+
inference_model: 'gpt-5.5',
|
|
40
44
|
font_key: 'Poppins',
|
|
41
45
|
enable_subtitles: true,
|
|
42
46
|
},
|
|
@@ -67,6 +71,10 @@ const videoFromImages = await samsar.createVideoFromImageList(
|
|
|
67
71
|
video_model: 'RUNWAYML',
|
|
68
72
|
aspect_ratio: '16:9',
|
|
69
73
|
language: 'en',
|
|
74
|
+
backingtrack_model: 'ELEVENLABS_MUSIC',
|
|
75
|
+
tts_model: 'ELEVENLABS',
|
|
76
|
+
speakerOptions: { elevenLabsSpeakers: ['EXAVITQu4vr4xnSDxMaL'] },
|
|
77
|
+
inference_model: 'gemini-3.1-pro',
|
|
70
78
|
font_key: 'Poppins',
|
|
71
79
|
enable_subtitles: true,
|
|
72
80
|
},
|
|
@@ -574,9 +582,11 @@ console.log(externalLibrary.data.requests.map((request) => request.request_id));
|
|
|
574
582
|
|
|
575
583
|
Video model support notes:
|
|
576
584
|
- `createVideoFromText` image model keys include: `GPTIMAGE2`, `IMAGEN4`, `SEEDREAM`, `NANOBANANA2`, `NANOBANANAPRO`, `CUSTOM_TEXT_TO_IMAGE`.
|
|
577
|
-
- `createVideoFromText` supports these video models: `RUNWAYML`, `VEO3.1I2V`, `VEO3.1I2VFAST`, `SEEDANCEI2V` (Seedance 1.5), `KLINGIMGTOVID3PRO`, and `HAPPYHORSEI2V`.
|
|
585
|
+
- `createVideoFromText` supports these video models: `RUNWAYML`, `VEO3.1I2V`, `VEO3.1I2VFAST`, `COSMOS3SUPERI2V`, `SEEDANCEI2V` (Seedance 1.5), `KLINGIMGTOVID3PRO`, and `HAPPYHORSEI2V`.
|
|
578
586
|
- `createVideoFromText` accepts either a provided outro (`outro_image_url`) or server-generated QR outro (`generate_outro_image: true` with `cta_url`). It can also render bottom CTA footer QR cards with `add_footer_animation` and `footer_metadata`; one footer item applies to every generated scene, while multiple items map by scene index.
|
|
579
|
-
- `createVideoFromImageList` supports `RUNWAYML`, `VEO3.1I2V`, `VEO3.1I2VFAST`, `SEEDANCEI2V`, `KLINGIMGTOVID3PRO`, and `HAPPYHORSEI2V` via `video_model`; if omitted, it defaults to `RUNWAYML`. It also accepts the same `image_model` keys as text-to-video. Use `aspect_ratio: '16:9'` or `'9:16'`; omitted or invalid values fall back to `16:9`.
|
|
587
|
+
- `createVideoFromImageList` supports `RUNWAYML`, `VEO3.1I2V`, `VEO3.1I2VFAST`, `COSMOS3SUPERI2V`, `SEEDANCEI2V`, `KLINGIMGTOVID3PRO`, and `HAPPYHORSEI2V` via `video_model`; if omitted, it defaults to `RUNWAYML`. It also accepts the same `image_model` keys as text-to-video. Use `aspect_ratio: '16:9'` or `'9:16'`; omitted or invalid values fall back to `16:9`.
|
|
588
|
+
- Text and image-list video creation both accept optional `backingtrack_model` / `backing_track_model` / `backingTrackModel` / `music_provider` / `musicProvider`, `tts_model` / `ttsModel` / `tts_provider` / `ttsProvider`, `speakerOptions` / `speaker_options`, and `inference_model` / `inferenceModel`. The adapter normalizes these to `backingtrack_model`, `tts_model`, `speakerOptions`, and `inference_model` in the request payload. Omit `inference_model` to use the account default; supported request values are `gpt-5.5` and `gemini-3.1-pro`. When `tts_model` is set, Samsar limits assignment to the matching speaker list (`openAISpeakers`, `elevenLabsSpeakers`, or `googleSpeakers`; Google TTS requests should include `googleSpeakerDetails`).
|
|
589
|
+
- `video_model_sub_type` is no longer used by the API and is stripped from text and image-list payloads before sending.
|
|
580
590
|
- `createVideoFromImageList` accepts either a provided outro (`outro_image_url`) or server-generated QR outro (`generate_outro_image: true` with `cta_url`). Do not combine the two modes in a single request.
|
|
581
591
|
- `createVideoFromImageList` can render per-scene footer QR cards by setting `add_footer_animation: true` and providing one `footer_metadata` item per image scene.
|
|
582
592
|
- `createVideoFromImageList` can also generate QR outro CTA text and each scene footer CTA from a single link by setting `express_cta_generation: true` with `cta_url`. CamelCase `expressCtaGeneration` and compatibility aliases `auto_generate_cta_text` / `generate_cta_texts` are normalized to the same API field.
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,36 @@ export interface FontOptions {
|
|
|
36
36
|
language?: string;
|
|
37
37
|
family?: string;
|
|
38
38
|
}
|
|
39
|
+
export type BackingTrackModel = 'LYRIA3' | 'LYRIA2' | 'ELEVENLABS_MUSIC' | 'Lyria 3' | 'Lyria 2' | 'ElevenLabs music' | string;
|
|
40
|
+
export type TTSModel = 'ELEVENLABS' | 'OPENAI' | 'GOOGLE' | 'ElevenLabs' | 'OpenAI' | 'Google TTS' | string;
|
|
41
|
+
export type InferenceModel = 'gpt-5.5' | 'GPT 5.5' | 'gemini-3.1-pro' | 'Gemini 3.1 Pro' | string;
|
|
42
|
+
export interface GoogleTTSSpeakerDetail {
|
|
43
|
+
provider?: 'GOOGLE' | string;
|
|
44
|
+
value?: string;
|
|
45
|
+
voiceId?: string;
|
|
46
|
+
name?: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
languageCode?: string;
|
|
49
|
+
languageCodes?: string[];
|
|
50
|
+
Gender?: 'M' | 'F' | '' | string | null;
|
|
51
|
+
gender?: string;
|
|
52
|
+
genderCode?: string;
|
|
53
|
+
ssmlGender?: string;
|
|
54
|
+
naturalSampleRateHertz?: number | null;
|
|
55
|
+
voiceType?: string;
|
|
56
|
+
previewRequiresAuth?: boolean;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
export interface TTSSpeakerOptions {
|
|
60
|
+
allowOpenAI?: boolean;
|
|
61
|
+
allowElevenLabs?: boolean;
|
|
62
|
+
allowGoogle?: boolean;
|
|
63
|
+
openAISpeakers?: string[];
|
|
64
|
+
elevenLabsSpeakers?: string[];
|
|
65
|
+
googleSpeakers?: string[];
|
|
66
|
+
googleSpeakerDetails?: GoogleTTSSpeakerDetail[];
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
}
|
|
39
69
|
export type V2StepGenerationMode = 'one_step' | 'two_step';
|
|
40
70
|
export interface V2StepGenerationOptions {
|
|
41
71
|
auto_render_full_video?: boolean;
|
|
@@ -50,7 +80,19 @@ export interface CreateVideoFromTextInput extends V2StepGenerationOptions {
|
|
|
50
80
|
duration: number;
|
|
51
81
|
tone?: string;
|
|
52
82
|
aspect_ratio?: string;
|
|
53
|
-
|
|
83
|
+
backingtrack_model?: BackingTrackModel;
|
|
84
|
+
backing_track_model?: BackingTrackModel;
|
|
85
|
+
backingTrackModel?: BackingTrackModel;
|
|
86
|
+
music_provider?: BackingTrackModel;
|
|
87
|
+
musicProvider?: BackingTrackModel;
|
|
88
|
+
tts_model?: TTSModel;
|
|
89
|
+
ttsModel?: TTSModel;
|
|
90
|
+
tts_provider?: TTSModel;
|
|
91
|
+
ttsProvider?: TTSModel;
|
|
92
|
+
inference_model?: InferenceModel;
|
|
93
|
+
inferenceModel?: InferenceModel;
|
|
94
|
+
speakerOptions?: TTSSpeakerOptions;
|
|
95
|
+
speaker_options?: TTSSpeakerOptions;
|
|
54
96
|
font_key?: string;
|
|
55
97
|
fontKey?: string;
|
|
56
98
|
subtitle_font?: string;
|
|
@@ -118,7 +160,7 @@ export interface FooterMetadataItem {
|
|
|
118
160
|
footerLogoImagePath?: string;
|
|
119
161
|
}
|
|
120
162
|
export type ImageListToVideoAspectRatio = '16:9' | '9:16';
|
|
121
|
-
export type ImageListToVideoModel = 'RUNWAYML' | 'VEO3.1I2V' | 'VEO3.1I2VFAST' | 'SEEDANCEI2V' | 'KLINGIMGTOVID3PRO' | 'HAPPYHORSEI2V';
|
|
163
|
+
export type ImageListToVideoModel = 'RUNWAYML' | 'VEO3.1I2V' | 'VEO3.1I2VFAST' | 'COSMOS3SUPERI2V' | 'SEEDANCEI2V' | 'KLINGIMGTOVID3PRO' | 'HAPPYHORSEI2V';
|
|
122
164
|
export interface ImageListToVideoItem {
|
|
123
165
|
image_url?: string;
|
|
124
166
|
imageUrl?: string;
|
|
@@ -155,6 +197,19 @@ export interface CreateVideoFromImageListInput extends V2StepGenerationOptions {
|
|
|
155
197
|
aspectRatio?: ImageListToVideoAspectRatio;
|
|
156
198
|
language?: string;
|
|
157
199
|
languageString?: string | null;
|
|
200
|
+
backingtrack_model?: BackingTrackModel;
|
|
201
|
+
backing_track_model?: BackingTrackModel;
|
|
202
|
+
backingTrackModel?: BackingTrackModel;
|
|
203
|
+
music_provider?: BackingTrackModel;
|
|
204
|
+
musicProvider?: BackingTrackModel;
|
|
205
|
+
tts_model?: TTSModel;
|
|
206
|
+
ttsModel?: TTSModel;
|
|
207
|
+
tts_provider?: TTSModel;
|
|
208
|
+
ttsProvider?: TTSModel;
|
|
209
|
+
inference_model?: InferenceModel;
|
|
210
|
+
inferenceModel?: InferenceModel;
|
|
211
|
+
speakerOptions?: TTSSpeakerOptions;
|
|
212
|
+
speaker_options?: TTSSpeakerOptions;
|
|
158
213
|
font_key?: string;
|
|
159
214
|
fontKey?: string;
|
|
160
215
|
subtitle_font?: string;
|
package/dist/index.js
CHANGED
|
@@ -137,6 +137,10 @@ function normalizeCreateVideoFromTextInput(input) {
|
|
|
137
137
|
['cta_logo', ['cta_logo', 'ctaLogo']],
|
|
138
138
|
['add_footer_animation', ['add_footer_animation', 'addFooterAnimation']],
|
|
139
139
|
['footer_metadata', ['footer_metadata', 'footerMetadata']],
|
|
140
|
+
['backingtrack_model', ['backingtrack_model', 'backing_track_model', 'backingTrackModel', 'music_provider', 'musicProvider']],
|
|
141
|
+
['tts_model', ['tts_model', 'ttsModel', 'tts_provider', 'ttsProvider']],
|
|
142
|
+
['inference_model', ['inference_model', 'inferenceModel']],
|
|
143
|
+
['speakerOptions', ['speakerOptions', 'speaker_options']],
|
|
140
144
|
['enable_subtitles', ['enable_subtitles', 'enableSubtitles']],
|
|
141
145
|
['font_key', ['font_key', 'fontKey']],
|
|
142
146
|
];
|
|
@@ -146,6 +150,8 @@ function normalizeCreateVideoFromTextInput(input) {
|
|
|
146
150
|
normalized[canonicalName] = value;
|
|
147
151
|
}
|
|
148
152
|
}
|
|
153
|
+
delete normalized.video_model_sub_type;
|
|
154
|
+
delete normalized.videoModelSubType;
|
|
149
155
|
assertOptionalBoolean(normalized.enable_subtitles, 'enable_subtitles', 'createVideoFromText');
|
|
150
156
|
assertOptionalBoolean(normalized.add_outro_animation, 'add_outro_animation', 'createVideoFromText');
|
|
151
157
|
assertOptionalBoolean(normalized.add_outro_focus_area, 'add_outro_focus_area', 'createVideoFromText');
|
|
@@ -193,6 +199,10 @@ function normalizeCreateVideoFromImageListInput(input) {
|
|
|
193
199
|
['cta_logo', ['cta_logo', 'ctaLogo']],
|
|
194
200
|
['add_footer_animation', ['add_footer_animation', 'addFooterAnimation']],
|
|
195
201
|
['footer_metadata', ['footer_metadata', 'footerMetadata']],
|
|
202
|
+
['backingtrack_model', ['backingtrack_model', 'backing_track_model', 'backingTrackModel', 'music_provider', 'musicProvider']],
|
|
203
|
+
['tts_model', ['tts_model', 'ttsModel', 'tts_provider', 'ttsProvider']],
|
|
204
|
+
['inference_model', ['inference_model', 'inferenceModel']],
|
|
205
|
+
['speakerOptions', ['speakerOptions', 'speaker_options']],
|
|
196
206
|
['limit_single_narrator', ['limit_single_narrator', 'limitSingleNarrator']],
|
|
197
207
|
['add_narrator_avatar', ['add_narrator_avatar', 'addNarratorAvatar']],
|
|
198
208
|
['enable_subtitles', ['enable_subtitles', 'enableSubtitles']],
|
|
@@ -204,6 +214,8 @@ function normalizeCreateVideoFromImageListInput(input) {
|
|
|
204
214
|
normalized[canonicalName] = value;
|
|
205
215
|
}
|
|
206
216
|
}
|
|
217
|
+
delete normalized.video_model_sub_type;
|
|
218
|
+
delete normalized.videoModelSubType;
|
|
207
219
|
assertOptionalBoolean(normalized.enable_subtitles, 'enable_subtitles');
|
|
208
220
|
assertOptionalBoolean(normalized.add_outro_animation, 'add_outro_animation');
|
|
209
221
|
assertOptionalBoolean(normalized.add_outro_focus_area, 'add_outro_focus_area');
|