heygen-com/hyperframes · error · CubeLutParseError

Mixed 1D and 3D cube LUTs are not supported yet

Error message

Mixed 1D and 3D cube LUTs are not supported yet

What it means

A .cube file that declares both LUT_1D_SIZE and LUT_3D_SIZE is ambiguous — the format does not define a combined 1D+3D LUT in a single file. The throw at line 173 fires after the loop when both sizes were set, regardless of whether data rows followed.

Source

Thrown at packages/core/src/colorLuts.ts:173

    }
    if (!lut3dSize) {
      if (lut1dSize) {
        throw new CubeLutParseError("1D cube LUTs are not supported yet", lineNumber);
      }
      throw new CubeLutParseError("LUT data appears before LUT_3D_SIZE", lineNumber);
    }
    if (parts.length !== 3) {
      throw new CubeLutParseError("LUT data rows must contain three numbers", lineNumber);
    }
    rows.push(
      parseFiniteNumber(parts[0]!, lineNumber),
      parseFiniteNumber(parts[1]!, lineNumber),
      parseFiniteNumber(parts[2]!, lineNumber),
    );
  }

  if (lut1dSize && lut3dSize) {
    throw new CubeLutParseError("Mixed 1D and 3D cube LUTs are not supported yet");
  }
  if (!lut3dSize) {
    if (lut1dSize) throw new CubeLutParseError("1D cube LUTs are not supported yet");
    throw new CubeLutParseError("Missing LUT_3D_SIZE");
  }
  validateDomain(domainMin, domainMax);

  const expectedRows = lut3dSize * lut3dSize * lut3dSize;
  if (rows.length !== expectedRows * 3) {
    throw new CubeLutParseError(
      `Expected ${expectedRows} LUT rows for size ${lut3dSize}, found ${rows.length / 3}`,
    );
  }

  return {
    title,
    size: lut3dSize,
    domainMin,

View on GitHub (pinned to c2996c8626)

Solutions

  1. Split the file into two separate .cube files (one 1D, one 3D) and apply them in sequence in your pipeline.
  2. Delete whichever header is unwanted.
  3. Re-export from the source tool, which writes one LUT type per file.

Example fix

// before
LUT_1D_SIZE 4
LUT_3D_SIZE 2
...

// after — keep only the 3D section
LUT_3D_SIZE 2
...
Defensive patterns

Strategy: try-catch

Validate before calling

function assertSingleLutType(fileText: string): void {
  const has1D = /^LUT_1D_SIZE/m.test(fileText);
  const has3D = /^LUT_3D_SIZE/m.test(fileText);
  if (has1D && has3D) throw new Error('File declares both 1D and 3D sizes; split into two files');
}

Try / catch

try {
  parseCubeLut(fileText);
} catch (err) {
  if (err instanceof CubeLutParseError && /Mixed 1D and 3D/.test(err.message)) {
    // split the file at the second LUT_*_SIZE header and handle each separately
  } else throw err;
}

Prevention

When it happens

Trigger: A single file containing both a 'LUT_1D_SIZE N' line and a 'LUT_3D_SIZE M' line anywhere in the header.

Common situations: Concatenating a 1D shaper LUT and a 3D look LUT into one file; a hand-edit that left both headers in place.

Related errors


AI-assisted analysis of heygen-com/hyperframes@c2996c8626 (2026-08-12). Data as JSON: /api/errors/c0eb7ccbccee1a5a. Report an issue: GitHub.