Skip to content

Commit a4ee331

Browse files
committed
Fixing dataclass missing SerializableMixin
1 parent 0dbbb70 commit a4ee331

1 file changed

Lines changed: 8 additions & 38 deletions

File tree

runware/types.py

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def request_key(self) -> str:
727727

728728

729729
@dataclass
730-
class IInputFrame:
730+
class IInputFrame(SerializableMixin):
731731
image: Union[str, File]
732732
frame: Optional[Union[Literal["first", "last"], int]] = None
733733

@@ -762,13 +762,13 @@ def __post_init__(self):
762762

763763

764764
@dataclass
765-
class IAudioInput:
765+
class IAudioInput(SerializableMixin):
766766
id: Optional[str] = None
767767
source: Optional[str] = None
768768

769769

770770
@dataclass
771-
class ISpeechInput:
771+
class ISpeechInput(SerializableMixin):
772772
id: Optional[str] = None
773773
provider: Optional[str] = None
774774
voiceId: Optional[str] = None
@@ -914,7 +914,7 @@ def request_key(self) -> str:
914914

915915

916916
@dataclass
917-
class IElevenLabsCompositionSection:
917+
class IElevenLabsCompositionSection(SerializableMixin):
918918
sectionName: str # 1-100 characters
919919
positiveLocalStyles: List[str] # Styles that should be present in this section
920920
negativeLocalStyles: List[str] # Styles that should not be present in this section
@@ -923,14 +923,14 @@ class IElevenLabsCompositionSection:
923923

924924

925925
@dataclass
926-
class IElevenLabsCompositionPlan:
926+
class IElevenLabsCompositionPlan(SerializableMixin):
927927
positiveGlobalStyles: List[str] # Styles that should be present in the entire song
928928
negativeGlobalStyles: List[str] # Styles that should not be present in the entire song
929929
sections: List[IElevenLabsCompositionSection] # Sections of the song
930930

931931

932932
@dataclass
933-
class IElevenLabsMusicSettings:
933+
class IElevenLabsMusicSettings(SerializableMixin):
934934
compositionPlan: IElevenLabsCompositionPlan # Music composition structure
935935

936936

@@ -1270,7 +1270,7 @@ def provider_key(self) -> str:
12701270

12711271

12721272
@dataclass
1273-
class IViduTemplate:
1273+
class IViduTemplate(SerializableMixin):
12741274
name: Optional[str] = None
12751275
area: Optional[str] = None
12761276
beast: Optional[str] = None
@@ -1320,7 +1320,7 @@ def serialize(self) -> Dict[str, Any]:
13201320

13211321

13221322
@dataclass
1323-
class ISyncSegment:
1323+
class ISyncSegment(SerializableMixin):
13241324
startTime: float
13251325
endTime: float
13261326
ref: str
@@ -1342,36 +1342,6 @@ class ISyncProviderSettings(BaseProviderSettings):
13421342
def provider_key(self) -> str:
13431343
return "sync"
13441344

1345-
def serialize(self) -> Dict[str, Any]:
1346-
result = {}
1347-
if self.syncMode is not None:
1348-
result["syncMode"] = self.syncMode
1349-
if self.editRegion is not None:
1350-
result["editRegion"] = self.editRegion
1351-
if self.emotionPrompt is not None:
1352-
result["emotionPrompt"] = self.emotionPrompt
1353-
if self.temperature is not None:
1354-
result["temperature"] = self.temperature
1355-
if self.activeSpeakerDetection is not None:
1356-
result["activeSpeakerDetection"] = self.activeSpeakerDetection
1357-
if self.occlusionDetectionEnabled is not None:
1358-
result["occlusionDetectionEnabled"] = self.occlusionDetectionEnabled
1359-
if self.segments is not None:
1360-
segments_list = []
1361-
for segment in self.segments:
1362-
segment_dict = {
1363-
"startTime": segment.startTime,
1364-
"endTime": segment.endTime,
1365-
"ref": segment.ref
1366-
}
1367-
if segment.audioStartTime is not None:
1368-
segment_dict["audioStartTime"] = segment.audioStartTime
1369-
if segment.audioEndTime is not None:
1370-
segment_dict["audioEndTime"] = segment.audioEndTime
1371-
segments_list.append(segment_dict)
1372-
result["segments"] = segments_list
1373-
return result
1374-
13751345

13761346
AudioProviderSettings = IElevenLabsProviderSettings | IKlingAIProviderSettings | IMireloProviderSettings
13771347
VideoProviderSettings = (

0 commit comments

Comments
 (0)