@henjicc/ai-sdk 0.8.0 → 0.10.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 +275 -211
- package/README.md +580 -577
- package/dist/capabilities/speech-recognition/bailian/module.js +40 -26
- package/dist/capabilities/speech-recognition/bailian/parse.js +9 -2
- package/dist/capabilities/speech-recognition/bailian/presets.d.ts +9 -1
- package/dist/capabilities/speech-recognition/bailian/presets.js +7 -2
- package/dist/capabilities/speech-recognition/bailian/realtime/presets.d.ts +2 -1
- package/dist/capabilities/speech-recognition/bailian/realtime/presets.js +2 -0
- package/dist/capabilities/speech-recognition/bailian/types.d.ts +2 -0
- package/dist/capabilities/speech-recognition/bailian/upload.js +11 -58
- package/dist/capabilities/speech-recognition/index.d.ts +5 -0
- package/dist/capabilities/speech-recognition/siliconflow/presets.d.ts +2 -3
- package/dist/capabilities/speech-recognition/siliconflow/presets.js +0 -2
- package/dist/capabilities/translation/bailian/types.d.ts +3 -0
- package/dist/capabilities/translation/bailian/types.js +6 -4
- package/dist/catalog/apimart/flux-3-image.model.d.ts +3 -0
- package/dist/catalog/apimart/flux-3-image.model.js +62 -0
- package/dist/catalog/apimart/flux-3-video.model.d.ts +3 -0
- package/dist/catalog/apimart/flux-3-video.model.js +120 -0
- package/dist/catalog/apimart/gemini-omni-1.2-flash.model.d.ts +3 -0
- package/dist/catalog/apimart/gemini-omni-1.2-flash.model.js +175 -0
- package/dist/catalog/apimart/gemini-omni-flash.model.js +30 -37
- package/dist/catalog/apimart/gpt-image-2.5.model.js +1 -1
- package/dist/catalog/apimart/gpt-image-2.6.model.d.ts +3 -0
- package/dist/catalog/apimart/gpt-image-2.6.model.js +103 -0
- package/dist/catalog/apimart/gpt-image-2.model.js +1 -1
- package/dist/catalog/apimart/grok-imagine-2.0.model.js +1 -1
- package/dist/catalog/apimart/grok-imagine-video-1.5.model.d.ts +3 -0
- package/dist/catalog/apimart/grok-imagine-video-1.5.model.js +85 -0
- package/dist/catalog/apimart/happyhorse-1.1.model.d.ts +3 -0
- package/dist/catalog/apimart/happyhorse-1.1.model.js +78 -0
- package/dist/catalog/apimart/kling-3.0-omni.model.js +12 -2
- package/dist/catalog/apimart/kling-3.0-turbo.model.js +5 -2
- package/dist/catalog/apimart/kling-3.0.model.js +1 -1
- package/dist/catalog/apimart/kling-4.0.model.d.ts +3 -0
- package/dist/catalog/apimart/kling-4.0.model.js +149 -0
- package/dist/catalog/apimart/midjourney-video.model.js +31 -32
- package/dist/catalog/apimart/midjourney.model.js +11 -1
- package/dist/catalog/apimart/minimax-h3-max.model.d.ts +3 -0
- package/dist/catalog/apimart/minimax-h3-max.model.js +101 -0
- package/dist/catalog/apimart/minimax-h3.model.js +8 -3
- package/dist/catalog/apimart/nano-banana-2-lite.model.js +1 -1
- package/dist/catalog/apimart/nano-banana-2.1.model.d.ts +2 -0
- package/dist/catalog/apimart/nano-banana-2.1.model.js +49 -0
- package/dist/catalog/apimart/nano-banana-2.model.js +1 -1
- package/dist/catalog/apimart/nano-banana-pro.model.js +1 -1
- package/dist/catalog/apimart/qwen-image-3.0.model.js +1 -1
- package/dist/catalog/apimart/seedance-2.0-fast.model.js +1 -1
- package/dist/catalog/apimart/seedance-2.0-mini.model.js +4 -4
- package/dist/catalog/apimart/seedance-2.0.model.js +1 -1
- package/dist/catalog/apimart/seedance-2.5.model.js +27 -5
- package/dist/catalog/apimart/seedream-5.0-flash.model.d.ts +3 -0
- package/dist/catalog/apimart/seedream-5.0-flash.model.js +52 -0
- package/dist/catalog/apimart/seedream-5.0-lite.model.js +4 -4
- package/dist/catalog/apimart/seedream-5.0-pro.model.js +1 -1
- package/dist/catalog/apimart/veo-3.1.model.d.ts +3 -0
- package/dist/catalog/apimart/veo-3.1.model.js +132 -0
- package/dist/catalog/apimart/wan-2.7-image.model.d.ts +3 -0
- package/dist/catalog/apimart/wan-2.7-image.model.js +80 -0
- package/dist/catalog/apimart/wan-3.0.model.d.ts +3 -0
- package/dist/catalog/apimart/wan-3.0.model.js +101 -0
- package/dist/catalog/apimart/z-image-turbo.model.js +1 -1
- package/dist/catalog/audio/tts-common.d.ts +2 -1
- package/dist/catalog/audio/tts-common.js +5 -1
- package/dist/catalog/bailian/cosyvoice-v3.5.model.js +1 -1
- package/dist/catalog/bailian/minimax-h3.model.d.ts +3 -0
- package/dist/catalog/bailian/minimax-h3.model.js +95 -0
- package/dist/catalog/bailian/minimax-speech-2.8.model.js +1 -1
- package/dist/catalog/bailian/qwen-audio-3.1-tts-flash.model.js +14 -3
- package/dist/catalog/bailian/qwen-audio-3.1-tts-plus.model.d.ts +2 -0
- package/dist/catalog/bailian/qwen-audio-3.1-tts-plus.model.js +44 -0
- package/dist/catalog/bailian/qwen-image-3.0.model.js +1 -1
- package/dist/catalog/bailian/wan-3.0.model.d.ts +3 -0
- package/dist/catalog/bailian/wan-3.0.model.js +104 -0
- package/dist/catalog/bailian/z-image-turbo.model.js +1 -1
- package/dist/catalog/consumer-contract.d.ts +16 -1
- package/dist/catalog/consumer-contract.js +31 -0
- package/dist/catalog/continuation.d.ts +20 -0
- package/dist/catalog/continuation.js +41 -0
- package/dist/catalog/fal/bria-creative-upscale.model.js +1 -1
- package/dist/catalog/fal/eleven-v3-tts.model.js +1 -1
- package/dist/catalog/fal/eleven-v4-tts.model.d.ts +2 -0
- package/dist/catalog/fal/eleven-v4-tts.model.js +38 -0
- package/dist/catalog/fal/flux-3-video.model.d.ts +2 -0
- package/dist/catalog/fal/flux-3-video.model.js +187 -0
- package/dist/catalog/fal/flux-3.model.d.ts +2 -0
- package/dist/catalog/fal/flux-3.model.js +69 -0
- package/dist/catalog/fal/gemini-omni-1.2-flash.model.d.ts +2 -0
- package/dist/catalog/fal/gemini-omni-1.2-flash.model.js +129 -0
- package/dist/catalog/fal/gemini-omni-flash.model.js +1 -1
- package/dist/catalog/fal/gpt-image-2.5.model.js +1 -1
- package/dist/catalog/fal/gpt-image-2.6.model.d.ts +2 -0
- package/dist/catalog/fal/gpt-image-2.6.model.js +97 -0
- package/dist/catalog/fal/gpt-image-2.model.js +1 -1
- package/dist/catalog/fal/grok-imagine-2.0.model.js +1 -1
- package/dist/catalog/fal/grok-imagine-video-1.5.model.d.ts +2 -0
- package/dist/catalog/fal/grok-imagine-video-1.5.model.js +121 -0
- package/dist/catalog/fal/hailuo-02.model.js +8 -4
- package/dist/catalog/fal/hailuo-2.3.model.js +1 -1
- package/dist/catalog/fal/ic-light-v2.model.js +1 -1
- package/dist/catalog/fal/ideogram-upscale.model.js +1 -1
- package/dist/catalog/fal/kling-3.0-omni.model.js +1 -1
- package/dist/catalog/fal/kling-3.0-turbo.model.js +5 -2
- package/dist/catalog/fal/kling-3.0.model.js +4 -1
- package/dist/catalog/fal/kling-4.0-flash.model.d.ts +2 -0
- package/dist/catalog/fal/kling-4.0-flash.model.js +132 -0
- package/dist/catalog/fal/kling-4.0.model.d.ts +2 -0
- package/dist/catalog/fal/kling-4.0.model.js +169 -0
- package/dist/catalog/fal/kling-image-o1.model.js +1 -1
- package/dist/catalog/fal/kling-video-o1.model.js +18 -7
- package/dist/catalog/fal/kling-video-v2.6-pro.model.js +3 -2
- package/dist/catalog/fal/ltx-2.3.model.d.ts +2 -0
- package/dist/catalog/fal/ltx-2.3.model.js +223 -0
- package/dist/catalog/fal/ltx-2.model.js +2 -1
- package/dist/catalog/fal/minimax-h3-max.model.d.ts +2 -0
- package/dist/catalog/fal/minimax-h3-max.model.js +132 -0
- package/dist/catalog/fal/minimax-h3.model.js +3 -4
- package/dist/catalog/fal/minimax-speech-2.8.model.js +1 -1
- package/dist/catalog/fal/nano-banana-2.1.model.d.ts +2 -0
- package/dist/catalog/fal/nano-banana-2.1.model.js +68 -0
- package/dist/catalog/fal/nano-banana-2.model.js +1 -1
- package/dist/catalog/fal/nano-banana-pro.model.js +1 -1
- package/dist/catalog/fal/nano-banana.model.js +1 -1
- package/dist/catalog/fal/pixverse-v5.5.model.js +9 -4
- package/dist/catalog/fal/qwen-image-3.0.model.js +2 -2
- package/dist/catalog/fal/qwen3-tts-1.7b.model.js +4 -3
- package/dist/catalog/fal/seedance-2.0-fast.model.js +1 -1
- package/dist/catalog/fal/seedance-2.0-mini.model.js +1 -1
- package/dist/catalog/fal/seedance-2.0.model.js +1 -1
- package/dist/catalog/fal/seedance-2.5.model.js +5 -2
- package/dist/catalog/fal/seedance.model.js +3 -2
- package/dist/catalog/fal/seedream-5.0-lite.model.js +1 -1
- package/dist/catalog/fal/seedream-5.0-pro.model.js +1 -1
- package/dist/catalog/fal/seedream-v4.5.model.js +1 -1
- package/dist/catalog/fal/seedream-v4.model.js +1 -1
- package/dist/catalog/fal/seedvr2-image-upscale.model.js +1 -1
- package/dist/catalog/fal/topaz-image-upscale.model.js +1 -1
- package/dist/catalog/fal/topaz-transparent-upscale.model.js +1 -1
- package/dist/catalog/fal/utils/klingV4.d.ts +17 -0
- package/dist/catalog/fal/utils/klingV4.js +33 -0
- package/dist/catalog/fal/veo-3.1.model.js +5 -2
- package/dist/catalog/fal/vidu-q2.model.js +20 -8
- package/dist/catalog/fal/wan-2.5-preview.model.js +4 -1
- package/dist/catalog/fal/wan-3.0.model.d.ts +2 -0
- package/dist/catalog/fal/wan-3.0.model.js +135 -0
- package/dist/catalog/fal/z-image-turbo.model.js +10 -9
- package/dist/catalog/grsai/gpt-image-2.5.model.js +13 -31
- package/dist/catalog/grsai/gpt-image-2.6.model.d.ts +2 -0
- package/dist/catalog/grsai/gpt-image-2.6.model.js +37 -0
- package/dist/catalog/grsai/gpt-image-2.model.js +5 -2
- package/dist/catalog/grsai/nano-banana-2-lite.model.js +1 -1
- package/dist/catalog/grsai/nano-banana-2.1.model.d.ts +2 -0
- package/dist/catalog/grsai/nano-banana-2.1.model.js +29 -0
- package/dist/catalog/grsai/nano-banana-2.model.js +1 -1
- package/dist/catalog/grsai/nano-banana-pro.model.js +1 -1
- package/dist/catalog/grsai/wan-3.0.model.d.ts +2 -0
- package/dist/catalog/grsai/wan-3.0.model.js +78 -0
- package/dist/catalog/index.d.ts +1 -0
- package/dist/catalog/index.js +205 -124
- package/dist/catalog/kie/eleven-v3-dialogue.model.js +1 -1
- package/dist/catalog/kie/flux-3-klein.model.d.ts +2 -0
- package/dist/catalog/kie/flux-3-klein.model.js +58 -0
- package/dist/catalog/kie/gemini-3.1-flash-tts.model.js +7 -4
- package/dist/catalog/kie/gemini-3.8-flash-lite-tts.model.d.ts +2 -0
- package/dist/catalog/kie/gemini-3.8-flash-lite-tts.model.js +11 -0
- package/dist/catalog/kie/gemini-3.8-flash-tts.model.d.ts +2 -0
- package/dist/catalog/kie/gemini-3.8-flash-tts.model.js +11 -0
- package/dist/catalog/kie/gemini-omni-video.model.js +8 -30
- package/dist/catalog/kie/gemini38Tts.d.ts +3 -0
- package/dist/catalog/kie/gemini38Tts.js +40 -0
- package/dist/catalog/kie/gpt-image-2.5.model.js +1 -1
- package/dist/catalog/kie/gpt-image-2.6.model.d.ts +2 -0
- package/dist/catalog/kie/gpt-image-2.6.model.js +87 -0
- package/dist/catalog/kie/gpt-image-2.model.js +8 -12
- package/dist/catalog/kie/grok-imagine-2.0.model.js +1 -1
- package/dist/catalog/kie/grok-imagine-video-1.5.model.d.ts +2 -0
- package/dist/catalog/kie/grok-imagine-video-1.5.model.js +52 -0
- package/dist/catalog/kie/grok-imagine-video.model.js +7 -3
- package/dist/catalog/kie/grok-imagine.model.js +4 -2
- package/dist/catalog/kie/hailuo-02.model.js +6 -4
- package/dist/catalog/kie/hailuo-2-3.model.js +1 -1
- package/dist/catalog/kie/happyhorse-1.1.model.js +5 -2
- package/dist/catalog/kie/kling-3.0-omni.model.js +51 -23
- package/dist/catalog/kie/kling-3.0-turbo.model.js +1 -1
- package/dist/catalog/kie/kling-3.0.model.js +1 -8
- package/dist/catalog/kie/kling-4.0-flash.model.d.ts +2 -0
- package/dist/catalog/kie/kling-4.0-flash.model.js +16 -0
- package/dist/catalog/kie/kling-4.0.model.d.ts +2 -0
- package/dist/catalog/kie/kling-4.0.model.js +17 -0
- package/dist/catalog/kie/kling-v2-6.model.js +1 -1
- package/dist/catalog/kie/kling40.d.ts +21 -0
- package/dist/catalog/kie/kling40.js +129 -0
- package/dist/catalog/kie/minimax-h3.model.js +16 -21
- package/dist/catalog/kie/nano-banana-2-lite.model.js +1 -1
- package/dist/catalog/kie/nano-banana-2.1.model.d.ts +2 -0
- package/dist/catalog/kie/nano-banana-2.1.model.js +34 -0
- package/dist/catalog/kie/nano-banana-2.model.js +2 -2
- package/dist/catalog/kie/nano-banana-pro.model.js +1 -1
- package/dist/catalog/kie/qwen-image-3.0.model.js +2 -10
- package/dist/catalog/kie/seedance-1.5-pro.model.js +2 -1
- package/dist/catalog/kie/seedance-2.0-fast.model.js +5 -1
- package/dist/catalog/kie/seedance-2.0-mini.model.js +5 -1
- package/dist/catalog/kie/seedance-2.0.model.js +5 -1
- package/dist/catalog/kie/seedance-2.5.model.js +10 -20
- package/dist/catalog/kie/seedance-v1.model.js +8 -4
- package/dist/catalog/kie/seedream-4.0.model.js +1 -1
- package/dist/catalog/kie/seedream-4.5.model.js +1 -1
- package/dist/catalog/kie/seedream-5.0-lite.model.js +1 -1
- package/dist/catalog/kie/seedream-5.0-pro.model.js +1 -1
- package/dist/catalog/kie/wan-3.0-prime.model.d.ts +2 -0
- package/dist/catalog/kie/wan-3.0-prime.model.js +15 -0
- package/dist/catalog/kie/wan-3.0.model.d.ts +2 -0
- package/dist/catalog/kie/wan-3.0.model.js +15 -0
- package/dist/catalog/kie/wan30.d.ts +10 -0
- package/dist/catalog/kie/wan30.js +78 -0
- package/dist/catalog/kie/z-image.model.js +1 -1
- package/dist/catalog/modelscope/flux-1-krea-dev.model.js +4 -2
- package/dist/catalog/modelscope/majicmix-realistic.model.js +3 -2
- package/dist/catalog/modelscope/modelscope-custom.model.js +3 -2
- package/dist/catalog/modelscope/qwen-image-2512.model.d.ts +5 -0
- package/dist/catalog/modelscope/{qwen-image.model.js → qwen-image-2512.model.js} +11 -8
- package/dist/catalog/modelscope/qwen-image-edit-2511.model.d.ts +5 -0
- package/dist/catalog/modelscope/{qwen-image-edit-2509.model.js → qwen-image-edit-2511.model.js} +9 -7
- package/dist/catalog/modelscope/sdxl-14-ckpt.model.js +3 -2
- package/dist/catalog/modelscope/utils.js +2 -2
- package/dist/catalog/modelscope/z-image-turbo.model.js +3 -2
- package/dist/catalog/ppio/kling-3.0.model.js +4 -1
- package/dist/catalog/ppio/minimax-speech.model.js +2 -1
- package/dist/catalog/shared/mediaPresence.d.ts +8 -1
- package/dist/catalog/shared/mediaPresence.js +21 -1
- package/dist/catalog/shared/nanoBanana21.d.ts +11 -0
- package/dist/catalog/shared/nanoBanana21.js +30 -0
- package/dist/catalog/shared/shotList.d.ts +31 -0
- package/dist/catalog/shared/shotList.js +48 -0
- package/dist/catalog/shared/subjectElements.d.ts +36 -0
- package/dist/catalog/shared/subjectElements.js +93 -0
- package/dist/catalog/siliconflow/moss-ttsd-0.5.model.js +1 -1
- package/dist/catalog/validate.js +14 -1
- package/dist/catalog/volcengine/seedance-2.0-fast.model.d.ts +2 -0
- package/dist/catalog/volcengine/seedance-2.0-fast.model.js +11 -0
- package/dist/catalog/volcengine/seedance-2.0-mini.model.d.ts +2 -0
- package/dist/catalog/volcengine/seedance-2.0-mini.model.js +11 -0
- package/dist/catalog/volcengine/seedance-2.0.model.d.ts +2 -0
- package/dist/catalog/volcengine/seedance-2.0.model.js +11 -0
- package/dist/catalog/volcengine/seedance-2.5.model.d.ts +2 -0
- package/dist/catalog/volcengine/seedance-2.5.model.js +11 -0
- package/dist/catalog/volcengine/seedance.d.ts +17 -0
- package/dist/catalog/volcengine/seedance.js +192 -0
- package/dist/catalog/volcengine/seedream-5.0-lite.model.js +2 -1
- package/dist/catalog/volcengine/seedream-5.0.js +1 -1
- package/dist/catalog/volcengine-speech/seed-icl-2.0.model.d.ts +1 -0
- package/dist/catalog/volcengine-speech/seed-icl-2.0.model.js +52 -10
- package/dist/catalog/volcengine-speech/seed-tts-2.0-voices.d.ts +2 -0
- package/dist/catalog/volcengine-speech/seed-tts-2.0-voices.js +438 -0
- package/dist/catalog/volcengine-speech/seed-tts-2.0.model.js +4 -4
- package/dist/discovery/index.js +13 -6
- package/dist/generation/core.d.ts +6 -0
- package/dist/generation/core.js +10 -2
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/llm/bigmodel/preset.js +2 -1
- package/dist/llm/bigmodel/profiles.js +0 -6
- package/dist/llm/chat.d.ts +8 -0
- package/dist/llm/chat.js +18 -2
- package/dist/llm/chatTypes.d.ts +6 -0
- package/dist/llm/defaults.d.ts +2 -2
- package/dist/llm/defaults.js +3 -3
- package/dist/llm/groq/preset.js +18 -2
- package/dist/llm/modelCatalog.d.ts +9 -2
- package/dist/llm/modelCatalog.js +17 -4
- package/dist/llm/modelCatalogEntries.d.ts +2 -0
- package/dist/llm/modelCatalogEntries.js +197 -42
- package/dist/llm/providerPresets.d.ts +3 -0
- package/dist/llm/providerPresets.js +145 -32
- package/dist/llm/providerReasoningRequest.js +28 -11
- package/dist/llm/siliconflow/index.js +1 -1
- package/dist/llm/siliconflow/preset.js +30 -0
- package/dist/llm/types.d.ts +6 -0
- package/dist/packs/models/{ppio/wan-2.5-preview.d.ts → apimart/flux-3-image.d.ts} +1 -1
- package/dist/packs/models/apimart/flux-3-image.js +7 -0
- package/dist/packs/models/apimart/flux-3-video.d.ts +6 -0
- package/dist/packs/models/apimart/flux-3-video.js +7 -0
- package/dist/packs/models/apimart/gemini-omni-1.2-flash.d.ts +6 -0
- package/dist/packs/models/apimart/gemini-omni-1.2-flash.js +7 -0
- package/dist/packs/models/{modelscope/qwen-image.d.ts → apimart/gpt-image-2.6.d.ts} +1 -1
- package/dist/packs/models/apimart/gpt-image-2.6.js +7 -0
- package/dist/packs/models/apimart/grok-imagine-video-1.5.d.ts +6 -0
- package/dist/packs/models/apimart/grok-imagine-video-1.5.js +7 -0
- package/dist/packs/models/apimart/happyhorse-1.1.d.ts +6 -0
- package/dist/packs/models/apimart/happyhorse-1.1.js +7 -0
- package/dist/packs/models/apimart/kling-4.0.d.ts +6 -0
- package/dist/packs/models/apimart/kling-4.0.js +7 -0
- package/dist/packs/models/apimart/minimax-h3-max.d.ts +6 -0
- package/dist/packs/models/apimart/minimax-h3-max.js +7 -0
- package/dist/packs/models/{ppio/minimax-hailuo-2.3.d.ts → apimart/nano-banana-2.1.d.ts} +1 -1
- package/dist/packs/models/{ppio/minimax-hailuo-2.3.js → apimart/nano-banana-2.1.js} +4 -4
- package/dist/packs/models/apimart/seedream-5.0-flash.d.ts +6 -0
- package/dist/packs/models/apimart/seedream-5.0-flash.js +7 -0
- package/dist/packs/models/apimart/veo-3.1.d.ts +6 -0
- package/dist/packs/models/apimart/veo-3.1.js +7 -0
- package/dist/packs/models/apimart/wan-2.7-image.d.ts +6 -0
- package/dist/packs/models/apimart/wan-2.7-image.js +7 -0
- package/dist/packs/models/apimart/wan-3.0.d.ts +6 -0
- package/dist/packs/models/apimart/wan-3.0.js +7 -0
- package/dist/packs/models/bailian/cosyvoice-v3.5.js +1 -1
- package/dist/packs/models/bailian/minimax-h3.d.ts +6 -0
- package/dist/packs/models/bailian/minimax-h3.js +7 -0
- package/dist/packs/models/bailian/minimax-speech-2.8.js +1 -1
- package/dist/packs/models/bailian/qwen-audio-3.1-tts-flash.js +1 -1
- package/dist/packs/models/bailian/qwen-audio-3.1-tts-plus.d.ts +6 -0
- package/dist/packs/models/bailian/qwen-audio-3.1-tts-plus.js +7 -0
- package/dist/packs/models/bailian/qwen-image-3.0.js +1 -1
- package/dist/packs/models/bailian/wan-3.0.d.ts +6 -0
- package/dist/packs/models/bailian/wan-3.0.js +7 -0
- package/dist/packs/models/bailian/z-image-turbo.js +1 -1
- package/dist/packs/models/fal/eleven-v4-tts.d.ts +6 -0
- package/dist/packs/models/{ppio/wan-2.5-preview.js → fal/eleven-v4-tts.js} +4 -4
- package/dist/packs/models/fal/flux-3-video.d.ts +6 -0
- package/dist/packs/models/fal/flux-3-video.js +7 -0
- package/dist/packs/models/{ppio/wan-2.6.d.ts → fal/flux-3.d.ts} +1 -1
- package/dist/packs/models/{ppio/wan-2.6.js → fal/flux-3.js} +4 -4
- package/dist/packs/models/fal/gemini-omni-1.2-flash.d.ts +6 -0
- package/dist/packs/models/fal/gemini-omni-1.2-flash.js +7 -0
- package/dist/packs/models/fal/gpt-image-2.6.d.ts +6 -0
- package/dist/packs/models/fal/gpt-image-2.6.js +7 -0
- package/dist/packs/models/fal/grok-imagine-video-1.5.d.ts +6 -0
- package/dist/packs/models/fal/grok-imagine-video-1.5.js +7 -0
- package/dist/packs/models/fal/kling-4.0-flash.d.ts +6 -0
- package/dist/packs/models/fal/kling-4.0-flash.js +7 -0
- package/dist/packs/models/fal/kling-4.0.d.ts +6 -0
- package/dist/packs/models/{ppio/wan-2.7.js → fal/kling-4.0.js} +4 -4
- package/dist/packs/models/{ppio/wan-2.7.d.ts → fal/ltx-2.3.d.ts} +1 -1
- package/dist/packs/models/fal/ltx-2.3.js +7 -0
- package/dist/packs/models/fal/minimax-h3-max.d.ts +6 -0
- package/dist/packs/models/fal/minimax-h3-max.js +7 -0
- package/dist/packs/models/fal/nano-banana-2.1.d.ts +6 -0
- package/dist/packs/models/fal/nano-banana-2.1.js +7 -0
- package/dist/packs/models/fal/wan-3.0.d.ts +6 -0
- package/dist/packs/models/fal/wan-3.0.js +7 -0
- package/dist/packs/models/grsai/gpt-image-2.6.d.ts +6 -0
- package/dist/packs/models/grsai/gpt-image-2.6.js +7 -0
- package/dist/packs/models/grsai/nano-banana-2.1.d.ts +6 -0
- package/dist/packs/models/grsai/nano-banana-2.1.js +7 -0
- package/dist/packs/models/grsai/wan-3.0.d.ts +6 -0
- package/dist/packs/models/grsai/wan-3.0.js +7 -0
- package/dist/packs/models/kie/flux-3-klein.d.ts +6 -0
- package/dist/packs/models/kie/flux-3-klein.js +7 -0
- package/dist/packs/models/kie/gemini-3.8-flash-lite-tts.d.ts +6 -0
- package/dist/packs/models/kie/gemini-3.8-flash-lite-tts.js +7 -0
- package/dist/packs/models/kie/{eleven-turbo-2.5-tts.d.ts → gemini-3.8-flash-tts.d.ts} +1 -1
- package/dist/packs/models/kie/{eleven-turbo-2.5-tts.js → gemini-3.8-flash-tts.js} +1 -1
- package/dist/packs/models/kie/gpt-image-2.6.d.ts +6 -0
- package/dist/packs/models/kie/gpt-image-2.6.js +7 -0
- package/dist/packs/models/kie/grok-imagine-video-1.5.d.ts +6 -0
- package/dist/packs/models/kie/grok-imagine-video-1.5.js +7 -0
- package/dist/packs/models/kie/kling-4.0-flash.d.ts +6 -0
- package/dist/packs/models/kie/kling-4.0-flash.js +7 -0
- package/dist/packs/models/kie/kling-4.0.d.ts +6 -0
- package/dist/packs/models/kie/kling-4.0.js +7 -0
- package/dist/packs/models/kie/nano-banana-2.1.d.ts +6 -0
- package/dist/packs/models/kie/nano-banana-2.1.js +7 -0
- package/dist/packs/models/kie/wan-3.0-prime.d.ts +6 -0
- package/dist/packs/models/kie/wan-3.0-prime.js +7 -0
- package/dist/packs/models/kie/wan-3.0.d.ts +6 -0
- package/dist/packs/models/kie/wan-3.0.js +7 -0
- package/dist/packs/models/modelscope/flux-1-krea-dev.js +1 -1
- package/dist/packs/models/modelscope/majicmix-realistic.js +1 -1
- package/dist/packs/models/modelscope/modelscope-custom.js +1 -1
- package/dist/packs/models/modelscope/qwen-image-2512.d.ts +6 -0
- package/dist/packs/models/modelscope/{qwen-image.js → qwen-image-2512.js} +2 -2
- package/dist/packs/models/modelscope/{qwen-image-edit-2509.d.ts → qwen-image-edit-2511.d.ts} +1 -1
- package/dist/packs/models/modelscope/{qwen-image-edit-2509.js → qwen-image-edit-2511.js} +2 -2
- package/dist/packs/models/modelscope/sdxl-14-ckpt.js +1 -1
- package/dist/packs/models/modelscope/z-image-turbo.js +1 -1
- package/dist/packs/models/volcengine/seedance-2.0-fast.d.ts +6 -0
- package/dist/packs/models/volcengine/seedance-2.0-fast.js +7 -0
- package/dist/packs/models/volcengine/seedance-2.0-mini.d.ts +6 -0
- package/dist/packs/models/volcengine/seedance-2.0-mini.js +7 -0
- package/dist/packs/models/volcengine/seedance-2.0.d.ts +6 -0
- package/dist/packs/models/volcengine/seedance-2.0.js +7 -0
- package/dist/packs/models/volcengine/seedance-2.5.d.ts +6 -0
- package/dist/packs/models/volcengine/seedance-2.5.js +7 -0
- package/dist/packs/models/volcengine/seedream-5.0-flash.js +1 -1
- package/dist/packs/models/volcengine/seedream-5.0-lite.js +1 -1
- package/dist/packs/models/volcengine/seedream-5.0-pro.js +1 -1
- package/dist/packs/provider-adapters/bailian.js +1 -1
- package/dist/packs/provider-adapters/modelscope.js +1 -1
- package/dist/packs/provider-adapters/volcengine.js +1 -1
- package/dist/packs/provider-packs/apimart.d.ts +1 -1
- package/dist/packs/provider-packs/apimart.js +35 -22
- package/dist/packs/provider-packs/bailian.d.ts +1 -1
- package/dist/packs/provider-packs/bailian.js +8 -5
- package/dist/packs/provider-packs/fal.d.ts +1 -1
- package/dist/packs/provider-packs/fal.js +52 -40
- package/dist/packs/provider-packs/grsai.d.ts +1 -1
- package/dist/packs/provider-packs/grsai.js +8 -5
- package/dist/packs/provider-packs/kie.d.ts +1 -1
- package/dist/packs/provider-packs/kie.js +41 -32
- package/dist/packs/provider-packs/modelscope.js +2 -2
- package/dist/packs/provider-packs/ppio.d.ts +1 -1
- package/dist/packs/provider-packs/ppio.js +2 -6
- package/dist/packs/provider-packs/volcengine.d.ts +1 -1
- package/dist/packs/provider-packs/volcengine.js +8 -4
- package/dist/pricing/index.d.ts +1 -0
- package/dist/pricing/index.js +1 -0
- package/dist/pricing/mediaContext.d.ts +6 -1
- package/dist/pricing/mediaContext.js +12 -5
- package/dist/pricing/tokenPricing.d.ts +36 -0
- package/dist/pricing/tokenPricing.js +26 -0
- package/dist/providers/bailian.d.ts +1 -1
- package/dist/providers/bailian.js +71 -4
- package/dist/providers/fal.js +11 -1
- package/dist/providers/helpers.d.ts +1 -1
- package/dist/providers/helpers.js +17 -5
- package/dist/providers/kie.js +16 -5
- package/dist/providers/metadata.js +2 -2
- package/dist/providers/openai-speech.d.ts +6 -0
- package/dist/providers/openai-speech.js +31 -0
- package/dist/providers/providerAccessErrors.d.ts +3 -0
- package/dist/providers/providerAccessErrors.js +73 -0
- package/dist/providers/siliconflow.js +2 -27
- package/dist/providers/volcengine-speech.d.ts +1 -1
- package/dist/providers/volcengine-speech.js +31 -8
- package/dist/providers/volcengine-voice-clone.d.ts +3 -0
- package/dist/providers/volcengine-voice-clone.js +138 -0
- package/dist/providers/volcengine.d.ts +1 -1
- package/dist/providers/volcengine.js +89 -11
- package/dist/runtime/retry.js +3 -0
- package/dist/tool-packs/fal-erase/models/bria-eraser.model.js +1 -1
- package/dist/tool-packs/fal-erase/models/finegrain-eraser.model.js +1 -1
- package/dist/tool-packs/fal-erase/models/flux-pro-erase.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/control-light.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/outpaint.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/photo-restoration.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/pixelcut-background-removal.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/product-photography.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/relighting.model.js +1 -1
- package/dist/tool-packs/fal-multi-angle/models/flux-2-multiple-angles.model.js +1 -1
- package/dist/tool-packs/fal-multi-angle/models/perspective-change.model.js +1 -1
- package/dist/tool-packs/fal-multi-angle/models/qwen-image-edit-2511-multiple-angles.model.js +1 -1
- package/dist/types/model.d.ts +68 -12
- package/dist/types/model.js +3 -0
- package/dist/types/modelTags.d.ts +142 -0
- package/dist/types/modelTags.js +44 -0
- package/dist/types/runtime.d.ts +3 -0
- package/dist/types/speechTimings.d.ts +15 -0
- package/dist/types/speechTimings.js +1 -0
- package/dist/upload/apimart-upload.d.ts +1 -1
- package/dist/upload/apimart-upload.js +37 -15
- package/dist/upload/bailian-oss-upload.d.ts +32 -0
- package/dist/upload/bailian-oss-upload.js +74 -0
- package/dist/upload/{fal-legacy.js → fal-host-fetch.js} +2 -2
- package/dist/upload/fal-transport.d.ts +6 -0
- package/dist/upload/fal-transport.js +2 -1
- package/dist/upload/index.d.ts +2 -2
- package/dist/upload/index.js +4 -7
- package/dist/upload/kie-upload.d.ts +1 -1
- package/dist/upload/kie-upload.js +34 -12
- package/dist/upload/media-binary.js +1 -0
- package/dist/upload/media-fields.js +7 -2
- package/dist/upload/preprocess-core.d.ts +2 -0
- package/dist/upload/preprocess-core.js +2 -0
- package/dist/upload/preprocess.d.ts +1 -1
- package/dist/upload/preprocess.js +12 -3
- package/dist/upload/provider-preprocessors/apimart.d.ts +1 -1
- package/dist/upload/provider-preprocessors/apimart.js +13 -5
- package/dist/upload/provider-preprocessors/bailian.d.ts +8 -0
- package/dist/upload/provider-preprocessors/bailian.js +45 -0
- package/dist/upload/provider-preprocessors/kie.d.ts +1 -1
- package/dist/upload/provider-preprocessors/kie.js +26 -9
- package/dist/upload/provider-preprocessors/ppio.d.ts +1 -2
- package/dist/upload/provider-preprocessors/ppio.js +2 -29
- package/dist/upload/provider-preprocessors/public-host.d.ts +5 -0
- package/dist/upload/provider-preprocessors/public-host.js +7 -0
- package/dist/upload/provider-preprocessors/volcengine.d.ts +5 -0
- package/dist/upload/provider-preprocessors/volcengine.js +10 -0
- package/dist/upload/public-host-upload.d.ts +7 -0
- package/dist/upload/public-host-upload.js +55 -0
- package/dist/upload/upload-response.js +12 -7
- package/docs/README.md +26 -26
- package/docs/consumers.md +150 -124
- package/docs/llm-adaptation/README.md +180 -166
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/DeepSeek.md +108 -104
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/Kimi.md +94 -76
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/MiniMax.md +89 -84
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//345/260/217/347/261/263MiMo.md +126 -126
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//346/231/272/350/260/261GLM.md +238 -234
- 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 +131 -87
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//347/231/276/347/202/274Qwen.md +112 -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/Eleven-v4/Eleven-v4_Fal.md +49 -0
- 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/FLUX-3/FLUX-3_APIMart.md +65 -0
- package/docs/model-adaptation/FLUX-3/FLUX-3_Fal.md +48 -0
- package/docs/model-adaptation/FLUX-3-Klein/FLUX-3-Klein_KIE.md +38 -0
- package/docs/model-adaptation/FLUX-3-Video/FLUX-3-Video_APIMart.md +84 -0
- package/docs/model-adaptation/FLUX-3-Video/FLUX-3-Video_Fal.md +80 -0
- 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 +47 -47
- package/docs/model-adaptation/Fun-ASR-Flash-2026-06-15/Fun-ASR-Flash-2026-06-15_/347/231/276/347/202/274.md +45 -45
- package/docs/model-adaptation/Fun-ASR-Realtime/Fun-ASR-Realtime_/347/231/276/347/202/274.md +57 -57
- 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 +217 -213
- 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 +138 -137
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_KIE.md +97 -93
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_APIMart.md +66 -66
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Fal.md +55 -55
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Grsai.md +59 -53
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_KIE.md +55 -55
- package/docs/model-adaptation/GPT-Image-2.6/GPT-Image-2.6_APIMart.md +101 -0
- package/docs/model-adaptation/GPT-Image-2.6/GPT-Image-2.6_Fal.md +55 -0
- package/docs/model-adaptation/GPT-Image-2.6/GPT-Image-2.6_Grsai.md +32 -0
- package/docs/model-adaptation/GPT-Image-2.6/GPT-Image-2.6_KIE.md +51 -0
- package/docs/model-adaptation/GPT-OSS-20B/GPT-OSS-20B_Groq.md +62 -62
- package/docs/model-adaptation/Gemini-3.8-Flash-Lite-TTS/Gemini-3.8-Flash-Lite-TTS_KIE.md +22 -0
- package/docs/model-adaptation/Gemini-3.8-Flash-TTS/Gemini-3.8-Flash-TTS_KIE.md +38 -0
- package/docs/model-adaptation/Gemini-Omni-1.2-Flash/Gemini-Omni-1.2-Flash_APIMart.md +79 -0
- package/docs/model-adaptation/Gemini-Omni-1.2-Flash/Gemini-Omni-1.2-Flash_Fal.md +60 -0
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_APIMart.md +131 -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 +132 -129
- package/docs/model-adaptation/Grok-Imagine/Grok-Imagine_KIE.md +38 -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/Grok-Imagine-Video-1.5/Grok-Imagine-Video-1.5_APIMart.md +68 -0
- package/docs/model-adaptation/Grok-Imagine-Video-1.5/Grok-Imagine-Video-1.5_Fal.md +47 -0
- package/docs/model-adaptation/Grok-Imagine-Video-1.5/Grok-Imagine-Video-1.5_KIE.md +37 -0
- package/docs/model-adaptation/Hailuo-02/Hailuo-02_Fal.md +95 -93
- package/docs/model-adaptation/Hailuo-02/Hailuo-02_KIE.md +58 -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/HappyHorse-1.1/HappyHorse-1.1_APIMart.md +66 -0
- package/docs/model-adaptation/HappyHorse-1.1/HappyHorse-1.1_KIE.md +31 -27
- package/docs/model-adaptation/IC-Light-v2/IC-Light-v2_Fal.md +99 -99
- 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 +91 -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 +120 -119
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_APIMart.md +130 -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 +148 -143
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_APIMart.md +88 -85
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_Fal.md +86 -83
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_KIE.md +84 -84
- package/docs/model-adaptation/Kling-4.0/Kling-4.0_APIMart.md +76 -0
- package/docs/model-adaptation/Kling-4.0/Kling-4.0_Fal.md +115 -0
- package/docs/model-adaptation/Kling-4.0/Kling-4.0_KIE.md +61 -0
- package/docs/model-adaptation/Kling-4.0-Flash/Kling-4.0-Flash_Fal.md +55 -0
- package/docs/model-adaptation/Kling-4.0-Flash/Kling-4.0-Flash_KIE.md +33 -0
- package/docs/model-adaptation/LTX-2.3/LTX-2.3_Fal.md +121 -0
- package/docs/model-adaptation/Midjourney/Midjourney_APIMart.md +402 -396
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_APIMart.md +237 -234
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_Fal.md +112 -108
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_KIE.md +118 -111
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_/347/231/276/347/202/274.md +65 -0
- package/docs/model-adaptation/MiniMax-H3-Max/MiniMax-H3-Max_APIMart.md +78 -0
- package/docs/model-adaptation/MiniMax-H3-Max/MiniMax-H3-Max_Fal.md +62 -0
- 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 +72 -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-2.1/Nano-Banana-2.1_APIMart.md +35 -0
- package/docs/model-adaptation/Nano-Banana-2.1/Nano-Banana-2.1_Fal.md +37 -0
- package/docs/model-adaptation/Nano-Banana-2.1/Nano-Banana-2.1_Grsai.md +35 -0
- package/docs/model-adaptation/Nano-Banana-2.1/Nano-Banana-2.1_KIE.md +36 -0
- 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-Audio-3.1-TTS-Plus/Qwen-Audio-3.1-TTS-Plus_/347/231/276/347/202/274.md +59 -0
- 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 +85 -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 -57
- package/docs/model-adaptation/Qwen-MT-Flash/Qwen-MT-Flash_/347/231/276/347/202/274.md +68 -68
- package/docs/model-adaptation/Qwen-MT-Lite/Qwen-MT-Lite_/347/231/276/347/202/274.md +40 -40
- package/docs/model-adaptation/Qwen-MT-Plus/Qwen-MT-Plus_/347/231/276/347/202/274.md +40 -40
- package/docs/model-adaptation/Qwen3-ASR-Flash/Qwen3-ASR-Flash_/347/231/276/347/202/274.md +44 -44
- package/docs/model-adaptation/Qwen3-ASR-Flash-2026-02-10/Qwen3-ASR-Flash-2026-02-10_/347/231/276/347/202/274.md +37 -37
- package/docs/model-adaptation/Qwen3-ASR-Flash-Filetrans/Qwen3-ASR-Flash-Filetrans_/347/231/276/347/202/274.md +45 -45
- package/docs/model-adaptation/Qwen3-ASR-Flash-Realtime/Qwen3-ASR-Flash-Realtime_/347/231/276/347/202/274.md +58 -58
- 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 +371 -328
- package/docs/model-adaptation/Seed-ICL-2.0/Seed-ICL-2.0_/347/201/253/345/261/261/345/274/225/346/223/216.md +65 -0
- 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 +147 -147
- 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 +87 -86
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_/347/201/253/345/261/261/345/274/225/346/223/216.md +101 -0
- 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 +79 -78
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_/347/201/253/345/261/261/345/274/225/346/223/216.md +98 -0
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_APIMart.md +93 -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 +79 -78
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_/347/201/253/345/261/261/345/274/225/346/223/216.md +98 -0
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_APIMart.md +217 -212
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_Fal.md +98 -94
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_KIE.md +94 -89
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_/347/201/253/345/261/261/345/274/225/346/223/216.md +102 -0
- package/docs/model-adaptation/Seedream-5.0-Flash/Seedream-5.0-Flash_APIMart.md +64 -0
- package/docs/model-adaptation/Seedream-5.0-Flash/Seedream-5.0-Flash_/347/201/253/345/261/261/345/274/225/346/223/216.md +18 -18
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_APIMart.md +113 -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 +110 -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 +73 -73
- package/docs/model-adaptation/TTS-/345/244/232/344/276/233/345/272/224/345/225/206-2026-09.md +52 -6
- package/docs/model-adaptation/TTS-/346/227/266/351/227/264/346/210/263-2026-10.md +36 -0
- 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/Veo-3.1/Veo-3.1_APIMart.md +90 -0
- package/docs/model-adaptation/Wan-2.7-Image/Wan-2.7-Image_APIMart.md +81 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_APIMart.md +74 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_Fal.md +60 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_Grsai.md +35 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_KIE.md +38 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_/347/231/276/347/202/274.md +96 -0
- package/docs/model-adaptation/Wan-3.0-Prime/Wan-3.0-Prime_KIE.md +20 -0
- package/docs/model-adaptation/Whisper-Large-v3/Whisper-Large-v3_Groq.md +80 -80
- package/docs/model-adaptation/Whisper-Large-v3-Turbo/Whisper-Large-v3-Turbo_Groq.md +79 -79
- 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 +103 -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 +99 -97
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/APIMart.md +240 -240
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Fal.md +190 -172
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Groq.md +136 -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 +159 -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 +170 -147
- 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 +191 -183
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/231/276/347/202/274.md +339 -282
- 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 +180 -153
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//351/255/224/346/220/255.md +205 -207
- package/docs/model-adaptation//346/226/207/346/241/243/351/207/207/351/233/206/346/211/213/345/206/214.md +339 -338
- 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 +38 -38
- 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 +259 -258
- package/dist/catalog/grsai/gptImage25Sizes.d.ts +0 -1
- package/dist/catalog/grsai/gptImage25Sizes.js +0 -76
- package/dist/catalog/kie/eleven-turbo-2.5-tts.model.d.ts +0 -2
- package/dist/catalog/kie/eleven-turbo-2.5-tts.model.js +0 -29
- package/dist/catalog/modelscope/qwen-image-edit-2509.model.d.ts +0 -5
- package/dist/catalog/modelscope/qwen-image.model.d.ts +0 -5
- package/dist/catalog/ppio/minimax-hailuo-2.3.model.d.ts +0 -7
- package/dist/catalog/ppio/minimax-hailuo-2.3.model.js +0 -114
- package/dist/catalog/ppio/wan-2.5-preview.model.d.ts +0 -7
- package/dist/catalog/ppio/wan-2.5-preview.model.js +0 -198
- package/dist/catalog/ppio/wan-2.6.model.d.ts +0 -7
- package/dist/catalog/ppio/wan-2.6.model.js +0 -206
- package/dist/catalog/ppio/wan-2.7.model.d.ts +0 -2
- package/dist/catalog/ppio/wan-2.7.model.js +0 -373
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_/346/264/276/346/254/247/344/272/221.md +0 -70
- package/docs/model-adaptation/TeleSpeechASR/TeleSpeechASR_/347/241/205/345/237/272/346/265/201/345/212/250.md +0 -76
- package/docs/model-adaptation/Wan-2.5-Preview/Wan-2.5-Preview_/346/264/276/346/254/247/344/272/221.md +0 -82
- package/docs/model-adaptation/Wan-2.6/Wan-2.6_/346/264/276/346/254/247/344/272/221.md +0 -84
- package/docs/model-adaptation/Wan-2.7/Wan-2.7_/346/264/276/346/254/247/344/272/221.md +0 -122
- /package/dist/upload/{fal-legacy.d.ts → fal-host-fetch.d.ts} +0 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/** APIMart Gemini Omni 1.2 Flash 官方与 Ext 渠道统一模型(运行时契约) */
|
|
2
|
+
import { readContinuation } from '../continuation.js';
|
|
3
|
+
import { defineModel } from '../defineModel.js';
|
|
4
|
+
import { hasUploadedImage, resolveUploadedImageSources, resolveUploadedVideoDurationSeconds, resolveUploadedVideoSources, } from '../shared/mediaPresence.js';
|
|
5
|
+
const MODES = ['text-image-to-video', 'reference-to-video', 'edit', 'extend'];
|
|
6
|
+
const EXTEND = 'extend';
|
|
7
|
+
// 宿主在三种场景下存放已上传素材的键;续写自己的结果时源任务已经给出视频,源请求的图和视频不能带过去。
|
|
8
|
+
const MEDIA_KEYS = [
|
|
9
|
+
'uploadedFilePaths', 'images', 'uploadedImages', 'uploadedVideoFilePaths', 'videos', 'uploadedVideos',
|
|
10
|
+
'__videoDurationSeconds', '__totalVideoDurationSeconds', '__firstVideoDurationSeconds',
|
|
11
|
+
];
|
|
12
|
+
const RESOLUTIONS = ['360p', '720p', '1080p', '4k'];
|
|
13
|
+
const RATES = {
|
|
14
|
+
official: { '360p': 0.02, '720p': 0.06, '1080p': 0.0904, '4k': 0.1808 },
|
|
15
|
+
ext: { '360p': 0.016, '720p': 0.024, '1080p': 0.024, '4k': 0.056 },
|
|
16
|
+
};
|
|
17
|
+
/** 续写自己上一次的结果,平台按 extend_from_task_id 取源视频,不需要再上传。 */
|
|
18
|
+
function extendFromTaskId(params) {
|
|
19
|
+
const taskId = readContinuation(params, EXTEND)?.reference.taskId;
|
|
20
|
+
return typeof taskId === 'string' && taskId.trim() ? taskId.trim() : null;
|
|
21
|
+
}
|
|
22
|
+
function isContinued(params) {
|
|
23
|
+
return extendFromTaskId(params) !== null;
|
|
24
|
+
}
|
|
25
|
+
function mode(params) {
|
|
26
|
+
if (isContinued(params))
|
|
27
|
+
return 'extend';
|
|
28
|
+
const value = params.apimartGeminiOmni12Mode;
|
|
29
|
+
return typeof value === 'string' && MODES.includes(value) ? value : 'text-image-to-video';
|
|
30
|
+
}
|
|
31
|
+
function channel(params) {
|
|
32
|
+
return params.apimartGeminiOmni12Channel === 'ext' ? 'ext' : 'official';
|
|
33
|
+
}
|
|
34
|
+
/** 首尾帧插值与续写只支持 3–10 秒,其余生成模式支持 3–15 秒。 */
|
|
35
|
+
function duration(params, images) {
|
|
36
|
+
const current = mode(params);
|
|
37
|
+
const max = current === 'extend' || (current === 'text-image-to-video' && images >= 2) ? 10 : 15;
|
|
38
|
+
return Math.min(max, Math.max(3, Math.round(Number(params.apimartGeminiOmni12Duration || 10))));
|
|
39
|
+
}
|
|
40
|
+
export const apimartGeminiOmni12FlashModel = defineModel({
|
|
41
|
+
meta: {
|
|
42
|
+
id: 'apimart-gemini-omni-1.2-flash', canonicalModelId: 'gemini-omni-1.2-flash',
|
|
43
|
+
seriesId: 'gemini-omni', seriesRank: 1.2, provider: 'apimart', type: 'video',
|
|
44
|
+
tags: ['text-to-video', 'image-to-video', 'start-end-frame', 'reference-mode', 'video-to-video', 'video-extension'],
|
|
45
|
+
polling: { interval: 5000, maxAttempts: 180, expectedAttempts: 40 },
|
|
46
|
+
},
|
|
47
|
+
inputLimits: {
|
|
48
|
+
images: { max: 2 }, videos: { max: 0 },
|
|
49
|
+
rules: [
|
|
50
|
+
{ when: 'apimartGeminiOmni12Channel === "ext" && apimartGeminiOmni12Mode === "text-image-to-video"', images: { max: 1 } },
|
|
51
|
+
// 多图参考至少 1 张参考图。
|
|
52
|
+
{ when: 'apimartGeminiOmni12Mode === "reference-to-video"', images: { min: 1, max: 10 } },
|
|
53
|
+
{ when: 'apimartGeminiOmni12Mode === "edit" || apimartGeminiOmni12Mode === "extend"', images: { max: 0 }, videos: { exact: 1 } },
|
|
54
|
+
{ when: isContinued, images: { exact: 0 }, videos: { exact: 0 } },
|
|
55
|
+
{ videoConstraints: { maxDurationSec: 15 } },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
requirements: [{
|
|
59
|
+
id: 'apimart-gemini-omni-12-prompt',
|
|
60
|
+
require: { prompt: true },
|
|
61
|
+
message: { title: '提示词必需', message: '所有模式都需要填写提示词。', type: 'warning' },
|
|
62
|
+
}, {
|
|
63
|
+
id: 'apimart-gemini-omni-12-input-video',
|
|
64
|
+
when: (params) => !isContinued(params) && (mode(params) === 'edit' || mode(params) === 'extend'),
|
|
65
|
+
require: { videos: { exact: 1 } },
|
|
66
|
+
message: { title: '需要输入视频', message: '视频编辑和续写需要 1 段输入视频。', type: 'warning' },
|
|
67
|
+
}],
|
|
68
|
+
params: [
|
|
69
|
+
// 续写只能接同渠道的源任务(Ext 只认本账号已完成的 Ext 任务),续写时渠道与模式沿用源任务,不让改。
|
|
70
|
+
{
|
|
71
|
+
id: 'apimartGeminiOmni12Channel', type: 'dropdown', order: 1, default: 'official', options: [{ value: 'official' }, { value: 'ext' }],
|
|
72
|
+
visible: { condition: (params) => !isContinued(params) },
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'apimartGeminiOmni12Mode', type: 'dropdown', order: 2, default: 'text-image-to-video', options: MODES.map(value => ({ value })),
|
|
76
|
+
visible: { condition: (params) => !isContinued(params) },
|
|
77
|
+
},
|
|
78
|
+
// 编辑与续写的画幅跟随输入视频;Ext 渠道带图时不传比例即跟随素材。这两种情况不显示也不发送比例。
|
|
79
|
+
{
|
|
80
|
+
id: 'apimartGeminiOmni12AspectRatio', type: 'dropdown', order: 3, default: '16:9', options: [{ value: '16:9' }, { value: '9:16' }],
|
|
81
|
+
visible: {
|
|
82
|
+
condition: (params) => mode(params) !== 'edit' && mode(params) !== 'extend' && !(channel(params) === 'ext' && hasUploadedImage(params)),
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{ id: 'apimartGeminiOmni12Resolution', type: 'dropdown', order: 4, default: '720p', options: RESOLUTIONS.map(value => ({ value })) },
|
|
86
|
+
// 编辑时输出时长跟随源视频,不能传 duration。
|
|
87
|
+
{
|
|
88
|
+
id: 'apimartGeminiOmni12Duration', type: 'number', order: 5, default: 10, min: 3, max: 15, step: 1,
|
|
89
|
+
visible: { condition: (params) => mode(params) !== 'edit' },
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
continuations: [{
|
|
93
|
+
id: EXTEND,
|
|
94
|
+
capture: ({ taskId }) => taskId ? { taskId } : null,
|
|
95
|
+
params: (source) => {
|
|
96
|
+
const next = { ...source, apimartGeminiOmni12Mode: 'extend' };
|
|
97
|
+
for (const key of MEDIA_KEYS)
|
|
98
|
+
delete next[key];
|
|
99
|
+
// 续写新增片段最长 10 秒。
|
|
100
|
+
const seconds = Number(source.apimartGeminiOmni12Duration);
|
|
101
|
+
if (Number.isFinite(seconds) && seconds > 10)
|
|
102
|
+
next.apimartGeminiOmni12Duration = 10;
|
|
103
|
+
return next;
|
|
104
|
+
},
|
|
105
|
+
submit: 'edit',
|
|
106
|
+
}],
|
|
107
|
+
endpoints: '/v1/videos/generations',
|
|
108
|
+
request: {
|
|
109
|
+
builder: (params) => {
|
|
110
|
+
const current = mode(params);
|
|
111
|
+
const route = channel(params);
|
|
112
|
+
const images = resolveUploadedImageSources(params);
|
|
113
|
+
const videos = resolveUploadedVideoSources(params);
|
|
114
|
+
const prompt = typeof params.prompt === 'string' ? params.prompt.trim() : '';
|
|
115
|
+
if (!prompt)
|
|
116
|
+
throw new Error('Gemini Omni 1.2 Flash 的所有模式都需要提示词');
|
|
117
|
+
const resolution = RESOLUTIONS.includes(String(params.apimartGeminiOmni12Resolution))
|
|
118
|
+
? String(params.apimartGeminiOmni12Resolution) : '720p';
|
|
119
|
+
const body = {
|
|
120
|
+
model: route === 'ext' ? 'gemini-omni-1.2-flash-ext' : 'gemini-omni-1.2-flash',
|
|
121
|
+
prompt,
|
|
122
|
+
resolution,
|
|
123
|
+
};
|
|
124
|
+
const fromTaskId = extendFromTaskId(params);
|
|
125
|
+
if (fromTaskId) {
|
|
126
|
+
// 与 video_urls 互斥;渠道沿用源任务,跨渠道续写会被平台拒绝。
|
|
127
|
+
return { ...body, extend_from_task_id: fromTaskId, omni_reference_task_type: 'extend', duration: duration(params, 0) };
|
|
128
|
+
}
|
|
129
|
+
if (current === 'edit' || current === 'extend') {
|
|
130
|
+
if (videos.length !== 1)
|
|
131
|
+
throw new Error('Gemini Omni 1.2 Flash 视频编辑和续写需要 1 段输入视频');
|
|
132
|
+
body.video_urls = videos;
|
|
133
|
+
body.omni_reference_task_type = current;
|
|
134
|
+
if (current === 'extend')
|
|
135
|
+
body.duration = duration(params, 0);
|
|
136
|
+
return body;
|
|
137
|
+
}
|
|
138
|
+
if (route !== 'ext' || images.length === 0)
|
|
139
|
+
body.aspect_ratio = params.apimartGeminiOmni12AspectRatio === '9:16' ? '9:16' : '16:9';
|
|
140
|
+
body.duration = duration(params, images.length);
|
|
141
|
+
if (current === 'reference-to-video') {
|
|
142
|
+
if (images.length === 0)
|
|
143
|
+
throw new Error('Gemini Omni 1.2 Flash 多图参考至少需要 1 张参考图');
|
|
144
|
+
if (images.length > 10)
|
|
145
|
+
throw new Error('Gemini Omni 1.2 Flash 最多支持 10 张参考图');
|
|
146
|
+
body.image_urls = images;
|
|
147
|
+
body.omni_reference_task_type = 'reference';
|
|
148
|
+
return body;
|
|
149
|
+
}
|
|
150
|
+
if (images.length > (route === 'ext' ? 1 : 2)) {
|
|
151
|
+
throw new Error(route === 'ext' ? 'Gemini Omni 1.2 Flash Ext 渠道不支持尾帧' : 'Gemini Omni 1.2 Flash 首尾帧最多 2 张图片');
|
|
152
|
+
}
|
|
153
|
+
if (images[0])
|
|
154
|
+
body.first_frame_image = images[0];
|
|
155
|
+
if (images[1])
|
|
156
|
+
body.last_frame_image = images[1];
|
|
157
|
+
return body;
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
pricing: {
|
|
161
|
+
currency: '$',
|
|
162
|
+
calculator: (params) => {
|
|
163
|
+
const rates = RATES[channel(params)];
|
|
164
|
+
const resolution = RESOLUTIONS.includes(String(params.apimartGeminiOmni12Resolution))
|
|
165
|
+
? String(params.apimartGeminiOmni12Resolution) : '720p';
|
|
166
|
+
if (mode(params) === 'edit') {
|
|
167
|
+
const seconds = resolveUploadedVideoDurationSeconds(params);
|
|
168
|
+
return rates[resolution] * Math.max(1, Math.ceil(seconds > 0 ? seconds - 0.15 : 10));
|
|
169
|
+
}
|
|
170
|
+
return rates[resolution] * duration(params, resolveUploadedImageSources(params).length);
|
|
171
|
+
},
|
|
172
|
+
description: '官方渠道 360p $0.02、720p $0.06、1080p $0.0904、4k $0.1808 每秒;Ext 渠道 360p $0.016、720p/1080p $0.024、4k $0.056 每秒;编辑按源视频秒数计费,续写只按新增秒数计费',
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
export default apimartGeminiOmni12FlashModel;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/** APIMart Gemini Omni Flash 官方与 Ext 渠道统一模型(运行时契约) */
|
|
2
2
|
import { defineModel } from '../defineModel.js';
|
|
3
|
+
import { countUploadedVideos, resolveUploadedImageSources, resolveUploadedVideoSources, hasUploadedVideo, hasUploadedImage } from '../shared/mediaPresence.js';
|
|
3
4
|
export const apimartGeminiOmniFlashModel = defineModel({
|
|
4
5
|
meta: {
|
|
5
6
|
id: 'apimart-gemini-omni-flash', canonicalModelId: 'gemini-omni-video',
|
|
6
7
|
seriesId: 'gemini-omni', seriesRank: 1, provider: 'apimart', type: 'video',
|
|
7
|
-
tags: [
|
|
8
|
-
'text-to-video', 'image-to-video', 'video-to-video', 'supports-video-editing',
|
|
9
|
-
'supports-multi-image', 'mixed-upload-mode', 'supports-4k', 'provider-apimart'
|
|
10
|
-
],
|
|
8
|
+
tags: ['text-to-video', 'image-to-video', 'reference-mode', 'video-to-video'],
|
|
11
9
|
aliases: [
|
|
12
10
|
'gemini-omni-flash-apimart',
|
|
13
11
|
'apimart-gemini-omni-flash-ext',
|
|
@@ -32,10 +30,13 @@ export const apimartGeminiOmniFlashModel = defineModel({
|
|
|
32
30
|
polling: { interval: 5000, maxAttempts: 180, expectedAttempts: 60 }
|
|
33
31
|
},
|
|
34
32
|
inputLimits: {
|
|
35
|
-
images: { max:
|
|
33
|
+
images: { max: 16 }, videos: { max: 1 },
|
|
36
34
|
rules: [{
|
|
37
35
|
when: 'apimartGeminiOmniFlashChannel === "ext"',
|
|
38
36
|
images: { max: 3 }
|
|
37
|
+
}, {
|
|
38
|
+
when: 'apimartGeminiOmniFlashChannel === "ext" && apimartGeminiOmniFlashGenerationType === "frame"',
|
|
39
|
+
images: { max: 1 }
|
|
39
40
|
}]
|
|
40
41
|
},
|
|
41
42
|
requirements: [{
|
|
@@ -62,6 +63,7 @@ export const apimartGeminiOmniFlashModel = defineModel({
|
|
|
62
63
|
id: 'apimartGeminiOmniFlashResolution', type: 'dropdown', order: 3,
|
|
63
64
|
default: '720p',
|
|
64
65
|
options: [
|
|
66
|
+
{ value: '360p' },
|
|
65
67
|
{ value: '720p' },
|
|
66
68
|
{ value: '1080p' },
|
|
67
69
|
{ value: '4k' }
|
|
@@ -75,34 +77,30 @@ export const apimartGeminiOmniFlashModel = defineModel({
|
|
|
75
77
|
{
|
|
76
78
|
id: 'apimartGeminiOmniFlashExtDuration', type: 'dropdown', order: 4,
|
|
77
79
|
default: '6',
|
|
78
|
-
|
|
80
|
+
// 带参考视频时时长跟随视频,不发送。
|
|
81
|
+
visible: { condition: (params) => params.apimartGeminiOmniFlashChannel === 'ext' && !hasUploadedVideo(params) },
|
|
79
82
|
options: ['4', '6', '8', '10'].map((value) => ({ value }))
|
|
80
83
|
},
|
|
81
84
|
{
|
|
82
85
|
id: 'apimartGeminiOmniFlashGenerationType', type: 'dropdown', order: 5,
|
|
83
86
|
default: 'reference',
|
|
84
|
-
|
|
87
|
+
// 只决定图片的用法,不带图时不发送。
|
|
88
|
+
visible: { condition: (params) => params.apimartGeminiOmniFlashChannel === 'ext' && hasUploadedImage(params) },
|
|
85
89
|
options: [
|
|
86
90
|
{ value: 'reference' },
|
|
87
91
|
{ value: 'frame' }
|
|
88
92
|
]
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
id: 'apimartGeminiOmniFlashExtendTaskId', type: 'text', order: 5,
|
|
92
|
-
default: '',
|
|
93
|
-
visible: { condition: (params) => params.apimartGeminiOmniFlashChannel !== 'ext' }
|
|
94
93
|
}
|
|
94
|
+
// extend_from_task_id(多轮延续)要填供应商侧的上一次任务 ID,界面不展示任务 ID、用户也拿不到:
|
|
95
|
+
// 按“不显示且不请求”处理(界面计划 5.8,P-17);以后做成生成记录上的“继续编辑”动作再接入
|
|
95
96
|
],
|
|
96
97
|
endpoints: '/v1/videos/generations',
|
|
97
98
|
request: {
|
|
98
99
|
builder: (params) => {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const images = uploadedImages.length > 0 ? uploadedImages : clean(params.images);
|
|
104
|
-
const uploadedVideos = clean(params.uploadedVideoFilePaths);
|
|
105
|
-
const videos = uploadedVideos.length > 0 ? uploadedVideos : clean(params.videos);
|
|
100
|
+
const images = resolveUploadedImageSources(params);
|
|
101
|
+
const videos = resolveUploadedVideoSources(params);
|
|
102
|
+
if (videos.length > 1)
|
|
103
|
+
throw new Error('Gemini Omni Flash 只支持一段参考视频');
|
|
106
104
|
const prompt = typeof params.prompt === 'string' ? params.prompt.trim() : '';
|
|
107
105
|
const aspectRatio = params.apimartGeminiOmniFlashAspectRatio === '9:16' ? '9:16' : '16:9';
|
|
108
106
|
const channel = params.apimartGeminiOmniFlashChannel === 'ext' ? 'ext' : 'official';
|
|
@@ -116,7 +114,8 @@ export const apimartGeminiOmniFlashModel = defineModel({
|
|
|
116
114
|
if (generationType === 'frame' && images.length > 1) {
|
|
117
115
|
throw new Error('Gemini Omni Flash 普通渠道的首帧模式只能传入 1 张图片');
|
|
118
116
|
}
|
|
119
|
-
const resolution = params.apimartGeminiOmniFlashResolution === '
|
|
117
|
+
const resolution = params.apimartGeminiOmniFlashResolution === '360p'
|
|
118
|
+
|| params.apimartGeminiOmniFlashResolution === '1080p'
|
|
120
119
|
|| params.apimartGeminiOmniFlashResolution === '4k'
|
|
121
120
|
? params.apimartGeminiOmniFlashResolution
|
|
122
121
|
: '720p';
|
|
@@ -124,7 +123,7 @@ export const apimartGeminiOmniFlashModel = defineModel({
|
|
|
124
123
|
? Number(params.apimartGeminiOmniFlashExtDuration)
|
|
125
124
|
: 6;
|
|
126
125
|
const body = {
|
|
127
|
-
model: '
|
|
126
|
+
model: 'gemini-omni-1.1-flash-ext', prompt, resolution, aspect_ratio: aspectRatio, nsfw_check: false
|
|
128
127
|
};
|
|
129
128
|
if (videos.length === 0)
|
|
130
129
|
body.duration = duration;
|
|
@@ -136,15 +135,11 @@ export const apimartGeminiOmniFlashModel = defineModel({
|
|
|
136
135
|
body.video_urls = videos.slice(0, 1);
|
|
137
136
|
return body;
|
|
138
137
|
}
|
|
139
|
-
|
|
140
|
-
? params.apimartGeminiOmniFlashExtendTaskId.trim()
|
|
141
|
-
: '';
|
|
142
|
-
if (videos.length > 0 && extendTaskId) {
|
|
143
|
-
throw new Error('Gemini Omni Flash 官方渠道不能同时传入参考视频和延续任务 ID');
|
|
144
|
-
}
|
|
145
|
-
if (!prompt && images.length + videos.length === 0 && !extendTaskId) {
|
|
138
|
+
if (!prompt && images.length + videos.length === 0) {
|
|
146
139
|
throw new Error('Gemini Omni Flash 官方渠道至少需要提示词或一份参考素材');
|
|
147
140
|
}
|
|
141
|
+
if (images.length > 16)
|
|
142
|
+
throw new Error('Gemini Omni Flash 官方渠道最多支持 16 张参考图');
|
|
148
143
|
const body = {
|
|
149
144
|
model: 'gemini-omni-flash-preview',
|
|
150
145
|
prompt,
|
|
@@ -153,11 +148,9 @@ export const apimartGeminiOmniFlashModel = defineModel({
|
|
|
153
148
|
resolution: '720p'
|
|
154
149
|
};
|
|
155
150
|
if (images.length > 0)
|
|
156
|
-
body.image_urls = images
|
|
151
|
+
body.image_urls = images;
|
|
157
152
|
if (videos.length > 0)
|
|
158
153
|
body.video_urls = videos.slice(0, 1);
|
|
159
|
-
if (extendTaskId)
|
|
160
|
-
body.extend_from_task_id = extendTaskId;
|
|
161
154
|
return body;
|
|
162
155
|
}
|
|
163
156
|
},
|
|
@@ -167,17 +160,17 @@ export const apimartGeminiOmniFlashModel = defineModel({
|
|
|
167
160
|
if (params.apimartGeminiOmniFlashChannel !== 'ext') {
|
|
168
161
|
return Math.min(10, Math.max(3, Math.round(Number(params.apimartGeminiOmniFlashOfficialDuration || 5)))) * 0.088;
|
|
169
162
|
}
|
|
170
|
-
const resolution = params.apimartGeminiOmniFlashResolution === '4k' ? '4k'
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
return resolution === '4k' ? 0.24 : 0.08;
|
|
163
|
+
const resolution = params.apimartGeminiOmniFlashResolution === '4k' ? '4k'
|
|
164
|
+
: params.apimartGeminiOmniFlashResolution === '360p' ? '360p' : 'standard';
|
|
165
|
+
if (countUploadedVideos(params) > 0)
|
|
166
|
+
return resolution === '4k' ? 0.24 : resolution === '360p' ? 0.04 : 0.08;
|
|
175
167
|
const duration = ['4', '6', '8', '10'].includes(String(params.apimartGeminiOmniFlashExtDuration))
|
|
176
168
|
? String(params.apimartGeminiOmniFlashExtDuration)
|
|
177
169
|
: '6';
|
|
178
170
|
const standard = { '4': 0.25, '6': 0.3, '8': 0.35, '10': 0.4 };
|
|
179
171
|
const high4k = { '4': 0.75, '6': 0.8, '8': 0.85, '10': 0.9 };
|
|
180
|
-
|
|
172
|
+
const low360 = { '4': 0.15, '6': 0.175, '8': 0.2, '10': 0.225 };
|
|
173
|
+
return (resolution === '4k' ? high4k : resolution === '360p' ? low360 : standard)[duration];
|
|
181
174
|
},
|
|
182
175
|
description: '官方渠道 720p $0.088/秒;普通渠道按分辨率、时长或参考视频档位计费'
|
|
183
176
|
}
|
|
@@ -5,7 +5,7 @@ export const apimartGptImage25Model = defineModel({
|
|
|
5
5
|
meta: {
|
|
6
6
|
id: 'apimart-gpt-image-2.5', canonicalModelId: 'gpt-image-2.5', seriesId: 'gpt-image', seriesRank: 2.5,
|
|
7
7
|
provider: 'apimart', type: 'image',
|
|
8
|
-
tags: ['text-to-image', 'image-to-image', '
|
|
8
|
+
tags: ['text-to-image', 'image-to-image', 'transparent-background'],
|
|
9
9
|
polling: { interval: 3000, maxAttempts: 200 },
|
|
10
10
|
},
|
|
11
11
|
inputLimits: { images: { max: 16 }, videos: { max: 0 } },
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/** APIMart GPT Image 2.6 Ext 与官方渠道统一模型(运行时契约) */
|
|
2
|
+
import { defineModel } from '../defineModel.js';
|
|
3
|
+
import { GPT25_OUTPUT_REFERENCE } from '../shared/gptImage25Pricing.js';
|
|
4
|
+
import { hasUploadedImage, resolveUploadedImageSources } from '../shared/mediaPresence.js';
|
|
5
|
+
const 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'];
|
|
6
|
+
const EXT_RATIOS = ['1:1', '3:2', '2:3', '4:3', '3:4', '5:4', '4:5', '16:9', '9:16', '21:9'];
|
|
7
|
+
const QUALITIES = ['auto', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
8
|
+
const RESOLUTIONS = ['1K', '2K', '4K'];
|
|
9
|
+
const COMPLEXITIES = ['low', 'medium', 'high'];
|
|
10
|
+
const BACKGROUNDS = ['auto', 'opaque', 'transparent'];
|
|
11
|
+
// 2.6 与 2.5 的像素尺寸映射相同;定价页说明 low 输出 token 为 2.5 的 4.2 倍、medium 为 3.3 倍,其余档位不变。
|
|
12
|
+
const TOKEN_MULTIPLIERS = [4.2, 3.3, 1, 1, 1];
|
|
13
|
+
const options = (values) => values.map(value => ({ value }));
|
|
14
|
+
function choice(value, values, fallback) {
|
|
15
|
+
if (value === undefined)
|
|
16
|
+
return fallback;
|
|
17
|
+
if (typeof value !== 'string' || !values.includes(value))
|
|
18
|
+
throw new Error(`GPT Image 2.6 参数不支持:${String(value)}`);
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
function count(params) {
|
|
22
|
+
if (params.gpt26Channel !== 'official')
|
|
23
|
+
return 1;
|
|
24
|
+
const value = params.gpt26Count;
|
|
25
|
+
if (value === undefined)
|
|
26
|
+
return 1;
|
|
27
|
+
if (typeof value !== 'number' || !Number.isInteger(value) || value < 1 || value > 4) {
|
|
28
|
+
throw new Error('GPT Image 2.6 生成数量必须为 1–4 的整数');
|
|
29
|
+
}
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
function ratio(params, candidates) {
|
|
33
|
+
const raw = choice(params.gpt26AspectRatio, ['smart', ...candidates], 'smart');
|
|
34
|
+
if (raw !== 'smart')
|
|
35
|
+
return raw;
|
|
36
|
+
const hint = hasUploadedImage(params) && typeof params.__firstImageRatio === 'number'
|
|
37
|
+
&& Number.isFinite(params.__firstImageRatio) && params.__firstImageRatio > 0 ? params.__firstImageRatio : 1;
|
|
38
|
+
const numeric = (value) => { const [w, h] = value.split(':').map(Number); return w / h; };
|
|
39
|
+
return candidates.reduce((best, next) => Math.abs(numeric(next) - hint) < Math.abs(numeric(best) - hint) ? next : best, '1:1');
|
|
40
|
+
}
|
|
41
|
+
function officialOutputEstimate(params) {
|
|
42
|
+
const quality = choice(params.gpt26Quality, QUALITIES, 'medium');
|
|
43
|
+
const index = ['low', 'medium', 'high', 'xhigh', 'max'].indexOf(quality === 'auto' ? 'max' : quality);
|
|
44
|
+
const resolution = choice(params.gpt26Resolution, RESOLUTIONS, '1K');
|
|
45
|
+
const reference = GPT25_OUTPUT_REFERENCE[ratio(params, RATIOS) + (resolution === '1K' ? '' : '@' + resolution.toLowerCase())];
|
|
46
|
+
// 黄金价图片输出 240 Credits / 1M tokens,即 $24 / 1M tokens。
|
|
47
|
+
return Math.ceil(reference.tokens[index] * TOKEN_MULTIPLIERS[index]) * 24 / 1000000 * count(params);
|
|
48
|
+
}
|
|
49
|
+
export const apimartGptImage26Model = defineModel({
|
|
50
|
+
meta: {
|
|
51
|
+
id: 'apimart-gpt-image-2.6', canonicalModelId: 'gpt-image-2.6', seriesId: 'gpt-image', seriesRank: 2.6,
|
|
52
|
+
provider: 'apimart', type: 'image',
|
|
53
|
+
tags: ['text-to-image', 'image-to-image', 'transparent-background'],
|
|
54
|
+
polling: { interval: 3000, maxAttempts: 200 },
|
|
55
|
+
},
|
|
56
|
+
inputLimits: { images: { max: 16 }, videos: { max: 0 } },
|
|
57
|
+
params: [
|
|
58
|
+
{ id: 'gpt26Channel', type: 'dropdown', order: 1, default: 'ext', options: options(['ext', 'official']) },
|
|
59
|
+
{ id: 'gpt26Variant', type: 'dropdown', order: 2, default: 'flare', options: options(['flare', 'sunburst']) },
|
|
60
|
+
{ id: 'gpt26AspectRatio', type: 'dropdown', order: 3, default: 'smart', options: options(['smart', ...RATIOS]) },
|
|
61
|
+
// Ext 渠道当前只开放 1K,2K/4K 会返回 model_price_not_configured。
|
|
62
|
+
{ id: 'gpt26Resolution', type: 'dropdown', order: 4, default: '1K', options: options(RESOLUTIONS), visible: { condition: p => p.gpt26Channel === 'official' } },
|
|
63
|
+
{ id: 'gpt26Quality', type: 'dropdown', order: 5, default: 'medium', options: options(QUALITIES) },
|
|
64
|
+
{ id: 'gpt26Complexity', type: 'dropdown', order: 6, default: 'high', options: options(COMPLEXITIES) },
|
|
65
|
+
// Ext 渠道 n=2–4 会建任务后失败退款,只在官方渠道开放多张。
|
|
66
|
+
{ id: 'gpt26Count', type: 'number', order: 7, default: 1, min: 1, max: 4, step: 1, visible: { condition: p => p.gpt26Channel === 'official' } },
|
|
67
|
+
{ id: 'gpt26Background', type: 'dropdown', order: 8, default: 'auto', options: options(BACKGROUNDS), visible: { condition: p => p.gpt26Channel === 'official' } },
|
|
68
|
+
],
|
|
69
|
+
endpoints: '/v1/images/generations',
|
|
70
|
+
request: { builder: params => {
|
|
71
|
+
const channel = choice(params.gpt26Channel, ['ext', 'official'], 'ext');
|
|
72
|
+
const variant = choice(params.gpt26Variant, ['flare', 'sunburst'], 'flare');
|
|
73
|
+
if (typeof params.prompt !== 'string' || !params.prompt.trim())
|
|
74
|
+
throw new Error('请输入 GPT Image 2.6 提示词');
|
|
75
|
+
if (params.prompt.length > 32000)
|
|
76
|
+
throw new Error('GPT Image 2.6 提示词最多 32000 字符');
|
|
77
|
+
const images = resolveUploadedImageSources(params);
|
|
78
|
+
if (images.length > 16)
|
|
79
|
+
throw new Error('GPT Image 2.6 最多支持 16 张参考图');
|
|
80
|
+
const body = {
|
|
81
|
+
model: channel === 'ext' ? 'gpt-image-2.6-ext' : `gpt-image-2.6-${variant}`,
|
|
82
|
+
prompt: params.prompt,
|
|
83
|
+
n: count(params),
|
|
84
|
+
size: ratio(params, channel === 'ext' ? EXT_RATIOS : RATIOS),
|
|
85
|
+
resolution: channel === 'ext' ? '1k' : choice(params.gpt26Resolution, RESOLUTIONS, '1K').toLowerCase(),
|
|
86
|
+
quality: choice(params.gpt26Quality, QUALITIES, 'medium'),
|
|
87
|
+
complexity: choice(params.gpt26Complexity, COMPLEXITIES, 'high'),
|
|
88
|
+
};
|
|
89
|
+
if (channel === 'ext')
|
|
90
|
+
body.version = variant;
|
|
91
|
+
else
|
|
92
|
+
body.background = choice(params.gpt26Background, BACKGROUNDS, 'auto');
|
|
93
|
+
if (images.length)
|
|
94
|
+
body.image_urls = images;
|
|
95
|
+
return body;
|
|
96
|
+
} },
|
|
97
|
+
pricing: {
|
|
98
|
+
currency: '$',
|
|
99
|
+
calculator: params => params.gpt26Channel === 'official' ? officialOutputEstimate(params) : 0.0085,
|
|
100
|
+
description: 'Ext 渠道 Flare / Sunburst 均为 1K $0.0085/张;官方渠道按 token 计费,估算仅含图片输出($24/1M tokens),提示词与参考图输入另计,自动质量按 max 预估',
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
export default apimartGptImage26Model;
|
|
@@ -14,7 +14,7 @@ export const apimartGptImage2Model = defineModel({
|
|
|
14
14
|
seriesRank: 2,
|
|
15
15
|
provider: 'apimart',
|
|
16
16
|
type: 'image',
|
|
17
|
-
tags: ['text-to-image', 'image-to-image', '
|
|
17
|
+
tags: ['text-to-image', 'image-to-image', 'inpainting', 'transparent-background'],
|
|
18
18
|
aliases: ['gpt-image-2-apimart', 'apimart-gpt-image-2-official', 'gpt-image-2-official-apimart'],
|
|
19
19
|
aliasParamDefaults: {
|
|
20
20
|
'apimart-gpt-image-2-official': { apimartGptImage2Version: 'official' },
|
|
@@ -16,7 +16,7 @@ export const apimartGrokImagine20Model = defineModel({
|
|
|
16
16
|
seriesRank: 2,
|
|
17
17
|
provider: 'apimart',
|
|
18
18
|
type: 'image',
|
|
19
|
-
tags: ['text-to-image', 'image-to-image'
|
|
19
|
+
tags: ['text-to-image', 'image-to-image'],
|
|
20
20
|
aliases: ['grok-imagine-2-apimart', 'apimart-grok-imagine-2.0-official', 'grok-imagine-image-2-official-apimart'],
|
|
21
21
|
aliasParamDefaults: {
|
|
22
22
|
'apimart-grok-imagine-2.0-official': { apimartGrokImagine20Version: 'official' },
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** APIMart Grok Imagine Video 1.5 官方与 Ext 渠道统一模型(运行时契约) */
|
|
2
|
+
import { defineModel } from '../defineModel.js';
|
|
3
|
+
import { countUploadedImages, hasUploadedImage, resolveUploadedImageSources } from '../shared/mediaPresence.js';
|
|
4
|
+
const OFFICIAL_RATIOS = ['16:9', '9:16', '1:1', '4:3', '3:4', '3:2', '2:3'];
|
|
5
|
+
const EXT_RATIOS = ['16:9', '9:16', '1:1', '3:2', '2:3'];
|
|
6
|
+
const OFFICIAL_RATES = { '480p': 0.064, '720p': 0.112, '1080p': 0.2 };
|
|
7
|
+
const EXT_RATES = { '480p': 0.0102, '720p': 0.01912 };
|
|
8
|
+
function isExt(params) {
|
|
9
|
+
return params.apimartGrokVideo15Channel === 'ext';
|
|
10
|
+
}
|
|
11
|
+
function resolution(params) {
|
|
12
|
+
const allowed = isExt(params) ? ['480p', '720p'] : ['480p', '720p', '1080p'];
|
|
13
|
+
return allowed.includes(String(params.apimartGrokVideo15Resolution)) ? String(params.apimartGrokVideo15Resolution) : '480p';
|
|
14
|
+
}
|
|
15
|
+
/** 官方 1–15 秒,Ext 6–15 秒。 */
|
|
16
|
+
function duration(params) {
|
|
17
|
+
return Math.min(15, Math.max(isExt(params) ? 6 : 1, Math.round(Number(params.apimartGrokVideo15Duration || 8))));
|
|
18
|
+
}
|
|
19
|
+
function ratio(params) {
|
|
20
|
+
const candidates = isExt(params) ? EXT_RATIOS : OFFICIAL_RATIOS;
|
|
21
|
+
const raw = String(params.apimartGrokVideo15AspectRatio || 'smart');
|
|
22
|
+
if (candidates.includes(raw))
|
|
23
|
+
return raw;
|
|
24
|
+
const hint = hasUploadedImage(params) && typeof params.__firstImageRatio === 'number'
|
|
25
|
+
&& Number.isFinite(params.__firstImageRatio) && params.__firstImageRatio > 0 ? params.__firstImageRatio : 16 / 9;
|
|
26
|
+
const numeric = (value) => { const [w, h] = value.split(':').map(Number); return w / h; };
|
|
27
|
+
return candidates.reduce((best, next) => Math.abs(numeric(next) - hint) < Math.abs(numeric(best) - hint) ? next : best, '16:9');
|
|
28
|
+
}
|
|
29
|
+
export const apimartGrokImagineVideo15Model = defineModel({
|
|
30
|
+
meta: {
|
|
31
|
+
id: 'apimart-grok-imagine-video-1.5', canonicalModelId: 'grok-imagine-video-1.5',
|
|
32
|
+
seriesId: 'grok-imagine-video', seriesRank: 1.5, provider: 'apimart', type: 'video',
|
|
33
|
+
tags: ['text-to-video', 'image-to-video', 'reference-mode'],
|
|
34
|
+
polling: { interval: 4000, maxAttempts: 180, expectedAttempts: 40 },
|
|
35
|
+
},
|
|
36
|
+
inputLimits: { images: { max: 7 }, videos: { max: 0 } },
|
|
37
|
+
requirements: [{
|
|
38
|
+
id: 'apimart-grok-video-15-prompt',
|
|
39
|
+
require: { prompt: true },
|
|
40
|
+
message: { title: '提示词必需', message: 'Grok Imagine Video 1.5 需要填写提示词。', type: 'warning' },
|
|
41
|
+
}],
|
|
42
|
+
params: [
|
|
43
|
+
{ id: 'apimartGrokVideo15Channel', type: 'dropdown', order: 1, default: 'official', options: [{ value: 'official' }, { value: 'ext' }] },
|
|
44
|
+
{ id: 'apimartGrokVideo15AspectRatio', type: 'dropdown', order: 2, default: 'smart', options: [{ value: 'smart' }, ...OFFICIAL_RATIOS.map(value => ({ value }))] },
|
|
45
|
+
{ id: 'apimartGrokVideo15Resolution', type: 'dropdown', order: 3, default: '480p', options: ['480p', '720p', '1080p'].map(value => ({ value })) },
|
|
46
|
+
{ id: 'apimartGrokVideo15Duration', type: 'number', order: 4, default: 8, min: 1, max: 15, step: 1 },
|
|
47
|
+
],
|
|
48
|
+
endpoints: '/v1/videos/generations',
|
|
49
|
+
request: {
|
|
50
|
+
builder: (params) => {
|
|
51
|
+
const prompt = typeof params.prompt === 'string' ? params.prompt.trim() : '';
|
|
52
|
+
if (!prompt)
|
|
53
|
+
throw new Error('Grok Imagine Video 1.5 需要填写提示词');
|
|
54
|
+
if (Array.from(prompt).length > 8000)
|
|
55
|
+
throw new Error('Grok Imagine Video 1.5 提示词最多 8000 字符');
|
|
56
|
+
const images = resolveUploadedImageSources(params);
|
|
57
|
+
if (images.length > 7)
|
|
58
|
+
throw new Error('Grok Imagine Video 1.5 最多支持 7 张参考图');
|
|
59
|
+
const ext = isExt(params);
|
|
60
|
+
const body = {
|
|
61
|
+
model: ext ? 'grok-imagine-1.5-video-ext' : 'grok-imagine-video-1.5',
|
|
62
|
+
prompt,
|
|
63
|
+
duration: duration(params),
|
|
64
|
+
resolution: resolution(params),
|
|
65
|
+
nsfw_check: false,
|
|
66
|
+
};
|
|
67
|
+
// Ext 用 size 传比例,官方用 aspect_ratio。
|
|
68
|
+
if (ext)
|
|
69
|
+
body.size = ratio(params);
|
|
70
|
+
else
|
|
71
|
+
body.aspect_ratio = ratio(params);
|
|
72
|
+
if (images.length > 0)
|
|
73
|
+
body.image_urls = images;
|
|
74
|
+
return body;
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
pricing: {
|
|
78
|
+
currency: '$',
|
|
79
|
+
calculator: (params) => isExt(params)
|
|
80
|
+
? EXT_RATES[resolution(params)] * duration(params)
|
|
81
|
+
: OFFICIAL_RATES[resolution(params)] * duration(params) + countUploadedImages(params) * 0.008,
|
|
82
|
+
description: '官方渠道 480p $0.064、720p $0.112、1080p $0.2 每秒,参考图 $0.008/张;Ext 渠道 480p $0.0102、720p $0.01912 每秒',
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
export default apimartGrokImagineVideo15Model;
|