Comfy-Org/ComfyUI · warning · ProcessingInterrupted
Upload cancelled
Error message
Upload cancelled
What it means
Raised as ProcessingInterrupted when an in-flight file upload (aiohttp PUT to a presigned upload_url) is abandoned because the interrupt monitor task finished first. upload_helpers.py races the PUT request against a monitor task via asyncio.wait(FIRST_COMPLETED); when the monitor wins while the request is still pending, the request task is cancelled and this error surfaces. It is ComfyUI's standard signal that the user or runtime cancelled processing mid-upload, not a network failure.
Source
Thrown at comfy_api_nodes/util/upload_helpers.py:303
try:
request_logger.log_request_response(
operation_id=operation_id,
request_method="PUT",
request_url=upload_url,
request_headers=headers or None,
request_params=None,
request_data=f"[File data {len(data)} bytes]",
)
sess = aiohttp.ClientSession(timeout=timeout)
req = sess.put(upload_url, data=data, headers=headers, skip_auto_headers=skip_auto_headers)
req_task = asyncio.create_task(req)
done, pending = await asyncio.wait({req_task, monitor_task}, return_when=asyncio.FIRST_COMPLETED)
if monitor_task in done and req_task in pending:
req_task.cancel()
raise ProcessingInterrupted("Upload cancelled")
try:
resp = await req_task
except asyncio.CancelledError:
raise ProcessingInterrupted("Upload cancelled") from None
async with resp:
if resp.status >= 400:
with contextlib.suppress(Exception):
try:
body = await resp.json()
except Exception:
body = await resp.text()
msg = f"Upload failed with status {resp.status}"
request_logger.log_request_response(
operation_id=operation_id,
request_method="PUT",
request_url=upload_url,View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Treat this as an expected cancellation, not a bug: catch ProcessingInterrupted in the node/caller and stop the work cleanly without retrying.
- If uploads are cancelled unexpectedly, check whether your own code or an integration is calling processing_interrupted() or cancelling the queue item.
- If it fires spuriously during slow uploads of large files, reduce the payload size (e.g., lower total_pixels for images) or improve upstream bandwidth before retrying the workflow.
Example fix
// before
url = await upload_image_to_comfyapi(cls, image)
// after
from comfy_api_nodes.util.common_exceptions import ProcessingInterrupted
try:
url = await upload_image_to_comfyapi(cls, image)
except ProcessingInterrupted:
logging.info("Upload cancelled by user")
raise Defensive patterns
Strategy: try-catch
Try / catch
from comfy_api_nodes.util.common_exceptions import ProcessingInterrupted
try:
urls = await upload_images_to_comfyapi(cls, images)
except ProcessingInterrupted:
# user/runtime cancel: stop cleanly, do not retry
raise Prevention
- Let cancellation propagate; never wrap uploads in a blanket retry loop
- Keep uploads short (smaller payloads) to narrow the cancel window
When it happens
Trigger: Calling upload_file_to_api_file_upload_url (or wrappers like upload_images_to_comfyapi / upload_image_to_comfyapi) and triggering processing_interrupted() (e.g., pressing Cancel in the ComfyUI queue) while the PUT is still streaming; the monitor task completes, req_task is pending, req_task.cancel() runs, and ProcessingInterrupted('Upload cancelled') is raised at upload_helpers.py:303.
Common situations: User hits Cancel on a long image/video upload to a ComfyUI API node; a workflow is interrupted from the UI or API while an api_nodes upload is in progress; a timeout monitor fires during a slow upload of a large video file.
Related errors
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/3f04db13f8b61f0b.
Report an issue: GitHub.