RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Glossary / Neural network architectures / U-Net
Neural network architectures

U-Net

U-Net is a convolutional neural network architecture designed for image segmentation tasks. It consists of a contracting (encoder) path that captures context and a symmetric expanding (decoder) path that enables precise localization. The key feature is skip connections that concatenate feature maps from the encoder to the decoder, preserving spatial details lost during downsampling. Operators encounter U-Net primarily in diffusion models (e.g., Stable Diffusion) where it denoises latent representations iteratively. The architecture's efficiency makes it suitable for consumer GPUs, though larger variants increase VRAM usage and inference latency.

Deeper dive

U-Net was introduced in 2015 for biomedical image segmentation, but its most prominent use in local AI is as the core denoising network in diffusion models like Stable Diffusion. The encoder compresses the input (e.g., a noisy latent image) into a bottleneck, while the decoder reconstructs it into a cleaner version. Skip connections from each encoder level to the corresponding decoder level allow the network to retain fine-grained details. In diffusion models, U-Net is conditioned on text embeddings (via cross-attention layers) and timestep embeddings. The number of parameters varies: Stable Diffusion 1.5 uses ~860M parameters, while SDXL uses ~2.6B. Operators running on consumer hardware must consider VRAM: a 6 GB GPU can run SD1.5 at 512x512, but SDXL may require 8+ GB or offloading. Quantization (e.g., FP16 vs. FP32) reduces memory at a slight quality cost.

Practical example

When generating an image with Stable Diffusion 1.5 using diffusers on an RTX 3060 (12 GB VRAM), the U-Net processes a 64x64 latent (512x512 image) through 25 denoising steps. Each step runs the U-Net forward pass, taking 100 ms. The model uses ~1.7 GB VRAM in FP16. For SDXL, the U-Net is larger (2.6B params) and requires ~5 GB VRAM, pushing the RTX 3060 to its limit; operators may need to use --medvram or system-RAM offload.

Workflow example

In Hugging Face Diffusers, loading a U-Net is explicit: from diffusers import UNet2DConditionModel; unet = UNet2DConditionModel.from_pretrained("runwayml/stable-diffusion-v1-5", subfolder="unet"). In ComfyUI, the U-Net is loaded automatically when you select a checkpoint. Operators can inspect the U-Net architecture via print(unet) to see layer sizes. When running inference, VRAM usage can be monitored with nvidia-smi; if out-of-memory occurs, switching to a smaller model or enabling torch.compile may help.

Reviewed by Fredoline Eruo. See our editorial policy.

Buyer guides
  • Best GPU for local AI →
  • Best laptop for local AI →
  • Best Mac for local AI →
When it doesn't work
  • CUDA out of memory →
  • Ollama running slowly →
  • ROCm not detected →