@howells/motif-sdk 0.3.2 → 0.5.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,
@@ -145,6 +146,7 @@ var AA_IMAGE_SOURCES = [
145
146
  "https://artificialanalysis.ai/image/leaderboard/editing"
146
147
  ];
147
148
  var FAL_PRICING_CHECKED_AT = "2026-05-12";
149
+ var FAL_PRICING_CHECKED_JUL_2026 = "2026-07-11";
148
150
  var MODELS = {
149
151
  // ─── Generation Models ────────────────────────────────────────
150
152
  gpt2: {
@@ -454,6 +456,58 @@ var MODELS = {
454
456
  supportsSyncMode: true,
455
457
  maxReferenceImages: 10
456
458
  },
459
+ seedream5: {
460
+ name: "Seedream 5.0 Pro",
461
+ endpoint: "bytedance/seedream/v5/pro/text-to-image",
462
+ editEndpoint: "bytedance/seedream/v5/pro/edit",
463
+ type: "generation",
464
+ // fal tiers Seedream v5 Pro by output size: $0.0675 up to 1536², $0.135 up to 2048².
465
+ pricing: "$0.0675 (\u22641536\xB2) / $0.135 (\u22642048\xB2)",
466
+ pricePerImageUsd: 0.0675,
467
+ falPricing: {
468
+ endpointId: "bytedance/seedream/v5/pro/text-to-image",
469
+ unitPrice: 0.0675,
470
+ unit: "images",
471
+ currency: "USD",
472
+ estimatedCostPerImageUsd: 0.0675,
473
+ source: "fal-pricing-api",
474
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
475
+ },
476
+ sizeMode: "image_size_enum",
477
+ supportsAspect: true,
478
+ supportsResolution: false,
479
+ supportsEdit: true,
480
+ supportsNumImages: true,
481
+ supportsSeed: true,
482
+ supportsSyncMode: true,
483
+ maxReferenceImages: 10
484
+ },
485
+ "seedream5-lite": {
486
+ name: "Seedream 5.0 Lite",
487
+ endpoint: "fal-ai/bytedance/seedream/v5/lite/text-to-image",
488
+ editEndpoint: "fal-ai/bytedance/seedream/v5/lite/edit",
489
+ type: "generation",
490
+ // Flat price regardless of resolution; native up to Auto 3K (~9.4MP).
491
+ pricing: "$0.035",
492
+ pricePerImageUsd: 0.035,
493
+ falPricing: {
494
+ endpointId: "fal-ai/bytedance/seedream/v5/lite/text-to-image",
495
+ unitPrice: 0.035,
496
+ unit: "images",
497
+ currency: "USD",
498
+ estimatedCostPerImageUsd: 0.035,
499
+ source: "fal-pricing-api",
500
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
501
+ },
502
+ sizeMode: "image_size_enum",
503
+ supportsAspect: true,
504
+ supportsResolution: false,
505
+ supportsEdit: true,
506
+ supportsNumImages: true,
507
+ supportsSeed: true,
508
+ supportsSyncMode: true,
509
+ maxReferenceImages: 10
510
+ },
457
511
  "flux2-max": {
458
512
  name: "FLUX.2 Max",
459
513
  endpoint: "fal-ai/flux-2-max",
@@ -587,7 +641,7 @@ var MODELS = {
587
641
  maxReferenceImages: 10
588
642
  },
589
643
  "flux2-dev": {
590
- name: "FLUX.2 Dev",
644
+ name: "FLUX.2 [dev]",
591
645
  endpoint: "fal-ai/flux-2",
592
646
  editEndpoint: "fal-ai/flux-2/edit",
593
647
  type: "generation",
@@ -630,6 +684,32 @@ var MODELS = {
630
684
  supportsSyncMode: true,
631
685
  maxReferenceImages: 10
632
686
  },
687
+ "flux2-turbo": {
688
+ name: "FLUX.2 Turbo",
689
+ endpoint: "fal-ai/flux-2/turbo",
690
+ type: "generation",
691
+ pricing: "$0.008/MP",
692
+ pricePerImageUsd: 8e-3,
693
+ falPricing: {
694
+ endpointId: "fal-ai/flux-2/turbo",
695
+ unitPrice: 8e-3,
696
+ unit: "megapixels",
697
+ currency: "USD",
698
+ estimatedCostPerImageUsd: 8e-3,
699
+ source: "fal-pricing-api",
700
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
701
+ },
702
+ sizeMode: "image_size_enum",
703
+ supportsAspect: true,
704
+ supportsResolution: false,
705
+ supportsEdit: false,
706
+ supportsNumImages: true,
707
+ supportsOutputFormat: true,
708
+ supportsSafetyChecker: true,
709
+ supportsSeed: true,
710
+ supportsGuidanceScale: true,
711
+ supportsSyncMode: true
712
+ },
633
713
  flux: {
634
714
  name: "FLUX Pro Ultra",
635
715
  endpoint: "fal-ai/flux-pro/v1.1-ultra",
@@ -708,6 +788,29 @@ var MODELS = {
708
788
  supportsStyle: true,
709
789
  supportsSyncMode: true
710
790
  },
791
+ recraft4: {
792
+ name: "Recraft V4",
793
+ endpoint: "fal-ai/recraft/v4/text-to-image",
794
+ type: "generation",
795
+ pricing: "$0.04",
796
+ pricePerImageUsd: 0.04,
797
+ falPricing: {
798
+ endpointId: "fal-ai/recraft/v4/text-to-image",
799
+ unitPrice: 0.04,
800
+ unit: "images",
801
+ currency: "USD",
802
+ estimatedCostPerImageUsd: 0.04,
803
+ source: "fal-pricing-api",
804
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
805
+ },
806
+ sizeMode: "image_size_enum",
807
+ supportsAspect: true,
808
+ supportsResolution: false,
809
+ supportsEdit: false,
810
+ supportsNumImages: false,
811
+ supportsStyle: true,
812
+ supportsSyncMode: true
813
+ },
711
814
  ideogram: {
712
815
  name: "Ideogram V3",
713
816
  endpoint: "fal-ai/ideogram/v3",
@@ -735,6 +838,36 @@ var MODELS = {
735
838
  supportsStyle: true,
736
839
  supportsSyncMode: true
737
840
  },
841
+ ideogram4: {
842
+ name: "Ideogram V4",
843
+ endpoint: "ideogram/v4",
844
+ type: "generation",
845
+ // fal bills v4 per output megapixel by rendering speed: TURBO $0.03, BALANCED
846
+ // $0.06, QUALITY $0.10 (plus a flat $0.03 when prompt expansion is used).
847
+ // Headline uses the TURBO 1MP rate, matching how ideogram v3 is modeled.
848
+ pricing: "$0.03",
849
+ pricePerImageUsd: 0.03,
850
+ falPricing: {
851
+ endpointId: "ideogram/v4",
852
+ unitPrice: 0.03,
853
+ unit: "megapixels",
854
+ currency: "USD",
855
+ estimatedCostPerImageUsd: 0.03,
856
+ source: "fal-pricing-api",
857
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
858
+ },
859
+ sizeMode: "image_size_enum",
860
+ supportsAspect: true,
861
+ supportsResolution: false,
862
+ supportsEdit: false,
863
+ supportsNumImages: true,
864
+ supportsRenderingSpeed: true,
865
+ supportsSeed: true,
866
+ supportsOutputFormat: true,
867
+ supportedOutputFormats: ["jpeg", "png"],
868
+ supportsSafetyChecker: true,
869
+ supportsSyncMode: true
870
+ },
738
871
  "grok-image": {
739
872
  name: "Grok Imagine Image",
740
873
  endpoint: "xai/grok-imagine-image",
@@ -830,7 +963,7 @@ var MODELS = {
830
963
  name: "Clarity Upscaler",
831
964
  endpoint: "fal-ai/clarity-upscaler",
832
965
  type: "utility",
833
- pricing: "$0.02",
966
+ pricing: "$0.03/MP",
834
967
  supportsAspect: false,
835
968
  supportsResolution: false,
836
969
  supportsEdit: false,
@@ -876,17 +1009,25 @@ var GENERATION_MODELS = [
876
1009
  "gemini3",
877
1010
  "seedream4",
878
1011
  "seedream45",
1012
+ "seedream5",
1013
+ "seedream5-lite",
879
1014
  "flux2-max",
880
1015
  "flux2-pro",
881
1016
  "flux2-flex",
882
1017
  "flux2-dev",
1018
+ "flux2-turbo",
883
1019
  "flux",
884
1020
  "flux-fast",
885
1021
  "recraft",
1022
+ "recraft4",
886
1023
  "ideogram",
1024
+ "ideogram4",
887
1025
  "grok-image",
888
1026
  "qwen"
889
1027
  ];
1028
+ var EDIT_CAPABLE_MODELS = GENERATION_MODELS.filter(
1029
+ (id) => MODELS[id]?.supportsEdit
1030
+ );
890
1031
  var UTILITY_MODELS = ["clarity", "crystal", "rmbg", "bria"];
891
1032
  var VIDEO_MODELS = ["kling"];
892
1033
  var RECRAFT_STYLES = [
@@ -941,6 +1082,9 @@ function estimateCost(model, resolution, numImages = 1) {
941
1082
  if ((model === "banana" || model === "gemini3") && resolution === "4K") {
942
1083
  return configuredPrice * 2 * numImages;
943
1084
  }
1085
+ if (model === "seedream5" && (resolution === "2K" || resolution === "4K")) {
1086
+ return configuredPrice * 2 * numImages;
1087
+ }
944
1088
  if (model === "banana2") {
945
1089
  const multiplier = resolution === "4K" ? 2 : resolution === "2K" ? 1.5 : resolution === "0.5K" ? 0.75 : 1;
946
1090
  return configuredPrice * multiplier * numImages;
@@ -965,6 +1109,7 @@ function estimateCost(model, resolution, numImages = 1) {
965
1109
  case "flux-fast":
966
1110
  return 3e-3 * numImages;
967
1111
  case "clarity":
1112
+ return 0.03 * numImages;
968
1113
  case "crystal":
969
1114
  case "rmbg":
970
1115
  case "bria":
@@ -2924,6 +3069,7 @@ function toMotifError(error) {
2924
3069
  CREATIVE_FIELDS,
2925
3070
  CREATIVE_TAXONOMY,
2926
3071
  CreativeOptionError,
3072
+ EDIT_CAPABLE_MODELS,
2927
3073
  FAL_TOOLS,
2928
3074
  FAL_TOOLS_CHECKED_AT,
2929
3075
  FAL_TOOL_IDS,
package/dist/index.d.cts CHANGED
@@ -463,7 +463,9 @@ declare const VIDEO_TEXT_TO_VIDEO_TOP_15: LeaderboardSnapshot;
463
463
  declare const VIDEO_IMAGE_TO_VIDEO_TOP_15: LeaderboardSnapshot;
464
464
 
465
465
  declare const MODELS: Record<string, ModelConfig>;
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"];
466
+ declare const GENERATION_MODELS: readonly ["gpt2", "gpt", "banana2", "banana", "gemini", "gemini3", "seedream4", "seedream45", "seedream5", "seedream5-lite", "flux2-max", "flux2-pro", "flux2-flex", "flux2-dev", "flux2-turbo", "flux", "flux-fast", "recraft", "recraft4", "ideogram", "ideogram4", "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" | "seedream5" | "seedream5-lite" | "flux2-max" | "flux2-pro" | "flux2-flex" | "flux2-dev" | "flux2-turbo" | "flux" | "flux-fast" | "recraft" | "recraft4" | "ideogram" | "ideogram4" | "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];
@@ -552,7 +554,7 @@ declare class MotifServer {
552
554
  /** Model registry. */
553
555
  get models(): Record<string, ModelConfig>;
554
556
  /** Generation model keys. */
555
- get generationModels(): 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"];
557
+ get generationModels(): readonly ["gpt2", "gpt", "banana2", "banana", "gemini", "gemini3", "seedream4", "seedream45", "seedream5", "seedream5-lite", "flux2-max", "flux2-pro", "flux2-flex", "flux2-dev", "flux2-turbo", "flux", "flux-fast", "recraft", "recraft4", "ideogram", "ideogram4", "grok-image", "qwen"];
556
558
  /** Utility model keys. */
557
559
  get utilityModels(): readonly ["clarity", "crystal", "rmbg", "bria"];
558
560
  /** Registered fal utility/tool endpoints. */
@@ -1315,4 +1317,4 @@ type FalToolId = (typeof FAL_TOOL_IDS)[number];
1315
1317
  declare function isFalToolId(tool: string): tool is FalToolId;
1316
1318
  declare function buildFalToolRequest(options: FalToolRunOptions): FalToolRequest;
1317
1319
 
1318
- 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
@@ -463,7 +463,9 @@ declare const VIDEO_TEXT_TO_VIDEO_TOP_15: LeaderboardSnapshot;
463
463
  declare const VIDEO_IMAGE_TO_VIDEO_TOP_15: LeaderboardSnapshot;
464
464
 
465
465
  declare const MODELS: Record<string, ModelConfig>;
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"];
466
+ declare const GENERATION_MODELS: readonly ["gpt2", "gpt", "banana2", "banana", "gemini", "gemini3", "seedream4", "seedream45", "seedream5", "seedream5-lite", "flux2-max", "flux2-pro", "flux2-flex", "flux2-dev", "flux2-turbo", "flux", "flux-fast", "recraft", "recraft4", "ideogram", "ideogram4", "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" | "seedream5" | "seedream5-lite" | "flux2-max" | "flux2-pro" | "flux2-flex" | "flux2-dev" | "flux2-turbo" | "flux" | "flux-fast" | "recraft" | "recraft4" | "ideogram" | "ideogram4" | "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];
@@ -552,7 +554,7 @@ declare class MotifServer {
552
554
  /** Model registry. */
553
555
  get models(): Record<string, ModelConfig>;
554
556
  /** Generation model keys. */
555
- get generationModels(): 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"];
557
+ get generationModels(): readonly ["gpt2", "gpt", "banana2", "banana", "gemini", "gemini3", "seedream4", "seedream45", "seedream5", "seedream5-lite", "flux2-max", "flux2-pro", "flux2-flex", "flux2-dev", "flux2-turbo", "flux", "flux-fast", "recraft", "recraft4", "ideogram", "ideogram4", "grok-image", "qwen"];
556
558
  /** Utility model keys. */
557
559
  get utilityModels(): readonly ["clarity", "crystal", "rmbg", "bria"];
558
560
  /** Registered fal utility/tool endpoints. */
@@ -1315,4 +1317,4 @@ type FalToolId = (typeof FAL_TOOL_IDS)[number];
1315
1317
  declare function isFalToolId(tool: string): tool is FalToolId;
1316
1318
  declare function buildFalToolRequest(options: FalToolRunOptions): FalToolRequest;
1317
1319
 
1318
- 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
@@ -87,6 +87,7 @@ var AA_IMAGE_SOURCES = [
87
87
  "https://artificialanalysis.ai/image/leaderboard/editing"
88
88
  ];
89
89
  var FAL_PRICING_CHECKED_AT = "2026-05-12";
90
+ var FAL_PRICING_CHECKED_JUL_2026 = "2026-07-11";
90
91
  var MODELS = {
91
92
  // ─── Generation Models ────────────────────────────────────────
92
93
  gpt2: {
@@ -396,6 +397,58 @@ var MODELS = {
396
397
  supportsSyncMode: true,
397
398
  maxReferenceImages: 10
398
399
  },
400
+ seedream5: {
401
+ name: "Seedream 5.0 Pro",
402
+ endpoint: "bytedance/seedream/v5/pro/text-to-image",
403
+ editEndpoint: "bytedance/seedream/v5/pro/edit",
404
+ type: "generation",
405
+ // fal tiers Seedream v5 Pro by output size: $0.0675 up to 1536², $0.135 up to 2048².
406
+ pricing: "$0.0675 (\u22641536\xB2) / $0.135 (\u22642048\xB2)",
407
+ pricePerImageUsd: 0.0675,
408
+ falPricing: {
409
+ endpointId: "bytedance/seedream/v5/pro/text-to-image",
410
+ unitPrice: 0.0675,
411
+ unit: "images",
412
+ currency: "USD",
413
+ estimatedCostPerImageUsd: 0.0675,
414
+ source: "fal-pricing-api",
415
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
416
+ },
417
+ sizeMode: "image_size_enum",
418
+ supportsAspect: true,
419
+ supportsResolution: false,
420
+ supportsEdit: true,
421
+ supportsNumImages: true,
422
+ supportsSeed: true,
423
+ supportsSyncMode: true,
424
+ maxReferenceImages: 10
425
+ },
426
+ "seedream5-lite": {
427
+ name: "Seedream 5.0 Lite",
428
+ endpoint: "fal-ai/bytedance/seedream/v5/lite/text-to-image",
429
+ editEndpoint: "fal-ai/bytedance/seedream/v5/lite/edit",
430
+ type: "generation",
431
+ // Flat price regardless of resolution; native up to Auto 3K (~9.4MP).
432
+ pricing: "$0.035",
433
+ pricePerImageUsd: 0.035,
434
+ falPricing: {
435
+ endpointId: "fal-ai/bytedance/seedream/v5/lite/text-to-image",
436
+ unitPrice: 0.035,
437
+ unit: "images",
438
+ currency: "USD",
439
+ estimatedCostPerImageUsd: 0.035,
440
+ source: "fal-pricing-api",
441
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
442
+ },
443
+ sizeMode: "image_size_enum",
444
+ supportsAspect: true,
445
+ supportsResolution: false,
446
+ supportsEdit: true,
447
+ supportsNumImages: true,
448
+ supportsSeed: true,
449
+ supportsSyncMode: true,
450
+ maxReferenceImages: 10
451
+ },
399
452
  "flux2-max": {
400
453
  name: "FLUX.2 Max",
401
454
  endpoint: "fal-ai/flux-2-max",
@@ -529,7 +582,7 @@ var MODELS = {
529
582
  maxReferenceImages: 10
530
583
  },
531
584
  "flux2-dev": {
532
- name: "FLUX.2 Dev",
585
+ name: "FLUX.2 [dev]",
533
586
  endpoint: "fal-ai/flux-2",
534
587
  editEndpoint: "fal-ai/flux-2/edit",
535
588
  type: "generation",
@@ -572,6 +625,32 @@ var MODELS = {
572
625
  supportsSyncMode: true,
573
626
  maxReferenceImages: 10
574
627
  },
628
+ "flux2-turbo": {
629
+ name: "FLUX.2 Turbo",
630
+ endpoint: "fal-ai/flux-2/turbo",
631
+ type: "generation",
632
+ pricing: "$0.008/MP",
633
+ pricePerImageUsd: 8e-3,
634
+ falPricing: {
635
+ endpointId: "fal-ai/flux-2/turbo",
636
+ unitPrice: 8e-3,
637
+ unit: "megapixels",
638
+ currency: "USD",
639
+ estimatedCostPerImageUsd: 8e-3,
640
+ source: "fal-pricing-api",
641
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
642
+ },
643
+ sizeMode: "image_size_enum",
644
+ supportsAspect: true,
645
+ supportsResolution: false,
646
+ supportsEdit: false,
647
+ supportsNumImages: true,
648
+ supportsOutputFormat: true,
649
+ supportsSafetyChecker: true,
650
+ supportsSeed: true,
651
+ supportsGuidanceScale: true,
652
+ supportsSyncMode: true
653
+ },
575
654
  flux: {
576
655
  name: "FLUX Pro Ultra",
577
656
  endpoint: "fal-ai/flux-pro/v1.1-ultra",
@@ -650,6 +729,29 @@ var MODELS = {
650
729
  supportsStyle: true,
651
730
  supportsSyncMode: true
652
731
  },
732
+ recraft4: {
733
+ name: "Recraft V4",
734
+ endpoint: "fal-ai/recraft/v4/text-to-image",
735
+ type: "generation",
736
+ pricing: "$0.04",
737
+ pricePerImageUsd: 0.04,
738
+ falPricing: {
739
+ endpointId: "fal-ai/recraft/v4/text-to-image",
740
+ unitPrice: 0.04,
741
+ unit: "images",
742
+ currency: "USD",
743
+ estimatedCostPerImageUsd: 0.04,
744
+ source: "fal-pricing-api",
745
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
746
+ },
747
+ sizeMode: "image_size_enum",
748
+ supportsAspect: true,
749
+ supportsResolution: false,
750
+ supportsEdit: false,
751
+ supportsNumImages: false,
752
+ supportsStyle: true,
753
+ supportsSyncMode: true
754
+ },
653
755
  ideogram: {
654
756
  name: "Ideogram V3",
655
757
  endpoint: "fal-ai/ideogram/v3",
@@ -677,6 +779,36 @@ var MODELS = {
677
779
  supportsStyle: true,
678
780
  supportsSyncMode: true
679
781
  },
782
+ ideogram4: {
783
+ name: "Ideogram V4",
784
+ endpoint: "ideogram/v4",
785
+ type: "generation",
786
+ // fal bills v4 per output megapixel by rendering speed: TURBO $0.03, BALANCED
787
+ // $0.06, QUALITY $0.10 (plus a flat $0.03 when prompt expansion is used).
788
+ // Headline uses the TURBO 1MP rate, matching how ideogram v3 is modeled.
789
+ pricing: "$0.03",
790
+ pricePerImageUsd: 0.03,
791
+ falPricing: {
792
+ endpointId: "ideogram/v4",
793
+ unitPrice: 0.03,
794
+ unit: "megapixels",
795
+ currency: "USD",
796
+ estimatedCostPerImageUsd: 0.03,
797
+ source: "fal-pricing-api",
798
+ checkedAt: FAL_PRICING_CHECKED_JUL_2026
799
+ },
800
+ sizeMode: "image_size_enum",
801
+ supportsAspect: true,
802
+ supportsResolution: false,
803
+ supportsEdit: false,
804
+ supportsNumImages: true,
805
+ supportsRenderingSpeed: true,
806
+ supportsSeed: true,
807
+ supportsOutputFormat: true,
808
+ supportedOutputFormats: ["jpeg", "png"],
809
+ supportsSafetyChecker: true,
810
+ supportsSyncMode: true
811
+ },
680
812
  "grok-image": {
681
813
  name: "Grok Imagine Image",
682
814
  endpoint: "xai/grok-imagine-image",
@@ -772,7 +904,7 @@ var MODELS = {
772
904
  name: "Clarity Upscaler",
773
905
  endpoint: "fal-ai/clarity-upscaler",
774
906
  type: "utility",
775
- pricing: "$0.02",
907
+ pricing: "$0.03/MP",
776
908
  supportsAspect: false,
777
909
  supportsResolution: false,
778
910
  supportsEdit: false,
@@ -818,17 +950,25 @@ var GENERATION_MODELS = [
818
950
  "gemini3",
819
951
  "seedream4",
820
952
  "seedream45",
953
+ "seedream5",
954
+ "seedream5-lite",
821
955
  "flux2-max",
822
956
  "flux2-pro",
823
957
  "flux2-flex",
824
958
  "flux2-dev",
959
+ "flux2-turbo",
825
960
  "flux",
826
961
  "flux-fast",
827
962
  "recraft",
963
+ "recraft4",
828
964
  "ideogram",
965
+ "ideogram4",
829
966
  "grok-image",
830
967
  "qwen"
831
968
  ];
969
+ var EDIT_CAPABLE_MODELS = GENERATION_MODELS.filter(
970
+ (id) => MODELS[id]?.supportsEdit
971
+ );
832
972
  var UTILITY_MODELS = ["clarity", "crystal", "rmbg", "bria"];
833
973
  var VIDEO_MODELS = ["kling"];
834
974
  var RECRAFT_STYLES = [
@@ -883,6 +1023,9 @@ function estimateCost(model, resolution, numImages = 1) {
883
1023
  if ((model === "banana" || model === "gemini3") && resolution === "4K") {
884
1024
  return configuredPrice * 2 * numImages;
885
1025
  }
1026
+ if (model === "seedream5" && (resolution === "2K" || resolution === "4K")) {
1027
+ return configuredPrice * 2 * numImages;
1028
+ }
886
1029
  if (model === "banana2") {
887
1030
  const multiplier = resolution === "4K" ? 2 : resolution === "2K" ? 1.5 : resolution === "0.5K" ? 0.75 : 1;
888
1031
  return configuredPrice * multiplier * numImages;
@@ -907,6 +1050,7 @@ function estimateCost(model, resolution, numImages = 1) {
907
1050
  case "flux-fast":
908
1051
  return 3e-3 * numImages;
909
1052
  case "clarity":
1053
+ return 0.03 * numImages;
910
1054
  case "crystal":
911
1055
  case "rmbg":
912
1056
  case "bria":
@@ -2865,6 +3009,7 @@ export {
2865
3009
  CREATIVE_FIELDS,
2866
3010
  CREATIVE_TAXONOMY,
2867
3011
  CreativeOptionError,
3012
+ EDIT_CAPABLE_MODELS,
2868
3013
  FAL_TOOLS,
2869
3014
  FAL_TOOLS_CHECKED_AT,
2870
3015
  FAL_TOOL_IDS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howells/motif-sdk",
3
- "version": "0.3.2",
3
+ "version": "0.5.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",