Reloading Modified Images Often Fails
- 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
In the Load Image and Load Image (as Mask) nodes, I press "choose file to upload", select a file from the dialog, and it uploads the selected file _every single time,_ even if I have uploaded a file with the same name before. (Nothing wrong with automatically appending (x), where 'x' is an incrementing value, to avoid overwriting an existing file with the same name, so long as the upload works and the new image is selected in the node.)
### Actual Behavior
I run the model and discover that I need to make some small changes to my input image or to a mask image I'm using. So I modify the image, save it with the same name, then I click "choose file to upload" and select my modified image.
At this point, one of two things happens. Around 20% of the time, the new file is uploaded, and a (x) numerical counter is added to the filename to avoid overwriting previous files (that I no longer care about). Around 80% of the time, it silently fails to upload the file at all, retaining the original file uploaded and not uploading the changes I've made. If the changes are especially small, it may not even be noticeable that it failed until running the model continues to produce the same undesirable results as before. Once it has failed in a particular node, it will fail every time after for that node and filename, until a restart or until you upload a file with a different name in that node (at which point it seems to reset to ~80% odds of failure each attempt).
### Steps to Reproduce
1. Create a 'Load Image' or 'Load Image (as Mask)' node.
2. Click 'choose file to upload', select a file, and upload it.
3. Make some (ideally visible) changes to the file you just uploaded.
4. In the same node, repeat starting from step 2, using the same (modified) file with the same filename.
Once a file with the same name as the one you are trying to upload has been uploaded, it silently fails around 80% of the time, and after that fails every time for that file until a server restart or a new file has been uploaded. (Refreshing the browser page may also work, but I've found that refreshing sometimes closes other workflow tabs, and I currently have several open that I don't want to have to try to find and re-open.)
### Debug Logs
```powershell
Launching ComfyUI from: /home/rybec/comfy/ComfyUI
comfy-aimdo failed to load: libcuda.so.1: cannot open shared object file: No such file or directory
NOTE: comfy-aimdo is currently only support for Nvidia GPUs
[ComfyUI-Manager] Using uv as Python module for pip operations.
Using Python 3.13.5 environment at: /home/rybec/comfy-env
[START] Security scan
[DONE] Security scan
** ComfyUI startup time: 2026-04-10 15:05:17.919
** Platform: Linux
** Python version: 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0]
** Python executable: /home/rybec/comfy-env/bin/python
** ComfyUI Path: /home/rybec/comfy/ComfyUI
** ComfyUI Base Folder Path: /home/rybec/comfy/ComfyUI
** User directory: /home/rybec/comfy/ComfyUI/user
** ComfyUI-Manager config path: /home/rybec/comfy/ComfyUI/user/__manager/config.ini
** Log path: /home/rybec/comfy/ComfyUI/user/comfyui.log
Using Python 3.13.5 environment at: /home/rybec/comfy-env
Using Python 3.13.5 environment at: /home/rybec/comfy-env
[PRE] ComfyUI-Manager
Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}
Found comfy_kitchen backend cuda: {'available': False, 'disabled': True, 'unavailable_reason': 'CUDA not available on this system', 'capabilities': []}
Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4']}
Checkpoint files will always be loaded safely.
[W410 15:05:19.111294757 OperatorEntry.cpp:218] Warning: Warning only once for all operators, other operators may also be overridden.
Overriding a previously registered kernel for the same operator and the same dispatch key
operator: aten::geometric_(Tensor(a!) self, float p, *, Generator? generator=None) -> Tensor(a!)
registered at /pytorch/build/aten/src/ATen/RegisterSchema.cpp:6
dispatch key: XPU
previous kernel: registered at /pytorch/aten/src/ATen/VmapModeRegistrations.cpp:37
new kernel: registered at /build/intel-pytorch-extension/build/Release/csrc/gpu/csrc/gpu/xpu/ATen/RegisterXPU_0.cpp:172 (function operator())
Total VRAM 14432 MB, total RAM 31664 MB
pytorch version: 2.8.0+xpu
Set vram state to: NORMAL_VRAM
Device: xpu:0 Intel(R) Arc(TM) Graphics
Using pytorch attention
Python version: 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0]
ComfyUI version: 0.18.1
comfy-aimdo version: 0.2.12
comfy-kitchen version: 0.2.8
ComfyUI frontend version: 1.42.8
[Prompt Server] web root: /home/rybec/comfy-env/lib/python3.13/site-packages/comfyui_frontend_package/static
Asset seeder disabled
[START] ComfyUI-Manager
[ComfyUI-Manager] network_mode: public
Import times for custom nodes:
0.0 seconds: /home/rybec/comfy/ComfyUI/custom_nodes/websocket_image_save.py
Context impl SQLiteImpl.
Will assume non-transactional DDL.
Starting server
To see the GUI go to: http://0.0.0.0:8188
```
### Other
I have never installed or used a custom node with Comfy, and this is my own local instance that no one else uses. (I _am_ using this instance from a different system on the same local network as the URL might suggest.)
---
This applies to any filename that has already been uploaded, not just the most recent one uploaded or currently selected in that node. Even if some other file is currently selected, if I try to upload a file with the same name as _any_ file currently in the list, it fails silently most of the time. So say another file is currently selected, if I attempt to upload some file with the same name as another file that has been uploaded in the past, it will fail to upload _and_ the currently selected file will remain selected, rather than the file changing to the existing file with the same name as the one I just attempted to upload. (In fact, this can be used to tell if the upload failed. You just select some file that looks dramatically different, attempt to upload the modified file, and if the image doesn't change, the upload failed.)
---
There's a third thing I've observed to happen, but it may be exclusively with an older version of the software. (I'm running an older version on one computer and the most recent on another. The logs and all of the above apply to the newer version. The older version does silently fail ~80% of the time though.) The older version is:
```
ComfyUI version: 0.3.34
ComfyUI frontend version: 1.18.10
[Prompt Server] web root: D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\comfyui_frontend_package\static
### Loading: ComfyUI-Manager (V3.32.3)
[ComfyUI-Manager] network_mode: public
### ComfyUI Revision: 150 [158419f3] *DETACHED | Released on '2025-05-12'
```
(Let me know if you want the entire startup log for this version. I suspect it won't matter though, given how old it is.)
The third behavior is that the upload is successful, and the original file of the same name is overwritten. I can't recall whether or not I've had this happen in the most recent version or only on the older version. (If I _do_ see it happen on the most recent version, I'll drop a comment.)
Contributor guide
Assessment
This issue has not been assessed yet.