Comfy-Org / Comfy-Org/ComfyUI

CLIPTextEncode "round" "_vml_cpu" not implemented for 'Long'

Open
#5,444 1 comment 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

### Expected Behavior

# ComfyUI Error Report
## Error Details
- **Node Type:** CLIPTextEncode
- **Exception Type:** RuntimeError
- **Exception Message:** "round" "_vml_cpu" not implemented for 'Long'
## Stack Trace
```
File "/home/jk/ComfyUI/execution.py", line 323, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

File "/home/jk/ComfyUI/execution.py", line 198, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

File "/home/jk/ComfyUI/execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)

File "/home/jk/ComfyUI/execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))

File "/home/jk/ComfyUI/nodes.py", line 65, in encode
output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True)

File "/home/jk/ComfyUI/comfy/sd.py", line 127, in encode_from_tokens
o = self.cond_stage_model.encode_token_weights(tokens)

File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 598, in encode_token_weights
out = getattr(self, self.clip).encode_token_weights(token_weight_pairs)

File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 41, in encode_token_weights
o = self.encode(to_encode)

File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 238, in encode
return self(tokens)

File "/home/jk/miniconda3/envs/cfu/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)

File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 210, in forward
outputs = self.transformer(tokens, attention_mask_model, intermediate_output=self.layer_idx, final_layer_norm_intermediate=self.layer_norm_hidden_state, dtype=torch.float32)

File "/home/jk/miniconda3/envs/cfu/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)

File "/home/jk/ComfyUI/comfy/clip_model.py", line 136, in forward
x = self.text_model(*args, **kwargs)

File "/home/jk/miniconda3/envs/cfu/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)

File "/home/jk/ComfyUI/comfy/clip_model.py", line 117, in forward
pooled_output = x[torch.arange(x.shape[0], device=x.device), (torch.round(input_tokens).to(dtype=torch.int, device=x.device) == self.eos_token_id).int().argmax(dim=-1),]

```
## System Information
- **ComfyUI Version:** v0.2.6-3-gf2aaa0a
- **Arguments:** main.py
- **OS:** posix
- **Python Version:** 3.10.0 (default, Mar 3 2022, 09:58:08) [GCC 7.5.0]
- **Embedded Python:** false
- **PyTorch Version:** 1.12.1+cu113
## Devices

- **Name:** cuda:0 Tesla P100-PCIE-16GB :
- **Type:** cuda
- **VRAM Total:** 17071734784
- **VRAM Free:** 16786718720
- **Torch VRAM Total:** 0
- **Torch VRAM Free:** 0

