Skip to content

FEATURE 5 - macOS support for all models #166

@lightningpixel

Description

@lightningpixel

FEATURE 5 — macOS support for all models

As a macOS (Apple Silicon) user, I want the generation models to run on my Mac, so I can generate 3D meshes without a CUDA GPU.

The backend currently assumes CUDA (torch.cuda.is_available() in api/services/generators/base.py), so the four models only run on Windows. macOS needs the Metal (MPS) backend, with a CPU fallback. This ticket adds device detection and makes each model run on macOS.

Models

  • TripoSG
  • Trellis2
  • Hunyuan3D
  • Pixal3D

Scope

  • Auto-detect device: CUDA → MPS → CPU based on the platform.
  • Each model runs on MPS and produces a valid GLB on Apple Silicon.
  • Handle MPS-specific issues (dtype, unsupported ops) with a CPU fallback where needed.
  • Weights download and load correctly on macOS.

Implementation

  • api/services/generators/base.py: replace the CUDA-only assumption with a shared device-selection helper (cudampscpu).
  • Each model extension (generator.py): use the selected device instead of hardcoded .cuda(); guard ops that MPS doesn't support.
  • Reuse the same helper across all four models so device logic lives in one place, not duplicated per extension.
  • No frontend, store, or API surface changes.

Acceptance criteria

  • Each of the four models generates a valid GLB on an Apple Silicon Mac.
  • No device-related errors on macOS (falls back to CPU when MPS is missing an op).
  • Windows/CUDA behavior is unchanged.

Estimate: M

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions