Wan 2.2 official Image-to-Video workflow generates 100% NaN latent tensors on RTX 5070 Ti (official models, clean install, reproducible)
- 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
The official Wan 2.2 Image-to-Video workflow should generate a normal video from the input image.
The workflow should complete successfully, generate a valid latent representation, decode it correctly through the official VAE and produce a visible MP4 output.
### Actual Behavior
The workflow completes successfully without any Python exception, CUDA error, Out Of Memory condition or warning.
However, the generated MP4 is completely black.
To isolate the issue, I connected a Save Image node directly to the output of the VAE Decode node.
The generated PNG is also completely black, demonstrating that the problem occurs before video encoding.
I then connected a Save Latent node directly after the final KSampler.
A latent file is successfully generated (approximately 5 MB), indicating that the sampling process completes and produces output.
A preliminary inspection suggests that the generated latent tensor may contain invalid numerical values (possibly NaN). This observation has not yet been independently verified using an external tensor inspection tool and should therefore be considered a working hypothesis.
The generated latent file is attached as a ZIP archive for further investigation.
### Steps to Reproduce
Environment
- Windows 11
- NVIDIA GeForce RTX 5070 Ti (16 GB)
- NVIDIA Driver 610.62
- ComfyUI 0.27.0
- Frontend 1.45.20
- Python 3.12.12
- PyTorch 2.13.0+cu130
Models
Official Wan 2.2 models only.
Workflow
Official "Image to Video (Wan 2.2)" blueprint included with ComfyUI.
Steps
1. Install a clean ComfyUI 0.27.0.
2. Download the official Wan 2.2 models.
3. Open the official Image-to-Video (Wan 2.2) workflow.
4. Load any input image.
5. Execute the workflow.
Result
The workflow completes successfully.
[log_comfyui.txt](https://github.com/user-attachments/files/29932537/log_comfyui.txt)
The generated MP4 is completely black.
Additional investigation
- Save Image connected after VAE Decode → generated PNG is completely black.
- Save Latent connected after the final KSampler → latent successfully generated (~5 MB).
- Same behaviour reproduced on two independent ComfyUI installations.
- Official workflow only.
- Official models only.
- SHA256 hashes verified.
- Different UNET weight_dtype settings tested with identical results.
[img2vid_comfyui_test.json](https://github.com/user-attachments/files/29932505/img2vid_comfyui_test.json)
[img2vid_comfyui.json](https://github.com/user-attachments/files/29932457/img2vid_comfyui.json)
[ComfyUI_00002_.latent.zip](https://github.com/user-attachments/files/29932469/ComfyUI_00002_.latent.zip)
https://github.com/user-attachments/assets/d4c71b53-053a-40f2-b2cb-8c6f079ba830
### Debug Logs
```powershell
Complete console log attached.
Relevant excerpt:
Requested to load WanTEModel
Requested to load WanVAE
Requested to load WAN21
model_type FLOW
Prompt executed successfully
No Python exception.
No CUDA exception.
No Out Of Memory.
```
### Other
Additional investigation
The issue has been reproduced on two independent ComfyUI installations using only the official Wan 2.2 workflow and official models.
The following have already been verified:
- Official workflow
- Official models
- Official VAE
- Official Text Encoder
- Official LoRA
- SHA256 hashes verified
- Models correctly detected and loaded by ComfyUI
- Different UNET weight_dtype configurations tested
- Latest NVIDIA driver
- No CUDA, Python or Out Of Memory errors
To isolate the issue, the workflow was instrumented with two debug nodes:
- Save Image immediately after VAE Decode
- Save Latent immediately after the final KSampler
The PNG generated directly from VAE Decode is already completely black, indicating that the problem occurs before video encoding.
The generated latent has been attached (ZIP archive) to help determine whether the tensor contains invalid numerical values or another form of corruption.
If requested, I can also provide the modified workflow containing the debug nodes.
The issue was also reproduced after launching ComfyUI with `--disable-all-custom-nodes`. The official Wan 2.2 workflow still generates a completely black PNG directly from VAE Decode and a completely black MP4.
Contributor guide
Research direction
Start with the attached img2vid_comfyui_test.json and img2vid_comfyui.json workflows, then reproduce with --disable-all-custom-nodes using the environment and model versions listed in the issue. Inspect the latent saved after the final KSampler and the image produced by VAE Decode, using log_comfyui.txt and the attached latent archive as evidence. Done means the official Wan 2.2 workflow produces valid decoded frames and a visible MP4 without numerical corruption.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- backend, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100