Nodes/SANA_LOWVRAM/SANADiffuse
ComfyUI Node

SANADiffuse

SANA on a 2GB GPU — no, really

By taabata·Created 2 years ago·Updated 2 years ago· 5
SANADiffuse
  • embeds
  • image
  • IMAGE
seed0
steps4
width512
height512
cfg8.0
pag_scale2.0
img2img
model_path
device
strength1.00

SANA is NVIDIA's answer to "modern text-to-image means you need a big card": a 0.6B/1.6B flow-matching model built around a tiny linear-attention DiT and a 32x-compression VAE, designed to run on laptop GPUs. SANADiffuse is the node that drags it into ComfyUI on hardware where SDXL wouldn't even load. The author says it runs on 2GB VRAM and 12GB RAM. On a laptop. That's the whole pitch, and for once it mostly holds.

But here's what nobody tells you before the first run: SANADiffuse isn't running SANA natively. It's a client for a tiny Flask server the pack ships. Each time you hit Queue, the node launches python3 app.py as a subprocess, POSTs your settings to 127.0.0.1:5000, polls for the result, then kills the server. The actual heavy lifting happens in a HuggingFace diffusers pipeline inside that subprocess - fp16 on CUDA with model CPU-offload switched on, fp32 on CPU. That's the low-VRAM trick: SANA is small enough that the whole pipeline can live off the GPU.

The inputs that matter

Most of the fields read like a standard sampler, because they are one:

  • model_path - pick your SANA variant. Four repo IDs are built in (600M/1600M x 512px/1024px) plus anything you drop in ComfyUI/models/diffusers. It has to match what SANATextEncode used, or you're feeding mismatched embeddings into the diffuser and getting garbage out.
  • steps - defaults to 4, and that's the point. SANA is flow matching, so a handful of steps is a feature, not a corner cut. Don't crank it the way you would SDXL.
  • cfg and pag_scale - classifier-free guidance plus PAG (perturbed attention guidance), the trick that sharpens detail by perturbing self-attention instead of using a separate guidance model. The defaults of 8 and 2 are sane starting points.
  • img2img - flip to "enable" and feed an image with a strength between 0 and 1 to redraw from something existing.

The embeds input is a class type - ComfyUI's way of saying "opaque blob". It's actually JSON shuttled over localhost, so the only thing that produces it is SANATextEncode from this same pack. You can't wire a standard CLIP text encoder in here, and you can't tap the pipeline's conditioning out either. The IMAGE output it emits behaves like any other image output - straight into Preview or Save.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/taabata/SANA_LOWVRAM.git

Grab the diffusers models from the Efficient-Large-Model SANA collection on HuggingFace and put them in ComfyUI/models/diffusers, then restart ComfyUI. (Or search "SANA_LOWVRAM" in the ComfyUI Manager install dialog - same result.) The README only mentions pip install diffusers, but the bundled server also needs Flask - if your first run dies with ModuleNotFoundError: flask, that's the fix.

Where people get burned

  • The startup lag is real. The node sleeps about five seconds just booting its server before generation starts. That's not a hang, that's the architecture. Budget it.
  • Port 5000 collisions. Every run spawns and kills its own server, so overlapping or parallel runs fight over the port. Keep executions sequential.
  • Model mismatch between the two nodes is the classic "worked in the example, not for me". Match them.
  • Everything round-trips as JSON over HTTP, so it's slower than a native implementation. Fine for a 512px image on a potato; don't expect real-time.

If you've got a modern card, SANA's proper ComfyUI integration or the raw diffusers pipeline is faster and less fiddly. Reach for SANADiffuse when "will it even fit in VRAM?" is a real question - for that job, it's genuinely the one that works.

Categorysana/nodes

Inputs (12)

NameTypeDefaultDescription
seedINT00–18446744073709550000
stepsINT40–360
widthINT5120–5000
heightINT5120–5000
cfgFLOAT8.00–30
pag_scaleFLOAT2.00–30
img2imgCOMBO2 options: disable, enable
embedsclass
model_pathCOMBO4 options: Efficient-Large-Model/Sana_600M_512px_diffusers, Efficient-Large-Model/Sana_600M_1024px_diffusers, Efficient-Large-Model/Sana_1600M_512px_diffusers, Efficient-Large-Model/Sana_1600M_1024px_diffusers
deviceCOMBO2 options: cuda, cpu
imageoptIMAGE
strengthoptFLOAT1.000–1

Outputs (1)

NameTypeDescription
IMAGEIMAGE