{"slug": "imagegen-local-ai-image-generation-for-mac-with-qwen-image-2-1", "title": "ImageGen: Local AI image generation for Mac with Qwen-Image 2.1", "summary": "ImageGen, a native macOS app from developer ph1lb4, runs Alibaba's Qwen-Image 2.1 image model fully on-device on Apple Silicon, requiring about 33 GB of unified memory and roughly 35 GB of free disk, with 64 GB recommended. The app generates a 1024x1024 image in about 1.5 to 2 minutes and a 2048x1152 image in about 5.5 minutes on an M5 Pro MacBook Pro with 64 GB, and it exposes a built-in MCP server so Claude Code, Cursor and other MCP clients can generate and edit images locally. ImageGen is built from source via a GitHub repository and supports text-to-image with typography, instruction-based editing of up to 10 reference images, and transparent RGBA PNG output.", "body_md": "**Local AI image generation for Mac.**\n\n  Run Qwen-Image 2.1 on Apple Silicon. Offline, private, no API keys, no per-image cost.\n\n  Built-in MCP server, so Claude Code and other AI agents can generate images on your Mac.\n\n[Watch the full explainer video](https://github.com/ph1lb4/imagegen-mac/blob/main/docs/media/imagegen-explainer.mp4)\n\nImage generation used to mean a cloud service, a monthly bill and your prompts on someone else's server.\nNot anymore. A state-of-the-art image model now fits in about **33 GB of memory**. That's a MacBook Pro\nor Mac Studio with 64 GB of unified memory.\n\nImageGen is a native macOS app that downloads the model, runs it on your Mac's GPU (Metal) and gives you a clean studio to work in. It also runs an MCP server, so your coding agent can make images while you work.\n\n- **Fully on-device.** Prompts and images never leave your Mac. Works offline once the model is downloaded.\n- **Text to image** with strong typography. Text inside images actually comes out readable.\n- **Image editing.** Change an image with an instruction, or combine up to 10 reference images.\n- **Transparent PNGs.** Native RGBA output for stickers, icons and assets.\n- **MCP server for AI agents.** Claude Code, Cursor and any MCP client can generate and edit images. Results show up in the app.\n- **One-click model download** from Hugging Face, resumable, right inside the app.\n- **Memory guards** so a big job fails cleanly instead of freezing your Mac.\n- **Native SwiftUI app** with a menu bar icon. The engine keeps serving agents with the window closed.\n\nEvery image here was generated locally on an M5 Pro MacBook Pro with 64 GB, with a VM and other apps running.\n\n| Text in images. 512 px draft, 20 s | Transparent sticker. 1024 px, 2 min | Low-poly diorama. 1024 px, 2 min | \n| Product shot. 2048x1152, 5.5 min | Long exposure. 2048x1152, 5.5 min | Stadium at night. 2048x1152, 6 min | \n\nThe app icon was made with ImageGen too.\n\nMeasured on an M5 Pro MacBook Pro with 64 GB unified memory, Qwen-Image 2.1 in bf16:\n\n| Output | Steps | Time | \n|---|---|---|\n| 512 x 512 (draft) | 20 | ~20 s | \n| 1024 x 1024 | 30 to 40 | ~1.5 to 2 min | \n| 1728 x 960 | 25 | ~2.5 min | \n| 2048 x 1152 | 40 | ~5.5 min | \n\nLoading the model takes about 20 seconds. Draft quality is the fastest way to iterate on a prompt.\n\n- Apple Silicon Mac (M1 or newer), macOS 14+\n- **64 GB unified memory recommended.** The model needs about 33 GB. 48 GB can load it, but only small images will fit\n- About 35 GB free disk for the model, plus about 1 GB for the Python environment\n- Xcode command line tools and [uv](https://docs.astral.sh/uv/) to build\n\n```\ngit clone https://github.com/ph1lb4/imagegen-mac.git\ncd imagegen-mac\n./scripts/build-app.sh\nopen build/ImageGen.app\n```\n\nCopy `build/ImageGen.app` to `/Applications` if you like. On first start the app sets up its Python\nenvironment with the bundled `uv` (a few minutes, about 1 GB). Later starts take seconds.\n\nThen pick Qwen-Image 2.1 and hit download. It's about 33 GB, and the download resumes if it gets interrupted.\n\nWith the app running:\n\n```\nclaude mcp add --transport http imagegen http://127.0.0.1:7860/mcp --scope user\n```\n\nNow ask Claude Code for an image: \"make a transparent app icon of a paper plane and save it to `assets/`\".\nThe MCP button in the app toolbar has copy-ready snippets for Claude Code and JSON-configured clients\n(Cursor, VS Code and others).\n\n| Tool | What it does | \n|---|---|\n| `generate_image` | Prompt to image. Aspect ratio, quality (draft/standard/high), transparent, seed, steps, `output_path` to save into a project | \n| `edit_image` | Edit or combine up to 10 input images with an instruction | \n| `list_models` | Supported models, download and load state | \n| `load_model` | Load an already downloaded model | \n| `get_status` | Engine state and queue | \n| `list_recent_images` | Recent results with prompts and paths | \n\nResults return the PNG path plus a small preview, so the agent can see what it made.\n\nThe model needs about 33 GB, and generation needs more on top. If a Mac runs out of memory, macOS swaps until the machine freezes. The engine has three guards against that:\n\n- **GPU memory cap.** PyTorch may use total memory minus 30% (at least 12 GB stays free), so 48 GB on a\n64 GB Mac. A job that needs more fails with an error instead of swapping. Override with`IMAGEGEN_GPU_MEMORY_LIMIT_GB` .\n- **Size cap.** \"High\" is 2048 px on Macs with 96 GB+ and 1536 px below that. Larger sizes are rejected\nbefore they start. Large images are decoded in tiles.\n- **Pressure check.** If macOS reports critical memory pressure during a job, the job stops.\n\nQuit big apps (VMs, Xcode, lots of browser tabs) before generating on a 64 GB Mac.\n\n| What | Where | \n|---|---|\n| Generated images (+ JSON metadata) | `~/Pictures/ImageGen` | \n| Models | `~/Library/Application Support/ImageGen/models` | \n| Python environment | `~/Library/Application Support/ImageGen/venv` | \n| Engine log | `~/Library/Application Support/ImageGen/engine.log` | \n\nSettings (port, Hugging Face token stored in Keychain) are in ImageGen > Settings.\n\n```\nImageGen.app (SwiftUI)\n ├─ starts ──> Python engine (FastAPI + diffusers on Metal/MPS), 127.0.0.1:7860\n │               ├─ /api/*   REST API used by the app\n │               └─ /mcp     MCP server (Streamable HTTP)\n └─ polls /api/status for progress, queue and new images\n```\n\n- `app/` SwiftUI app (Swift Package).`EngineProcess.swift` runs`uv sync` and launches the engine.\n- `backend/imagegen/` the engine:`catalog.py` (models),`downloader.py` (Hugging Face),`engine.py` (pipeline + job queue),`mcp_server.py` (MCP tools),`app.py` (HTTP routes).\n- One job runs at a time. UI and MCP requests share the same queue.\n- The engine listens on `127.0.0.1` by default. Nothing is exposed to your network.\n\nAdd a `ModelSpec` to `backend/imagegen/catalog.py` with the Hugging Face repo and the diffusers pipeline\nclass name. If the pipeline takes different arguments, adjust `Engine._run`. Pull requests for new\nmodels are welcome.\n\n```\ncd backend\nuv run python -m imagegen --port 7860   # the app connects to an engine that is already running\n```\n\n**Does it work without internet?**\nYes. You need internet once to download the model and the Python packages. After that, everything runs offline.\n\n**Is it a Stable Diffusion or Midjourney alternative?**\nFor many uses, yes. Qwen-Image 2.1 is a newer model with very good prompt following and text rendering,\nand it runs on your own hardware. Check the model license below before using it for client work.\n\n**Will it run on 32 GB?**\nNot this model. It needs about 33 GB for the weights alone. Smaller models may be added later.\n\n**Intel Macs?**\nNo. It needs Apple Silicon and Metal.\n\nThe ImageGen code is [MIT licensed](https://github.com/ph1lb4/imagegen-mac/blob/main/LICENSE). Use it, fork it, ship it.\n\n**The model has its own license.** Qwen-Image 2.1 is released by the Qwen team under the\n[Qwen Research License Agreement](https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE), which allows\n**non-commercial (research and evaluation) use only**. Commercial use needs a separate license from Qwen.\nImageGen does not ship the weights. You download them from Hugging Face and accept that license yourself.\n\nThird-party components and their licenses are listed in [THIRD_PARTY_NOTICES.md](https://github.com/ph1lb4/imagegen-mac/blob/main/THIRD_PARTY_NOTICES.md).\nImageGen is not affiliated with or endorsed by Alibaba, the Qwen team or Hugging Face.\n\nBuilt by [Philipp Baldauf](https://github.com/ph1lb4). Powered by\n[Qwen-Image](https://huggingface.co/Qwen/Qwen-Image-2.1), [diffusers](https://github.com/huggingface/diffusers),\n[PyTorch](https://pytorch.org), [FastAPI](https://fastapi.tiangolo.com), the\n[MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) and [uv](https://github.com/astral-sh/uv).\n\nIf ImageGen is useful to you, a star helps other Mac users find it.", "url": "https://wpnews.pro/news/imagegen-local-ai-image-generation-for-mac-with-qwen-image-2-1", "canonical_source": "https://github.com/ph1lb4/imagegen-mac", "published_at": "2026-10-02 06:06:15+00:00", "updated_at": "2026-10-02 06:15:47.006546+00:00", "lang": "en", "topics": ["generative-ai", "ai-products", "ai-tools", "agent-protocols", "ai-agents"], "entities": ["ImageGen", "Qwen-Image 2.1", "Apple Silicon", "MacBook Pro", "Claude Code", "Cursor", "Hugging Face", "ph1lb4"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/imagegen-local-ai-image-generation-for-mac-with-qwen-image-2-1", "markdown": "https://wpnews.pro/news/imagegen-local-ai-image-generation-for-mac-with-qwen-image-2-1.md", "text": "https://wpnews.pro/news/imagegen-local-ai-image-generation-for-mac-with-qwen-image-2-1.txt", "jsonld": "https://wpnews.pro/news/imagegen-local-ai-image-generation-for-mac-with-qwen-image-2-1.jsonld"}}