mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:21:10 +02:00
The repo's mana-image-gen used to be a Mac Mini–only service built on flux2.c with hard MPS+arm64 platform checks. The actual production image-gen runs on the Windows GPU server (RTX 3090) using HuggingFace diffusers + PyTorch CUDA + FLUX.1-schnell — completely different code that lived only at C:\mana\services\mana-image-gen\ on the GPU box. This commit pulls the Windows implementation into the repo and deletes the Mac one, so there's exactly one mana-image-gen and its source of truth is git rather than one folder on one machine. Removed: - setup.sh — Mac-only flux2.c installer with hard arm64 platform check - app/main.py (Mac flux2.c subprocess wrapper version) - app/flux_service.py (Mac flux2.c subprocess wrapper version) Added (pulled from C:\mana\services\mana-image-gen\): - app/main.py — FastAPI endpoints (/generate, /images/*, /cleanup) - app/flux_service.py — diffusers FluxPipeline wrapper - app/api_auth.py — ApiKeyMiddleware (GPU_API_KEY) - app/vram_manager.py — shared VRAM accounting - service.pyw — Windows runner used by the ManaImageGen scheduled task Updated: - main.py PORT default from 3025 → 3023 to match the production reality (the service.pyw runner already binds 3023 explicitly via uvicorn.run, but the source default should match so direct uvicorn invocations and local tests don't pick the wrong port) - CLAUDE.md fully rewritten to describe the Windows/CUDA/diffusers stack - README.md trimmed to a pointer at CLAUDE.md + the public URL - .env.example written from scratch (didn't exist before — the service's .env on the GPU box was undocumented) The setup-image-gen.sh launchd installer in scripts/mac-mini/ and the actual Mac Mini deployment will be cleaned up in the next commit, along with the rest of the Mac-Mini AI service infrastructure.
17 lines
498 B
Python
17 lines
498 B
Python
"""mana-image-gen service runner."""
|
|
import os
|
|
import sys
|
|
os.chdir(r"C:\mana\services\mana-image-gen")
|
|
sys.path.insert(0, r"C:\mana\services\mana-image-gen")
|
|
|
|
# Load .env file
|
|
from dotenv import load_dotenv
|
|
load_dotenv(r"C:\mana\services\mana-image-gen\.env")
|
|
|
|
# Redirect stdout/stderr to log file
|
|
log = open(r"C:\mana\services\mana-image-gen\service.log", "w", buffering=1)
|
|
sys.stdout = log
|
|
sys.stderr = log
|
|
|
|
import uvicorn
|
|
uvicorn.run("app.main:app", host="0.0.0.0", port=3023, log_level="info")
|