Nemotron-Labs-Image on an 8GB GPU: It Runs in ComfyUI, Slowly

Advertisement
Nemotron-Labs-Image on an 8GB GPU Generative AI
Advertisement

NVIDIA released Nemotron-Labs-Image-30B-A3B in late November, and it is an odd one: instead of being a diffusion model like Stable Diffusion or FLUX, it draws images the same way a language model writes text. NVIDIA's own example runs it on four H100 80GB cards, and the author of the ComfyUI node says it needs at least a 12GB GPU. I wanted to know what happens on an RTX 2080 SUPER with 8GB of VRAM, so I tried it.

It worked. On a PC with 32GB of RAM, all four test images finished, and I never hit an out-of-memory error. The catch is speed: one 1024x1024 image took 54 minutes, and even 512x512 took about 15. If you have an 8GB card and want to try it anyway, start at 512x512 and turn on the live preview so you can watch the image appear.

A 1024x1024 image made with Nemotron-Labs-Image on an 8GB GPU, showing a black shop sign that reads HAMUTETSU LAB
1024x1024 on an 8GB GPU (54 min 32 s). Every letter of HAMUTETSU LAB is correct. Click to enlarge.

What is Nemotron-Labs-Image?

It is an image generator built on top of NVIDIA's Nemotron 3 Nano language model, with open weights on Hugging Face. The model has 30B parameters in total, but it is a mixture-of-experts (MoE) model, so only about 3B of them are used for each step.

The interesting part is how it makes a picture. A diffusion model starts from noise covering the whole frame and cleans it up over 20 to 30 steps. Nemotron-Labs-Image works like a chatbot writing a sentence one word at a time. It writes "image tokens", each standing for a 16x16-pixel patch, row by row from the top left. A 1024x1024 image is about 4,250 tokens, and a bundled decoder turns those tokens back into pixels.

Diffusion models (Stable Diffusion, FLUX) Nemotron-Labs-Image
How it draws Removes noise from the whole frame, a little at a time Writes small patches, one row after another
What sets the time Number of steps Image size (number of tokens)
Preview while it runs Blurry everywhere, then sharper Appears from the top down

Because it reuses the language model machinery, it is supposed to be good at spelling out text on signs and labels. The license is the NVIDIA License for non-commercial research and evaluation only, so you can't use the images commercially.

My setup

  • GPU: RTX 2080 SUPER (8GB VRAM, driver 610.88)
  • RAM: 32GB
  • Windows 11 Pro, ComfyUI portable v0.46.0 (0.44.0 or newer is required)
  • Custom node: ComfyUI-Nemotron-Image by PedroMarinhoDev
  • Free disk space: about 28GB (23GB of model files plus ComfyUI)

The official weights are 133GB and run on vLLM under Linux. I used the node author's 4-bit ComfyUI file instead (21.6GB). With an 8GB card, most of the model lives in system RAM, so VRAM use never went above 6.3GB. RAM is the tight spot: with 32GB, free memory dropped to between 0.1GB and 2GB during every run, so close everything else before you start.

Results and timings

I used two English prompts, a hamster on a desk and a shop sign with text, both with seed 42.

A cozy desk with a hamster figurine next to a laptop showing code, warm morning light, photo
A shop sign that says HAMUTETSU LAB
A 1024x1024 image made with Nemotron-Labs-Image: a laptop and a hamster figurine on a desk by a window
The desk prompt at 1024x1024 (53 min 55 s). The lighting looks great, but the model added a sign and book titles I never asked for, with garbled text. Click to enlarge.

The HAMUTETSU LAB sign was spelled correctly at both 512 and 1024. When the prompt didn't ask for any text, though, the model filled the wall sign and book spines with made-up words. The node's README warns about this too ("Short prompts invite unasked text") and suggests describing colors, counts and positions in detail.

Two 512x512 images made with Nemotron-Labs-Image: a hamster at a desk on the left, a HAMUTETSU LAB sign on the right
The two 512x512 images. On the left the hamster is cut off at the bottom. The sign on the right is spelled correctly. Click to enlarge.

