8 Commits
Author SHA1 Message Date
bowtiedbluefin 6ac4b3b486 Fix: Use OpenAI's exact supported video sizes
OpenAI's video API only supports 4 specific sizes:
- '1280x720' (landscape 16:9)
- '720x1280' (portrait 9:16)
- '1792x1024' (wide landscape)
- '1024x1792' (tall portrait)

Changes:
- Updated size_mapping to use OpenAI's exact supported sizes
- Map user selections to closest supported size
- Added info logging to show size conversions
- Keep original size mapping for non-OpenAI APIs
- Updated documentation with actual supported sizes

This fixes the 'invalid_value' error for the size parameter.
2025-11-08 02:41:53 -05:00
bowtiedbluefin a6a1cb5050 Fix: OpenAI video API requires seconds as string from allowed values
OpenAI's video API is very specific about the 'seconds' parameter:
- Must be a STRING (not integer)
- Must be one of: "4", "8", or "12"

Changes:
- Convert duration to nearest valid value (4, 8, or 12 seconds)
- Send as string to match OpenAI's requirements
- Added info message when duration is auto-converted
- Updated default model to 'sora-2'
- Updated default duration to 4 (valid value)
- Updated documentation with OpenAI's duration constraints
- Keep flexible duration for non-OpenAI APIs

This fixes the 'invalid_type' error for the seconds parameter.
2025-11-08 02:38:25 -05:00
bowtiedbluefin 5986b4598d Fix: OpenAI video API expects JSON, not multipart/form-data
The error 'failed to parse JSON value' revealed that despite curl examples
using -F flags, OpenAI's video API actually expects JSON POST requests.

- Changed back to JSON format using _request() method
- Simplified code by removing multipart/form-data handling
- Kept debug logging for troubleshooting
- Updated documentation to remove multipart/form-data mention

This should resolve the 400 Bad Request error.
2025-11-08 02:34:08 -05:00
bowtiedbluefin 8e996fab73 Add debug logging and improve error handling for video generation
- Added detailed debug output showing URL, model, prompt, and parameters
- Improved error handling to show full API response in error messages
- Fixed form data handling to preserve integer types properly
- Added empty string check before adding parameters

This will help diagnose the 400 Bad Request error
2025-11-08 02:23:18 -05:00
bowtiedbluefin 88fb7142c4 Fix OpenAI video API to use correct endpoint and multipart/form-data
BREAKING FIX: Corrected to match official OpenAI API documentation
- Changed endpoint to /v1/videos (was incorrectly /v1/videos/generations)
- Changed from JSON POST to multipart/form-data POST (OpenAI requirement)
- Fixed image-to-video parameter: 'image' (was incorrectly 'input_reference')
- Updated API client to use requests 'files' parameter for form fields
- Removed incorrect Content-Type header to allow proper boundary setting

Reference: https://platform.openai.com/docs/api-reference/videos/create
2025-11-08 02:12:21 -05:00
bowtiedbluefin 0708554221 Fix OpenAI video API endpoint and parameter format
- Changed endpoint from /videos/create to /videos/generations (correct OpenAI endpoint)
- Changed 'seconds' parameter from string '5s' to integer 5 (as per OpenAI spec)
- Updated documentation to reflect correct parameter types
2025-11-08 02:03:18 -05:00
bowtiedbluefin 9dd2d82195 Fix OpenAI video API compatibility and add video save node
- Fixed video generation parameters to match OpenAI's API format
  - Convert resolution + aspect_ratio to 'size' parameter (e.g., '1920x1080')
  - Convert duration to 'seconds' string format (e.g., '5s')
  - Filter out fps parameter for OpenAI (not supported)
  - Use 'input_reference' instead of 'image_url' for image-to-video
- Added SaveVideoNode to download and save videos locally
  - Supports timestamp placeholders in filenames
  - Auto-creates output directories
  - Shows file size after download
- Updated QUICKSTART guide with video generation examples
- Updated API client documentation with correct parameter formats
2025-11-08 01:55:01 -05:00
bowtiedbluefin fdb6595ccd Initial commit: ComfyUI AI CustomURL Extension
- Full OpenAI-compatible API integration for ComfyUI
- Support for Text, Image, Video, and Speech generation
- Works with OpenAI, Venice.ai, OpenRouter, Together.ai, Ollama, and any OpenAI-compatible API
- Modern comfy_api.latest node format
- 10 nodes: 4 basic + 4 advanced + 2 utility
- Complete documentation and examples
- Model discovery and caching system
- Server routes for API management
2025-11-07 23:55:04 -05:00