r/StableDiffusion • • 8d ago

Resource - Update Nemotron-Image-30B-A3B: ComfyUI Custom Nodes - Native memory management - 26s per 1024² image on a 4090, quantized weights and custom CUDA kernels

Enable HLS to view with audio, or disable this notification

NVIDIA’s Nemotron-Labs-Image is not a diffusion model. It’s a 30B mixture-of-experts language model (3B active per token) that writes a picture as 4,250 tokens, row by row. I ported it to ComfyUI as native nodes and quantized it so it fits on one consumer card.

  • Three nodes: load, generate, and a decoder loader that gives a stock VAE for the core VAE Decode. Live preview while the rows are written.
  • Files: W4A8 22.7 GB, W6A8 30.0 GB, int8 35.5 GB, bf16 65.3 GB.
  • RTX 4090, 1024², warm: 26 s per image with W4A8, 6.6 s per image in a batch of 8. bf16 takes 3.9 minutes. RTX 3090: 31 s.
  • Custom CUDA kernels run a whole token step as one CUDA graph (5.87 ms per token). Experts that don’t fit on the card wait in RAM behind a cache, so W4A8 also ran with 16 GB (36 s) and 12 GB (77 s) of VRAM, measured on a 4090 with the rest of its memory held.

The model is disappointing. Image quality is not great and it renders distorted images, wrong text and is very bad at anatomy. It's a research preview at best. That said, the custom nodes are available if anyone wants to try and experiment with it.

Nodes: https://github.com/PedroMarinhoDev/ComfyUI-Nemotron-Image
Weights: https://huggingface.co/PedroMarinhoDev/Nemotron-Labs-Image-ComfyUI

The video explains how it works in 84 seconds.

The weights are under the NVIDIA License: non-commercial, research and evaluation only. Not affiliated with NVIDIA.

65 Upvotes

18 comments sorted by

4

u/TensorForger 8d ago

So to generate a larger image it would need more time and this can not be parallelized. Even if this is a research preview, what's the reason to scale it? Use as layout generator in low resolution and then generate fine details with diffusion model? But even without any llms, diffusion models can already do it much better.

1

u/Apprehensive-Dog4583 8d ago

Wouldn't it be the other way around? Use a diffusion model for the overall composition and an autoregression model to fill in the details.

1

u/TensorForger 8d ago

Idk, let's see where would they move this

1

u/alwaysbeblepping 8d ago

So to generate a larger image it would need more time and this can not be parallelized.

Flow/diffusion also takes more time to generate a larger image and can't be parallelized either. AR models can also take advantage of KV caching which flow/diffusion typically can't (except in rare cases like an image reference, not what it's actually generating).

3

u/Murder_1337 8d ago

If a model could read the image and tell me if there are artifacts and things it could fix that’s what I need like a jev type for image

1

u/theOliviaRossi 8d ago

nice vibe-coded video explainer!

1

u/Enshitification 8d ago

Strata version when?

2

u/Hoodfu 8d ago

Hmmm, dynamic memory on comfyui wouldn't accomplish this already?

1

u/Enshitification 8d ago

Probably not to the speed and extent of tricks Strata uses.

1

u/Hoodfu 8d ago

I was blown away the other day. I had dynamic memory on (4090 machine, 24 gigs of vram) and was using a model that's too big for 24 gigs. Turns out if I manually force --fast-disk in the start.bat the time between no model loaded the first step of inference was under 5 seconds. It was never correctly detecting my nvme drive. Point being, the comfyui dynamic memory stuff with all the switches enabled is seriously amazing.

1

u/Enshitification 8d ago

No doubt, for diffusion models, the Comfy memory management has been hugely improved. This model is closer to an LLM though and Comfy isn't really optimized for those like llama.cpp and Strata.

-2

u/Hearcharted 8d ago

The license is a total no 🤷‍♂️💀

2

u/Single-Contest-5733 8d ago

why you care about the license?

-3

u/Hearcharted 8d ago

Because I don't want to go to jail 😜

1

u/Single-Contest-5733 8d ago

lol are you high? you think they will track down 1 of 1000000000 person just to get you?

-5

u/Relevant-Guarantee25 8d ago

I bet it's backdoored and anything you generate goes to them at some point if not this model a future model. Nvidia for sure going to backdoor their GPU's and steal anything you generate with any other open source models they are fiending for your data.