Times are from sending the prompt to the saved PNG.

Size Prompt Time Peak VRAM Lowest free RAM
512x512 Desk 15 min 45 s 6.3GB 0.1GB
512x512 Sign 14 min 27 s 4.9GB 2.2GB
1024x1024 Desk 53 min 55 s 5.0GB 0.7GB
1024x1024 Sign 54 min 32 s 5.0GB 1.8GB

Every run moved at about 0.8 seconds per token. A 1024 image has four times as many tokens as a 512 image, and it took almost exactly four times as long. The node author measured 21.8 seconds for the same file at 1024x1024 on an RTX 4090, so my PC was more than 100 times slower. After roughly two minutes spent reading the prompt, each row came out at a steady pace.

What tripped me up on 8GB

The fast CUDA path never kicked in

The node ships with custom CUDA kernels (the "fast path"), and the speeds in the README come from those. My first run's log showed this instead, which means it fell back to plain PyTorch:

Nemotron Image: engine auto, experts in RAM (2.4 GiB under the patcher)
Nemotron Image: plain decode (no CUDA device with NVRTC)

Reading the node's code, the fast path compiles its kernels at runtime, and along the way PyTorch looks for a CUDA Toolkit install through CUDA_HOME. I don't have the CUDA Toolkit installed. Pointing CUDA_HOME at an empty folder was enough to get the kernels to compile for the RTX 2080 SUPER, but then the log stopped at a different reason:

Nemotron Image: plain decode (its 15.3 GiB of host memory would leave too little RAM available)

On an 8GB card the node keeps most of the model (15.3GiB) in system RAM. To use the fast path it pins that memory, and it wants at least 16GiB still free afterward. A 32GB PC can't meet that, and the later runs were no faster than the first one. In practice you need 48GB of RAM or more for the fast path. Because of that, I couldn't confirm whether the fast kernels produce correct output on an RTX 20-series card.

The bundled workflow loads with red nodes

If you load the node's example workflow as is, both loader nodes turn red and ComfyUI reports two problems. The model names are written with "/" separators, while ComfyUI on Windows lists them with "\". The example also defaults to the w4a8 file rather than the int8dense one I downloaded. Picking the files again from the dropdowns gets it running (step 5 below).

The example workflow loaded as is in ComfyUI on Windows, with Load Nemotron Image and Load Nemotron Image Decoder outlined in red and a two-problems warning
The example workflow straight after loading. Both loaders are outlined in red. Click to enlarge. (My ComfyUI UI is in Japanese.)

512x512 can crop the subject

To save time I tried 512x512, and the hamster ended up cut off at the bottom of the frame. With the same seed and prompt at 1024, the whole figurine fit. Going down to 256x256 was worse: with the sign prompt, no sign or text appeared at all. Simple subjects like the sign were fine at 512, so a sensible routine is to check text and mood at 512 first, then rerun only the prompts you like at 1024.

How to run Nemotron-Labs-Image in ComfyUI

Step 1: Install ComfyUI portable

You need ComfyUI 0.44.0 or newer. If yours is older, download the latest ComfyUI_windows_portable_nvidia.7z from the ComfyUI releases page and extract it to a new folder. If it is in your Downloads folder, these two PowerShell lines extract it:

cd D:\
tar -xf $env:USERPROFILE\Downloads\ComfyUI_windows_portable_nvidia.7z

The rest of this guide assumes D:\ComfyUI_windows_portable. Change the path if you put it somewhere else.

Step 2: Install ComfyUI-Nemotron-Image

You need Git for Windows. There is nothing to pip install.

cd D:\ComfyUI_windows_portable\ComfyUI\custom_nodes
git clone --depth 1 https://github.com/PedroMarinhoDev/ComfyUI-Nemotron-Image.git

Step 3: Download the model files

