@howells/motif-sdk 0.3.1 → 0.4.0

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/dist/index.cjs CHANGED
@@ -24,6 +24,7 @@ __export(index_exports, {
24
24
  CREATIVE_FIELDS: () => CREATIVE_FIELDS,
25
25
  CREATIVE_TAXONOMY: () => CREATIVE_TAXONOMY,
26
26
  CreativeOptionError: () => CreativeOptionError,
27
+ EDIT_CAPABLE_MODELS: () => EDIT_CAPABLE_MODELS,
27
28
  FAL_TOOLS: () => FAL_TOOLS,
28
29
  FAL_TOOLS_CHECKED_AT: () => FAL_TOOLS_CHECKED_AT,
29
30
  FAL_TOOL_IDS: () => FAL_TOOL_IDS,
@@ -887,6 +888,9 @@ var GENERATION_MODELS = [
887
888
  "grok-image",
888
889
  "qwen"
889
890
  ];
891
+ var EDIT_CAPABLE_MODELS = GENERATION_MODELS.filter(
892
+ (id) => MODELS[id]?.supportsEdit
893
+ );
890
894
  var UTILITY_MODELS = ["clarity", "crystal", "rmbg", "bria"];
891
895
  var VIDEO_MODELS = ["kling"];
892
896
  var RECRAFT_STYLES = [
@@ -2256,6 +2260,23 @@ var FAL_TOOLS = {
2256
2260
  output_format: "png"
2257
2261
  }
2258
2262
  },
2263
+ "sam3-1-image": {
2264
+ name: "SAM 3.1 Image",
2265
+ endpoint: "fal-ai/sam-3-1/image",
2266
+ task: "promptable image segmentation",
2267
+ category: "segmentation",
2268
+ description: "Segment image objects with text, point, or box prompts. SAM 3.1 adds Object Multiplex for faster multi-object tracking.",
2269
+ inputKind: "image",
2270
+ inputField: "image_url",
2271
+ outputKeys: ["image", "masks", "metadata", "scores", "boxes"],
2272
+ pricing: "$0.005/request",
2273
+ sourceUrl: "https://fal.ai/models/fal-ai/sam-3-1/image",
2274
+ defaultOptions: {
2275
+ apply_mask: true,
2276
+ max_masks: 3,
2277
+ output_format: "png"
2278
+ }
2279
+ },
2259
2280
  "sam3-image-rle": {
2260
2281
  name: "SAM 3 Image RLE",
2261
2282
  endpoint: "fal-ai/sam-3/image-rle",
@@ -2907,6 +2928,7 @@ function toMotifError(error) {
2907
2928
  CREATIVE_FIELDS,
2908
2929
  CREATIVE_TAXONOMY,
2909
2930
  CreativeOptionError,
2931
+ EDIT_CAPABLE_MODELS,
2910
2932
  FAL_TOOLS,
2911
2933
  FAL_TOOLS_CHECKED_AT,
2912
2934
  FAL_TOOL_IDS,
package/dist/index.d.cts CHANGED
@@ -464,6 +464,8 @@ declare const VIDEO_IMAGE_TO_VIDEO_TOP_15: LeaderboardSnapshot;
464
464
 
465
465
  declare const MODELS: Record<string, ModelConfig>;
466
466
  declare const GENERATION_MODELS: readonly ["gpt2", "gpt", "banana2", "banana", "gemini", "gemini3", "seedream4", "seedream45", "flux2-max", "flux2-pro", "flux2-flex", "flux2-dev", "flux", "flux-fast", "recraft", "ideogram", "grok-image", "qwen"];
467
+ /** Models whose fal endpoints support image editing (vary/edit flows). */
468
+ declare const EDIT_CAPABLE_MODELS: ("gpt2" | "gpt" | "banana2" | "banana" | "gemini" | "gemini3" | "seedream4" | "seedream45" | "flux2-max" | "flux2-pro" | "flux2-flex" | "flux2-dev" | "flux" | "flux-fast" | "recraft" | "ideogram" | "grok-image" | "qwen")[];
467
469
  declare const UTILITY_MODELS: readonly ["clarity", "crystal", "rmbg", "bria"];
468
470
  declare const VIDEO_MODELS: readonly ["kling"];
469
471
  type GenerationModelName = (typeof GENERATION_MODELS)[number];
@@ -783,6 +785,23 @@ declare class MotifServer {
783
785
  readonly output_format: "png";
784
786
  };
785
787
  };
788
+ readonly "sam3-1-image": {
789
+ readonly name: "SAM 3.1 Image";
790
+ readonly endpoint: "fal-ai/sam-3-1/image";
791
+ readonly task: "promptable image segmentation";
792
+ readonly category: "segmentation";
793
+ readonly description: "Segment image objects with text, point, or box prompts. SAM 3.1 adds Object Multiplex for faster multi-object tracking.";
794
+ readonly inputKind: "image";
795
+ readonly inputField: "image_url";
796
+ readonly outputKeys: ["image", "masks", "metadata", "scores", "boxes"];
797
+ readonly pricing: "$0.005/request";
798
+ readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3-1/image";
799
+ readonly defaultOptions: {
800
+ readonly apply_mask: true;
801
+ readonly max_masks: 3;
802
+ readonly output_format: "png";
803
+ };
804
+ };
786
805
  readonly "sam3-image-rle": {
787
806
  readonly name: "SAM 3 Image RLE";
788
807
  readonly endpoint: "fal-ai/sam-3/image-rle";
@@ -1163,6 +1182,23 @@ declare const FAL_TOOLS: {
1163
1182
  readonly output_format: "png";
1164
1183
  };
1165
1184
  };
1185
+ readonly "sam3-1-image": {
1186
+ readonly name: "SAM 3.1 Image";
1187
+ readonly endpoint: "fal-ai/sam-3-1/image";
1188
+ readonly task: "promptable image segmentation";
1189
+ readonly category: "segmentation";
1190
+ readonly description: "Segment image objects with text, point, or box prompts. SAM 3.1 adds Object Multiplex for faster multi-object tracking.";
1191
+ readonly inputKind: "image";
1192
+ readonly inputField: "image_url";
1193
+ readonly outputKeys: ["image", "masks", "metadata", "scores", "boxes"];
1194
+ readonly pricing: "$0.005/request";
1195
+ readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3-1/image";
1196
+ readonly defaultOptions: {
1197
+ readonly apply_mask: true;
1198
+ readonly max_masks: 3;
1199
+ readonly output_format: "png";
1200
+ };
1201
+ };
1166
1202
  readonly "sam3-image-rle": {
1167
1203
  readonly name: "SAM 3 Image RLE";
1168
1204
  readonly endpoint: "fal-ai/sam-3/image-rle";
@@ -1281,4 +1317,4 @@ type FalToolId = (typeof FAL_TOOL_IDS)[number];
1281
1317
  declare function isFalToolId(tool: string): tool is FalToolId;
1282
1318
  declare function buildFalToolRequest(options: FalToolRunOptions): FalToolRequest;
1283
1319
 
1284
- export { ASPECT_RATIOS, type AspectRatio, type BackgroundMode, CREATIVE_FIELDS, CREATIVE_TAXONOMY, type CreativeDirection, type CreativeField, type CreativeOption, CreativeOptionError, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, type EnrichPromptOptions, FAL_TOOLS, FAL_TOOLS_CHECKED_AT, FAL_TOOL_IDS, FORMAT_PRESETS, type FalImageSizePreset, type FalToolConfig, type FalToolId, type FalToolInputKind, type FalToolRequest, type FalToolRunOptions, GENERATION_MODELS, type GenerateOptions, type GenerationModelName, type GptImageSize, IDEOGRAM_STYLES, IMAGE_EDITING_TOP_20, IMAGE_TEXT_TO_IMAGE_TOP_20, type ImageOutputFormat, type ImageQuality, type ImageSize, type JobStatus, type LeaderboardEntry, type LeaderboardSnapshot, MODELS, type ModelConfig, type ModelType, type MotifEnv, MotifError, type MotifImage, type MotifResponse, MotifServer, type MotifServerConfig, type QueuedJob, RECRAFT_STYLES, RESOLUTIONS, type RemoveBackgroundOptions, type Resolution, type SizeMode, type ThinkingLevel, type ToolResponse, type ToolRunOptions, UTILITY_MODELS, type UpscaleOptions, VIDEO_IMAGE_TO_VIDEO_TOP_15, VIDEO_MODELS, VIDEO_TEXT_TO_VIDEO_TOP_15, type VideoOptions, type VideoResponse, aspectToFalImageSize, aspectToGptSize, buildFalToolRequest, buildGenerateBody, enrichPrompt, estimateCost, estimateVideoCost, getFalKeyFromEnv, isFalToolId, motifEnvSchema, parseMotifEnv, sanitizePrompt };
1320
+ export { ASPECT_RATIOS, type AspectRatio, type BackgroundMode, CREATIVE_FIELDS, CREATIVE_TAXONOMY, type CreativeDirection, type CreativeField, type CreativeOption, CreativeOptionError, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, EDIT_CAPABLE_MODELS, type EnrichPromptOptions, FAL_TOOLS, FAL_TOOLS_CHECKED_AT, FAL_TOOL_IDS, FORMAT_PRESETS, type FalImageSizePreset, type FalToolConfig, type FalToolId, type FalToolInputKind, type FalToolRequest, type FalToolRunOptions, GENERATION_MODELS, type GenerateOptions, type GenerationModelName, type GptImageSize, IDEOGRAM_STYLES, IMAGE_EDITING_TOP_20, IMAGE_TEXT_TO_IMAGE_TOP_20, type ImageOutputFormat, type ImageQuality, type ImageSize, type JobStatus, type LeaderboardEntry, type LeaderboardSnapshot, MODELS, type ModelConfig, type ModelType, type MotifEnv, MotifError, type MotifImage, type MotifResponse, MotifServer, type MotifServerConfig, type QueuedJob, RECRAFT_STYLES, RESOLUTIONS, type RemoveBackgroundOptions, type Resolution, type SizeMode, type ThinkingLevel, type ToolResponse, type ToolRunOptions, UTILITY_MODELS, type UpscaleOptions, VIDEO_IMAGE_TO_VIDEO_TOP_15, VIDEO_MODELS, VIDEO_TEXT_TO_VIDEO_TOP_15, type VideoOptions, type VideoResponse, aspectToFalImageSize, aspectToGptSize, buildFalToolRequest, buildGenerateBody, enrichPrompt, estimateCost, estimateVideoCost, getFalKeyFromEnv, isFalToolId, motifEnvSchema, parseMotifEnv, sanitizePrompt };
package/dist/index.d.ts CHANGED
@@ -464,6 +464,8 @@ declare const VIDEO_IMAGE_TO_VIDEO_TOP_15: LeaderboardSnapshot;
464
464
 
465
465
  declare const MODELS: Record<string, ModelConfig>;
466
466
  declare const GENERATION_MODELS: readonly ["gpt2", "gpt", "banana2", "banana", "gemini", "gemini3", "seedream4", "seedream45", "flux2-max", "flux2-pro", "flux2-flex", "flux2-dev", "flux", "flux-fast", "recraft", "ideogram", "grok-image", "qwen"];
467
+ /** Models whose fal endpoints support image editing (vary/edit flows). */
468
+ declare const EDIT_CAPABLE_MODELS: ("gpt2" | "gpt" | "banana2" | "banana" | "gemini" | "gemini3" | "seedream4" | "seedream45" | "flux2-max" | "flux2-pro" | "flux2-flex" | "flux2-dev" | "flux" | "flux-fast" | "recraft" | "ideogram" | "grok-image" | "qwen")[];
467
469
  declare const UTILITY_MODELS: readonly ["clarity", "crystal", "rmbg", "bria"];
468
470
  declare const VIDEO_MODELS: readonly ["kling"];
469
471
  type GenerationModelName = (typeof GENERATION_MODELS)[number];
@@ -783,6 +785,23 @@ declare class MotifServer {
783
785
  readonly output_format: "png";
784
786
  };
785
787
  };
788
+ readonly "sam3-1-image": {
789
+ readonly name: "SAM 3.1 Image";
790
+ readonly endpoint: "fal-ai/sam-3-1/image";
791
+ readonly task: "promptable image segmentation";
792
+ readonly category: "segmentation";
793
+ readonly description: "Segment image objects with text, point, or box prompts. SAM 3.1 adds Object Multiplex for faster multi-object tracking.";
794
+ readonly inputKind: "image";
795
+ readonly inputField: "image_url";
796
+ readonly outputKeys: ["image", "masks", "metadata", "scores", "boxes"];
797
+ readonly pricing: "$0.005/request";
798
+ readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3-1/image";
799
+ readonly defaultOptions: {
800
+ readonly apply_mask: true;
801
+ readonly max_masks: 3;
802
+ readonly output_format: "png";
803
+ };
804
+ };
786
805
  readonly "sam3-image-rle": {
787
806
  readonly name: "SAM 3 Image RLE";
788
807
  readonly endpoint: "fal-ai/sam-3/image-rle";
@@ -1163,6 +1182,23 @@ declare const FAL_TOOLS: {
1163
1182
  readonly output_format: "png";
1164
1183
  };
1165
1184
  };
1185
+ readonly "sam3-1-image": {
1186
+ readonly name: "SAM 3.1 Image";
1187
+ readonly endpoint: "fal-ai/sam-3-1/image";
1188
+ readonly task: "promptable image segmentation";
1189
+ readonly category: "segmentation";
1190
+ readonly description: "Segment image objects with text, point, or box prompts. SAM 3.1 adds Object Multiplex for faster multi-object tracking.";
1191
+ readonly inputKind: "image";
1192
+ readonly inputField: "image_url";
1193
+ readonly outputKeys: ["image", "masks", "metadata", "scores", "boxes"];
1194
+ readonly pricing: "$0.005/request";
1195
+ readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3-1/image";
1196
+ readonly defaultOptions: {
1197
+ readonly apply_mask: true;
1198
+ readonly max_masks: 3;
1199
+ readonly output_format: "png";
1200
+ };
1201
+ };
1166
1202
  readonly "sam3-image-rle": {
1167
1203
  readonly name: "SAM 3 Image RLE";
1168
1204
  readonly endpoint: "fal-ai/sam-3/image-rle";
@@ -1281,4 +1317,4 @@ type FalToolId = (typeof FAL_TOOL_IDS)[number];
1281
1317
  declare function isFalToolId(tool: string): tool is FalToolId;
1282
1318
  declare function buildFalToolRequest(options: FalToolRunOptions): FalToolRequest;
1283
1319
 
1284
- export { ASPECT_RATIOS, type AspectRatio, type BackgroundMode, CREATIVE_FIELDS, CREATIVE_TAXONOMY, type CreativeDirection, type CreativeField, type CreativeOption, CreativeOptionError, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, type EnrichPromptOptions, FAL_TOOLS, FAL_TOOLS_CHECKED_AT, FAL_TOOL_IDS, FORMAT_PRESETS, type FalImageSizePreset, type FalToolConfig, type FalToolId, type FalToolInputKind, type FalToolRequest, type FalToolRunOptions, GENERATION_MODELS, type GenerateOptions, type GenerationModelName, type GptImageSize, IDEOGRAM_STYLES, IMAGE_EDITING_TOP_20, IMAGE_TEXT_TO_IMAGE_TOP_20, type ImageOutputFormat, type ImageQuality, type ImageSize, type JobStatus, type LeaderboardEntry, type LeaderboardSnapshot, MODELS, type ModelConfig, type ModelType, type MotifEnv, MotifError, type MotifImage, type MotifResponse, MotifServer, type MotifServerConfig, type QueuedJob, RECRAFT_STYLES, RESOLUTIONS, type RemoveBackgroundOptions, type Resolution, type SizeMode, type ThinkingLevel, type ToolResponse, type ToolRunOptions, UTILITY_MODELS, type UpscaleOptions, VIDEO_IMAGE_TO_VIDEO_TOP_15, VIDEO_MODELS, VIDEO_TEXT_TO_VIDEO_TOP_15, type VideoOptions, type VideoResponse, aspectToFalImageSize, aspectToGptSize, buildFalToolRequest, buildGenerateBody, enrichPrompt, estimateCost, estimateVideoCost, getFalKeyFromEnv, isFalToolId, motifEnvSchema, parseMotifEnv, sanitizePrompt };
1320
+ export { ASPECT_RATIOS, type AspectRatio, type BackgroundMode, CREATIVE_FIELDS, CREATIVE_TAXONOMY, type CreativeDirection, type CreativeField, type CreativeOption, CreativeOptionError, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, EDIT_CAPABLE_MODELS, type EnrichPromptOptions, FAL_TOOLS, FAL_TOOLS_CHECKED_AT, FAL_TOOL_IDS, FORMAT_PRESETS, type FalImageSizePreset, type FalToolConfig, type FalToolId, type FalToolInputKind, type FalToolRequest, type FalToolRunOptions, GENERATION_MODELS, type GenerateOptions, type GenerationModelName, type GptImageSize, IDEOGRAM_STYLES, IMAGE_EDITING_TOP_20, IMAGE_TEXT_TO_IMAGE_TOP_20, type ImageOutputFormat, type ImageQuality, type ImageSize, type JobStatus, type LeaderboardEntry, type LeaderboardSnapshot, MODELS, type ModelConfig, type ModelType, type MotifEnv, MotifError, type MotifImage, type MotifResponse, MotifServer, type MotifServerConfig, type QueuedJob, RECRAFT_STYLES, RESOLUTIONS, type RemoveBackgroundOptions, type Resolution, type SizeMode, type ThinkingLevel, type ToolResponse, type ToolRunOptions, UTILITY_MODELS, type UpscaleOptions, VIDEO_IMAGE_TO_VIDEO_TOP_15, VIDEO_MODELS, VIDEO_TEXT_TO_VIDEO_TOP_15, type VideoOptions, type VideoResponse, aspectToFalImageSize, aspectToGptSize, buildFalToolRequest, buildGenerateBody, enrichPrompt, estimateCost, estimateVideoCost, getFalKeyFromEnv, isFalToolId, motifEnvSchema, parseMotifEnv, sanitizePrompt };
package/dist/index.js CHANGED
@@ -829,6 +829,9 @@ var GENERATION_MODELS = [
829
829
  "grok-image",
830
830
  "qwen"
831
831
  ];
832
+ var EDIT_CAPABLE_MODELS = GENERATION_MODELS.filter(
833
+ (id) => MODELS[id]?.supportsEdit
834
+ );
832
835
  var UTILITY_MODELS = ["clarity", "crystal", "rmbg", "bria"];
833
836
  var VIDEO_MODELS = ["kling"];
834
837
  var RECRAFT_STYLES = [
@@ -2198,6 +2201,23 @@ var FAL_TOOLS = {
2198
2201
  output_format: "png"
2199
2202
  }
2200
2203
  },
2204
+ "sam3-1-image": {
2205
+ name: "SAM 3.1 Image",
2206
+ endpoint: "fal-ai/sam-3-1/image",
2207
+ task: "promptable image segmentation",
2208
+ category: "segmentation",
2209
+ description: "Segment image objects with text, point, or box prompts. SAM 3.1 adds Object Multiplex for faster multi-object tracking.",
2210
+ inputKind: "image",
2211
+ inputField: "image_url",
2212
+ outputKeys: ["image", "masks", "metadata", "scores", "boxes"],
2213
+ pricing: "$0.005/request",
2214
+ sourceUrl: "https://fal.ai/models/fal-ai/sam-3-1/image",
2215
+ defaultOptions: {
2216
+ apply_mask: true,
2217
+ max_masks: 3,
2218
+ output_format: "png"
2219
+ }
2220
+ },
2201
2221
  "sam3-image-rle": {
2202
2222
  name: "SAM 3 Image RLE",
2203
2223
  endpoint: "fal-ai/sam-3/image-rle",
@@ -2848,6 +2868,7 @@ export {
2848
2868
  CREATIVE_FIELDS,
2849
2869
  CREATIVE_TAXONOMY,
2850
2870
  CreativeOptionError,
2871
+ EDIT_CAPABLE_MODELS,
2851
2872
  FAL_TOOLS,
2852
2873
  FAL_TOOLS_CHECKED_AT,
2853
2874
  FAL_TOOL_IDS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howells/motif-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Public Node SDK for Motif fal.ai generation, editing, utility tools, and model metadata.",
5
5
  "license": "MIT",
6
6
  "author": "Daniel Howells",