mirror of
https://github.com/TheSmallHanCat/sora2api.git
synced 2026-02-13 17:34:42 +08:00
@@ -339,12 +339,31 @@ class GenerationHandler:
|
||||
# Get n_frames from model configuration
|
||||
n_frames = model_config.get("n_frames", 300) # Default to 300 frames (10s)
|
||||
|
||||
task_id = await self.sora_client.generate_video(
|
||||
prompt, token_obj.token,
|
||||
orientation=model_config["orientation"],
|
||||
media_id=media_id,
|
||||
n_frames=n_frames
|
||||
)
|
||||
# Check if prompt is in storyboard format
|
||||
if self.sora_client.is_storyboard_prompt(prompt):
|
||||
# Storyboard mode
|
||||
if stream:
|
||||
yield self._format_stream_chunk(
|
||||
reasoning_content="Detected storyboard format. Converting to storyboard API format...\n"
|
||||
)
|
||||
|
||||
formatted_prompt = self.sora_client.format_storyboard_prompt(prompt)
|
||||
debug_logger.log_info(f"Storyboard mode detected. Formatted prompt: {formatted_prompt}")
|
||||
|
||||
task_id = await self.sora_client.generate_storyboard(
|
||||
formatted_prompt, token_obj.token,
|
||||
orientation=model_config["orientation"],
|
||||
media_id=media_id,
|
||||
n_frames=n_frames
|
||||
)
|
||||
else:
|
||||
# Normal video generation
|
||||
task_id = await self.sora_client.generate_video(
|
||||
prompt, token_obj.token,
|
||||
orientation=model_config["orientation"],
|
||||
media_id=media_id,
|
||||
n_frames=n_frames
|
||||
)
|
||||
else:
|
||||
task_id = await self.sora_client.generate_image(
|
||||
prompt, token_obj.token,
|
||||
|
||||
Reference in New Issue
Block a user