Video generation using Sora 2 and Sora 2 pro#79
Conversation
There was a problem hiding this comment.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on January 16
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| "1024x1792", # Tall vertical | ||
| "1792x1024", # Wide horizontal | ||
| } | ||
| } |
There was a problem hiding this comment.
Bug: Missing Full HD resolutions in MODEL_RESOLUTIONS validation
The MODEL_RESOLUTIONS dictionary is missing 1920x1080 and 1080x1920 resolutions that are documented in the README and accepted by the CLI's choices parameter. When users try to use these documented resolutions (e.g., --resolution 1920x1080), the adapter's _validate_common_params method will raise a ValueError because these resolutions aren't in the model-specific sets. The CLI accepts 6 resolutions but the adapter only supports 4.
Additional Locations (1)
| f"Image dimensions {image_resolution} do not match any supported video resolution. " | ||
| f"Supported resolutions: {VALID_RESOLUTIONS}. " | ||
| f"Set auto_resize=True to automatically resize, or resize your image manually." | ||
| ) |
There was a problem hiding this comment.
Bug: Error message shows wrong resolutions for model
The error messages in generate_image_to_video and generate_image_to_video_async use the global VALID_RESOLUTIONS constant instead of the model-specific model_resolutions variable that was computed earlier in the same functions. This causes the error to display all resolutions across all models rather than the resolutions actually supported by the user's selected model, which is inconsistent with the validation logic and could mislead users.
Additional Locations (1)
| time.sleep(1) | ||
| except KeyboardInterrupt: | ||
| print("\nExiting... (video generation continues on server)") | ||
| sys.exit(0) |
There was a problem hiding this comment.
Bug: CLI async mode never exits after completion or error
In async mode, the main thread runs an infinite while True loop that only exits on keyboard interrupt. The on_complete callback saves the video but doesn't signal the main thread to exit, and the on_error callback calls sys.exit(1) which doesn't work from a background thread (it only terminates that thread, not the process). Users must manually press Ctrl+C even after successful video generation or after an error occurs.
🚀 Added: OpenAI Sora Video Generation Adapter (Sora 2 & Sora 2 Pro)
This update introduces a comprehensive video generation adapter for OpenAI’s Sora models, enabling both text-to-video and image-to-video workflows with robust resolution handling, flexible waiting strategies, and a clean developer experience.
Key Features
Core Functionality
Technical Implementation
Developer Experience
sora_video.pyWhy This Matters
This adapter makes Sora video generation production-ready:
Developers can move from experimentation to deployment with minimal friction.
Documentation
Full API reference, quickstart guide, and usage examples added to Docusaurus documentation.
Note
Adds Sora 2/2 Pro video generation (text/image-to-video) with sync/async APIs, a CLI, and comprehensive documentation updates.
SoraVideoAdapterintryon/api/openAI/video_adapter.pysupportingtext-to-video,image-to-video, sync polling, async callbacks, status retrieval, and downloads; model-specific durations/resolutions.tryon/api/openAI/__init__.py.sora_video.pyfor video generation with options for--model,--duration,--resolution, async mode, and API key handling.docs/docs/api-reference/sora-video.md(usage, API reference, supported options).README.mdwith “Video Generation with OpenAI Sora” section and examples.docs/docs/getting-started/quickstart.mdto include Sora examples and add link.docs/docs/intro.mdto mention Sora and add relevant keywords.docs/sidebars.tsto includeapi-reference/sora-video.Written by Cursor Bugbot for commit 2abcd7f. This will update automatically on new commits. Configure here.