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.

Not sure which model to pull? Use the GPU model picker: enter your VRAM and RAM and get a list of Ollama models that fit.

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

ModelNative sizeComfortable onLicence
Stable Diffusion 1.5512x5124-6 GBCreativeML OpenRAIL-M
SDXL1024x10248 GB+CreativeML Open RAIL++-M
Stable Diffusion 3.5 Medium / Large1024x1024Medium 8 GB+, Large 16 GB+Stability AI Community License
FLUX.1 [schnell] / [dev]Around 1024x102412 GB+ using fp8 or GGUF versionsschnell: Apache 2.0; dev: non-commercial
Qwen-ImageAround 1024x1024 or larger16-24 GB using fp8 or GGUF versionsApache 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 .safetensors files. Older .ckpt and .pt files 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. A run_cpu.bat is 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.txt and python 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

  1. Get a model. Download an SDXL checkpoint and put it in the models/checkpoints folder inside your ComfyUI install. Many of the built-in templates also offer to download the models they need.
  2. Open a template. Browse the built-in templates and pick a basic text-to-image workflow.
  3. Choose the model in the Load Checkpoint node.
  4. Write your prompt in the positive text box, and anything you want to avoid (such as “blurry, low quality”) in the negative one.
  5. Set the size in the Empty Latent Image node to the model’s native resolution, for example 1024x1024 for SDXL.
  6. Click Run (Queue Prompt in older versions). Finished images are saved in the output folder.

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 --novram as a last resort). In the portable build, add the flag to the end of the line in run_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 ps to see what’s loaded and ollama 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

AppGood for
Draw ThingsFree native app for Mac, iPhone and iPad, with no setup
InvokeAIOpen-source app for Windows, Mac and Linux with a canvas for inpainting and editing
Stable Diffusion WebUI ForgeA form-based interface with sliders instead of nodes, based on the AUTOMATIC1111 WebUI that many older tutorials use
Krita AI DiffusionA plugin that adds generation to the free Krita painting app, using ComfyUI behind the scenes
Open WebUIGenerating 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

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.

Subscribe free →

Lila Forge Kits

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 →
VibeEngine

Best local LLM tools, ranked

Ollama, LM Studio, Open WebUI and llama.cpp scored from public evidence, with top picks.

vibeengine.lilaforge.com →