Skip to content

allow settings and dict for videoInference, add new settings params, update bytedance providerSettings#247

Open
Sirsho1997 wants to merge 4 commits intomainfrom
feature-bytedanceProviderSettingsUpdate/videoInferenceSettings
Open

allow settings and dict for videoInference, add new settings params, update bytedance providerSettings#247
Sirsho1997 wants to merge 4 commits intomainfrom
feature-bytedanceProviderSettingsUpdate/videoInferenceSettings

Conversation

@Sirsho1997
Copy link
Collaborator

@Sirsho1997 Sirsho1997 commented Feb 25, 2026

Added

  • Added IBytedanceProviderSettings.optimizePromptMode: Optional[str]
  • Added settings to IVideoInference dataclass
  • Added draft: Optional[bool], audio: Optional[bool], and promptUpsampling: Optional[bool] to ISettings dataclass
  • Added post_init to ISettings dataclass

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 optimizePromptMode parameter to IBytedanceProviderSettings
  • Enabled settings parameter in IVideoInference with 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +1443 to +1447
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)
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +760 to +766
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)
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@Sirsho1997 Sirsho1997 requested a review from teith February 25, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants