Kling 节点接入官方 4.0 / Flash(文生/图生/Omni)

This commit is contained in:
Jony
2026-11-10 12:50:52 +08:00
parent b4ddd35a6c
commit af300996b9
8 changed files with 974 additions and 179 deletions
+2
View File
@@ -30,6 +30,8 @@ For `O1keyPromptMultiFunction`, keep the original first two widgets unchanged an
For Omni Flash, keep `O1keyOmniFlashVideo` as the sole node ID. Its `execute` validates all modes and media before upload or paid submission, then returns a native `VIDEO`. Ordinary generation hard-codes `omni_flash_10s`; edit mode uses `omni_flash_abra_edit`. If changing the widget schema, keep the migration that removes the former model value at index 2 so saved workflows remain aligned. The button only queues the current node using ComfyUI's native queue. O1Key's JSON `/v1/videos` gateway requires `input_reference` to be a string for one image; send several references as repeated multipart fields, never a JSON array under `input_reference`. Keep provider URLs and credentials out of widgets, workflow metadata, and logs. Use `tests/test_omni_flash.py` and `tests/test_omni_flash_frontend.mjs` for offline regression coverage.
For `K3Video`, keep the released node ID and the existing v3 / v2.6 / v3-omni widget order. Official Kling 4.0 and Kling 4.0 Flash are stored as `v4` and `v4-flash` with frontend display names; accept the `v4` alias so saved workflows keep working. Build official `contents` / `settings` / `options` bodies in `clients/kling_video_client.py`, choose the path by model and generation mode, and never send a `model` field. Use a dedicated 4.0 query parser (`data.id`, `submitted` / `processing` / `succeeded` / `failed`, `data[].outputs[].url`) and do not route 4.0 tasks through the 3.0 Omni `video_url` parser. Flash must reject `1080p` and durations above 20 seconds in both the backend and `web/js/klingV4ParameterGuard.js`. Do not invent a 4.0 motion-control path on `K3MotionControl`. Run `tests/test_kling_video.py` after changing this contract.
- Normalize authentication and base URL selection through `utils/config.py`.
- Use shared retry, interruption, polling, upload, and download helpers before creating provider-local variants.
- Convert provider-specific failures into actionable messages without printing secrets or full payloads.