Eventual black images (can break at any step randomly)
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
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
Expected is there are no black images generated.
### Actual Behavior
I have a problem with images turning black during generation. It looks like not only me (as it looks there are similar problems on different hardware / starting parameters). I'm using fresh ComfyUI version with only one starting parameter "--disable-all-custom-nodes". It happens more often on SDXL models for some reason, more rarely on Anima model. Not sure why so. There are no messages in console (except once something was detected and in other cases no any message) - generation ends like everything is ok. I'm not sure how to catch this error - feels more like I need to modify KSampler to detect a possible reason...
### Steps to Reproduce
Just default workflow like in simple SDXL example (except KSampler Advanced is used). Happens in 25% cases for me on SDXL 30 steps generations. More steps - more likely it would happen.
### Debug Logs
Current run have: --enable-manager --deterministic --disable-all-custom-nodes flags. Deterministic don't change a thing as I tested - black images happen without it. --enable-manager - does almost nothing in theory as --disable-all-custom-nodes flag makes custom nodes unavailable.
There is one error message during generation - where 1st image in batch of 4 (for preview) turned black. For other cases, where black image appeared as 2nd,3rd,4th there are no such message.
```powershell
[INFO] setup plugin alembic.autogenerate.schemas
[INFO] setup plugin alembic.autogenerate.tables
[INFO] setup plugin alembic.autogenerate.types
[INFO] setup plugin alembic.autogenerate.constraints
[INFO] setup plugin alembic.autogenerate.defaults
[INFO] setup plugin alembic.autogenerate.comments
[WARNING] Could not autodetect AIMDO implementation, assuming Nvidia
[START] Security scan
[INFO] [ComfyUI-Manager] Using uv as Python module for pip operations.
Using Python 3.14.6 environment at: venv
[DONE] Security scan
** ComfyUI startup time: 2026-07-03 14:01:09.950
** Platform: Linux
** Python version: 3.14.6 (main, Jun 23 2026, 18:14:05) [GCC 16.1.1 20260430]
** Python executable: /home/okolenmi/comfy/venv/bin/python
** ComfyUI Path: /home/okolenmi/comfy/ComfyUI
** ComfyUI Base Folder Path: /home/okolenmi/comfy/ComfyUI
** User directory: /home/okolenmi/comfy/ComfyUI/user
** ComfyUI-Manager config path: /home/okolenmi/comfy/ComfyUI/user/__manager/config.ini
** Log path: /home/okolenmi/comfy/ComfyUI/user/comfyui.log
Using Python 3.14.6 environment at: venv
Using Python 3.14.6 environment at: venv
[INFO] [PRE] ComfyUI-Manager
[INFO] Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope_split_half', 'apply_rope_split_half1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'int8_linear', 'quantize_and_rotate_rowwise', 'quantize_int8_rowwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}
[INFO] Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope_split_half', 'apply_rope_split_half1', 'dequantize_int8_simple', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'gemv_awq_w4a16', 'int8_linear', 'quantize_and_rotate_rowwise', 'quantize_int8_rowwise', 'quantize_int8_tensorwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'quantize_svdquant_w4a4', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4', 'scaled_mm_svdquant_w4a4', 'stochastic_rounding_fp8']}
[INFO] Found comfy_kitchen backend cuda: {'available': False, 'disabled': True, 'unavailable_reason': 'CUDA not available on this system', 'capabilities': []}
[INFO] Checkpoint files will always be loaded safely.
[INFO] Using deterministic algorithms for pytorch
[INFO] Total VRAM 12216 MB, total RAM 40046 MB
[INFO] pytorch version: 2.14.0.dev20260616+xpu
[INFO] Set vram state to: NORMAL_VRAM
[INFO] Device: xpu:0 Intel(R) Arc(TM) B580 Graphics
[INFO] Using pytorch attention
[INFO] Python version: 3.14.6 (main, Jun 23 2026, 18:14:05) [GCC 16.1.1 20260430]
[INFO] ComfyUI version: 0.26.0
[INFO] comfy-aimdo version: 0.4.10
[INFO] comfy-kitchen version: 0.2.14
[INFO] comfyui-frontend-package version: 1.45.19
[INFO] comfyui-workflow-templates version: 0.10.7
[INFO] comfyui-embedded-docs version: 0.5.6
[INFO] comfy-kitchen version: 0.2.14
[INFO] comfy-aimdo version: 0.4.10
[INFO] [Prompt Server] web root: /home/okolenmi/comfy/venv/lib/python3.14/site-packages/comfyui_frontend_package/static
[INFO] Asset seeder disabled
[INFO] [START] ComfyUI-Manager
[ComfyUI-Manager] Using GitPython backend
[INFO] [ComfyUI-Manager] network_mode: public
[WARNING] [ComfyUI-Manager] The matrix sharing feature has been disabled because the `matrix-nio` dependency is not installed.
To use this feature, please run the following command:
/home/okolenmi/comfy/venv/bin/python -m pip install matrix-nio
[INFO] No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
[INFO] Skipping loading of custom nodes
[INFO] Context impl SQLiteImpl.
[INFO] Will assume non-transactional DDL.
[INFO] Using RAM pressure cache.
[INFO] Starting server
[INFO] To see the GUI go to: http://127.0.0.1:8188
[INFO] [ComfyUI-Manager] The ComfyRegistry cache update is still in progress, so an outdated cache is being used.
FETCH DATA from: /home/okolenmi/comfy/venv/lib/python3.14/site-packages/comfyui_manager/custom-node-list.json [DONE]
[INFO] got prompt
[INFO] model weight dtype torch.float16, manual cast: None
[INFO] model_type EPS
[INFO] Using pytorch attention in VAE
[INFO] Using pytorch attention in VAE
[INFO] VAE load device: xpu:0, offload device: cpu, dtype: torch.bfloat16
[INFO] Requested to load SDXLClipModel
[INFO] loaded completely; 1560.80 MB loaded, full load: True
[INFO] CLIP/text encoder model load device: xpu:0, offload device: cpu, current: xpu:0, dtype: torch.float16
[INFO] Requested to load SDXL
[INFO] loaded completely; 9235.98 MB usable, 4897.05 MB loaded, full load: True
63%|█████████████████████████████████████████████████████████████████████ | 19/30 [00:30<00:16, 1.52s/it][INFO] [ComfyUI-Manager] The ComfyRegistry cache update is still in progress, so an outdated cache is being used.
67%|████████████████████████████████████████████████████████████████████████▋ | 20/30 [00:31<00:14, 1.40s/it]FETCH DATA from: /home/okolenmi/comfy/venv/lib/python3.14/site-packages/comfyui_manager/custom-node-list.json [DONE]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:47<00:00, 1.59s/it]
[INFO] Requested to load AutoencoderKL
[INFO] loaded completely; 2273.19 MB usable, 159.56 MB loaded, full load: True
/home/okolenmi/comfy/ComfyUI/nodes.py:1659: RuntimeWarning: invalid value encountered in cast
img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
[INFO] Prompt executed in 57.64 seconds
[INFO] FETCH ComfyRegistry Data [DONE]
[INFO] [ComfyUI-Manager] default cache updated: https://api.comfy.org/nodes
FETCH DATA from: /home/okolenmi/comfy/ComfyUI/user/__manager/cache/1514988643_custom-node-list.json [DONE]
[INFO] [ComfyUI-Manager] All startup tasks have been completed.
[INFO] got prompt
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:35<00:00, 1.18s/it]
[INFO] Prompt executed in 36.81 seconds
[INFO] got prompt
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:50<00:00, 1.69s/it]
[INFO] Prompt executed in 52.98 seconds
[INFO] got prompt
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:41<00:00, 1.39s/it]
[INFO] Prompt executed in 43.26 seconds
```
### Other
As you can see it's different from other similar cases.
- No sage attention enabled (it's just impossible without CUDA) on my Intel Arc B580
- torch library for this GPU is different.
Contributor guide
Research direction
Reproduce the default SDXL workflow with KSampler Advanced on the reported Intel Arc B580 setup, using 30 steps and repeated runs. Start at nodes.py:1659 and investigate the invalid-value cast warning alongside the XPU/PyTorch versions in the logs. Done means the source of the intermittent black images is identified and repeated generations no longer produce them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100