allow settings and dict for videoInference, add new settings params, update bytedance providerSettings#247
Conversation
…update bytedance providerSettings
There was a problem hiding this comment.
Pull request overview
This PR enhances the video inference capabilities by adding support for a settings parameter that can accept either an ISettings object or a plain dictionary for convenience. It also adds new video-specific settings fields and updates Bytedance provider settings.
Changes:
- Added three new video-related settings fields to
ISettings(draft,save_audio,promptUpsampling) - Added
optimizePromptModeparameter toIBytedanceProviderSettings - Enabled
settingsparameter inIVideoInferencewith automatic dict-to-object conversion
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| runware/types.py | Added video settings fields to ISettings, added optimizePromptMode to IBytedanceProviderSettings, and added settings field with Union type and __post_init__ conversion to IVideoInference |
| runware/base.py | Updated _buildVideoRequest to include settings in video inference requests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| settings: Optional[Union[ISettings, Dict[str, Any]]] = None | ||
|
|
||
| def __post_init__(self): | ||
| if self.settings is not None and isinstance(self.settings, dict): | ||
| self.settings = ISettings(**self.settings) |
There was a problem hiding this comment.
IVideoInference.settings is newly supported as a dict via __post_init__, but there are no unit tests covering the conversion (dict -> ISettings) and the resulting serialized shape. Adding tests in tests/test_types.py for constructing IVideoInference(settings={...}) and asserting settings becomes an ISettings (and serializes as expected) would prevent regressions.
| def __post_init__(self): | ||
| if self.sparseStructure is not None and isinstance(self.sparseStructure, dict): | ||
| self.sparseStructure = ISparseStructure(**self.sparseStructure) | ||
| if self.shapeSlat is not None and isinstance(self.shapeSlat, dict): | ||
| self.shapeSlat = IShapeSlat(**self.shapeSlat) | ||
| if self.texSlat is not None and isinstance(self.texSlat, dict): | ||
| self.texSlat = ITexSlat(**self.texSlat) |
There was a problem hiding this comment.
ISettings.__post_init__ now explicitly accepts dict values for sparseStructure, shapeSlat, and texSlat, but the field type annotations are still Optional[ISparseStructure] / Optional[IShapeSlat] / Optional[ITexSlat]. This makes the public API and type hints inconsistent with actual supported inputs. Consider updating those annotations to include Dict[str, Any] (or otherwise constraining inputs and removing the conversion) so users and static type checkers have an accurate contract.
Added
IBytedanceProviderSettings.optimizePromptMode: Optional[str]settingsto IVideoInference dataclassdraft: Optional[bool],audio: Optional[bool], andpromptUpsampling: Optional[bool] toISettingsdataclassISettingsdataclass