Guides · Updated
Generating images locally: ComfyUI and Stable Diffusion for beginners
Make AI images on your own computer: which open image models fit your GPU, how to install ComfyUI and generate your first picture, and simpler apps if you'd rather skip the node graph.
Image generation runs on your own hardware just like chat models do, and your prompts and pictures never leave your machine. It uses different tools from the chat setups in our other guides: an image app (ComfyUI is the most popular) plus an image model such as Stable Diffusion or FLUX.
What you need
- A GPU matters even more than for chat. NVIDIA is the smoothest path. AMD, Intel Arc and Apple Silicon Macs work too, with more setup or slower results. CPU-only generation is possible but painfully slow.
- VRAM decides which models you can use, just as with chat models. The basics are in VRAM and quantisation explained.
- Disk space. Image models are several gigabytes each, and a few models plus add-ons quickly reach tens of gigabytes. Tips for keeping it under control: Keeping local models up to date and tidy.
Pick a model for your GPU
| Model | Native size | Comfortable on | Licence |
|---|---|---|---|
| Stable Diffusion 1.5 | 512x512 | 4-6 GB | CreativeML OpenRAIL-M |
| SDXL | 1024x1024 | 8 GB+ | CreativeML Open RAIL++-M |
| Stable Diffusion 3.5 Medium / Large | 1024x1024 | Medium 8 GB+, Large 16 GB+ | Stability AI Community License |
| FLUX.1 [schnell] / [dev] | Around 1024x1024 | 12 GB+ using fp8 or GGUF versions | schnell: Apache 2.0; dev: non-commercial |
| Qwen-Image | Around 1024x1024 or larger | 16-24 GB using fp8 or GGUF versions | Apache 2.0 |
- Start with SDXL. It’s the best balance for beginners: good quality, fits 8 GB cards, and has thousands of community fine-tunes and add-ons.
- SD 1.5 is older and lower quality, but very light, so it’s the pick for 4-6 GB cards.
- FLUX and Qwen-Image follow prompts more closely and handle text inside images much better, but they’re far larger. Smaller fp8 and GGUF versions make them usable on mid-range cards, at some cost in speed and quality.
Licences matter if you sell your work. FLUX.1 [dev] is non-commercial, and the Stability AI Community License has revenue-based terms for commercial use. Read the licence on the model page before you rely on a model for business.
Where to download models
- Hugging Face: the official pages from Stability AI, Black Forest Labs (FLUX) and Qwen. Some models are gated, so you sign in and accept the licence first. The Comfy-Org account also publishes repackaged versions ready for ComfyUI.
- Civitai: the main home for community fine-tunes and LoRAs (small add-ons that teach a style or subject). Quality and content vary widely, and each upload has its own licence.
- Prefer
.safetensorsfiles. Older.ckptand.ptfiles can contain code that runs when loaded, so avoid them from sources you don’t trust.
Install ComfyUI
ComfyUI is a free, open-source app that builds images from a graph of connected boxes (“nodes”). It looks intimidating, but the built-in templates mean you can generate an image without wiring anything yourself.
- Desktop app (Windows and Apple Silicon Macs): download it from comfy.org. It installs Python and everything else for you. It’s the easiest route on NVIDIA GPUs and Macs.
- Portable build (Windows): download the archive from ComfyUI’s GitHub releases page, extract it, and run
run_nvidia_gpu.bat. Arun_cpu.batis included for machines without a supported GPU. - Manual install (Linux, AMD, Intel): clone the repository, install the PyTorch build for your GPU, then
pip install -r requirements.txtandpython main.py. The ComfyUI docs cover each GPU type.
The portable and manual versions open in your browser at http://127.0.0.1:8188, served from your own PC.
Your first image
- Get a model. Download an SDXL checkpoint and put it in the
models/checkpointsfolder inside your ComfyUI install. Many of the built-in templates also offer to download the models they need. - Open a template. Browse the built-in templates and pick a basic text-to-image workflow.
- Choose the model in the Load Checkpoint node.
- Write your prompt in the positive text box, and anything you want to avoid (such as “blurry, low quality”) in the negative one.
- Set the size in the Empty Latent Image node to the model’s native resolution, for example 1024x1024 for SDXL.
- Click Run (Queue Prompt in older versions). Finished images are saved in the
outputfolder.
What the main nodes do: the text encoder turns your prompt into numbers the model understands, the KSampler turns random noise into an image step by step, and VAE Decode turns the result into pixels.
KSampler settings worth knowing:
- Seed: the same seed and settings recreate the same image. Change it for variations.
- Steps: more steps means more refinement, up to a point. Around 20-30 is a common starting point for SDXL. “Turbo” and “Lightning” versions, and FLUX.1 [schnell], are built to need only a few steps.
- CFG: how strictly the image follows your prompt. FLUX models handle guidance differently, so start from a template made for the model you’re using.
ComfyUI saves the whole workflow inside each PNG it creates. Drag one of your images back into ComfyUI to reload its exact settings. That also means a shared PNG includes your prompt, so strip the metadata first if that matters to you.
Low on VRAM?
- ComfyUI manages memory for you. When VRAM runs out it moves parts of the model to system RAM. It’s slower, but it usually works.
- Out-of-memory errors: start the portable or manual version with
--lowvram(or--novramas a last resort). In the portable build, add the flag to the end of the line inrun_nvidia_gpu.bat. - Use smaller model files. fp8 versions roughly halve the size of big models, and GGUF versions (loaded with the ComfyUI-GGUF custom node) go smaller still.
- Generate small, then upscale. Make the image at native size and use an upscaler afterwards instead of asking for a huge image up front.
- Free the GPU. Chat models use the same VRAM. Run
ollama psto see what’s loaded andollama stop <model>to unload it.
If the picture never starts, the GPU stays idle, or port 8188 is already taken, see When it doesn’t work.
Be careful with custom nodes
ComfyUI’s huge library of extensions (“custom nodes”) is one of its strengths, and ComfyUI-Manager makes them easy to install. But custom nodes are ordinary Python code with full access to your computer. Install only well-known, actively maintained ones, and treat random workflows that need many unfamiliar nodes with caution. More on keeping a local setup safe: Local AI for privacy, step by step.
Simpler alternatives
| App | Good for |
|---|---|
| Draw Things | Free native app for Mac, iPhone and iPad, with no setup |
| InvokeAI | Open-source app for Windows, Mac and Linux with a canvas for inpainting and editing |
| Stable Diffusion WebUI Forge | A form-based interface with sliders instead of nodes, based on the AUTOMATIC1111 WebUI that many older tutorials use |
| Krita AI Diffusion | A plugin that adds generation to the free Krita painting app, using ComfyUI behind the scenes |
| Open WebUI | Generating images from your chat window: connect it to ComfyUI in Admin Panel → Settings → Images |
Setting up Open WebUI: Running a local AI chat with a nice interface.
Use it responsibly
- Real people: don’t generate images of real people without their consent, and never use images to deceive. Many countries have laws against fake intimate images.
- Copyright: in some countries, including the US, purely AI-generated images can’t be copyrighted. If you’re making work for clients, check where you stand.
Next steps
- On a Mac? See Local AI on a Mac with Apple Silicon.
- No big GPU? See Local AI on a budget PC.
- Curious how LoRAs work, and how the same idea applies to chat models? See Fine-tuning a small model with LoRA.
- Choosing a GPU with image generation in mind? More VRAM is the thing to pay for. See the hardware guide.
Sources: ComfyUI docs, Stability AI licence, FLUX on GitHub, Open WebUI docs.
Get the Local AI weekly
New models worth running, what fits which GPU, and setup fixes. One short email a week, free. Unsubscribe any time.
Local-LLM App Starter
A tested starter for building your own app on Ollama: chat, RAG and a GPU-fit checker. Skip the setup hours.
kits.lilaforge.com → VibeEngineBest local LLM tools, ranked
Ollama, LM Studio, Open WebUI and llama.cpp scored from public evidence, with top picks.
vibeengine.lilaforge.com →