I2V Generation Fails on AMD ROCm: 'Boolean value of Tensor' Error (v1.4.7 + HEAD)
Image-to-video generation consistently fails on AMD Radeon RX 7800 XT (ROCm 7.1) + Windows 11, with a tensor-related error preventing any I2V output. The exact error signature has shifted across test runs, suggesting either multiple related issues or the same underlying bug surfacing differently.
Timeline of Observed Symptoms
During investigation, the error signature changed across test runs and commits:
- Initial failures: RuntimeError referencing shape mismatch
[999, 993, 985, ...]in unpatchify - Subsequent runs: RuntimeError
"shape '[999, 993, 985, 1, 2, 2, 16]' is invalid for input of size 399360" - After diagnostic logging: RuntimeError
"Boolean value of Tensor with more than one value is ambiguous"at line 3419 - Version 1.4.7 (stable release): Same
"Boolean value of Tensor"error, but different line context Important caveat: These may represent:
- Different manifestations of a single root issue
- Multiple independent bugs in the I2V code path
- Environmental/configuration issues specific to AMD ROCm
- Or some combination of the above We cannot confirm with certainty which, as diagnostic attempts were blocked by the tensor boolean error.
Test Environment
- GPU: AMD Radeon RX 7800 XT
- ROCm: 7.1
- PyTorch: 2.9.0+rocmsdk20251116
- WanVideoWrapper:
- Tested v1.4.7 (commit e091c4a, stable release) — FAILS
- Tested HEAD (commit 088128b) — FAILS
- ComfyUI: 0.19.1
- OS: Windows 11 Pro
Deterministic Reproduction Case
Image: 832×480 pixels (plasma_wave_002) Frames: 16 Precision: float16 VAE: Tiled (tiled_vae=true) Seed: 445566778 Steps: 20
Result: Consistently fails on first diffusion sampling pass with tensor boolean error.
Specific Questions for Maintainers
- Is AMD ROCm I2V tested and supported? Has I2V generation been validated to work on AMD Radeon + ROCm systems, or is this codebase primarily tested on NVIDIA/CUDA?
- Tensor/scalar type handling: The error "Boolean value of Tensor" suggests a variable that should be a Python scalar (int, float) is instead a PyTorch tensor. In I2V's forward pass, which variables are expected to be scalars that might receive tensors instead?
- Error shift across versions: Since v1.4.7 (stable) also fails with the same class of error, is there a known issue with I2V tensor handling that predates recent commits?
- Context of line 3419: In v1.4.7, the error occurs at
x = x[:, -self.original_seq_len:]. Isself.original_seq_lenexpected to always be a Python int, or could it legitimately be a tensor in some configurations?
Configurations Tested (All Failed)
- float16 precision
- float32 precision
- Quantized Q4 models
- Different T5 text encoder versions (fp8, fp16)
- Tiled VAE enabled / disabled
- Various latent tiling configurations
- Fresh model file downloads The consistency across these variations suggests the issue is not configuration/model-file related, but rather something in the I2V code path itself.
Workarounds Attempted
- Restarting ComfyUI with clean database
- Clearing Python cache
- Testing multiple model checkpoints
- Reverting to "stable" version 1.4.7 None resolved the error, all produced the same class of failure (tensor boolean evaluation error).
Note: We attempted diagnostic logging to pinpoint the exact cause, but the tensor boolean error itself prevented reaching deeper diagnostics. The issue manifests early enough in the forward pass that core I2V functionality cannot be evaluated.
Source: kijai/ComfyUI-WanVideoWrapper