Skip to content

Conversation

fragmede
Copy link

@fragmede fragmede commented Oct 5, 2025

Summary

This PR adds an intuitive download system to the missing models dialog, allowing users to download required models directly from the ComfyUI interface with real-time progress tracking and download speed display.

Problem Solved

When users load workflows with missing models, they currently see a dialog listing the missing files but must:

  1. Manually download files
  2. Move files to correct directories

This creates friction, especially for:

  • New users unfamiliar with model repositories
  • Complex workflows requiring multiple models
  • Users working across different machines

Solution

This PR enhances the missing models dialog with:

✨ User Experience Features

  • Download buttons for each missing model
  • "Download All" button for batch downloads
  • Real-time progress display with percentage
  • Download speed indicator (MB/s or KB/s)
  • File size tracking (X / Y GB downloaded)
  • Auto-close on completion when all models download successfully
  • Dynamic count updates showing remaining downloads

🎨 UI Implementation

  • Clean, integrated design matching ComfyUI's aesthetic
  • Non-intrusive progress indicators
  • Clear success/failure states
  • Retry capability for failed downloads

🔒 Security Features

  • Client-side validation of URLs and paths
  • Sanitization of model names and folders
  • Path traversal prevention
  • File extension validation

📁 Files Modified

  • src/extensions/core/missingModelsDownloader.ts - Core implementation

Related PR

Also see comfyanonymous/ComfyUI#10224

Features in Detail

Individual Download Buttons

Each missing model gets a download button that:

  • Shows download progress as percentage
  • Displays current download speed
  • Shows downloaded/total size
  • Changes to "✓ Done" when complete
  • Allows retry on failure

Download All Button

  • Shows count of remaining downloads
  • Updates dynamically as downloads complete
  • Changes to "All Downloads Complete!" when done
  • Auto-closes dialog after 2 seconds when all complete

Progress Display Format

1.2 / 4.5 GB @ 5.3 MB/s

Visual States

  • Ready: Green "Download" button
  • Downloading: Blue progress percentage
  • Complete: Green "✓ Done"
  • Failed: Red "Retry" button
  • Starting: Orange "Starting..."

Screenshots

image image

Before

  • Dialog shows missing models
  • Users must manually download files to correct location

After

  • Each model has a download button
  • Real-time progress tracking
  • Download All option for convenience

Integration

Works with the companion backend PR that provides:

  • /models/download API endpoints
  • Secure file handling
  • Progress tracking backend

Testing

Tested scenarios:

  • Single model download
  • Multiple concurrent downloads
  • Large files (>10GB)
  • Failed downloads and retry
  • Various model types (checkpoints, VAE, LoRA, etc.)
  • Mixed success/failure scenarios

Browser Compatibility

Tested on:

  • Chrome/Edge (latest)

Performance

  • Minimal memory footprint
  • Efficient DOM updates
  • No impact on workflow execution
  • Handles multiple concurrent downloads smoothly

Related PR

See companion backend PR: ComfyUI#XXX for API implementation

Future Enhancements

Potential improvements for future iterations:

  • Pause/resume functionality
  • Download queue reordering
  • Alternative download sources
  • Torrent/P2P support
  • Model integrity verification (hash checking)

Note: This PR requires the companion backend PR to be merged for full functionality. The UI gracefully handles cases where the backend is not available.

┆Issue is synchronized with this Notion page by Unito

fragmede and others added 5 commits September 27, 2025 02:53
Adds automatic download functionality to the Missing Models dialog.

Features:
- Automatically adds Download buttons to each missing model
- Pre-configured URLs for popular models (SDXL, SD1.5, VAEs, LoRAs, etc.)
- Real-time download progress shown in button (percentage)
- Custom URL prompt for unknown models
- Download All button for bulk downloads
- TypeScript implementation with proper typing

When the Missing Models dialog appears, users can now download missing
models directly without manually searching and moving files.

Requires backend API endpoints in ComfyUI server for download functionality.
- Automatically extract URLs from the dialog (no more prompting for URLs that are already shown)
- Replace alert/prompt boxes with inline UI elements for better UX
- Add inline status messages showing download progress and file sizes
- Add inline URL input field when URL is not available
- Show "Open URL" link when backend doesn't support downloads
- Better error handling and status feedback

The extension now:
1. Extracts existing URLs from the dialog HTML
2. Uses inline input fields instead of browser prompts
3. Shows real-time download progress with file sizes
4. Provides better visual feedback with status messages

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Remove /api prefix from model download endpoints
- ComfyUI serves these endpoints at /models/download not /api/models/download
- This fixes the 405 Method Not Allowed error

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Added data-download-button attribute to track existing buttons
- Check for existing buttons before adding new ones
- Prevents duplicate buttons from appearing in the UI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Removed 'Download from provided URL' tooltip
- Simplified button title to only show 'Click to enter URL' when needed
- Cleaner UI without redundant text

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Oct 5, 2025
Copy link

github-actions bot commented Oct 5, 2025

🎭 Playwright Test Results

loading Tests are starting...

⏰ Started at: 10/05/2025, 08:43:53 PM UTC

🚀 Running Tests

  • 🧪 chromium: Running tests...
  • 🧪 chromium-0.5x: Running tests...
  • 🧪 chromium-2x: Running tests...
  • 🧪 mobile-chrome: Running tests...

⏱️ Please wait while tests are running...

Copy link

github-actions bot commented Oct 5, 2025

🎨 Storybook Build Status

loading Build is starting...

⏰ Started at: 10/05/2025, 08:43:55 PM UTC

🚀 Building Storybook

  • 📦 Installing dependencies...
  • 🔧 Building Storybook components...
  • 🌐 Preparing deployment to Cloudflare Pages...

⏱️ Please wait while the Storybook build is in progress...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant