Files
ComfyUI_frontend/src/scripts
Luke Mino-Altherr 14d0ec73f6 [feat] Add async model upload with WebSocket progress tracking (#7746)
## Summary
- Adds asynchronous model upload support with HTTP 202 responses
- Implements WebSocket-based real-time download progress tracking via
`asset_download` events
- Creates `assetDownloadStore` for centralized download state management
and toast notifications
- Updates upload wizard UI to show "processing" state when downloads
continue in background

## Changes
- **Core**: New `assetDownloadStore` for managing async downloads with
WebSocket events
- **API**: Support for HTTP 202 async upload responses with task
tracking
- **UI**: Upload wizard now shows "processing" state and allows closing
dialog during download
- **Progress**: Periodic toast notifications (every 5s) during active
downloads with completion/error toasts
- **Schema**: Updated task statuses (`created`, `running`, `completed`,
`failed`) and WebSocket message types

## Review Focus
- WebSocket event handling and download state management in
`assetDownloadStore`
- Upload flow UX - users can now close the dialog and download continues
in background
- Toast notification frequency and timing
- Schema alignment with backend async upload API

Fixes #7748

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7746-feat-Add-async-model-upload-with-WebSocket-progress-tracking-2d36d73d3650811cb79ae06f470dcded)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: GitHub Action <action@github.com>
2026-01-06 11:43:11 -08:00
..
2025-12-10 11:08:47 -08:00

Scripts Directory Documentation

This directory contains TypeScript code inherited from the legacy ComfyUI JavaScript frontend project. The code has been migrated from JavaScript to TypeScript while maintaining compatibility with the original functionality.

When implementing new features, prefer using the new Vue3 system over the legacy scripts.

Key Components

ComfyApi (api.ts)

Main API client class that handles communication with the ComfyUI backend. Provides methods for:

  • Queue management
  • Model operations
  • Extension handling
  • WebSocket communication
  • User data management

ComfyApp (app.ts)

Core application class that manages:

  • Graph manipulation
  • Node management
  • Canvas interactions
  • Extension system
  • Workflow state

UI Components (ui/)

Collection of reusable UI components including:

  • Buttons and button groups
  • Popups and dialogs
  • Draggable lists
  • Image previews
  • Menu system
  • Settings dialog

Integration with Vite

All TypeScript exports are shimmed through Vite configuration to maintain compatibility with the legacy JavaScript codebase. The shimming logic can be found in vite.config.mts.

Legacy Compatibility

This codebase maintains compatibility with the original ComfyUI Legacy Frontend while providing TypeScript type safety and modern development features.

For users wanting to fall back to the legacy frontend, use the command line argument:

--front-end-version Comfy-Org/ComfyUI_legacy_frontend@latest