pixverse_image
Transform static images into animated videos by providing a motion description prompt. Specify duration, aspect ratio, and control elements to avoid for customized video generation.
Instructions
Pixverse V4.5 I2V - Advanced image-to-video
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image_url | Yes | URL of the input image | |
| prompt | Yes | Motion description prompt | |
| duration | No | Video duration in seconds | 5 |
| aspect_ratio | No | 16:9 | |
| negative_prompt | No | What to avoid in the video | |
| cfg_scale | No | How closely to follow the prompt |
Implementation Reference
- src/index.ts:122-122 (registration)Registration of the 'pixverse_image' tool in the MODEL_REGISTRY.imageToVideo array, defining its ID, endpoint, name, and description.{ id: 'pixverse_image', endpoint: 'fal-ai/pixverse/v4.5/image-to-video', name: 'Pixverse V4.5 I2V', description: 'Advanced image-to-video' },
- src/index.ts:380-390 (schema)Dynamic generation of input schema for all image-to-video tools, including pixverse_image, defining parameters like image_url, prompt, duration, etc.} else if (category === 'imageToVideo') { baseSchema.inputSchema.properties = { image_url: { type: 'string', description: 'URL of the input image' }, prompt: { type: 'string', description: 'Motion description prompt' }, duration: { type: 'string', enum: ['5', '10'], default: '5', description: 'Video duration in seconds' }, aspect_ratio: { type: 'string', enum: ['16:9', '9:16', '1:1'], default: '16:9' }, negative_prompt: { type: 'string', description: 'What to avoid in the video' }, cfg_scale: { type: 'number', default: 0.5, minimum: 0, maximum: 1, description: 'How closely to follow the prompt' } }; baseSchema.inputSchema.required = ['image_url', 'prompt']; }
- src/index.ts:566-625 (handler)Core handler function that executes the pixverse_image tool logic: destructures arguments, prepares input params, calls fal.subscribe on the model endpoint, processes video output with downloads/data URLs, and returns structured content.private async handleImageToVideo(args: any, model: any) { const { image_url, prompt, duration = '5', aspect_ratio = '16:9', negative_prompt, cfg_scale } = args; try { // Configure FAL client lazily with query config override configureFalClient(this.currentQueryConfig); const inputParams: any = { image_url, prompt }; // Add optional parameters if (duration) inputParams.duration = duration; if (aspect_ratio) inputParams.aspect_ratio = aspect_ratio; if (negative_prompt) inputParams.negative_prompt = negative_prompt; if (cfg_scale !== undefined) inputParams.cfg_scale = cfg_scale; const result = await fal.subscribe(model.endpoint, { input: inputParams }); const videoData = result.data as FalVideoResult; const videoProcessed = await downloadAndProcessVideo(videoData.video.url, model.id); return { content: [ { type: 'text', text: JSON.stringify({ model: model.name, id: model.id, endpoint: model.endpoint, input_image: image_url, prompt, video: { url: videoData.video.url, localPath: videoProcessed.localPath, ...(videoProcessed.dataUrl && { dataUrl: videoProcessed.dataUrl }), width: videoData.video.width, height: videoData.video.height, }, metadata: inputParams, download_path: DOWNLOAD_PATH, data_url_settings: { enabled: ENABLE_DATA_URLS, max_size_mb: Math.round(MAX_DATA_URL_SIZE / 1024 / 1024), }, autoopen_settings: { enabled: AUTOOPEN, note: AUTOOPEN ? "Files automatically opened with default application" : "Auto-open disabled" }, }, null, 2), }, ], }; } catch (error) { throw new Error(`${model.name} generation failed: ${error}`); } }
- src/index.ts:480-482 (handler)Dispatch logic in CallToolRequestSchema handler that routes calls to pixverse_image (and other imageToVideo tools) to the handleImageToVideo function.} else if (MODEL_REGISTRY.imageToVideo.find(m => m.id === name)) { return await this.handleImageToVideo(args, model); }
- src/index.ts:140-143 (helper)Helper function to retrieve the model configuration (endpoint, name, etc.) by tool ID, used before dispatching to handlers.function getModelById(id: string) { const allModels = getAllModels(); return allModels.find(model => model.id === id); }