Two files, about 23GB in total. Paste this into PowerShell and it creates the folders and downloads them one after the other. No Hugging Face login is needed. It took about 46 minutes on my connection.

cd D:\ComfyUI_windows_portable\ComfyUI\models
curl.exe -L --create-dirs -o diffusion_models\nemotron-image\nemotron_labs_image_30b_a3b_w4a8_int8dense.safetensors "https://huggingface.co/PedroMarinhoDev/Nemotron-Labs-Image-ComfyUI/resolve/main/nemotron_labs_image_30b_a3b_w4a8_int8dense.safetensors"
curl.exe -L --create-dirs -o vae\nemotron-image\nemotron_labs_image_tokenizer_bf16.safetensors "https://huggingface.co/PedroMarinhoDev/Nemotron-Labs-Image-ComfyUI/resolve/main/nemotron_labs_image_tokenizer_bf16.safetensors"
Folder (under models\) File Size Role
diffusion_models\nemotron-image nemotron_labs_image_30b_a3b_w4a8_int8dense.safetensors 21.6GB Writes the image tokens
vae\nemotron-image nemotron_labs_image_tokenizer_bf16.safetensors 1.24GB Turns tokens into pixels

There are five precision options for the main model, and the example workflow defaults to w4a8 (22.7GB). The README calls int8dense the fastest file, and it is also the smallest, so that is the one I used.

Step 4: Create a launcher with live preview

When one image takes this long, it helps to see it being drawn. Run this one line in PowerShell to create run_nemotron.bat, which starts ComfyUI with --preview-method auto:

Set-Content D:\ComfyUI_windows_portable\run_nemotron.bat ".\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --preview-method auto`r`npause" -Encoding ascii

From now on, double-click run_nemotron.bat in D:\ComfyUI_windows_portable instead of run_nvidia_gpu.bat.

Step 5: Load the example workflow and reselect the models

Drag nemotron_image_t2i.json from ComfyUI\custom_nodes\ComfyUI-Nemotron-Image\example_workflows onto the ComfyUI canvas. Then pick these files from the dropdowns on the two red nodes:

Node Field Choose
Load Nemotron Image model_name nemotron-image\nemotron_labs_image_30b_a3b_w4a8_int8dense.safetensors
Load Nemotron Image Decoder vae_name nemotron-image\nemotron_labs_image_tokenizer_bf16.safetensors
Load Nemotron Image and Load Nemotron Image Decoder with the models reselected, and Nemotron Image Generate set to the sign prompt at 512x512
The nodes after reselecting the models. experts and engine stay on auto. Click to enlarge.

Leave experts and engine on auto in Load Nemotron Image. With an 8GB card, auto keeps most of the model in system RAM on its own.

Step 6: Enter a prompt and a size, then run

Type an English prompt into Nemotron Image Generate, set width and height to 512, and click Run in the top right. Sizes must be multiples of 16, and the model card recommends sizes such as 1024x1024 and 1248x832. Leave temperature 0.9, top_p 1.0 and top_k 0 alone, since those are the model card's values. Once it starts, a preview appears at the bottom of the Generate node and grows downward in strips. The finished image is saved to ComfyUI\output.

The Nemotron Image Generate node showing a half-finished live preview that grows from the top
Halfway through a run, with the top half drawn inside the Generate node (a 256x256 test). Click to enlarge.

Wrapping up

Nemotron-Labs-Image does run on 8GB of VRAM with 32GB of RAM, but expect 54 minutes at 1024 and about 15 at 512. The text rendering really is accurate, so it is worth a look. For usable speed, plan on 48GB of RAM or more. If you want an image model that is actually quick on an 8GB card, see my MiniMax H3 Image guide.

Sources: nvidia/Nemotron-Labs-Image-30B-A3B - Hugging Face, PedroMarinhoDev/ComfyUI-Nemotron-Image - GitHub, PedroMarinhoDev/Nemotron-Labs-Image-ComfyUI - Hugging Face

Comments

Copied title and URL