Skip to content

[fal.ai] memflow pipeline: Invalid resolution 674×389 — width/height must be divisible by 16 #931

@livepeer-tessa

Description

@livepeer-tessa

Summary

The memflow pipeline is failing to load when the input resolution is 674×389, because memflow requires both width and height to be divisible by 16. The error occurs repeatedly within the same session and causes the pipeline to be marked as failed on startup.

Error Details

From Grafana/Loki — 2026-04-13 13:34:17–13:34:23 UTC (scope-app--prod, job 0e48d66d):

scope.server.pipeline_manager - ERROR - [0e48d66d] Failed to load pipeline: memflow
scope.server.pipeline_manager - ERROR - [0e48d66d] Failed to load pipeline memflow: Invalid resolution 674×389. 
  Both width and height must be divisible by 16 
  Please adjust to a valid resolution, e.g., 672×384.
  If this error persists, consider removing the models directory '/data/models' and re-downloading models.
scope.server.pipeline_manager - ERROR - [0e48d66d] Some pipelines failed to load

Frequency: 4 occurrences (2 retry attempts), 2026-04-13 13:34 UTC
Session: 0e48d66d
App: scope-app--prod (fal.ai)

Behavior

The error message already contains a helpful suggestion (e.g., 672×384), but the pipeline fails completely rather than snapping to the nearest valid resolution. The error is also published as a Kafka error event (dbf6ef7d-983b-4402-8c25-284bb7e24dff).

Root Cause

Resolution 674×389 is not divisible by 16:

  • 674 / 16 = 42.125 → should be 672
  • 389 / 16 = 24.3125 → should be 384 or 400

This likely happens when a user resizes the canvas to a non-standard size, or when a source input has a non-standard resolution that gets passed to memflow.

Possible Fix

Two approaches:

  1. Auto-snap: In the pipeline loader, automatically round down the resolution to the nearest valid multiple of 16 before initializing memflow, with a warning log rather than an error.
  2. Validation UI: Surface the resolution constraint earlier in the client (before the pipeline attempts to load), showing a warning when the selected resolution is not divisible by 16.

Auto-snapping is likely the better UX path — users shouldn't need to manually calculate divisibility.

Suggested code change

In the memflow pipeline loader, before constructing the model:

def snap_to_multiple(val, multiple=16):
    return (val // multiple) * multiple

width = snap_to_multiple(input_width)
height = snap_to_multiple(input_height)
if width != input_width or height != input_height:
    logger.warning(f'Snapping resolution from {input_width}×{input_height} to {width}×{height} (must be divisible by 16)')

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions