Generating AI images on a 6GB laptop GPU, or: VRAM is a lie

I came to AI image generation the way I come to most things: late, sceptical, and determined to do it the awkward way. The cloud services were right there — slick websites, free tiers, results in seconds. But the whole point of my recent conversion is that things run here, on hardware I own, where nobody is logging my prompts or training on my cat.

The hardware I own, in this case, is a laptop with a mobile GPU and 6GB of VRAM. The model I wanted to run, SDXL, is widely described as needing at least 8GB, ideally 12, realistically “more than you have, mate”.

The internet was very confident I couldn’t do it. The internet said the model alone barely fits, that I’d be swapping to disk, that I should run an older, smaller model and know my station. My laptop and I took that personally.

Attempt one went exactly as prophesied. The model loaded — barely — and the moment I asked for an image, the terminal produced the error message that would become my constant companion for the next week:

torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 1.50 GiB

The rest of this article is for subscribers.

Subscriptions are launching soon