Black images or invalid colors: separate sampling, VAE and display failures
Compare the saved artifact with the preview before diagnosing a black image. A black preview and genuinely invalid output pixels are different observations.
Symptoms and scope
Compare the saved artifact with the preview before diagnosing a black image. A black preview and genuinely invalid output pixels are different observations.
Search terms and a possible warning, not a list of errors confirmed by one report; only the invalid-cast warning appears in the cited issue:
invalid value encountered in cast
black image
NaN
Source-supported context
Official basic workflows separate sampling, VAE decoding and saving. Historical issue #1402 includes black output and invalid-cast warnings, but the reporter crossed out an initial VAE-precision hypothesis; it is not a confirmed cause. Source 1 Source 2 Source 3
Cases to distinguish
1. Saved pixels are valid and only frontend preview or display is failing.
2. Sampling/decoding produces nonfinite values, precision trouble or mismatched components, surfacing during saving.
3. Input, mask, strong adapters or a specific parameter combination needs a minimal controlled comparison.
Diagnostic sequence
The sequence below is an editorial procedure based on the cited context, not a diagnosis already confirmed for your environment.
Step 1. Open the saved image in another trusted viewer and preserve warnings before the failure.
Step 2. In a copy, establish an official or known-working baseline compatible with the model and its matching VAE. Omit LoRA, ControlNet, IPAdapter or precision overrides only when they are optional for that workflow; retain required components and change one setting at a time.
Step 3. Fix seed and dimensions and restore one branch at a time. Record the first NaN/invalid-cast stage instead of hiding it by replacing pixels at save time.
Step 4. Change VAE/attention precision only when model/node documentation permits it, and check the memory impact.
Completion check
Saved output is readable and plausible, repeated minimal tasks are stable, and numerical warnings are also reviewed.
Limitations and cautions
Appearance alone cannot identify a unique cause, and fp32 is not a guaranteed repair. Do not generalize one historical GPU workaround to every platform.
Original sources
- Black images with invalid cast warning — individual report, checked 2026-09-26.
- Text-to-image workflow — checked 2026-09-26.
- ComfyUI model troubleshooting — checked 2026-09-26.
Source review updated 2026-09-26. No workflow execution, GPU run, minimum-memory measurement or runtime guarantee is supplied.
Related troubleshooting and guides
Was this page helpful?
Anonymous. Only a yes/no counter is stored; no account, IP address or device details.
Sources & references
Official ComfyUI workflow/model guidance and individual issue #1402 rechecked 2026-09-26. NaN is a diagnostic search term, not an observed log in that report. No workflow or GPU run was performed.
01Black images with invalid cast warningSource checked: 2026-09-2602Text-to-image workflowSource checked: 2026-09-2603ComfyUI model troubleshootingSource checked: 2026-09-26