Skip to content

Migrate Ideogram runtime to MLX#1

Merged
haxlys merged 5 commits into
mainfrom
codex/mlx-migration
Jun 18, 2026
Merged

Migrate Ideogram runtime to MLX#1
haxlys merged 5 commits into
mainfrom
codex/mlx-migration

Conversation

@haxlys

@haxlys haxlys commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace the legacy PyTorch/MPS runtime path with an MLX/mflux runtime targeting MLXBits/ideogram-4-mlx-q8.
  • Add server/mlx_runtime.py and ideogram4_mlx.py; remove old MPS benchmark/LoRA helper scripts.
  • Keep FastAPI/WebUI contracts stable while surfacing MLX backend, model repo, quantization, memory, and local LoRA reload state.
  • Route all MLX/mflux model operations through a single worker thread to avoid thread-local MLX stream errors during LoRA reload + generation.
  • Add ./run.sh doctor and benchmark documentation.

Validation

  • python -m compileall server ideogram4_mlx.py scripts/doctor.py
  • rg "torch|safetensors.torch|from ideogram4|import ideogram4" server ideogram4_mlx.py
  • ./run.sh doctor (0 failures; 1 warning for unset optional IDEOGRAM4_MLX_CACHE_LIMIT_GB)
  • cd webui && pnpm lint
  • cd webui && pnpm build
  • Full local smoke: Magic Prompt health/generation, model load, 256x256 V4_TURBO_12 generation, LoRA apply -> generate -> remove -> generate.

Operational Notes

  • legacy/pytorch-mps has been pushed separately to preserve the old PyTorch/MPS runtime as the rollback branch.
  • IDEOGRAM4_MODEL_DAEMON_AUTOLOAD now defaults to 0 to avoid immediately reserving about 29GB of unified memory while a local Magic Prompt LLM may also be running.
  • Use the WebUI Load button or POST /api/model/load when image generation is needed.
  • IDEOGRAM4_MLX_CACHE_LIMIT_GB remains optional for machines that need a stricter reusable MLX cache budget.

Follow-up Tracking

@haxlys haxlys merged commit 30dbf40 into main Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant