hanshs474 / freeimagetovideo
Free image to video AI with no daily cap: start with no sign-up, keep going on a free account. Every video comes with sound and no watermark. This is the official PHP SDK for Free Image to Video.
Package info
pkg:composer/hanshs474/freeimagetovideo
Requires
- php: >=8.1
- ext-curl: *
- ext-json: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Free image to video AI with no daily cap: start with no sign-up, keep going on a free account. Every video comes with sound and no watermark. This is the official PHP SDK for Free Image to Video: turn a prompt or a photo into a video clip from PHP.
use FreeImageToVideo\FreeImageToVideo; $fitv = new FreeImageToVideo(); // reads FREEIMAGETOVIDEO_API_KEY $clip = $fitv->generateVideo('a paper lantern drifting over a night river'); $moved = $fitv->generateVideo('the camera slowly orbits the statue', imageUrl: 'https://example.com/statue.jpg', options: ['duration' => 6, 'aspect_ratio' => '9:16']);
Each call submits the run, waits for it and returns the URL of the finished clip. With imageUrl it is image to video AI with sound: your photo is the first frame. Without it, it is free text to video AI from the prompt alone.
Install
composer require hanshs474/freeimagetovideo
PHP 8.1+ with ext-curl and ext-json. No other dependencies.
API key and plans
Create a key at freeimagetovideo.ai/settings/apikeys and set FREEIMAGETOVIDEO_API_KEY (or pass it: new FreeImageToVideo('sk-...')). API runs need a paid plan: each run draws on the plan's full-speed allowance, then waits in the relaxed queue. See pricing. To make clips without a key, use the generator on freeimagetovideo.ai: start with no sign-up, keep going on a free account.
Options
| option | values |
|---|---|
duration |
4, 5, 6, 8, 10, 15 (seconds) |
resolution |
480p (default), 768p |
aspect_ratio |
16:9 (default), 9:16, 1:1 |
Model: MiniMax H3 (minimax-h3). Every clip comes with sound.
Lower level
$id = $fitv->submit('a koi pond in the rain'); $run = $fitv->status($id); // $run['status']: pending | processing | success | failed | canceled $url = $fitv->wait($id); // polls every 10 s, gives up after 30 minutes $left = $fitv->credits();
Errors worth catching
All extend FreeImageToVideo\FreeImageToVideoException:
AuthError: no key, or the key is wrong or deletedQuotaError: not enough credits for this runPlanError: API runs need a paid planBusyError: too many runs generating at onceRejectedError: the content filter refused the prompt, or a cooldown is activeGenerationError: the run failed or was canceled;$e->errorMessagesays whyTimeoutError: still generating at the deadline; check the run later withstatus()ApiError: any other failed request
MIT licensed.