模板中媒体尺寸改为预置方案

This commit is contained in:
puke
2025-11-12 17:19:06 +08:00
parent 64dcca204e
commit 7443cbf9c2
31 changed files with 576 additions and 90 deletions

View File

@@ -92,8 +92,7 @@ class CustomPipeline(BasePipeline):
ref_audio: Optional[str] = None,
image_workflow: Optional[str] = None,
image_width: int = 1024,
image_height: int = 1024,
# Note: image_width and image_height are now auto-determined from template
frame_template: Optional[str] = None,
video_fps: int = 30,
@@ -161,6 +160,10 @@ class CustomPipeline(BasePipeline):
generator = HTMLFrameGenerator(template_path)
template_requires_image = generator.requires_image()
# Read media size from template meta tags
image_width, image_height = generator.get_media_size()
logger.info(f"📐 Media size from template: {image_width}x{image_height}")
if template_requires_image:
logger.info(f"📸 Template requires image generation")
else:

View File

@@ -94,8 +94,7 @@ class StandardPipeline(BasePipeline):
max_image_prompt_words: int = 60,
# === Image Parameters ===
image_width: int = 1024,
image_height: int = 1024,
# Note: image_width and image_height are now auto-determined from template meta tags
image_workflow: Optional[str] = None,
# === Video Parameters ===
@@ -151,9 +150,8 @@ class StandardPipeline(BasePipeline):
min_image_prompt_words: Min image prompt length
max_image_prompt_words: Max image prompt length
image_width: Generated image width (default 1024)
image_height: Generated image height (default 1024)
image_workflow: Image workflow filename (e.g., "image_flux.json", None = use default)
Note: Image/video size is now auto-determined from template meta tags
video_fps: Video frame rate (default 30)
@@ -239,6 +237,16 @@ class StandardPipeline(BasePipeline):
template_config = self.core.config.get("template", {})
frame_template = template_config.get("default_template", "1080x1920/default.html")
# Read media size from template meta tags
from pixelle_video.services.frame_html import HTMLFrameGenerator
from pixelle_video.utils.template_util import resolve_template_path
template_path = resolve_template_path(frame_template)
temp_generator = HTMLFrameGenerator(template_path)
image_width, image_height = temp_generator.get_media_size()
logger.info(f"📐 Media size from template: {image_width}x{image_height}")
# Create storyboard config
config = StoryboardConfig(
task_id=task_id,