## Logs
```
2024-10-31 09:57:08,312 - root - INFO - Total VRAM 16281 MB, total RAM 56256 MB
2024-10-31 09:57:08,312 - root - INFO - pytorch version: 1.12.1+cu113
2024-10-31 09:57:08,312 - root - INFO - Set vram state to: NORMAL_VRAM
2024-10-31 09:57:08,313 - root - INFO - Device: cuda:0 Tesla P100-PCIE-16GB :
2024-10-31 09:57:08,539 - root - INFO - Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
2024-10-31 09:57:09,537 - root - INFO - [Prompt Server] web root: /home/jk/ComfyUI/web
2024-10-31 09:57:09,772 - root - INFO -
Import times for custom nodes:
2024-10-31 09:57:09,772 - root - INFO - 0.0 seconds: /home/jk/ComfyUI/custom_nodes/websocket_image_save.py
2024-10-31 09:57:09,772 - root - INFO -
2024-10-31 09:57:09,778 - root - INFO - Starting server

### Actual Behavior

2024-10-31 09:57:46,120 - root - ERROR - !!! Exception during processing !!! "round" "_vml_cpu" not implemented for 'Long'
2024-10-31 09:57:46,121 - root - ERROR - Traceback (most recent call last):
File "/home/jk/ComfyUI/execution.py", line 323, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
File "/home/jk/ComfyUI/execution.py", line 198, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
File "/home/jk/ComfyUI/execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "/home/jk/ComfyUI/execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
File "/home/jk/ComfyUI/nodes.py", line 65, in encode
output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True)
File "/home/jk/ComfyUI/comfy/sd.py", line 127, in encode_from_tokens
o = self.cond_stage_model.encode_token_weights(tokens)
File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 598, in encode_token_weights
out = getattr(self, self.clip).encode_token_weights(token_weight_pairs)
File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 41, in encode_token_weights
o = self.encode(to_encode)
File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 238, in encode
return self(tokens)
File "/home/jk/miniconda3/envs/cfu/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 210, in forward
outputs = self.transformer(tokens, attention_mask_model, intermediate_output=self.layer_idx, final_layer_norm_intermediate=self.layer_norm_hidden_state, dtype=torch.float32)
File "/home/jk/miniconda3/envs/cfu/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jk/ComfyUI/comfy/clip_model.py", line 136, in forward
x = self.text_model(*args, **kwargs)
File "/home/jk/miniconda3/envs/cfu/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jk/ComfyUI/comfy/clip_model.py", line 117, in forward
pooled_output = x[torch.arange(x.shape[0], device=x.device), (torch.round(input_tokens).to(dtype=torch.int, device=x.device) == self.eos_token_id).int().argmax(dim=-1),]
RuntimeError: "round" "_vml_cpu" not implemented for 'Long'

### Steps to Reproduce

2024-10-31 09:57:46,121 - root - ERROR - Got an OOM, unloading all loaded models.
2024-10-31 09:57:46,122 - root - INFO - Prompt executed in 1.62 seconds
2024-10-31 10:20:54,487 - root - INFO - got prompt
2024-10-31 10:20:54,644 - root - ERROR - !!! Exception during processing !!! "round" "_vml_cpu" not implemented for 'Long'
2024-10-31 10:20:54,645 - root - ERROR - Traceback (most recent call last):
File "/home/jk/ComfyUI/execution.py", line 323, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
File "/home/jk/ComfyUI/execution.py", line 198, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
File "/home/jk/ComfyUI/execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "/home/jk/ComfyUI/execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
File "/home/jk/ComfyUI/nodes.py", line 65, in encode
output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True)
File "/home/jk/ComfyUI/comfy/sd.py", line 127, in encode_from_tokens
o = self.cond_stage_model.encode_token_weights(tokens)
File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 598, in encode_token_weights
out = getattr(self, self.clip).encode_token_weights(token_weight_pairs)
File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 41, in encode_token_weights
o = self.encode(to_encode)
File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 238, in encode
return self(tokens)
File "/home/jk/miniconda3/envs/cfu/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jk/ComfyUI/comfy/sd1_clip.py", line 210, in forward
outputs = self.transformer(tokens, attention_mask_model, intermediate_output=self.layer_idx, final_layer_norm_intermediate=self.layer_norm_hidden_state, dtype=torch.float32)
File "/home/jk/miniconda3/envs/cfu/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jk/ComfyUI/comfy/clip_model.py", line 136, in forward
x = self.text_model(*args, **kwargs)
File "/home/jk/miniconda3/envs/cfu/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/jk/ComfyUI/comfy/clip_model.py", line 117, in forward
pooled_output = x[torch.arange(x.shape[0], device=x.device), (torch.round(input_tokens).to(dtype=torch.int, device=x.device) == self.eos_token_id).int().argmax(dim=-1),]
RuntimeError: "round" "_vml_cpu" not implemented for 'Long'

### Debug Logs

```powershell
2024-10-31 10:20:54,646 - root - ERROR - Got an OOM, unloading all loaded models.
2024-10-31 10:20:54,648 - root - INFO - Prompt executed in 0.16 seconds

## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.
```
{"last_node_id":9,"last_link_id":9,"nodes":[{"id":7,"type":"CLIPTextEncode","pos":{"0":413,"1":389},"size":{"0":425.27801513671875,"1":180.6060791015625},"flags":{},"order":3,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["text, watermark"]},{"id":6,"type":"CLIPTextEncode","pos":{"0":415,"1":186},"size":{"0":422.84503173828125,"1":164.31304931640625},"flags":{},"order":2,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"]},{"id":5,"type":"EmptyLatentImage","pos":{"0":473,"1":609},"size":{"0":315,"1":106},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"properties":{"Node name for S&R":"EmptyLatentImage"},"widgets_values":[512,512,1]},{"id":3,"type":"KSampler","pos":{"0":863,"1":186},"size":{"0":315,"1":262},"flags":{},"order":4,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[250084882913724,"randomize",20,8,"euler","normal",1]},{"id":8,"type":"VAEDecode","pos":{"0":1209,"1":188},"size":{"0":210,"1":46},"flags":{},"order":5,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":9,"type":"SaveImage","pos":{"0":1451,"1":189},"size":{"0":210,"1":58},"flags":{},"order":6,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"properties":{},"widgets_values":["ComfyUI"]},{"id":4,"type":"CheckpointLoaderSimple","pos":{"0":26,"1":474},"size":{"0":315,"1":98},"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[8],"slot_index":2}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["cardosAnime_v20.safetensors"]}],"links":[[1,4,0,3,0,"MODEL"],[2,5,0,3,3,"LATENT"],[3,4,1,6,0,"CLIP"],[4,6,0,3,1,"CONDITIONING"],[5,4,1,7,0,"CLIP"],[6,7,0,3,2,"CONDITIONING"],[7,3,0,8,0,"LATENT"],[8,4,2,8,1,"VAE"],[9,8,0,9,0,"IMAGE"]],"groups":[],"config":{},"extra":{"ds":{"scale":1,"offset":[126,77]}},"version":0.4}
```
```

### Other

## Additional Context
(Please add any additional context or steps to reproduce the error here)

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.