完善fastapi接口
This commit is contained in:
@@ -2,19 +2,32 @@
|
||||
TTS API schemas
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class TTSSynthesizeRequest(BaseModel):
|
||||
"""TTS synthesis request"""
|
||||
text: str = Field(..., description="Text to synthesize")
|
||||
voice_id: str = Field("[Chinese] zh-CN Yunjian", description="Voice ID")
|
||||
workflow: Optional[str] = Field(
|
||||
None,
|
||||
description="TTS workflow key (e.g., 'runninghub/tts_edge.json' or 'selfhost/tts_edge.json'). If not specified, uses default workflow from config."
|
||||
)
|
||||
ref_audio: Optional[str] = Field(
|
||||
None,
|
||||
description="Reference audio path for voice cloning (optional). Can be a local file path or URL."
|
||||
)
|
||||
voice_id: Optional[str] = Field(
|
||||
None,
|
||||
description="Voice ID (deprecated, use workflow instead)"
|
||||
)
|
||||
|
||||
class Config:
|
||||
json_schema_extra = {
|
||||
"example": {
|
||||
"text": "Hello, welcome to Pixelle-Video!",
|
||||
"voice_id": "[Chinese] zh-CN Yunjian"
|
||||
"workflow": "runninghub/tts_edge.json",
|
||||
"ref_audio": None
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user