Local AI Image Generation on Mac: Run, Train and Automate Image Models
On This Page
- Why Run Image Models Locally
- Why a Mac Can Do This at All
- The 3 Tools: mflux, Draw Things and ComfyUI
- The Models and What Fits Your Mac
- Generating Your First Image
- Training Your Own LoRA
- Local Video and Consistent Characters
- Turning It Into a Tool
- Can a Server Without a GPU Do This?
- Common Mistakes
- A Sensible Path Through All of It
Why Run Image Models Locally
So the hosted image tools are good, and for someone who needs 5 images a month they are the right answer. The reasons to run a model on your own machine show up when your use does not fit that shape.
Cost at volume. Hosted generation is priced per image or per month. A local model costs the electricity to run the Mac. If you need 20 variations to find 1 good one, or 500 images for a project, the local route has no meter running, and that changes how you work, you try things you would not pay to try.
Privacy. A prompt and an image sent to a service are on someone else's server. A local model sees nothing leave. That matters most for training, since teaching a model your face or an unreleased product means handing over the photos.
Your own subjects and styles. A hosted tool makes what it makes. A local model can be taught, with a small add on called a LoRA, to draw your character, your product or your art style, and then it does so every time.
Stability. A service changes its model, its prices and its rules when it likes. A model file on your disk behaves the same next year. For anything you want to repeat, a consistent look across hundreds of images, that counts for a lot.
Automation. A model on your machine can be called from a script or by an AI assistant as many times as you want, with no key and no rate limit.
Now the other side, said plainly. The best hosted models are still ahead of what runs locally on the hardest requests, long text in an image, complicated scenes with many people, exact instructions. Local generation is slower per image than a data center. And there is setup, even if it is 2 commands. A local model basically means "I trade some peak quality and a bit of setup for unlimited, private, repeatable use". If that trade does not sound good, the free hosted options in the free AI image generators guide are the better fit.
Why a Mac Can Do This at All
For a long time the answer to "can I run this on a Mac" was "sort of". The image tools were written for NVIDIA graphics cards and their software layer, CUDA, and a Mac has neither. Two things changed that.
The first is how Apple Silicon handles memory. On a PC, an image model has to fit in the graphics card's own memory, and consumer cards top out around 24 GB. A Mac uses 1 shared pool for everything, called unified memory, so a Mac with 64 GB can give most of 64 GB to a model. That is why a laptop can load models that need a very expensive card on a PC.
The second is MLX, a machine learning framework Apple released for its own chips. Tools built on MLX are written for the Mac from the start, instead of being NVIDIA code adapted to limp along. They install cleanly, use memory well, and skip the odd errors the adapted tools are known for.
The trade is speed. A Mac's graphics chip is slower at this math than a high end NVIDIA card. So a Mac can load nearly anything and takes longer to run it, where a PC card runs fast and is limited in what it can load. For images that is a fine deal, the wait is seconds to a couple of minutes. For video, as you will see below, the wait gets long.
All of this needs an Apple Silicon Mac, any M1 through M5 chip. Intel Macs cannot run these tools.
The 3 Tools: mflux, Draw Things and ComfyUI
There are dozens of projects, and 3 cover almost everything. They are less rivals than 3 different shapes of the same job.
| mflux | Draw Things | ComfyUI | |
|---|---|---|---|
| What it is | Command line and Python tool | Mac app | Node graph in a browser |
| Setup | 2 commands | App Store install | Installer or command line |
| Built for Apple Silicon | Yes, on MLX | Yes | Supported, built for NVIDIA first |
| LoRA training | Yes | Yes | Not its strength |
| Video | No | Yes | Yes, most complete |
| Best at | Scripting and automation | Ease, editing by hand | Multi step pipelines |
mflux is a set of terminal commands, 1 per model, built on MLX. You type a command with a prompt and get an image file. It supports around 20 model families, trains LoRAs from a config file, and has a Python interface, so it is the natural base for anything automated. This guide uses it as the main path because every step can be written down as a command you can copy.
Draw Things is a free app from the Mac App Store. It generates, edits with masks, makes short video clips and trains LoRAs, all with buttons and menus, and it also runs on iPad and iPhone. It is the fastest way to find out what these models can do, and the right choice for anyone who does not want a terminal.
ComfyUI draws a generation as a graph of connected boxes, which is harder to learn and lets you chain any steps together. It is slower on a Mac than the other 2 and it is where the newest and most complicated workflows live, video above all.
A common setup is 2 of the 3, Draw Things for looking at pictures and trying ideas, and mflux for anything repeated or scripted, with ComfyUI added later if a job needs it.
Install it and make your first image from the terminal, with the memory settings that matter. Draw Things for Mac
The free app route: generating, editing, video and LoRA training with no terminal. ComfyUI on Mac
Installing it on Apple Silicon, where model files go, and the Mac only errors to expect. Best Models by RAM
What a 16, 32 and 64 GB Mac can generate and train, with measured memory numbers.
The Models and What Fits Your Mac
The tool is the easy choice. The model is where the decisions are, and the deciding number is memory.
Image models are sized by parameter count, the billions of numbers inside them. The current open ones run from under 1B to 20B. The ones worth knowing first:
- Z-Image Turbo (6B). Fast, small, strong realism, generates in 9 steps. The default starting point.
- FLUX.2 klein (4B and 9B). The smallest and fastest current family, 4 steps, and it also edits images.
- Qwen Image 2.1 (7.1B plus an 8B text encoder). Good prompt understanding, text in images, editing with reference pictures.
- Krea 2 (12B). Wide range of styles, good for creative exploration.
- FLUX 3 Image Klein (5.6B plus a 4B text encoder). Strong text rendering and layouts, takes up to 10 reference images.
Two terms come up constantly. A distilled or "turbo" model has been compressed to make an image in very few steps, 4 to 9, where the base model needs 40 to 50. You generate with the distilled one because it is 5 times faster or more, and you train on the base one. Quantization stores each number in the model with fewer bits, 8 or 4 instead of 16, which shrinks memory use by half or three quarters. At 8 bit the quality loss is very hard to see.
For memory, most numbers quoted online are file sizes or guesses. The mflux project publishes measured peaks, and for Z-Image Turbo at 8 bit, a 1024 by 1024 image peaks at 7.5 GB when the model is loaded from a saved copy. The same model loaded straight from the download cache peaks at about 26 GB, because the weights there are stored in a larger format and get converted on the way in. So a single save command is the difference between a model that fits a 16 GB Mac and one that does not.
| Mac memory | Images | LoRA training | Video |
|---|---|---|---|
| 16 GB | Small models at 8 bit | Smallest models, tight | Not practical |
| 32 to 36 GB | All models, large ones quantized | Yes, with memory saving settings | Small models |
| 64 GB | All models, most at full size | Comfortable | Short clips, slowly |
Memory decides what runs and the chip decides how long it takes. A base chip with 32 GB runs more than a Max chip with 16 GB, just slower. The full breakdown, including how to check whether a run is spilling into swap, is in best local image models by RAM.
Generating Your First Image
From nothing to a picture is 3 commands. Install the package manager, install mflux, generate:
brew install uv
uv tool install --upgrade mflux
mflux-generate-z-image-turbo \
--prompt "A puffin standing on a cliff" \
--width 1280 --height 500 \
--seed 42 --steps 9 -q 8
The first run downloads the model, several GB, so it sits quietly for a while. After that each image starts right away. -q 8 is the 8 bit quantization, --steps 9 is what this model is built for, and --seed is the random starting point, the same seed and prompt give the same image again.
Then do the 1 thing that makes the biggest difference to memory, save a quantized copy and load from it:
mflux-save --path "$HOME/models/z-image-turbo_8bit" --model z-image-turbo --quantize 8
On prompts, the newer models read plain sentences better than the comma separated keyword lists older models wanted. Describe the subject, the setting, the lighting and the style the way you would to a person. Be specific about what matters and leave out what does not. If you want a flat illustration on a white background, say exactly that, the model's default is a detailed photo.
The complete walkthrough, with the low memory flags, other models and the errors people hit, is in generating images with mflux.
Training Your Own LoRA
This is the part that makes local worth it. A LoRA is a small file of extra weights that sits on top of a model and teaches it 1 new thing: a person, a character, a product, an art style. The base model stays untouched. You are training well under 1% of the numbers, which is why a laptop can do it.
The word "training" causes confusion, because it covers 3 very different jobs. Building a model from scratch takes hundreds of millions of images and a data center. Fully retraining an existing model takes thousands of images and server hardware. Training a LoRA takes 15 to 40 images and an hour or a few on a Mac. The third is the one people actually want, and it has its own page: can you train an AI image model on a Mac?
The process has 4 parts.
The dataset. A folder of images, each with a text file of the same name holding a 1 sentence caption. The rule is to keep your subject the same and change everything else, background, lighting, angle, outfit. Whatever repeats across the images gets learned as part of the subject, so 20 photos on the same couch teaches the model that the couch is part of the dog. This step decides the result more than any setting does.
The config. A short JSON file naming the model, the data folder, and a handful of numbers. A learning rate of 1e-4, a rank of 8 to 16, and enough epochs to reach 1000 to 2000 steps cover most cases.
The run. 1 command, mflux-train --config train.json. It saves a checkpoint every so many steps and generates preview images as it goes, so you can watch the subject appear.
Picking the result. The best checkpoint is rarely the last one. Too few steps and the subject is not there yet, too many and the LoRA has memorized the training photos and ignores your prompt. You look at the previews, pick the one in between, pull the LoRA file out of that checkpoint, and load it with 2 flags when you generate.
On memory, training needs far more than generating. The mflux docs name 32 to 36 GB as the size where FLUX.2 klein training fits with the memory saving settings on. On 64 GB it is comfortable. On 16 GB it is a struggle, and a free cloud notebook or a rented card for a dollar or 2 is often the better move.
What a Mac can and cannot train, how much memory it takes, and how it compares to a GPU. Train a LoRA on a Mac
The full process from the command line: data folder, config file, run, and using the result. Build a LoRA Dataset
Choosing, resizing and captioning images with tools already on a Mac. LoRA Training Settings
Steps, learning rate and rank explained, and how to read an over or under trained result. Train a LoRA of Yourself or a Character
The photos to take, and building a dataset for a character that exists as 1 drawing. Train a LoRA for Free
Local, free cloud notebooks and credit sites compared, plus what paid actually costs.
Local Video and Consistent Characters
Video is where the Mac's limits show, and it is better to know that going in. A video model makes dozens of frames that all have to agree with each other, and the good open ones are 14B to 19B parameters, 2 to 3 times the size of an image model. On a 64 GB Mac they load. Then each clip takes minutes, for 2 to 5 seconds of footage. One published test on a 64 GB M1 Max took 1 hour 22 minutes for a 2 second clip with the large Wan 2.2 model, and that chip is several generations old, but it sets the scale.
What works is short clips with the smaller models, the Wan 2.1 1.3B model is the practical start, and the large models with a 4 step speed up LoRA. Draw Things is the easiest way to try it, mlx-video is the command line option built for the Mac, and ComfyUI has the most complete workflows. A Mac is a good place to learn and experiment with video. For a finished piece on a deadline, a rented NVIDIA card or a hosted service is still the realistic choice, and the hosted options are covered in the AI video guide.
The most useful thing to understand about video is how character consistency works, because most people attack it from the wrong end. A video model has no memory, describe the same character in 2 clips and you get 2 different people. Training the video model on your character is possible and needs server hardware. The method that works on modest hardware is to put the consistency in still images: train a character LoRA on an image model, generate a still for each shot, and then use image to video to animate each still. The video model only has to move a character it has been shown, which it is good at, instead of remembering one it has been told about, which it is bad at.
The tools, the models, the commands, real speed numbers, and where the cloud makes more sense. Consistent Characters
Character LoRAs, reference images and image to video, and the shot by shot workflow.
Turning It Into a Tool
Once a model runs from a command, it can be called by anything. That is the step where a local model stops being something you play with and becomes part of how you work.
The simplest version is a short shell script that takes a prompt and a file name and hides the flags. Any program that can run a command can now make an image, including an AI coding assistant with terminal access, which can then generate the images a task needs without you stepping in. For batches, a Python script loads the model once and loops over a list of prompts, so you pay the load time once instead of per image. For an AI assistant that should treat it as a real tool with a name and typed inputs, a small MCP server with a single function does it in about 30 lines.
Two things matter when a model is called repeatedly. Load from a saved quantized copy, so each call uses about 7.5 GB instead of 26. And decide whether the model stays loaded between calls, which is faster and holds around 11 GB the whole time, or loads fresh each call, which is slower and uses nothing when idle. On a Mac that is also running a local language model, that choice decides whether the 2 fit together.
A shell wrapper, a Python batch script, an MCP server for AI assistants, and the ComfyUI API. Generate Images With mflux
The commands every wrapper is built on.
Can a Server Without a GPU Do This?
People with a cloud server often ask whether it can do the same job. If the server has no graphics card, mostly no. Image models can run on a plain processor, and a small model will produce an image in several minutes instead of several seconds, which is usable for an occasional background job and painful for anything else. Training on a processor alone is not practical at all, a run that takes an hour on a Mac would take days.
What a plain server is good for is everything around the model: collecting and resizing images, running caption jobs with a small model, storing datasets and results, and queueing work for a machine that does have the hardware. The economics are simple. A GPU server costs a dollar or more per hour to keep running, so for steady image work a Mac you already own is the cheaper machine, and for bursts of heavy work, renting a GPU by the hour beats owning one. The wider cost picture is in cloud AI vs self hosted AI costs.
Common Mistakes
Judging by file size. A model's download size is not its memory use. The same model can peak at 7.5 GB or 26 GB depending on how it is loaded. Check swap use on your own machine instead of trusting a number.
Loading from the download cache every time. Save a quantized copy once and load from that.
Starting with the biggest model. The largest models are slower and need more memory, and for most images the 6B class is as good. Start small and move up only when you hit something it cannot do.
Using a LoRA on the wrong model. A LoRA only works on the family it was trained for. When one seems to do nothing, that is the first thing to check.
Training on a distilled model. For the families that have both, train on the base version and generate with the fast one.
Blaming the settings for a dataset problem. When a LoRA puts the same background in every image, no learning rate will fix it. The images need more variety.
Keeping only the last checkpoint. Save often and choose by looking at previews.
Expecting video to feel like images. Plan video in short clips, start at low resolution, and confirm a pipeline works before asking for a long run.
Storing every model 3 times. Each tool keeps models in its own format. Several tools and several models will fill a disk long before memory becomes the problem, so check where the space is going and delete what you do not use.
A Sensible Path Through All of It
There is a lot here, and it does not need to be done at once. An order that works:
- Install Draw Things or mflux and generate images with Z-Image Turbo for a day. Learn what the model does well and how it reads prompts.
- Save an 8 bit copy and check your memory use, so you know your machine's real budget.
- Try a second model, FLUX.2 klein for speed and editing, or Qwen Image 2.1 for text in images.
- Build a small dataset of 1 subject, 20 images, and train your first LoRA. Expect the first one to be mediocre, it is how you learn what the dataset needs.
- Wrap the generate command in a script, and use it for a real task.
- Only then look at video, with the smallest model first.
Each step is useful on its own, and you can stop at any of them. Plenty of people get everything they need from step 1.