Comfy-Org / Comfy-Org/ComfyUI

cannot save latent from LTXV crop guides

Open
#7,190 2 comments 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

save latent from LTXV crop guides using save latent node

### Actual Behavior

will get the following error:
You are trying to save a non contiguous tensor: `latent_tensor` which is not allowed. It either means you are trying to save tensors which are reference of each other in which case it's recommended to save only the full tensors, and reslice at load time, or simply call `.contiguous()` on your tensor to pack it before saving.

### Steps to Reproduce

just run a LTXV workflow with image guide and a LTXV crop guides node at the very end, and try saving the latent output from LTXV crop guides node.

### Debug Logs

```powershell
!!! Exception during processing !!! You are trying to save a non contiguous tensor: `latent_tensor` which is not allowed. It either means you are trying to save tensors which are reference of each other in which case it's recommended to save only the full tensors, and reslice at load time, or simply call `.contiguous()` on your tensor to pack it before saving.
Traceback (most recent call last):
File "/Users/john2stai/Desktop/sd/comfyui/execution.py", line 327, 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 "/Users/john2stai/Desktop/sd/comfyui/custom_nodes/Comfy-WaveSpeed/first_block_cache.py", line 101, in new_get_output_data
out = get_output_data(*args, **kwargs)
File "/Users/john2stai/Desktop/sd/comfyui/execution.py", line 202, 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 "/Users/john2stai/Desktop/sd/comfyui/execution.py", line 174, in _map_node_over_list
process_inputs(input_dict, i)
File "/Users/john2stai/Desktop/sd/comfyui/execution.py", line 163, in process_inputs
results.append(getattr(obj, func)(**inputs))
File "/Users/john2stai/Desktop/sd/comfyui/nodes.py", line 495, in save
comfy.utils.save_torch_file(output, file, metadata=metadata)
File "/Users/john2stai/Desktop/sd/comfyui/comfy/utils.py", line 90, in save_torch_file
safetensors.torch.save_file(sd, ckpt, metadata=metadata)
File "/Users/john2stai/Desktop/sd/comfyui/.venv/lib/python3.10/site-packages/safetensors/torch.py", line 286, in save_file
serialize_file(_flatten(tensors), filename, metadata=metadata)
File "/Users/john2stai/Desktop/sd/comfyui/.venv/lib/python3.10/site-packages/safetensors/torch.py", line 496, in _flatten
return {
File "/Users/john2stai/Desktop/sd/comfyui/.venv/lib/python3.10/site-packages/safetensors/torch.py", line 500, in
"data": _tobytes(v, k),
File "/Users/john2stai/Desktop/sd/comfyui/.venv/lib/python3.10/site-packages/safetensors/torch.py", line 414, in _tobytes
raise ValueError(
ValueError: You are trying to save a non contiguous tensor: `latent_tensor` which is not allowed. It either means you are trying to save tensors which are reference of each other in which case it's recommended to save only the full tensors, and reslice at load time, or simply call `.contiguous()` on your tensor to pack it before saving.
```

### Other

_No response_

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.