Comfy-Org / Comfy-Org/ComfyUI

[Bug] Z-Image Base outputs silent black images regardless of precision (FP16/BF16/FP32), while Turbo works perfectly.

Open
#13,123 3 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

Hello, I am experiencing a silent failure where the Z-Image Base model outputs completely black images in ComfyUI. There are no error logs, NaN warnings, or crashes in the console—just a solid black output.

Interestingly, the Z-Image Turbo model works flawlessly under the exact same workflow and environment. The issue is entirely isolated to the Base model.

Environment:
UI: ComfyUI (Latest)
Models Tested: Z-Image Base (Fails), Z-Image Turbo (Works)
Hardware/API: AMD RX 7900 XTX, ROCm, ZLUDA same black, Desktop version.

### Actual Behavior

Image
Image

### Steps to Reproduce

Load the Z-Image Base model.
Set KSampler with appropriate Base settings (e.g., CFG 4.0~7.0, Steps 20~30).
Generate the image.
The output is completely black. No error is thrown.

### Debug Logs

```powershell
got prompt
CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cpu, dtype: torch.float16
Requested to load ZImageTEModel_
loaded completely; 22483.30 MB usable, 7672.25 MB loaded, full load: True
Using split attention in VAE
Using split attention in VAE
VAE load device: cuda:0, offload device: cpu, dtype: torch.float32
model weight dtype torch.bfloat16, manual cast: None
model_type FLOW
Requested to load Lumina2
loaded completely; 22485.30 MB usable, 11739.54 MB loaded, full load: True
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:12<00:00, 2.45it/s]
Requested to load AutoencodingEngine
loaded completely; 17031.39 MB usable, 319.75 MB loaded, full load: True
RAM清理完成 [44.4% → 32.5%, 释放: 7775MB]
VRAM清理完成 [卸载模型: True, 清空缓存: True]
C:\AI\ComfyUI\comfy\utils.py:1024: RuntimeWarning: invalid value encountered in cast
images = [Image.fromarray(np.clip(255. * image.cpu().numpy(), 0, 255).astype(np.uint8)) for image in samples]
Requested to load AutoencodingEngine
0 models unloaded.
loaded completely; 9601.00 MB usable, 319.75 MB loaded, full load: True
Requested to load Lumina2
loaded completely; 21154.10 MB usable, 11739.54 MB loaded, full load: True
100%|██████████████████████████████████████████████████████████████████████████████████| 12/12 [00:41<00:00, 3.48s/it]
Requested to load AutoencodingEngine
0 models unloaded.
loaded completely; 9601.00 MB usable, 319.75 MB loaded, full load: True
C:\AI\ComfyUI\nodes.py:1662: RuntimeWarning: invalid value encountered in cast
img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
Prompt executed in 140.27 seconds
-------------------------------------
**Terminal Log Evidence:**
The terminal does not crash, but it throws this specific Numpy casting warning at the end of the generation, proving that the KSampler is outputting NaN tensors before decoding:
`C:\AI\ComfyUI\comfy\utils.py:1024: RuntimeWarning: invalid value encountered in cast`
`images = [Image.fromarray(np.clip(255. * image.cpu().numpy(), 0, 255).astype(np.uint8)) for image in samples]`
Also, my terminal shows the model is loading properly with `dtype torch.bfloat16` and VAE in `torch.float32`, and is using the Lumina2 architecture node. The generation speed is abnormally fast (e.g., 2.45it/s), confirming it's just passing NaN values through the steps.
```

### Other

What I've Tried (and why it's not a standard precision issue):
Changing Precision Args: I tried running ComfyUI with --no-half-vae (FP32), as well as forcing BF16. The output remains completely black in all precision modes.
Changing CFG and Steps: Adjusting generation parameters does not fix it.
Different Nodes: Tried both standard ComfyUI nodes and Custom KSampler nodes. Same black result.
Testing Z-Image Turbo: Works perfectly with no issues in the exact same workflow.
Alternative UI: Both Base and Turbo work perfectly in Forge Neo on the same machine. This strongly suggests the issue is specific to how ComfyUI handles the Base model's tensors or architecture.

Expected Behavior:
Z-Image Base should generate images properly in ComfyUI, just as it does in Forge Neo, without failing silently into a black screen across all precision settings.
Any insights or fixes would be greatly appreciated!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.