@mynthio/sdk 0.0.42 → 0.0.43
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 +11 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +34 -1
- package/dist/types.d.ts +13 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -177,7 +177,6 @@ const task = await mynth.image.generate({
|
|
|
177
177
|
count: 2,
|
|
178
178
|
output: {
|
|
179
179
|
format: "webp",
|
|
180
|
-
quality: 80,
|
|
181
180
|
},
|
|
182
181
|
webhook: {
|
|
183
182
|
dashboard: false,
|
|
@@ -214,7 +213,7 @@ const task = await mynth.image.generate({
|
|
|
214
213
|
|
|
215
214
|
`access.pat.enabled` controls whether the create-task response includes a short-lived Public Access Token for browser-side polling. It defaults to `true`.
|
|
216
215
|
|
|
217
|
-
`output` is optional.
|
|
216
|
+
`output` is optional. Set `output.format` to `png`, `jpg`, or `webp`. When it is omitted, the result keeps the format the provider delivered.
|
|
218
217
|
|
|
219
218
|
## Upload Images
|
|
220
219
|
|
|
@@ -554,6 +553,7 @@ Current model IDs include:
|
|
|
554
553
|
- `alibaba/qwen-image-3.0-pro`
|
|
555
554
|
- `bytedance/seedream-5.0-lite`
|
|
556
555
|
- `bytedance/seedream-pro`
|
|
556
|
+
- `bytedance/seedream-v5-flash`
|
|
557
557
|
- `black-forest-labs/flux.1-dev`
|
|
558
558
|
- `black-forest-labs/flux-1-schnell`
|
|
559
559
|
- `black-forest-labs/flux.2-dev`
|
|
@@ -561,6 +561,7 @@ Current model IDs include:
|
|
|
561
561
|
- `black-forest-labs/flux.2-flex`
|
|
562
562
|
- `black-forest-labs/flux.2-max`
|
|
563
563
|
- `black-forest-labs/flux.2-klein-4b`
|
|
564
|
+
- `goofy-ai/prefect-pony-xl-lora`
|
|
564
565
|
- `google/gemini-3.1-flash-lite-image`
|
|
565
566
|
- `google/gemini-3.1-flash-image`
|
|
566
567
|
- `google/gemini-3-pro-image-preview`
|
|
@@ -577,6 +578,7 @@ Current model IDs include:
|
|
|
577
578
|
- `openai/gpt-image-2`
|
|
578
579
|
- `purplesmartai/pony-diffusion-v6-xl`
|
|
579
580
|
- `recraft/recraft-v4`
|
|
581
|
+
- `recraft/recraft-v4.1-flash`
|
|
580
582
|
- `recraft/recraft-v4-pro`
|
|
581
583
|
- `sourceful/riverflow-2.0-pro`
|
|
582
584
|
- `tongyi-mai/z-image`
|
|
@@ -705,13 +707,14 @@ console.log(model);
|
|
|
705
707
|
// }
|
|
706
708
|
```
|
|
707
709
|
|
|
708
|
-
| Model | Resolutions
|
|
709
|
-
| ------------------------------ |
|
|
710
|
-
| `bytedance/seedance-2.0-mini` | 480p, 720p
|
|
711
|
-
| `google/gemini-omni-flash-1.1` | 720p, 1080p, 4k
|
|
712
|
-
| `prunaai/p-video` | 720p, 1080p
|
|
710
|
+
| Model | Resolutions | Duration (s) | Inputs |
|
|
711
|
+
| ------------------------------ | ----------------- | ---------------- | ----------------------- |
|
|
712
|
+
| `bytedance/seedance-2.0-mini` | 480p, 720p | 4–15 (default 5) | first frame, last frame |
|
|
713
|
+
| `google/gemini-omni-flash-1.1` | 720p, 1080p, 4k | 3–10 (default 8) | first frame, last frame |
|
|
714
|
+
| `prunaai/p-video` | 720p, 1080p | 1–10 (default 5) | first frame |
|
|
715
|
+
| `xai/grok-imagine-video-1.5` | 480p, 720p, 1080p | 1–15 (default 8) | first frame |
|
|
713
716
|
|
|
714
|
-
|
|
717
|
+
Each of these supports generated audio.
|
|
715
718
|
|
|
716
719
|
`mynth.models.list()` covers these video models alongside the image catalog.
|
|
717
720
|
|
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export declare class ImageGenerationResult<MetadataT = Record<string, unknown> |
|
|
|
81
81
|
/** Current status of the task */
|
|
82
82
|
get status(): MynthSDKTypes.TaskStatus;
|
|
83
83
|
/**
|
|
84
|
-
* The generation result
|
|
84
|
+
* The generation result: images, the format each one was delivered in, and the model.
|
|
85
85
|
* Returns `null` if the task hasn't completed yet.
|
|
86
86
|
*/
|
|
87
87
|
get result(): TypedImageResult<RatingT> | null;
|
package/dist/index.js
CHANGED
|
@@ -57,6 +57,11 @@ const AVAILABLE_MODELS = [
|
|
|
57
57
|
label: "Seedream Pro",
|
|
58
58
|
capabilities: ["inputs"]
|
|
59
59
|
},
|
|
60
|
+
{
|
|
61
|
+
id: "bytedance/seedream-v5-flash",
|
|
62
|
+
label: "Seedream 5.0 Flash",
|
|
63
|
+
capabilities: ["inputs"]
|
|
64
|
+
},
|
|
60
65
|
{
|
|
61
66
|
id: "black-forest-labs/flux.1-dev",
|
|
62
67
|
label: "FLUX.1 Dev",
|
|
@@ -117,6 +122,11 @@ const AVAILABLE_MODELS = [
|
|
|
117
122
|
label: "Anima",
|
|
118
123
|
capabilities: ["inputs"]
|
|
119
124
|
},
|
|
125
|
+
{
|
|
126
|
+
id: "goofy-ai/prefect-pony-xl-lora",
|
|
127
|
+
label: "Prefect Pony XL LoRA",
|
|
128
|
+
capabilities: []
|
|
129
|
+
},
|
|
120
130
|
{
|
|
121
131
|
id: "john6666/bismuth-illustrious-mix",
|
|
122
132
|
label: "Bismuth Illustrious Mix",
|
|
@@ -192,6 +202,11 @@ const AVAILABLE_MODELS = [
|
|
|
192
202
|
label: "Recraft V4",
|
|
193
203
|
capabilities: []
|
|
194
204
|
},
|
|
205
|
+
{
|
|
206
|
+
id: "recraft/recraft-v4.1-flash",
|
|
207
|
+
label: "Recraft V4.1 Flash",
|
|
208
|
+
capabilities: []
|
|
209
|
+
},
|
|
195
210
|
{
|
|
196
211
|
id: "recraft/recraft-v4-pro",
|
|
197
212
|
label: "Recraft V4 Pro",
|
|
@@ -345,6 +360,24 @@ const AVAILABLE_VIDEO_MODELS = [
|
|
|
345
360
|
audio: true,
|
|
346
361
|
inputs: ["first_frame"],
|
|
347
362
|
maxInputs: 1
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
id: "xai/grok-imagine-video-1.5",
|
|
366
|
+
label: "Grok Imagine Video 1.5",
|
|
367
|
+
resolutions: [
|
|
368
|
+
"480p",
|
|
369
|
+
"720p",
|
|
370
|
+
"1080p"
|
|
371
|
+
],
|
|
372
|
+
defaultResolution: "480p",
|
|
373
|
+
duration: {
|
|
374
|
+
default: 8,
|
|
375
|
+
min: 1,
|
|
376
|
+
max: 15
|
|
377
|
+
},
|
|
378
|
+
audio: true,
|
|
379
|
+
inputs: ["first_frame"],
|
|
380
|
+
maxInputs: 1
|
|
348
381
|
}
|
|
349
382
|
];
|
|
350
383
|
//#endregion
|
|
@@ -475,7 +508,7 @@ var ImageGenerationResult = class {
|
|
|
475
508
|
return this.data.status;
|
|
476
509
|
}
|
|
477
510
|
/**
|
|
478
|
-
* The generation result
|
|
511
|
+
* The generation result: images, the format each one was delivered in, and the model.
|
|
479
512
|
* Returns `null` if the task hasn't completed yet.
|
|
480
513
|
*/
|
|
481
514
|
get result() {
|
package/dist/types.d.ts
CHANGED
|
@@ -130,16 +130,18 @@ declare namespace MynthSDKTypes {
|
|
|
130
130
|
type VideoGenerationTaskData = Extract<TaskData, {
|
|
131
131
|
type: "video.generate";
|
|
132
132
|
}>;
|
|
133
|
-
type
|
|
133
|
+
type ImageModelInputKind = "source" | "reference";
|
|
134
|
+
type VideoModelInputKind = "first_frame" | "last_frame" | "reference" | "source";
|
|
135
|
+
type ModelInputRule<Kind extends string = ImageModelInputKind | VideoModelInputKind> = {
|
|
134
136
|
type: "image";
|
|
135
137
|
/** Role the input plays. Absent means the rule accepts any image. */
|
|
136
|
-
kind?:
|
|
138
|
+
kind?: Kind;
|
|
137
139
|
min?: number;
|
|
138
140
|
max: number;
|
|
139
141
|
};
|
|
140
|
-
type ModelMode = {
|
|
142
|
+
type ModelMode<Kind extends string = ImageModelInputKind | VideoModelInputKind> = {
|
|
141
143
|
inputs?: {
|
|
142
|
-
rules: ModelInputRule[];
|
|
144
|
+
rules: ModelInputRule<Kind>[];
|
|
143
145
|
maxTotal?: number;
|
|
144
146
|
};
|
|
145
147
|
};
|
|
@@ -163,19 +165,19 @@ declare namespace MynthSDKTypes {
|
|
|
163
165
|
id: string;
|
|
164
166
|
displayName: string | null;
|
|
165
167
|
type: "image";
|
|
166
|
-
modes: Partial<Record<"txt->img" | "img->img", ModelMode
|
|
168
|
+
modes: Partial<Record<"txt->img" | "img->img", ModelMode<ImageModelInputKind>>>;
|
|
167
169
|
pricing: ImageModelPricing | null;
|
|
168
170
|
};
|
|
169
171
|
type VideoModel = {
|
|
170
172
|
id: string;
|
|
171
173
|
displayName: string | null;
|
|
172
174
|
type: "video";
|
|
173
|
-
modes: Partial<Record<"txt->vid" | "img->vid", ModelMode
|
|
175
|
+
modes: Partial<Record<"txt->vid" | "img->vid", ModelMode<VideoModelInputKind>>>;
|
|
174
176
|
pricing: VideoModelPricing | null;
|
|
175
177
|
};
|
|
176
178
|
type Model = ImageModel | VideoModel;
|
|
177
179
|
type ModelsListResponse = ApiResponse<Model[]>;
|
|
178
|
-
type ImageGenerationModelId = "alibaba/qwen-image-2.0" | "alibaba/qwen-image-2.0-pro" | "alibaba/qwen-image-3.0" | "alibaba/qwen-image-3.0-pro" | "bytedance/seedream-5.0-lite" | "bytedance/seedream-pro" | "black-forest-labs/flux.1-dev" | "black-forest-labs/flux-1-schnell" | "black-forest-labs/flux.2-dev" | "black-forest-labs/flux.2-pro" | "black-forest-labs/flux.2-flex" | "black-forest-labs/flux.2-max" | "black-forest-labs/flux.2-klein-4b" | "bria/fibo-edit-1.5" | "bria/fibo-generate-1.5" | "circlestone-labs/anima" | "google/gemini-3.1-flash-lite-image" | "google/gemini-3.1-flash-image" | "google/gemini-3-pro-image-preview" | "imagineart/imagineart-1.5-pro" | "imagineart/imagineart-2.0" | "klingai/kling-image-3.0" | "klingai/kling-image-o3" | "krea/krea-2-turbo" | "krea/krea-2-medium" | "krea/krea-2-large" | "luma/uni-1" | "luma/uni-1-max" | "meta/muse-image" | "microsoft/mai-image-2.6" | "microsoft/mai-image-2.6-flash" | "minimax/h3" | "openai/gpt-image-2" | "openai/gpt-image-2.5-flare" | "openai/gpt-image-2.5-sunburst" | "tongyi-mai/z-image" | "tongyi-mai/z-image-turbo" | "john6666/bismuth-illustrious-mix" | "maxfeifei8/one-obsession" | "purplesmartai/pony-diffusion-v6-xl" | "recraft/recraft-v4" | "recraft/recraft-v4-pro" | "reve/reve" | "reve/reve-remix" | "sourceful/riverflow-2.0-pro" | "wan/wan2.6-image" | "wan/wan2.7-image" | "wan/wan2.7-image-pro" | "xai/grok-imagine-image" | "xai/grok-imagine-image-2.0" | "xai/grok-imagine-image-quality";
|
|
180
|
+
type ImageGenerationModelId = "alibaba/qwen-image-2.0" | "alibaba/qwen-image-2.0-pro" | "alibaba/qwen-image-3.0" | "alibaba/qwen-image-3.0-pro" | "bytedance/seedream-5.0-lite" | "bytedance/seedream-pro" | "bytedance/seedream-v5-flash" | "black-forest-labs/flux.1-dev" | "black-forest-labs/flux-1-schnell" | "black-forest-labs/flux.2-dev" | "black-forest-labs/flux.2-pro" | "black-forest-labs/flux.2-flex" | "black-forest-labs/flux.2-max" | "black-forest-labs/flux.2-klein-4b" | "bria/fibo-edit-1.5" | "bria/fibo-generate-1.5" | "circlestone-labs/anima" | "goofy-ai/prefect-pony-xl-lora" | "google/gemini-3.1-flash-lite-image" | "google/gemini-3.1-flash-image" | "google/gemini-3-pro-image-preview" | "imagineart/imagineart-1.5-pro" | "imagineart/imagineart-2.0" | "klingai/kling-image-3.0" | "klingai/kling-image-o3" | "krea/krea-2-turbo" | "krea/krea-2-medium" | "krea/krea-2-large" | "luma/uni-1" | "luma/uni-1-max" | "meta/muse-image" | "microsoft/mai-image-2.6" | "microsoft/mai-image-2.6-flash" | "minimax/h3" | "openai/gpt-image-2" | "openai/gpt-image-2.5-flare" | "openai/gpt-image-2.5-sunburst" | "tongyi-mai/z-image" | "tongyi-mai/z-image-turbo" | "john6666/bismuth-illustrious-mix" | "maxfeifei8/one-obsession" | "purplesmartai/pony-diffusion-v6-xl" | "recraft/recraft-v4" | "recraft/recraft-v4.1-flash" | "recraft/recraft-v4-pro" | "reve/reve" | "reve/reve-remix" | "sourceful/riverflow-2.0-pro" | "wan/wan2.6-image" | "wan/wan2.7-image" | "wan/wan2.7-image-pro" | "xai/grok-imagine-image" | "xai/grok-imagine-image-2.0" | "xai/grok-imagine-image-quality";
|
|
179
181
|
type ImageGenerationModel = ImageGenerationModelId | "auto";
|
|
180
182
|
type GenerateImageOptionsIn = {
|
|
181
183
|
prompt: string;
|
|
@@ -186,9 +188,8 @@ declare namespace MynthSDKTypes {
|
|
|
186
188
|
type ImageGenerationRequestPrompt = GenerateImageOptionsIn["prompt"];
|
|
187
189
|
type ImageGenerationRequestOutputFormat = "png" | "jpg" | "webp";
|
|
188
190
|
type ImageGenerationRequestOutput = {
|
|
189
|
-
format
|
|
190
|
-
|
|
191
|
-
quality: number;
|
|
191
|
+
/** Converts the result to this format. When omitted, the provider's format is kept. */
|
|
192
|
+
format?: ImageGenerationRequestOutputFormat;
|
|
192
193
|
};
|
|
193
194
|
type ImageGenerationRequestCustomWebhook = {
|
|
194
195
|
url: string;
|
|
@@ -293,7 +294,7 @@ declare namespace MynthSDKTypes {
|
|
|
293
294
|
url: string | null;
|
|
294
295
|
mynth_url: string;
|
|
295
296
|
size: string;
|
|
296
|
-
|
|
297
|
+
format: ImageGenerationRequestOutputFormat;
|
|
297
298
|
destination?: ImageResultDestination;
|
|
298
299
|
rating?: ImageResultRating;
|
|
299
300
|
};
|
|
@@ -434,7 +435,7 @@ declare namespace MynthSDKTypes {
|
|
|
434
435
|
type ImageRemoveBackgroundTaskResult = {
|
|
435
436
|
image: ImageRemoveBackgroundResultImage;
|
|
436
437
|
};
|
|
437
|
-
type VideoGenerationModelId = "bytedance/seedance-2.0-mini" | "google/gemini-omni-flash-1.1" | "prunaai/p-video";
|
|
438
|
+
type VideoGenerationModelId = "bytedance/seedance-2.0-mini" | "google/gemini-omni-flash-1.1" | "prunaai/p-video" | "xai/grok-imagine-video-1.5";
|
|
438
439
|
type VideoGenerationModel = VideoGenerationModelId;
|
|
439
440
|
type VideoGenerationRequestResolution = "480p" | "720p" | "1080p" | "4k";
|
|
440
441
|
type VideoGenerationRequestWebhook = ImageGenerationRequestWebhook;
|