@henjicc/ai-sdk 0.2.8 → 0.3.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/CHANGELOG.md +153 -143
- package/README.md +486 -461
- package/dist/capabilities/embedding/bailian.d.ts +23 -0
- package/dist/capabilities/embedding/bailian.js +10 -0
- package/dist/capabilities/embedding/bigmodel.d.ts +9 -0
- package/dist/capabilities/embedding/bigmodel.js +5 -0
- package/dist/capabilities/embedding/index.d.ts +1 -0
- package/dist/capabilities/embedding/index.js +1 -0
- package/dist/capabilities/embedding/ppio.d.ts +7 -0
- package/dist/capabilities/embedding/ppio.js +5 -0
- package/dist/capabilities/embedding/siliconflow.d.ts +21 -0
- package/dist/capabilities/embedding/siliconflow.js +10 -0
- package/dist/capabilities/embedding/volcengine.d.ts +10 -0
- package/dist/capabilities/embedding/volcengine.js +6 -0
- package/dist/capabilities/rerank/bailian.d.ts +21 -0
- package/dist/capabilities/rerank/bailian.js +14 -0
- package/dist/capabilities/rerank/bigmodel.d.ts +9 -0
- package/dist/capabilities/rerank/bigmodel.js +5 -0
- package/dist/capabilities/rerank/index.d.ts +1 -0
- package/dist/capabilities/rerank/index.js +1 -0
- package/dist/capabilities/rerank/ppio.d.ts +7 -0
- package/dist/capabilities/rerank/ppio.js +5 -0
- package/dist/capabilities/rerank/siliconflow.d.ts +21 -0
- package/dist/capabilities/rerank/siliconflow.js +10 -0
- package/dist/capabilities/retrieval/http.d.ts +3 -0
- package/dist/capabilities/retrieval/http.js +48 -0
- package/dist/capabilities/retrieval/module.d.ts +11 -0
- package/dist/capabilities/retrieval/module.js +110 -0
- package/dist/capabilities/retrieval/types.d.ts +54 -0
- package/dist/capabilities/retrieval/types.js +1 -0
- package/dist/capabilities/retrieval/validation.d.ts +10 -0
- package/dist/capabilities/retrieval/validation.js +65 -0
- package/dist/capabilities/types.d.ts +1 -1
- package/dist/catalog/apimart/gpt-image-2.5.model.d.ts +2 -0
- package/dist/catalog/apimart/gpt-image-2.5.model.js +51 -0
- package/dist/catalog/fal/gpt-image-2.5.model.d.ts +2 -0
- package/dist/catalog/fal/gpt-image-2.5.model.js +53 -0
- package/dist/catalog/fal/ic-light-v2.model.js +9 -13
- package/dist/catalog/grsai/gpt-image-2.5.model.d.ts +2 -0
- package/dist/catalog/grsai/gpt-image-2.5.model.js +54 -0
- package/dist/catalog/grsai/gptImage25Sizes.d.ts +1 -0
- package/dist/catalog/grsai/gptImage25Sizes.js +76 -0
- package/dist/catalog/index.js +112 -104
- package/dist/catalog/kie/gpt-image-2.5.model.d.ts +2 -0
- package/dist/catalog/kie/gpt-image-2.5.model.js +38 -0
- package/dist/catalog/shared/gptImage25.d.ts +16 -0
- package/dist/catalog/shared/gptImage25.js +48 -0
- package/dist/catalog/shared/gptImage25Pricing.d.ts +12 -0
- package/dist/catalog/shared/gptImage25Pricing.js +508 -0
- package/dist/llm/defaults.d.ts +1 -1
- package/dist/llm/defaults.js +1 -1
- package/dist/llm/modelCatalogEntries.js +16 -0
- package/dist/llm/providerPresets.js +2 -2
- package/dist/packs/models/apimart/gpt-image-2.5.d.ts +6 -0
- package/dist/packs/models/apimart/gpt-image-2.5.js +7 -0
- package/dist/packs/models/fal/gpt-image-2.5.d.ts +6 -0
- package/dist/packs/models/fal/gpt-image-2.5.js +7 -0
- package/dist/packs/models/grsai/gpt-image-2.5.d.ts +6 -0
- package/dist/packs/models/grsai/gpt-image-2.5.js +7 -0
- package/dist/packs/models/kie/gpt-image-2.5.d.ts +6 -0
- package/dist/packs/models/kie/gpt-image-2.5.js +7 -0
- package/dist/packs/provider-packs/apimart.d.ts +1 -1
- package/dist/packs/provider-packs/apimart.js +21 -20
- package/dist/packs/provider-packs/fal.d.ts +1 -1
- package/dist/packs/provider-packs/fal.js +37 -36
- package/dist/packs/provider-packs/grsai.d.ts +1 -1
- package/dist/packs/provider-packs/grsai.js +6 -5
- package/dist/packs/provider-packs/kie.d.ts +1 -1
- package/dist/packs/provider-packs/kie.js +28 -27
- package/dist/packs/tool-models/fal/{qwen-image-edit-2509-multiple-angles.d.ts → qwen-image-edit-2511-multiple-angles.d.ts} +1 -1
- package/dist/packs/tool-models/fal/{qwen-image-edit-2509-multiple-angles.js → qwen-image-edit-2511-multiple-angles.js} +1 -1
- package/dist/packs/tool-packs/fal-multi-angle-tools.js +1 -1
- package/dist/tool-packs/fal-multi-angle/models/qwen-image-edit-2511-multiple-angles.model.d.ts +2 -0
- package/dist/tool-packs/fal-multi-angle/models/{qwen-image-edit-2509-multiple-angles.model.js → qwen-image-edit-2511-multiple-angles.model.js} +20 -17
- package/docs/README.md +26 -26
- package/docs/consumers.md +54 -48
- package/docs/llm-adaptation/README.md +139 -139
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/DeepSeek.md +103 -91
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/Kimi.md +75 -75
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/MiniMax.md +84 -84
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//345/260/217/347/261/263MiMo.md +85 -85
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//346/231/272/350/260/261GLM.md +232 -232
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//347/201/253/345/261/261/345/274/225/346/223/216.md +87 -87
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//347/231/276/347/202/274Qwen.md +84 -84
- package/docs/llm-adaptation//346/226/207/346/241/243/351/207/207/351/233/206/346/211/213/345/206/214.md +88 -88
- package/docs/model-adaptation/Bria-Eraser/Bria-Eraser_Fal.md +32 -32
- package/docs/model-adaptation/Bria-/345/210/233/346/204/217/346/224/276/345/244/247/Bria-/345/210/233/346/204/217/346/224/276/345/244/247_Fal.md +31 -31
- package/docs/model-adaptation/ControlLight/ControlLight_Fal.md +85 -85
- package/docs/model-adaptation/FLUX-2-/345/244/232/350/247/222/345/272/246/FLUX-2-/345/244/232/350/247/222/345/272/246_Fal.md +107 -107
- package/docs/model-adaptation/Finegrain-Eraser/Finegrain-Eraser_Fal.md +31 -31
- package/docs/model-adaptation/Flux-Pro-Erase/Flux-Pro-Erase_Fal.md +34 -34
- package/docs/model-adaptation/Fun-ASR/Fun-ASR_/347/231/276/347/202/274.md +43 -43
- package/docs/model-adaptation/Fun-ASR-Flash-2026-06-15/Fun-ASR-Flash-2026-06-15_/347/231/276/347/202/274.md +41 -41
- package/docs/model-adaptation/Fun-ASR-Realtime/Fun-ASR-Realtime_/347/231/276/347/202/274.md +37 -37
- package/docs/model-adaptation/Fun-ASR-Realtime-2026-02-28/Fun-ASR-Realtime-2026-02-28_/347/231/276/347/202/274.md +39 -39
- package/docs/model-adaptation/GLM-5.3-Flash/GLM-5.3-Flash_/346/231/272/350/260/261.md +207 -207
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_APIMart.md +173 -173
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_Fal.md +94 -94
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_Grsai.md +137 -137
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_KIE.md +93 -93
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_APIMart.md +66 -0
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Fal.md +55 -0
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Grsai.md +53 -0
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_KIE.md +55 -0
- package/docs/model-adaptation/GPT-OSS-20B/GPT-OSS-20B_Groq.md +62 -62
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_APIMart.md +124 -124
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_Fal.md +84 -84
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_KIE.md +129 -129
- package/docs/model-adaptation/Grok-Imagine/Grok-Imagine_KIE.md +36 -36
- package/docs/model-adaptation/Grok-Imagine-2.0/Grok-Imagine-2.0_APIMart.md +250 -250
- package/docs/model-adaptation/Grok-Imagine-2.0/Grok-Imagine-2.0_Fal.md +84 -84
- package/docs/model-adaptation/Grok-Imagine-2.0/Grok-Imagine-2.0_KIE.md +105 -105
- package/docs/model-adaptation/Hailuo-02/Hailuo-02_Fal.md +93 -93
- package/docs/model-adaptation/Hailuo-02/Hailuo-02_KIE.md +56 -56
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_Fal.md +88 -88
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_KIE.md +51 -51
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_/346/264/276/346/254/247/344/272/221.md +70 -70
- package/docs/model-adaptation/IC-Light-v2/IC-Light-v2_Fal.md +97 -94
- package/docs/model-adaptation/Ideogram-/345/233/276/347/211/207/346/224/276/345/244/247/Ideogram-/345/233/276/347/211/207/346/224/276/345/244/247_Fal.md +41 -41
- package/docs/model-adaptation/Image-Apps-v2-/345/225/206/345/223/201/346/221/204/345/275/261/Image-Apps-v2-/345/225/206/345/223/201/346/221/204/345/275/261_Fal.md +72 -72
- package/docs/model-adaptation/Image-Apps-v2-/346/211/251/345/233/276/Image-Apps-v2-/346/211/251/345/233/276_Fal.md +93 -93
- package/docs/model-adaptation/Image-Apps-v2-/347/205/247/347/211/207/344/277/256/345/244/215/Image-Apps-v2-/347/205/247/347/211/207/344/277/256/345/244/215_Fal.md +86 -86
- package/docs/model-adaptation/Image-Apps-v2-/351/207/215/346/211/223/345/205/211/Image-Apps-v2-/351/207/215/346/211/223/345/205/211_Fal.md +84 -84
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_APIMart.md +112 -112
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_Fal.md +89 -89
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_KIE.md +106 -106
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_/346/264/276/346/254/247/344/272/221.md +119 -119
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_APIMart.md +125 -125
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_Fal.md +107 -107
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_KIE.md +143 -143
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_APIMart.md +85 -85
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_Fal.md +83 -83
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_KIE.md +84 -84
- package/docs/model-adaptation/Midjourney/Midjourney_APIMart.md +396 -396
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_APIMart.md +234 -234
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_Fal.md +108 -108
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_KIE.md +111 -111
- package/docs/model-adaptation/MiniMax-Speech/MiniMax-Speech_/346/264/276/346/254/247/344/272/221.md +170 -170
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_APIMart.md +89 -89
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_Fal.md +99 -99
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_Grsai.md +82 -82
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_KIE.md +70 -70
- package/docs/model-adaptation/Nano-Banana-2-Lite/Nano-Banana-2-Lite_APIMart.md +79 -79
- package/docs/model-adaptation/Nano-Banana-2-Lite/Nano-Banana-2-Lite_Grsai.md +65 -65
- package/docs/model-adaptation/Nano-Banana-2-Lite/Nano-Banana-2-Lite_KIE.md +64 -64
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_APIMart.md +83 -83
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_Fal.md +89 -89
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_Grsai.md +82 -82
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_KIE.md +64 -64
- package/docs/model-adaptation/Pixelcut-/350/203/214/346/231/257/347/247/273/351/231/244/Pixelcut-/350/203/214/346/231/257/347/247/273/351/231/244_Fal.md +79 -79
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_APIMart.md +117 -117
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_Fal.md +84 -84
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_KIE.md +103 -103
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_/347/231/276/347/202/274.md +138 -138
- package/docs/model-adaptation/Qwen-Image-Edit-2511-/345/244/232/350/247/222/345/272/246/Qwen-Image-Edit-2511-/345/244/232/350/247/222/345/272/246_Fal.md +57 -0
- package/docs/model-adaptation/Qwen-MT-Flash/Qwen-MT-Flash_/347/231/276/347/202/274.md +47 -47
- package/docs/model-adaptation/Qwen-MT-Lite/Qwen-MT-Lite_/347/231/276/347/202/274.md +39 -39
- package/docs/model-adaptation/Qwen-MT-Plus/Qwen-MT-Plus_/347/231/276/347/202/274.md +39 -39
- package/docs/model-adaptation/Qwen3-ASR-Flash/Qwen3-ASR-Flash_/347/231/276/347/202/274.md +40 -40
- package/docs/model-adaptation/Qwen3-ASR-Flash-2026-02-10/Qwen3-ASR-Flash-2026-02-10_/347/231/276/347/202/274.md +33 -33
- package/docs/model-adaptation/Qwen3-ASR-Flash-Filetrans/Qwen3-ASR-Flash-Filetrans_/347/231/276/347/202/274.md +41 -41
- package/docs/model-adaptation/Qwen3-ASR-Flash-Realtime/Qwen3-ASR-Flash-Realtime_/347/231/276/347/202/274.md +35 -35
- package/docs/model-adaptation/Qwen3-ASR-Flash-Realtime-2026-02-10/Qwen3-ASR-Flash-Realtime-2026-02-10_/347/231/276/347/202/274.md +37 -37
- package/docs/model-adaptation/README.md +313 -295
- package/docs/model-adaptation/SeedASR-2.0-File/SeedASR-2.0-File_/347/201/253/345/261/261/345/274/225/346/223/216.md +115 -115
- package/docs/model-adaptation/SeedASR-2.0-Realtime/SeedASR-2.0-Realtime_/347/201/253/345/261/261/345/274/225/346/223/216.md +143 -143
- package/docs/model-adaptation/SeedVR2-/345/233/276/347/211/207/346/224/276/345/244/247/SeedVR2-/345/233/276/347/211/207/346/224/276/345/244/247_Fal.md +45 -45
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_APIMart.md +121 -121
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_Fal.md +97 -97
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_KIE.md +86 -86
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_APIMart.md +89 -89
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_Fal.md +95 -95
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_KIE.md +78 -78
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_APIMart.md +89 -89
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_Fal.md +96 -96
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_KIE.md +78 -78
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_APIMart.md +212 -212
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_Fal.md +94 -94
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_KIE.md +89 -89
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_APIMart.md +106 -106
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_Fal.md +91 -91
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_KIE.md +89 -89
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_/347/201/253/345/261/261/345/274/225/346/223/216.md +108 -108
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_APIMart.md +194 -194
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_Fal.md +100 -100
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_KIE.md +141 -141
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_/347/201/253/345/261/261/345/274/225/346/223/216.md +137 -137
- package/docs/model-adaptation/SenseVoiceSmall/SenseVoiceSmall_/347/241/205/345/237/272/346/265/201/345/212/250.md +69 -69
- package/docs/model-adaptation/TeleSpeechASR/TeleSpeechASR_/347/241/205/345/237/272/346/265/201/345/212/250.md +72 -72
- package/docs/model-adaptation/Topaz-/345/233/276/347/211/207/346/224/276/345/244/247/Topaz-/345/233/276/347/211/207/346/224/276/345/244/247_Fal.md +87 -87
- package/docs/model-adaptation/Topaz-/351/200/217/346/230/216/345/233/276/346/224/276/345/244/247/Topaz-/351/200/217/346/230/216/345/233/276/346/224/276/345/244/247_Fal.md +34 -34
- package/docs/model-adaptation/Wan-2.5-Preview/Wan-2.5-Preview_/346/264/276/346/254/247/344/272/221.md +82 -82
- package/docs/model-adaptation/Wan-2.6/Wan-2.6_/346/264/276/346/254/247/344/272/221.md +84 -84
- package/docs/model-adaptation/Wan-2.7/Wan-2.7_/346/264/276/346/254/247/344/272/221.md +122 -122
- package/docs/model-adaptation/Whisper-Large-v3/Whisper-Large-v3_Groq.md +76 -76
- package/docs/model-adaptation/Whisper-Large-v3-Turbo/Whisper-Large-v3-Turbo_Groq.md +75 -75
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_APIMart.md +88 -88
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_Fal.md +95 -95
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_KIE.md +71 -71
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_/347/231/276/347/202/274.md +122 -122
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_/351/255/224/346/220/255.md +97 -97
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/APIMart.md +238 -238
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Fal.md +172 -172
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Groq.md +121 -121
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Grsai.md +217 -217
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/KIE.md +131 -131
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//345/200/231/351/200/211/344/276/233/345/272/224/345/225/206/350/260/203/347/240/224-/345/233/276/347/211/207/345/267/245/345/205/267.md +151 -151
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//345/277/253/351/200/237/351/200/202/351/205/215/344/276/233/345/272/224/345/225/206.md +65 -65
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//346/264/276/346/254/247/344/272/221.md +147 -138
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/201/253/345/261/261/345/274/225/346/223/216.md +181 -171
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/231/276/347/202/274.md +237 -227
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/241/205/345/237/272/346/265/201/345/212/250.md +110 -88
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//351/255/224/346/220/255.md +207 -207
- package/docs/model-adaptation//346/226/207/346/241/243/351/207/207/351/233/206/346/211/213/345/206/214.md +338 -311
- package/docs/model-adaptation//351/200/217/350/247/206/345/217/230/346/215/242//351/200/217/350/247/206/345/217/230/346/215/242_Fal.md +59 -59
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227/Electron.md +77 -77
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227/Tauri.md +81 -81
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227/UXP.md +169 -169
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227//344/276/233/345/272/224/345/225/206/345/237/237/345/220/215.md +83 -83
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227//351/224/231/350/257/257/345/244/204/347/220/206.md +72 -72
- package/examples/form-renderer/README.md +17 -17
- package/examples/form-renderer/cli.ts +32 -32
- package/examples/form-renderer/index.ts +144 -144
- package/examples/form-renderer/package.json +16 -16
- package/examples/form-renderer/tsconfig.json +14 -14
- package/examples/llm-chat/README.md +32 -32
- package/examples/llm-chat/index.ts +100 -100
- package/examples/llm-chat/package.json +19 -19
- package/examples/llm-chat/tsconfig.json +14 -14
- package/examples/minimal-node/README.md +31 -31
- package/examples/minimal-node/index.ts +138 -138
- package/examples/minimal-node/package.json +17 -17
- package/examples/minimal-node/tsconfig.json +14 -14
- package/package.json +252 -197
- package/dist/tool-packs/fal-multi-angle/models/qwen-image-edit-2509-multiple-angles.model.d.ts +0 -2
- package/docs/model-adaptation/Qwen-Image-Edit-2509-/345/244/232/350/247/222/345/272/246/Qwen-Image-Edit-2509-/345/244/232/350/247/222/345/272/246_Fal.md +0 -116
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { hasUploadedImage } from '../shared/mediaPresence.js';
|
|
3
|
+
import { GPT25_BACKGROUNDS, GPT25_QUALITIES, GPT25_RATIOS, GPT25_RESOLUTIONS, gpt25Choice, gpt25Count, gpt25Images, gpt25Options, gpt25Prompt } from '../shared/gptImage25.js';
|
|
4
|
+
import { gpt25OutputEstimate, gpt25SizeReference } from '../shared/gptImage25Pricing.js';
|
|
5
|
+
export const falGptImage25Model = defineModel({
|
|
6
|
+
meta: {
|
|
7
|
+
id: 'fal-ai-gpt-image-2.5', canonicalModelId: 'gpt-image-2.5', seriesId: 'gpt-image', seriesRank: 2.5,
|
|
8
|
+
provider: 'fal', type: 'image',
|
|
9
|
+
tags: ['text-to-image', 'image-to-image', 'supports-image-editing', 'supports-multi-image', 'multi-output', 'supports-4k', 'provider-fal'],
|
|
10
|
+
polling: { interval: 3000, maxAttempts: 200 },
|
|
11
|
+
},
|
|
12
|
+
inputLimits: { images: { max: 16 }, videos: { max: 0 } },
|
|
13
|
+
params: [
|
|
14
|
+
{ id: 'gpt25Variant', type: 'dropdown', order: 1, default: 'flare', options: gpt25Options(['flare', 'sunburst']) },
|
|
15
|
+
{ id: 'gpt25AspectRatio', type: 'dropdown', order: 2, default: 'smart', options: gpt25Options(['smart', ...GPT25_RATIOS]) },
|
|
16
|
+
{ id: 'gpt25Resolution', type: 'dropdown', order: 3, default: '1K', options: gpt25Options(GPT25_RESOLUTIONS) },
|
|
17
|
+
{ id: 'gpt25Quality', type: 'dropdown', order: 4, default: 'high', options: gpt25Options(GPT25_QUALITIES) },
|
|
18
|
+
{ id: 'gpt25Count', type: 'number', order: 5, default: 1, min: 1, max: 10, step: 1 },
|
|
19
|
+
{ id: 'gpt25Background', type: 'dropdown', order: 6, default: 'auto', options: gpt25Options(GPT25_BACKGROUNDS) },
|
|
20
|
+
{ id: 'gpt25Mask', type: 'image-upload', order: 7, default: [], valueType: 'array', maxCount: 1, format: 'url', accept: ['image/png'], visible: { condition: hasUploadedImage } },
|
|
21
|
+
],
|
|
22
|
+
runtimeConstraints: { mediaFields: [{ field: 'mask_url', kind: 'image' }] },
|
|
23
|
+
endpoints: { selector: params => {
|
|
24
|
+
const variant = gpt25Choice(params.gpt25Variant, ['flare', 'sunburst'], 'flare');
|
|
25
|
+
return `openai/gpt-image-2.5/${variant}/${hasUploadedImage(params) ? 'edit' : 'text-to-image'}`;
|
|
26
|
+
} },
|
|
27
|
+
request: { builder: params => {
|
|
28
|
+
const { width, height } = gpt25SizeReference(params);
|
|
29
|
+
const body = {
|
|
30
|
+
prompt: gpt25Prompt(params), image_size: { width, height },
|
|
31
|
+
quality: gpt25Choice(params.gpt25Quality, GPT25_QUALITIES, 'high'),
|
|
32
|
+
background: gpt25Choice(params.gpt25Background, GPT25_BACKGROUNDS, 'auto'),
|
|
33
|
+
num_images: gpt25Count(params.gpt25Count, 10),
|
|
34
|
+
};
|
|
35
|
+
const images = gpt25Images(params);
|
|
36
|
+
if (images.length)
|
|
37
|
+
body.image_urls = images;
|
|
38
|
+
const masks = params.gpt25Mask === undefined ? [] : params.gpt25Mask;
|
|
39
|
+
if (!Array.isArray(masks) || masks.length > 1 || masks.some(m => typeof m !== 'string' || !m.trim()))
|
|
40
|
+
throw new Error('局部重绘遮罩必须是单张图片');
|
|
41
|
+
if (masks.length) {
|
|
42
|
+
if (!images.length)
|
|
43
|
+
throw new Error('局部重绘需要先添加参考图');
|
|
44
|
+
body.mask_url = masks[0];
|
|
45
|
+
}
|
|
46
|
+
return body;
|
|
47
|
+
} },
|
|
48
|
+
pricing: {
|
|
49
|
+
currency: '$', calculator: params => gpt25OutputEstimate(params, 30, 'high'),
|
|
50
|
+
description: '按token计费;仅为同型号尺寸/token表的输出参考估算,提示词与参考图输入另计;自动质量按max预估',
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
export default falGptImage25Model;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { defineModel } from '../defineModel.js';
|
|
2
|
-
import { falOneMegapixelSize } from './imageSizing.js';
|
|
3
2
|
const IC_LIGHT_DIRECTIONS = ['None', 'Left', 'Right', 'Top', 'Bottom'];
|
|
4
3
|
function cleanImages(value) {
|
|
5
4
|
return Array.isArray(value)
|
|
6
5
|
? value.filter((item) => typeof item === 'string' && item.trim().length > 0)
|
|
7
6
|
: [];
|
|
8
7
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
? candidate
|
|
16
|
-
: best;
|
|
17
|
-
}, '1:1');
|
|
8
|
+
function sourceAspectSize(ratio) {
|
|
9
|
+
// Fal ImageSize 接受自定义整数尺寸,不应把源图吸附到少数比例预设。
|
|
10
|
+
// 只等比控制约 1MP 的输出尺寸;不对上传原图作非等比拉伸。
|
|
11
|
+
const scale = Math.min(1024, 14142 / Math.sqrt(ratio), 14142 * Math.sqrt(ratio));
|
|
12
|
+
return { width: Math.max(1, Math.round(scale * Math.sqrt(ratio))),
|
|
13
|
+
height: Math.max(1, Math.round(scale / Math.sqrt(ratio))) };
|
|
18
14
|
}
|
|
19
15
|
export const falIcLightV2Model = defineModel({
|
|
20
16
|
meta: {
|
|
@@ -61,14 +57,14 @@ export const falIcLightV2Model = defineModel({
|
|
|
61
57
|
prompt: typeof params.prompt === 'string' ? params.prompt.slice(0, 32000) : '',
|
|
62
58
|
image_url: images[0],
|
|
63
59
|
initial_latent: direction,
|
|
64
|
-
image_size:
|
|
60
|
+
image_size: sourceAspectSize(ratio),
|
|
65
61
|
num_images: 1,
|
|
66
62
|
num_inference_steps: 28,
|
|
67
|
-
|
|
63
|
+
cfg: 1,
|
|
68
64
|
guidance_scale: 5,
|
|
69
65
|
lowres_denoise: 0.98,
|
|
70
66
|
highres_denoise: 0.95,
|
|
71
|
-
|
|
67
|
+
hr_downscale: 0.5,
|
|
72
68
|
enable_hr_fix: false,
|
|
73
69
|
enable_safety_checker: true,
|
|
74
70
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { GPT25_RATIOS, GPT25_RESOLUTIONS, gpt25Choice, gpt25Images, gpt25Options, gpt25Prompt, gpt25Ratio } from '../shared/gptImage25.js';
|
|
3
|
+
import { GRSAI_GPT25_SIZES } from './gptImage25Sizes.js';
|
|
4
|
+
const regularRatios = GPT25_RATIOS.filter(r => r !== '1:3' && r !== '3:1');
|
|
5
|
+
export const grsaiGptImage25Model = defineModel({
|
|
6
|
+
meta: {
|
|
7
|
+
id: 'grsai-gpt-image-2.5', canonicalModelId: 'gpt-image-2.5', seriesId: 'gpt-image', seriesRank: 2.5,
|
|
8
|
+
provider: 'grsai', type: 'image',
|
|
9
|
+
tags: ['text-to-image', 'image-to-image', 'supports-image-editing', 'supports-multi-image', 'supports-4k', 'provider-grsai'],
|
|
10
|
+
polling: { interval: 3000, maxAttempts: 200 },
|
|
11
|
+
},
|
|
12
|
+
// 应用本地上限;Grsai官方未声明参考图数量上限。
|
|
13
|
+
inputLimits: { images: { max: 16 }, videos: { max: 0 } },
|
|
14
|
+
params: [
|
|
15
|
+
{ id: 'gpt25Variant', type: 'dropdown', order: 1, default: 'flare', options: gpt25Options(['standard', 'flare', 'sunburst']) },
|
|
16
|
+
{ id: 'gpt25AspectRatio', type: 'dropdown', order: 2, default: 'smart', options: gpt25Options(['smart', ...GPT25_RATIOS]) },
|
|
17
|
+
{ id: 'gpt25Resolution', type: 'dropdown', order: 3, default: '1K', options: gpt25Options(GPT25_RESOLUTIONS), visible: { condition: p => p.gpt25Variant !== 'standard' } },
|
|
18
|
+
{ id: 'gpt25Quality', type: 'dropdown', order: 4, default: 'medium', options: gpt25Options(['low', 'medium', 'high', 'xhigh', 'max']), visible: { condition: p => p.gpt25Variant !== 'standard' } },
|
|
19
|
+
{ id: 'gpt25Transparent', type: 'switch', order: 5, default: false, visible: { condition: p => p.gpt25Variant !== 'standard' } },
|
|
20
|
+
],
|
|
21
|
+
endpoints: '/v1/api/generate',
|
|
22
|
+
request: { builder: params => {
|
|
23
|
+
const variant = gpt25Choice(params.gpt25Variant, ['standard', 'flare', 'sunburst'], 'flare');
|
|
24
|
+
const standard = variant === 'standard';
|
|
25
|
+
const resolution = standard ? '1K' : gpt25Choice(params.gpt25Resolution, GPT25_RESOLUTIONS, '1K');
|
|
26
|
+
const candidates = standard || resolution === '2K' ? regularRatios : GPT25_RATIOS;
|
|
27
|
+
const ratio = gpt25Ratio(params, params.gpt25AspectRatio, candidates);
|
|
28
|
+
const size = standard ? ratio : GRSAI_GPT25_SIZES[ratio]?.[resolution];
|
|
29
|
+
if (!size)
|
|
30
|
+
throw new Error('该比例与分辨率组合尚无官方像素规格');
|
|
31
|
+
const body = {
|
|
32
|
+
model: standard ? 'gpt-image-2.5' : `gpt-image-2.5-${variant}`,
|
|
33
|
+
prompt: gpt25Prompt(params),
|
|
34
|
+
aspectRatio: size,
|
|
35
|
+
};
|
|
36
|
+
if (!standard) {
|
|
37
|
+
body.quality = gpt25Choice(params.gpt25Quality, variant === 'sunburst' ? ['low', 'medium', 'high', 'xhigh', 'max'] : ['low', 'medium', 'high'], 'medium');
|
|
38
|
+
if (params.gpt25Transparent !== undefined && typeof params.gpt25Transparent !== 'boolean')
|
|
39
|
+
throw new Error('透明背景参数必须为布尔值');
|
|
40
|
+
if (params.gpt25Transparent === true)
|
|
41
|
+
body.background = 'transparent';
|
|
42
|
+
}
|
|
43
|
+
const images = gpt25Images(params);
|
|
44
|
+
if (images.length)
|
|
45
|
+
body.images = images;
|
|
46
|
+
return body;
|
|
47
|
+
} },
|
|
48
|
+
pricing: {
|
|
49
|
+
currency: '¥',
|
|
50
|
+
calculator: params => ({ standard: 0.06, flare: 0.2, sunburst: 0.24 }[gpt25Choice(params.gpt25Variant, ['standard', 'flare', 'sunburst'], 'flare')] ?? 0.2),
|
|
51
|
+
description: '每次600/2000/2400积分;基础充值档标准¥0.06、Flare¥0.20、Sunburst¥0.24;高额充值档低至¥0.03/0.10/0.12',
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
export default grsaiGptImage25Model;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GRSAI_GPT25_SIZES: Record<string, Partial<Record<string, string>>>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// https://qmy27nhsd9.apifox.cn/452409160e0.md (2026-09-10)
|
|
2
|
+
export const GRSAI_GPT25_SIZES = {
|
|
3
|
+
"1:1": {
|
|
4
|
+
"1K": "1024x1024",
|
|
5
|
+
"2K": "2048x2048",
|
|
6
|
+
"4K": "2880x2880"
|
|
7
|
+
},
|
|
8
|
+
"16:9": {
|
|
9
|
+
"1K": "1280x720",
|
|
10
|
+
"2K": "2048x1152",
|
|
11
|
+
"4K": "3840x2160"
|
|
12
|
+
},
|
|
13
|
+
"9:16": {
|
|
14
|
+
"1K": "720x1280",
|
|
15
|
+
"2K": "1152x2048",
|
|
16
|
+
"4K": "2160x3840"
|
|
17
|
+
},
|
|
18
|
+
"4:3": {
|
|
19
|
+
"1K": "1152x864",
|
|
20
|
+
"2K": "2304x1728",
|
|
21
|
+
"4K": "3264x2448"
|
|
22
|
+
},
|
|
23
|
+
"3:4": {
|
|
24
|
+
"1K": "864x1152",
|
|
25
|
+
"2K": "1728x2304",
|
|
26
|
+
"4K": "2448x3264"
|
|
27
|
+
},
|
|
28
|
+
"3:2": {
|
|
29
|
+
"1K": "1536x1024",
|
|
30
|
+
"2K": "2048x1360",
|
|
31
|
+
"4K": "3504x2336"
|
|
32
|
+
},
|
|
33
|
+
"2:3": {
|
|
34
|
+
"1K": "1024x1536",
|
|
35
|
+
"2K": "1360x2048",
|
|
36
|
+
"4K": "2336x3504"
|
|
37
|
+
},
|
|
38
|
+
"5:4": {
|
|
39
|
+
"1K": "1120x896",
|
|
40
|
+
"2K": "2240x1792",
|
|
41
|
+
"4K": "3200x2560"
|
|
42
|
+
},
|
|
43
|
+
"4:5": {
|
|
44
|
+
"1K": "896x1120",
|
|
45
|
+
"2K": "1792x2240",
|
|
46
|
+
"4K": "2560x3200"
|
|
47
|
+
},
|
|
48
|
+
"21:9": {
|
|
49
|
+
"1K": "1456x624",
|
|
50
|
+
"2K": "2912x1248",
|
|
51
|
+
"4K": "3840x1648"
|
|
52
|
+
},
|
|
53
|
+
"9:21": {
|
|
54
|
+
"1K": "624x1456",
|
|
55
|
+
"2K": "1248x2912",
|
|
56
|
+
"4K": "1648x3840"
|
|
57
|
+
},
|
|
58
|
+
"1:3": {
|
|
59
|
+
"1K": "688x2048",
|
|
60
|
+
"4K": "1280x3840"
|
|
61
|
+
},
|
|
62
|
+
"3:1": {
|
|
63
|
+
"1K": "2048x688",
|
|
64
|
+
"4K": "3840x1280"
|
|
65
|
+
},
|
|
66
|
+
"2:1": {
|
|
67
|
+
"1K": "1536x768",
|
|
68
|
+
"2K": "3072x1536",
|
|
69
|
+
"4K": "3840x1920"
|
|
70
|
+
},
|
|
71
|
+
"1:2": {
|
|
72
|
+
"1K": "768x1536",
|
|
73
|
+
"2K": "1536x3072",
|
|
74
|
+
"4K": "1920x3840"
|
|
75
|
+
}
|
|
76
|
+
};
|
package/dist/catalog/index.js
CHANGED
|
@@ -4,110 +4,114 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { createModelIndex } from './model-index.js';
|
|
6
6
|
import catalogModel1 from './apimart/gemini-omni-flash.model.js';
|
|
7
|
-
import catalogModel2 from './apimart/gpt-image-2.model.js';
|
|
8
|
-
import catalogModel3 from './apimart/
|
|
9
|
-
import catalogModel4 from './apimart/
|
|
10
|
-
import catalogModel5 from './apimart/kling-3.0-
|
|
11
|
-
import catalogModel6 from './apimart/kling-3.0.model.js';
|
|
12
|
-
import catalogModel7 from './apimart/
|
|
13
|
-
import catalogModel8 from './apimart/midjourney.model.js';
|
|
14
|
-
import catalogModel9 from './apimart/
|
|
15
|
-
import catalogModel10 from './apimart/
|
|
16
|
-
import catalogModel11 from './apimart/nano-banana-2.model.js';
|
|
17
|
-
import catalogModel12 from './apimart/nano-banana-
|
|
18
|
-
import catalogModel13 from './apimart/
|
|
19
|
-
import catalogModel14 from './apimart/
|
|
20
|
-
import catalogModel15 from './apimart/seedance-2.0-
|
|
21
|
-
import catalogModel16 from './apimart/seedance-2.0.model.js';
|
|
22
|
-
import catalogModel17 from './apimart/seedance-2.
|
|
23
|
-
import catalogModel18 from './apimart/
|
|
24
|
-
import catalogModel19 from './apimart/seedream-5.0-
|
|
25
|
-
import catalogModel20 from './apimart/
|
|
26
|
-
import catalogModel21 from './
|
|
27
|
-
import catalogModel22 from './bailian/
|
|
28
|
-
import catalogModel23 from './
|
|
29
|
-
import catalogModel24 from './fal/
|
|
30
|
-
import catalogModel25 from './fal/
|
|
31
|
-
import catalogModel26 from './fal/
|
|
32
|
-
import catalogModel27 from './fal/
|
|
33
|
-
import catalogModel28 from './fal/
|
|
34
|
-
import catalogModel29 from './fal/
|
|
35
|
-
import catalogModel30 from './fal/
|
|
36
|
-
import catalogModel31 from './fal/
|
|
37
|
-
import catalogModel32 from './fal/
|
|
38
|
-
import catalogModel33 from './fal/kling-3.0.model.js';
|
|
39
|
-
import catalogModel34 from './fal/kling-
|
|
40
|
-
import catalogModel35 from './fal/kling-
|
|
41
|
-
import catalogModel36 from './fal/kling-
|
|
42
|
-
import catalogModel37 from './fal/
|
|
43
|
-
import catalogModel38 from './fal/
|
|
44
|
-
import catalogModel39 from './fal/
|
|
45
|
-
import catalogModel40 from './fal/
|
|
46
|
-
import catalogModel41 from './fal/nano-banana.model.js';
|
|
47
|
-
import catalogModel42 from './fal/
|
|
48
|
-
import catalogModel43 from './fal/
|
|
49
|
-
import catalogModel44 from './fal/
|
|
50
|
-
import catalogModel45 from './fal/
|
|
51
|
-
import catalogModel46 from './fal/seedance-2.0.model.js';
|
|
52
|
-
import catalogModel47 from './fal/seedance-2.
|
|
53
|
-
import catalogModel48 from './fal/seedance.model.js';
|
|
54
|
-
import catalogModel49 from './fal/
|
|
55
|
-
import catalogModel50 from './fal/
|
|
56
|
-
import catalogModel51 from './fal/seedream-
|
|
57
|
-
import catalogModel52 from './fal/seedream-
|
|
58
|
-
import catalogModel53 from './fal/
|
|
59
|
-
import catalogModel54 from './fal/
|
|
60
|
-
import catalogModel55 from './fal/
|
|
61
|
-
import catalogModel56 from './fal/
|
|
62
|
-
import catalogModel57 from './fal/
|
|
63
|
-
import catalogModel58 from './fal/
|
|
64
|
-
import catalogModel59 from './fal/
|
|
65
|
-
import catalogModel60 from './
|
|
66
|
-
import catalogModel61 from './
|
|
67
|
-
import catalogModel62 from './grsai/
|
|
68
|
-
import catalogModel63 from './grsai/
|
|
69
|
-
import catalogModel64 from './
|
|
70
|
-
import catalogModel65 from './
|
|
71
|
-
import catalogModel66 from './
|
|
72
|
-
import catalogModel67 from './kie/
|
|
73
|
-
import catalogModel68 from './kie/
|
|
74
|
-
import catalogModel69 from './kie/
|
|
75
|
-
import catalogModel70 from './kie/
|
|
76
|
-
import catalogModel71 from './kie/
|
|
77
|
-
import catalogModel72 from './kie/
|
|
78
|
-
import catalogModel73 from './kie/
|
|
79
|
-
import catalogModel74 from './kie/
|
|
80
|
-
import catalogModel75 from './kie/
|
|
81
|
-
import catalogModel76 from './kie/
|
|
82
|
-
import catalogModel77 from './kie/
|
|
83
|
-
import catalogModel78 from './kie/
|
|
84
|
-
import catalogModel79 from './kie/
|
|
85
|
-
import catalogModel80 from './kie/
|
|
86
|
-
import catalogModel81 from './kie/
|
|
87
|
-
import catalogModel82 from './kie/
|
|
88
|
-
import catalogModel83 from './kie/
|
|
89
|
-
import catalogModel84 from './kie/seedance-
|
|
90
|
-
import catalogModel85 from './kie/seedance-
|
|
91
|
-
import catalogModel86 from './kie/
|
|
92
|
-
import catalogModel87 from './kie/
|
|
93
|
-
import catalogModel88 from './kie/
|
|
94
|
-
import catalogModel89 from './kie/
|
|
95
|
-
import catalogModel90 from './kie/
|
|
96
|
-
import catalogModel91 from './
|
|
97
|
-
import catalogModel92 from './
|
|
98
|
-
import catalogModel93 from './
|
|
99
|
-
import catalogModel94 from './
|
|
100
|
-
import catalogModel95 from './modelscope/
|
|
101
|
-
import catalogModel96 from './modelscope/
|
|
102
|
-
import catalogModel97 from './modelscope/
|
|
103
|
-
import catalogModel98 from './
|
|
104
|
-
import catalogModel99 from './
|
|
105
|
-
import catalogModel100 from './
|
|
106
|
-
import catalogModel101 from './
|
|
107
|
-
import catalogModel102 from './ppio/
|
|
108
|
-
import catalogModel103 from './ppio/
|
|
109
|
-
import catalogModel104 from './
|
|
110
|
-
import catalogModel105 from './
|
|
7
|
+
import catalogModel2 from './apimart/gpt-image-2.5.model.js';
|
|
8
|
+
import catalogModel3 from './apimart/gpt-image-2.model.js';
|
|
9
|
+
import catalogModel4 from './apimart/grok-imagine-2.0.model.js';
|
|
10
|
+
import catalogModel5 from './apimart/kling-3.0-omni.model.js';
|
|
11
|
+
import catalogModel6 from './apimart/kling-3.0-turbo.model.js';
|
|
12
|
+
import catalogModel7 from './apimart/kling-3.0.model.js';
|
|
13
|
+
import catalogModel8 from './apimart/midjourney-video.model.js';
|
|
14
|
+
import catalogModel9 from './apimart/midjourney.model.js';
|
|
15
|
+
import catalogModel10 from './apimart/minimax-h3.model.js';
|
|
16
|
+
import catalogModel11 from './apimart/nano-banana-2-lite.model.js';
|
|
17
|
+
import catalogModel12 from './apimart/nano-banana-2.model.js';
|
|
18
|
+
import catalogModel13 from './apimart/nano-banana-pro.model.js';
|
|
19
|
+
import catalogModel14 from './apimart/qwen-image-3.0.model.js';
|
|
20
|
+
import catalogModel15 from './apimart/seedance-2.0-fast.model.js';
|
|
21
|
+
import catalogModel16 from './apimart/seedance-2.0-mini.model.js';
|
|
22
|
+
import catalogModel17 from './apimart/seedance-2.0.model.js';
|
|
23
|
+
import catalogModel18 from './apimart/seedance-2.5.model.js';
|
|
24
|
+
import catalogModel19 from './apimart/seedream-5.0-lite.model.js';
|
|
25
|
+
import catalogModel20 from './apimart/seedream-5.0-pro.model.js';
|
|
26
|
+
import catalogModel21 from './apimart/z-image-turbo.model.js';
|
|
27
|
+
import catalogModel22 from './bailian/qwen-image-3.0.model.js';
|
|
28
|
+
import catalogModel23 from './bailian/z-image-turbo.model.js';
|
|
29
|
+
import catalogModel24 from './fal/bria-creative-upscale.model.js';
|
|
30
|
+
import catalogModel25 from './fal/gemini-omni-flash.model.js';
|
|
31
|
+
import catalogModel26 from './fal/gpt-image-2.5.model.js';
|
|
32
|
+
import catalogModel27 from './fal/gpt-image-2.model.js';
|
|
33
|
+
import catalogModel28 from './fal/grok-imagine-2.0.model.js';
|
|
34
|
+
import catalogModel29 from './fal/hailuo-02.model.js';
|
|
35
|
+
import catalogModel30 from './fal/hailuo-2.3.model.js';
|
|
36
|
+
import catalogModel31 from './fal/ic-light-v2.model.js';
|
|
37
|
+
import catalogModel32 from './fal/ideogram-upscale.model.js';
|
|
38
|
+
import catalogModel33 from './fal/kling-3.0-omni.model.js';
|
|
39
|
+
import catalogModel34 from './fal/kling-3.0-turbo.model.js';
|
|
40
|
+
import catalogModel35 from './fal/kling-3.0.model.js';
|
|
41
|
+
import catalogModel36 from './fal/kling-image-o1.model.js';
|
|
42
|
+
import catalogModel37 from './fal/kling-video-o1.model.js';
|
|
43
|
+
import catalogModel38 from './fal/kling-video-v2.6-pro.model.js';
|
|
44
|
+
import catalogModel39 from './fal/ltx-2.model.js';
|
|
45
|
+
import catalogModel40 from './fal/minimax-h3.model.js';
|
|
46
|
+
import catalogModel41 from './fal/nano-banana-2.model.js';
|
|
47
|
+
import catalogModel42 from './fal/nano-banana-pro.model.js';
|
|
48
|
+
import catalogModel43 from './fal/nano-banana.model.js';
|
|
49
|
+
import catalogModel44 from './fal/pixverse-v5.5.model.js';
|
|
50
|
+
import catalogModel45 from './fal/qwen-image-3.0.model.js';
|
|
51
|
+
import catalogModel46 from './fal/seedance-2.0-fast.model.js';
|
|
52
|
+
import catalogModel47 from './fal/seedance-2.0-mini.model.js';
|
|
53
|
+
import catalogModel48 from './fal/seedance-2.0.model.js';
|
|
54
|
+
import catalogModel49 from './fal/seedance-2.5.model.js';
|
|
55
|
+
import catalogModel50 from './fal/seedance.model.js';
|
|
56
|
+
import catalogModel51 from './fal/seedream-5.0-lite.model.js';
|
|
57
|
+
import catalogModel52 from './fal/seedream-5.0-pro.model.js';
|
|
58
|
+
import catalogModel53 from './fal/seedream-v4.5.model.js';
|
|
59
|
+
import catalogModel54 from './fal/seedream-v4.model.js';
|
|
60
|
+
import catalogModel55 from './fal/seedvr2-image-upscale.model.js';
|
|
61
|
+
import catalogModel56 from './fal/topaz-image-upscale.model.js';
|
|
62
|
+
import catalogModel57 from './fal/topaz-transparent-upscale.model.js';
|
|
63
|
+
import catalogModel58 from './fal/veo-3.1.model.js';
|
|
64
|
+
import catalogModel59 from './fal/vidu-q2.model.js';
|
|
65
|
+
import catalogModel60 from './fal/wan-2.5-preview.model.js';
|
|
66
|
+
import catalogModel61 from './fal/z-image-turbo.model.js';
|
|
67
|
+
import catalogModel62 from './grsai/gpt-image-2.5.model.js';
|
|
68
|
+
import catalogModel63 from './grsai/gpt-image-2.model.js';
|
|
69
|
+
import catalogModel64 from './grsai/nano-banana-2-lite.model.js';
|
|
70
|
+
import catalogModel65 from './grsai/nano-banana-2.model.js';
|
|
71
|
+
import catalogModel66 from './grsai/nano-banana-pro.model.js';
|
|
72
|
+
import catalogModel67 from './kie/gemini-omni-video.model.js';
|
|
73
|
+
import catalogModel68 from './kie/gpt-image-2.5.model.js';
|
|
74
|
+
import catalogModel69 from './kie/gpt-image-2.model.js';
|
|
75
|
+
import catalogModel70 from './kie/grok-imagine-2.0.model.js';
|
|
76
|
+
import catalogModel71 from './kie/grok-imagine-video.model.js';
|
|
77
|
+
import catalogModel72 from './kie/grok-imagine.model.js';
|
|
78
|
+
import catalogModel73 from './kie/hailuo-02.model.js';
|
|
79
|
+
import catalogModel74 from './kie/hailuo-2-3.model.js';
|
|
80
|
+
import catalogModel75 from './kie/kling-3.0-omni.model.js';
|
|
81
|
+
import catalogModel76 from './kie/kling-3.0-turbo.model.js';
|
|
82
|
+
import catalogModel77 from './kie/kling-3.0.model.js';
|
|
83
|
+
import catalogModel78 from './kie/kling-v2-6.model.js';
|
|
84
|
+
import catalogModel79 from './kie/minimax-h3.model.js';
|
|
85
|
+
import catalogModel80 from './kie/nano-banana-2-lite.model.js';
|
|
86
|
+
import catalogModel81 from './kie/nano-banana-2.model.js';
|
|
87
|
+
import catalogModel82 from './kie/nano-banana-pro.model.js';
|
|
88
|
+
import catalogModel83 from './kie/qwen-image-3.0.model.js';
|
|
89
|
+
import catalogModel84 from './kie/seedance-1.5-pro.model.js';
|
|
90
|
+
import catalogModel85 from './kie/seedance-2.0-fast.model.js';
|
|
91
|
+
import catalogModel86 from './kie/seedance-2.0-mini.model.js';
|
|
92
|
+
import catalogModel87 from './kie/seedance-2.0.model.js';
|
|
93
|
+
import catalogModel88 from './kie/seedance-2.5.model.js';
|
|
94
|
+
import catalogModel89 from './kie/seedance-v1.model.js';
|
|
95
|
+
import catalogModel90 from './kie/seedream-4.0.model.js';
|
|
96
|
+
import catalogModel91 from './kie/seedream-4.5.model.js';
|
|
97
|
+
import catalogModel92 from './kie/seedream-5.0-lite.model.js';
|
|
98
|
+
import catalogModel93 from './kie/seedream-5.0-pro.model.js';
|
|
99
|
+
import catalogModel94 from './kie/z-image.model.js';
|
|
100
|
+
import catalogModel95 from './modelscope/flux-1-krea-dev.model.js';
|
|
101
|
+
import catalogModel96 from './modelscope/majicmix-realistic.model.js';
|
|
102
|
+
import catalogModel97 from './modelscope/modelscope-custom.model.js';
|
|
103
|
+
import catalogModel98 from './modelscope/qwen-image-edit-2509.model.js';
|
|
104
|
+
import catalogModel99 from './modelscope/qwen-image.model.js';
|
|
105
|
+
import catalogModel100 from './modelscope/sdxl-14-ckpt.model.js';
|
|
106
|
+
import catalogModel101 from './modelscope/z-image-turbo.model.js';
|
|
107
|
+
import catalogModel102 from './ppio/kling-3.0.model.js';
|
|
108
|
+
import catalogModel103 from './ppio/minimax-hailuo-2.3.model.js';
|
|
109
|
+
import catalogModel104 from './ppio/minimax-speech.model.js';
|
|
110
|
+
import catalogModel105 from './ppio/wan-2.5-preview.model.js';
|
|
111
|
+
import catalogModel106 from './ppio/wan-2.6.model.js';
|
|
112
|
+
import catalogModel107 from './ppio/wan-2.7.model.js';
|
|
113
|
+
import catalogModel108 from './volcengine/seedream-5.0-lite.model.js';
|
|
114
|
+
import catalogModel109 from './volcengine/seedream-5.0-pro.model.js';
|
|
111
115
|
export * from './defineModel.js';
|
|
112
116
|
export * from './model-index.js';
|
|
113
117
|
export * from './validate.js';
|
|
@@ -220,5 +224,9 @@ export const catalog = [
|
|
|
220
224
|
catalogModel103,
|
|
221
225
|
catalogModel104,
|
|
222
226
|
catalogModel105,
|
|
227
|
+
catalogModel106,
|
|
228
|
+
catalogModel107,
|
|
229
|
+
catalogModel108,
|
|
230
|
+
catalogModel109,
|
|
223
231
|
];
|
|
224
232
|
export const catalogIndex = createModelIndex(catalog);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { hasUploadedImage } from '../shared/mediaPresence.js';
|
|
3
|
+
import { GPT25_BACKGROUNDS, GPT25_KIE_RATIOS, GPT25_KIE_1K_RATIOS, GPT25_RESOLUTIONS, gpt25Choice, gpt25Images, gpt25Options, gpt25Prompt, gpt25Ratio } from '../shared/gptImage25.js';
|
|
4
|
+
export const kieGptImage25Model = defineModel({
|
|
5
|
+
meta: {
|
|
6
|
+
id: 'kie-gpt-image-2.5', canonicalModelId: 'gpt-image-2.5', seriesId: 'gpt-image', seriesRank: 2.5,
|
|
7
|
+
provider: 'kie', type: 'image',
|
|
8
|
+
tags: ['text-to-image', 'image-to-image', 'supports-image-editing', 'supports-multi-image', 'reference-mode', 'supports-4k', 'provider-kie'],
|
|
9
|
+
},
|
|
10
|
+
inputLimits: { images: { max: 16 }, videos: { max: 0 } },
|
|
11
|
+
params: [
|
|
12
|
+
{ id: 'gpt25Variant', type: 'dropdown', order: 1, default: 'flare', options: gpt25Options(['flare', 'sunburst']) },
|
|
13
|
+
{ id: 'gpt25AspectRatio', type: 'dropdown', order: 2, default: 'smart', options: gpt25Options(['smart', ...GPT25_KIE_RATIOS]) },
|
|
14
|
+
{ id: 'gpt25Resolution', type: 'dropdown', order: 3, default: '1K', options: gpt25Options(GPT25_RESOLUTIONS) },
|
|
15
|
+
{ id: 'gpt25Background', type: 'dropdown', order: 4, default: 'auto', options: gpt25Options(GPT25_BACKGROUNDS) },
|
|
16
|
+
],
|
|
17
|
+
endpoints: '/api/v1/jobs/createTask',
|
|
18
|
+
request: { builder: (params) => {
|
|
19
|
+
const variant = gpt25Choice(params.gpt25Variant, ['flare', 'sunburst'], 'flare');
|
|
20
|
+
const resolution = gpt25Choice(params.gpt25Resolution, GPT25_RESOLUTIONS, '1K');
|
|
21
|
+
const ratios = resolution === '1K' ? GPT25_KIE_RATIOS : GPT25_KIE_RATIOS.filter(r => !GPT25_KIE_1K_RATIOS.includes(r));
|
|
22
|
+
const input = {
|
|
23
|
+
prompt: gpt25Prompt(params, 20000),
|
|
24
|
+
aspect_ratio: gpt25Ratio(params, params.gpt25AspectRatio, ratios), resolution,
|
|
25
|
+
background: gpt25Choice(params.gpt25Background, GPT25_BACKGROUNDS, 'auto'),
|
|
26
|
+
};
|
|
27
|
+
const images = gpt25Images(params);
|
|
28
|
+
if (images.length)
|
|
29
|
+
input.input_urls = images;
|
|
30
|
+
return { model: `gpt-image-2-5-${variant}-${hasUploadedImage(params) ? 'image-to-image' : 'text-to-image'}`, input };
|
|
31
|
+
} },
|
|
32
|
+
pricing: {
|
|
33
|
+
currency: '$',
|
|
34
|
+
calculator: params => ({ '1K': 0.03, '2K': 0.05, '4K': 0.08 }[gpt25Choice(params.gpt25Resolution, GPT25_RESOLUTIONS, '1K')] ?? 0.03),
|
|
35
|
+
description: 'Flare / Sunburst 文生图与编辑同价:1K $0.03、2K $0.05、4K $0.08/张,不含充值赠送优惠',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
export default kieGptImage25Model;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { JsonObject, JsonValue } from '../../types/runtime.js';
|
|
2
|
+
export declare const GPT25_RATIOS: string[];
|
|
3
|
+
export declare const GPT25_EXT_RATIOS: string[];
|
|
4
|
+
export declare const GPT25_KIE_RATIOS: string[];
|
|
5
|
+
export declare const GPT25_KIE_1K_RATIOS: string[];
|
|
6
|
+
export declare const GPT25_QUALITIES: string[];
|
|
7
|
+
export declare const GPT25_RESOLUTIONS: string[];
|
|
8
|
+
export declare const GPT25_BACKGROUNDS: string[];
|
|
9
|
+
export declare const gpt25Options: (values: readonly string[]) => {
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
export declare function gpt25Choice(value: JsonValue, values: readonly string[], fallback: string): string;
|
|
13
|
+
export declare function gpt25Count(value: JsonValue, max: number): number;
|
|
14
|
+
export declare function gpt25Images(params: JsonObject): string[];
|
|
15
|
+
export declare function gpt25Prompt(params: JsonObject, max?: number): string;
|
|
16
|
+
export declare function gpt25Ratio(params: JsonObject, value: JsonValue, candidates: readonly string[]): string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { hasUploadedImage, resolveUploadedImageSources } from './mediaPresence.js';
|
|
2
|
+
export const GPT25_RATIOS = ['1:1', '3:2', '2:3', '4:3', '3:4', '5:4', '4:5', '16:9', '9:16', '2:1', '1:2', '21:9', '9:21', '3:1', '1:3'];
|
|
3
|
+
export const GPT25_EXT_RATIOS = ['1:1', '16:9', '9:16', '4:3', '3:4', '3:2', '2:3', '5:4', '4:5', '21:9'];
|
|
4
|
+
export const GPT25_KIE_RATIOS = ['1:1', '3:2', '2:3', '4:3', '3:4', '16:9', '9:16', '21:9', '27:16', '16:27', '9:8', '8:9'];
|
|
5
|
+
export const GPT25_KIE_1K_RATIOS = ['27:16', '16:27', '9:8', '8:9'];
|
|
6
|
+
export const GPT25_QUALITIES = ['auto', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
7
|
+
export const GPT25_RESOLUTIONS = ['1K', '2K', '4K'];
|
|
8
|
+
export const GPT25_BACKGROUNDS = ['auto', 'opaque', 'transparent'];
|
|
9
|
+
export const gpt25Options = (values) => values.map(value => ({ value }));
|
|
10
|
+
export function gpt25Choice(value, values, fallback) {
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
return fallback;
|
|
13
|
+
if (typeof value !== 'string' || !values.includes(value))
|
|
14
|
+
throw new Error(`GPT Image 2.5 参数不支持:${String(value)}`);
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
export function gpt25Count(value, max) {
|
|
18
|
+
if (value === undefined)
|
|
19
|
+
return 1;
|
|
20
|
+
if (typeof value !== 'number' || !Number.isInteger(value) || value < 1 || value > max) {
|
|
21
|
+
throw new Error(`GPT Image 2.5 生成数量必须为 1–${max} 的整数`);
|
|
22
|
+
}
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
export function gpt25Images(params) {
|
|
26
|
+
const images = resolveUploadedImageSources(params);
|
|
27
|
+
if (images.length > 16)
|
|
28
|
+
throw new Error('GPT Image 2.5 最多支持 16 张参考图');
|
|
29
|
+
return images;
|
|
30
|
+
}
|
|
31
|
+
export function gpt25Prompt(params, max) {
|
|
32
|
+
if (typeof params.prompt !== 'string' || !params.prompt.trim())
|
|
33
|
+
throw new Error('请输入 GPT Image 2.5 提示词');
|
|
34
|
+
if (max !== undefined && params.prompt.length > max)
|
|
35
|
+
throw new Error(`GPT Image 2.5 提示词最多 ${max} 字符`);
|
|
36
|
+
return params.prompt;
|
|
37
|
+
}
|
|
38
|
+
export function gpt25Ratio(params, value, candidates) {
|
|
39
|
+
const raw = gpt25Choice(value, ['smart', ...candidates], 'smart');
|
|
40
|
+
if (raw !== 'smart')
|
|
41
|
+
return raw;
|
|
42
|
+
const hint = hasUploadedImage(params) && typeof params.__firstImageRatio === 'number'
|
|
43
|
+
&& Number.isFinite(params.__firstImageRatio) && params.__firstImageRatio > 0 ? params.__firstImageRatio : 1;
|
|
44
|
+
return candidates.reduce((best, next) => {
|
|
45
|
+
const numeric = (ratio) => { const [w, h] = ratio.split(':').map(Number); return w / h; };
|
|
46
|
+
return Math.abs(numeric(next) - hint) < Math.abs(numeric(best) - hint) ? next : best;
|
|
47
|
+
}, '1:1');
|
|
48
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { JsonObject } from '../../types/runtime.js';
|
|
2
|
+
export declare const GPT25_OUTPUT_REFERENCE: Record<string, {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
tokens: number[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare function gpt25SizeReference(params: JsonObject): {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
tokens: number[];
|
|
11
|
+
};
|
|
12
|
+
export declare function gpt25OutputEstimate(params: JsonObject, rate: number, defaultQuality: string): number;
|