ATH-MaaS/Pixelle-Video · error · ValueError
Invalid size dimensions: {width}x{height}
Error message
Invalid size dimensions: {width}x{height} What it means
After parsing WIDTHxHEIGHT from the directory name, parse_template_size sanity-checks that both dimensions are within 100–10000 pixels; outside that range it raises ValueError('Invalid size dimensions: WxH'). This catches nonsense sizes like '0x0', '50x50', or '99999x99999'.
Source
Thrown at pixelle_video/utils/template_util.py:80
f"Invalid template path format: {template_path}. "
f"Expected format: 'WIDTHxHEIGHT/template.html' or 'templates/WIDTHxHEIGHT/template.html'"
)
# Parse size from directory name
if 'x' not in dir_name:
raise ValueError(
f"Invalid size format in path: {template_path}. "
f"Directory name should be 'WIDTHxHEIGHT' (e.g., '1080x1920')"
)
try:
width_str, height_str = dir_name.split('x')
width = int(width_str)
height = int(height_str)
# Sanity check
if width < 100 or height < 100 or width > 10000 or height > 10000:
raise ValueError(f"Invalid size dimensions: {width}x{height}")
return (width, height)
except ValueError as e:
raise ValueError(
f"Failed to parse size from path: {template_path}. "
f"Expected format: 'WIDTHxHEIGHT/template.html' (e.g., '1080x1920/default.html'). "
f"Error: {e}"
)
def list_available_sizes() -> List[str]:
"""
List all available video sizes (merged from templates/ and data/templates/)
Returns:
List of size strings like ["1080x1920", "1920x1080", "1080x1080"]
Examples:View on GitHub (pinned to 848b054e4f)
Solutions
- Rename the directory to realistic canvas dimensions between 100 and 10000 px, e.g. '1080x1920'.
- Check for typos or extra zeros in the directory name.
- If you genuinely need >10000 px output, adjust the sanity-check bounds in template_util.py.
- Validate configured resolutions at startup before rendering.
Example fix
// before templates/80x80/default.html // after templates/1080x1080/default.html # dimensions must be within 100-10000
Defensive patterns
Strategy: validation
Validate before calling
def size_in_bounds(w: int, h: int) -> bool:
return 100 <= w <= 10000 and 100 <= h <= 10000
# assert size_in_bounds(*parse_template_size(tpl_path)) before rendering Type guard
def safe_parse_size(template_path: str):
try:
w, h = parse_template_size(template_path)
except ValueError:
return None
return (w, h) if 100 <= w <= 10000 and 100 <= h <= 10000 else None Try / catch
try:
w, h = parse_template_size(template_path)
except ValueError as e:
if "Invalid size dimensions" in str(e):
logger.error("Directory name out of 100-10000 px bounds: %s", e)
raise Prevention
- Only create template directories with realistic canvas sizes (100-10000 px)
- Watch for typos like extra zeros in dimension folder names
- Validate configured resolutions against bounds before rendering
- Keep placeholder/test directories out of the templates tree
When it happens
Trigger: Template directory names like '50x50/default.html', '0x1920/default.html', or '20000x20000/default.html' passed to parse_template_size (directly or via render_frame, __init__, render_single_output, render_style_config).
Common situations: Placeholder/test directories ('1x1', 'test'); icon-size folders reused for templates; typos with extra digits ('10800x1920'); accidentally nesting templates under a directory named like a number pair that fails bounds.
Related errors
- Invalid template path format: {template_path}. Expected form
- Invalid size format in path: {template_path}. Directory name
- frame_template is required to determine media size
- Progress must be between 0.0 and 1.0, got {self.progress}
- No assets provided. Please upload at least one image or vide
AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30).
Data as JSON: /api/errors/2e58f3cc362be45c.
Report an issue: GitHub.