Do not use any built-in image or video generation tool as a fallback. If the Hermes Web UI endpoint returns `401`, `403`, connection failure, or any other error, stop and report the Hermes Web UI error to the user.
Call the local Hermes Web UI media endpoint. Pass a local image path; the server will check for xAI credentials, read the file, convert it to a base64 data URI, call xAI, poll until completion, and optionally save the generated mp4.
Endpoint:
```bash
POST <Hermes Web UI base URL>/api/hermes/media/grok-image-to-video
```
Resolve the Hermes Web UI base URL in this order:
1.`HERMES_WEB_UI_URL` environment variable, if set.
2.`http://127.0.0.1:${PORT}`, if `PORT` is set.
3.`http://127.0.0.1:8648` for local development.
When Hermes Web UI is running from the provided Docker Compose setup, the default external URL is `http://127.0.0.1:6060`.
The endpoint is protected by Hermes Web UI auth. Always send the Hermes Web UI server bearer token. This token is accepted only by Hermes Web UI media generation endpoints for agent skills; it is not a general Web UI login token.
-`image_path`: local path to a png, jpeg, or webp image.
-`prompt`: motion and style instructions for the generated video.
Optional JSON fields:
-`duration`: seconds, 1 to 15. Defaults to 8.
-`output_path`: local path where the server should save the mp4. If omitted, the server saves to `${HERMES_WEB_UI_HOME:-~/.hermes-web-ui}/media/<request_id>.mp4` and creates the `media` directory if needed.
-`timeout_ms`: maximum wait time. Defaults to 600000.