fix: run VAE in fp32 to stop black/blank generated images

fp16 VAE produces NaNs on many SD1.5/SDXL checkpoints, yielding black
images (often mistaken for NSFW censorship - there is no NSFW filter in
the generator). Switch COMFYUI_FLAGS from --fp16-vae to --fp32-vae in
.env.example and document the fix in the README. Verified end-to-end:
a test generation now produces a real image (mean ~86) instead of black.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 16:56:46 -04:00
parent 15e0dc3772
commit c2b0f202bf
2 changed files with 9 additions and 2 deletions
+3 -1
View File
@@ -16,8 +16,10 @@ COMFYUI_PORT=8188
# Key: DON'T use --gpu-only - it fights the unified memory fabric # Key: DON'T use --gpu-only - it fights the unified memory fabric
# --disable-pinned-memory: reduces overhead on unified fabric # --disable-pinned-memory: reduces overhead on unified fabric
# --force-fp16 + --fp16-*: enables SageAttention optimization # --force-fp16 + --fp16-*: enables SageAttention optimization
# --fp32-vae: run the VAE in fp32 - fp16 VAE produces NaNs -> BLACK images on
# many SD1.5/SDXL checkpoints. (Use --bf16-vae instead for a faster compromise.)
# --dont-upcast-attention: keeps attention in FP16 for speed # --dont-upcast-attention: keeps attention in FP16 for speed
COMFYUI_FLAGS=--listen 0.0.0.0 --port 8188 --disable-pinned-memory --force-fp16 --fp16-unet --fp16-vae --fp16-text-enc --dont-upcast-attention COMFYUI_FLAGS=--listen 0.0.0.0 --port 8188 --disable-pinned-memory --force-fp16 --fp16-unet --fp32-vae --fp16-text-enc --dont-upcast-attention
# Build refs (pin to specific commits/tags for reproducibility) # Build refs (pin to specific commits/tags for reproducibility)
COMFYUI_REF=master COMFYUI_REF=master
+6 -1
View File
@@ -40,10 +40,15 @@ The DGX Spark's Grace-Blackwell architecture uses **unified memory** - a coheren
```bash ```bash
--disable-pinned-memory # Reduces overhead on unified fabric --disable-pinned-memory # Reduces overhead on unified fabric
--force-fp16 # Enables SageAttention optimization --force-fp16 # Enables SageAttention optimization
--fp16-unet --fp16-vae --fp16-text-enc # FP16 precision throughout --fp16-unet --fp16-text-enc # FP16 precision for UNet + text encoder
--fp32-vae # VAE in fp32 - fp16 VAE causes NaNs -> BLACK images
--dont-upcast-attention # Keeps attention in FP16 for speed --dont-upcast-attention # Keeps attention in FP16 for speed
``` ```
> **Black/blank images?** That's the classic fp16-VAE NaN issue, not an NSFW
> filter (there is none). Keep `--fp32-vae` (default). `--bf16-vae` is a faster
> alternative that also avoids the NaNs.
**What NOT to use:** **What NOT to use:**
- `--gpu-only` - fights the unified memory fabric, hurts performance - `--gpu-only` - fights the unified memory fabric, hurts performance
- `--cache-none` - disables natural caching, slows model loading - `--cache-none` - disables natural caching, slows model loading