Why Krea 2 is slow on 16 GB RAM, and how I made it ~30% faster (8 GB VRAM)

by Aer0 · measured, not guessed
Update, Nov 27: an important correction
A reader tested this on their own machine and saw no per-step disk reads with default ComfyUI flags. They were right, and I had left out a key detail: I run ComfyUI with --disable-pinned-memory. I added it a while ago because pinned RAM together with --fast-disk kept freezing my 16 GB Linux box. With pinned memory off, ComfyUI streams the whole model from disk on every step. With the default (pinned memory on), it keeps ~9.5 GB of the weights in RAM and streams only the rest. It's the flag, not the ComfyUI version: current ComfyUI does the same with pinned memory off.
I re-measured on my machine with the same workflow, seeds 42 / 43, ComfyUI capped at 12 GB:
- NVMe (~3 GB/s), pinned memory off: 75 / 64 s per image
- NVMe, pinned memory on (default): 76 / 69 s. Steps are faster, but every pass starts by pinning ~9.5 GB, so there's no net gain.
- SATA-speed disk (reads capped at 550 MB/s), pinned memory off: 256 / 196 s
- SATA-speed disk, pinned memory on (default): 114 / 118 s
What this means for you:
- Default flags: most of the per-step reads described below don't happen to you, so defragging gains much less than the ~30% I measured. The model is still read from disk at every load (my base pass read ~33 GB even with pinned memory), so a fragmented model still slows things down.
--disable-pinned-memory(for example because of freezes or swap trouble): everything below applies in full.- Slow disk: keep pinned memory on if your system handles it. On my box it locked ~10 GB of RAM and pushed ~3 GB of other apps into swap.
The commenter also suggested updating ComfyUI, so I did: from the August build to the Nov 26 build (ComfyUI 0.46.0, comfy-aimdo 0.6.0). Same workflow, seeds and flags:
- August build: 76.5 / 69.6 s per image
- Nov 26 build: 73.7 / 63.8 s per image (−4 / −8%)
- A heavier workflow of mine (2nd pass, face and hand detailers, 4K): 307.9 → 290.4 s (−6%)
- Output: pixel-identical in both
So updating is free speed and worth doing, but on its own it doesn't stop the per-step reads when pinned memory is off.
Absolute times are lower than in the original test below because less RAM was in use by other apps that day. Thanks to the commenter for actually testing it.
TL;DR
- With 16 GB RAM and pinned memory disabled (see the update above), ComfyUI can't keep a 13 GB Krea 2 model in memory, so it re-reads the whole model from disk on every sampling step. One image read 130–150 GB from my SSD.
- That makes disk speed part of your generation time. My model file was split into 9,115 pieces and read at half speed.
- After I rewrote it as one contiguous file: 135 s → 92 s per image (−27–32%). The output was pixel-identical and nothing else changed.
- Attached: Aer0 Model Defrag, a small Linux tool that does this safely for all your models.
The setup
- RTX 3070 8 GB · 16 GB RAM · i7-9700 · NVMe SSD · Linux (btrfs with zstd compression)
- ComfyUI (August 2026) with
--lowvram --cache-none --disable-pinned-memory, ComfyUI limited to 12 GB of RAM so it can't freeze the desktop - Model: Krea 2 Turbo int8_convrot (official Comfy-Org checkpoint) + Realistic Snapshot LoRA
- Workflow: my free Aer0 Lite: base 768×1344 (8 steps) → 2nd pass ×1.5 (4 steps) → 4x upscale → 1728×3024
- Same prompt, seeds 42 and 43, two runs each time
I wrote a small profiler that watches ComfyUI's websocket and the process's disk counters. For every node it records the time, the GB actually read from disk, and the RAM used.
Finding 1: the model is read from disk on every step
- Base pass (8 steps): 74 s (9.0 s/step), 102 GB read from disk
- 2nd pass (4 steps): 40 s (9.8 s/step), 46 GB read from disk
- Prompt encoder: 4.9 s, 4.6 GB
- 4x upscale: 7.1 s, ~0 GB
- Whole image: 135 s, 154 GB read from disk
102 GB over 8 steps is 12.8 GB per step, which is exactly the size of the model. The weights don't fit in VRAM, so they are streamed in for every step. They also don't stay in RAM: Linux keeps recently read files in its page cache, but here the cache had only about 9 GB to work with. A 12.9 GB model read start to end pushes its own beginning out before the next step needs it, so almost nothing is ever found in cache.
So on 16 GB machines, sampling speed is partly disk speed. Each step takes about as long as reading 12.8 GB from the SSD.
Finding 2: the model file was badly fragmented
btrfs compresses data in 128 KB chunks, and my disk was 95% full. The result:
- Krea 2 Turbo int8 (as downloaded months ago): split into 9,115 pieces, raw read speed 1.7 GB/s
- A freshly written file on the same disk: 4 pieces, raw read speed 2.9–3.2 GB/s
Bonus discovery: my NVMe runs at PCIe 3.0 although it supports 4.0, which caps it at ~3.5 GB/s. Check yours, for example with CrystalDiskInfo on Windows.
The fix: rewrite the model as one contiguous file
The content is byte-for-byte identical, verified with sha256. Only the layout on disk changes:
- Time per image: 135 s → 92 s (run 1) and 113 s → 82 s (run 2)
- Base pass: 9.0 → 5.5 s/step (run 1) and 7.1 → 4.75 s/step (run 2)
- 2nd pass: 9.8 → 7.1 s/step (run 1) and 9.4 → 7.0 s/step (run 2)
- Output image: pixel-identical with the same seed
What did NOT help (so you don't have to try)
- GGUF Q4_K_M (7.5 GB): small enough to stay cached, so disk reads dropped from 154 GB to 9 GB. But the image took 150–156 s, slower than before: GGUF unpacks its weights on the GPU at every step, while int8 runs natively on RTX 30 tensor cores. It also loses some quality.
- Caching the prompt encoding: would save only 3–5 s out of ~113 s.
- Prefetching the file harder (
MADV_WILLNEED): no gain. The disk was the limit, not the readahead.
What you can do
- Linux with btrfs (Fedora, Nobara, CachyOS and openSUSE use it by default): run the attached Aer0 Model Defrag.
scanshows which models are fragmented and changes nothing.apply --min-gb 4rewrites only the big files. Note that rewritten files are stored uncompressed; for me that cost 19 GB on 88 GB of models. - Everyone with 16 GB RAM:
- - Keep your models on your fastest NVMe and check that it runs at its full PCIe generation.
- - Don't let that disk fill up completely.
- - Keep ComfyUI up to date: the Nov 2026 build was 4–8% faster for me with identical output.
- RTX 20/30 owners: prefer int8_convrot checkpoints over fp8. On my 3070, int8 ran at 13.1 s/it versus 16–18 s/it for fp8 on the same Krea 2 finetune and settings, because these cards have no native fp8.
- Windows: I haven't measured NTFS yet. If you try, post your numbers.
Download
Aer0 Model Defrag v0.1.0 (attached): one Python file, Linux, Python 3.10+, no dependencies, no network access. Every file is checked with sha256 before it is replaced, and an interrupted run leaves your originals untouched.
Next
I prototyped the "real fix": keep ~9 GB of the weights permanently cached and stream only the rest. It worked (−28 to −40% per image at SATA speed), but ComfyUI's own pinned memory does the same thing better, so I'm not releasing it. Follow Aer0 for the next pack.
Credits: Krea 2 by Krea (Krea 2 Community License) · int8_convrot checkpoints by Comfy-Org · Realistic Snapshot LoRA by MonkeyForever.