TextEncodeAceStepAudio1.5 - RuntimeError: probability tensor contains either `inf`, `nan` or element < 0
- 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
I tried the official audio_ace_step_1_5_checkpoint.json and audio_ace_step_1_5_split.json workflows, but the text encoding node fails with the error below. However, it does work when I set device "cpu" in the CLIP loader node, it just takes 5+ minutes.
I tried adding some random things to sample_manual_loop_no_classes in ace15.py to maybe work around it, but to no avail.
temperature=0 prevents the error, but the resulting audio is just a single vocal note for 2 minutes.
```
temperature = 0
model = model.float()
execution_dtype = torch.float32
[...]
cfg_logits = cond_logits
```
### Actual Behavior
-
### Steps to Reproduce
audio_ace_step_1_5_checkpoint.json
audio_ace_step_1_5_split.json
### Debug Logs
```powershell
$ python3 main.py --disable-api-nodes
Checkpoint files will always be loaded safely.
WARNING: You need pytorch with cu130 or higher to use optimized CUDA operations.
Found comfy_kitchen backend cuda: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}
Total VRAM 24208 MB, total RAM 31229 MB
pytorch version: 2.4.0+cu121
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4090 : cudaMallocAsync
Using async weight offloading with 2 streams
Enabled pinned memory 29667.0
Using pytorch attention
Python version: 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0]
ComfyUI version: 0.12.2
ComfyUI frontend version: 1.37.11
[Prompt Server] web root: /home/worker/miniconda3/envs/comfyui/lib/python3.12/site-packages/comfyui_frontend_package/static
/home/worker/miniconda3/envs/comfyui/lib/python3.12/site-packages/kornia/feature/lightglue.py:44: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
@torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)
Context impl SQLiteImpl.
Will assume non-transactional DDL.
Assets scan(roots=['models']) completed in 0.020s (created=0, skipped_existing=310, orphans_pruned=0, total_seen=310)
Starting server
To see the GUI go to: http://127.0.0.1:8188
got prompt
model weight dtype torch.bfloat16, manual cast: None
model_type FLOW
VAE load device: cuda:0, offload device: cpu, dtype: torch.float16
Requested to load ACE15TEModel_
loaded completely; 4673.04 MB loaded, full load: True
CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cuda:0, dtype: torch.float16
!!! Exception during processing !!! probability tensor contains either `inf`, `nan` or element < 0
Traceback (most recent call last):
File "/media/worker/disk4/ML/ComfyUI/execution.py", line 527, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/execution.py", line 331, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/execution.py", line 305, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "/media/worker/disk4/ML/ComfyUI/execution.py", line 293, in process_inputs
result = f(**inputs)
^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/comfy_api/internal/__init__.py", line 149, in wrapped_func
return method(locked_class, **inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/comfy_api/latest/_io.py", line 1710, in EXECUTE_NORMALIZED
to_return = cls.execute(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/comfy_extras/nodes_ace.py", line 54, in execute
conditioning = clip.encode_from_tokens_scheduled(tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/comfy/sd.py", line 311, in encode_from_tokens_scheduled
pooled_dict = self.encode_from_tokens(tokens, return_pooled=return_pooled, return_dict=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/comfy/sd.py", line 375, in encode_from_tokens
o = self.cond_stage_model.encode_token_weights(tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/comfy/text_encoders/ace15.py", line 207, in encode_token_weights
audio_codes = generate_audio_codes(getattr(self, self.lm_model, self.qwen3_06b), token_weight_pairs["lm_prompt"], token_weight_pairs["lm_prompt_negative"], min_tokens=lm_metadata["min_tokens"], max_tokens=lm_metadata["min_tokens"], seed=lm_metadata["seed"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/comfy/text_encoders/ace15.py", line 123, in generate_audio_codes
return sample_manual_loop_no_classes(model, [positive, negative], paddings, cfg_scale=cfg_scale, seed=seed, min_tokens=min_tokens, max_new_tokens=max_tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/worker/disk4/ML/ComfyUI/comfy/text_encoders/ace15.py", line 85, in sample_manual_loop_no_classes
next_token = torch.multinomial(torch.softmax(cfg_logits, dim=-1), num_samples=1, generator=generator).squeeze(1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: probability tensor contains either `inf`, `nan` or element < 0
Prompt executed in 2.23 seconds
```
### Other
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.