[GH-ISSUE #1196] Add Hugging Face Endpoint Configuration Support #335

Closed
opened 2026-10-31 22:11:43 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @christian-byrne on GitHub (Jun 16, 2025).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1196

Add Hugging Face Endpoint Configuration Support

Summary

Add UI-based configuration support for Hugging Face endpoints (HF_ENDPOINT) to enable users to easily configure mirror endpoints like hf-mirror.com, following the existing mirror configuration patterns already established in the codebase.

Problem

Users cannot reliably configure Hugging Face endpoints on Windows Desktop version (see #832). While the app inherits system environment variables, Windows desktop apps launched via shortcuts/Start Menu don't always inherit environment variables set after launch, making the current approach unreliable.

Proposed Solution

Implement HF_ENDPOINT configuration using the exact same pattern already established for other mirrors in the codebase:

Current Mirror System Pattern

The app already has a well-established 3-layer mirror configuration system:

  1. Settings Layer: Comfy-Desktop.UV.PythonInstallMirror, Comfy-Desktop.UV.PypiInstallMirror, Comfy-Desktop.UV.TorchInstallMirror
  2. Interface Layer: InstallOptions interface with pythonMirror, pypiMirror, torchMirror
  3. Implementation Layer: Environment variable passing in VirtualEnvironment.runCommand()

Implementation Plan

Follow the same pattern for HF_ENDPOINT:

  1. Add to comfySettings.ts:

    'Comfy-Desktop.HuggingFace.Endpoint': '',
    
  2. Add to InstallOptions interface (preload.ts):

    huggingFaceEndpoint?: string; // HF_ENDPOINT for mirrors
    
  3. Update VirtualEnvironment to pass HF_ENDPOINT to Python processes:

    ...(this.huggingFaceEndpoint ? { HF_ENDPOINT: this.huggingFaceEndpoint } : {}),
    

Benefits

  • Consistency: Uses established patterns already in the codebase
  • Reliability: Bypasses Windows environment variable inheritance issues
  • User Experience: Provides UI-based configuration like other mirrors
  • Maintenance: Leverages existing infrastructure

References

  • Related issue: #832 (HF_ENDPOINT environment variable not working on Windows)
  • Existing mirror configurations in: src/config/comfySettings.ts:13-15
  • Mirror interface patterns in: src/preload.ts:30-33
  • Environment variable handling in: src/virtualEnvironment.ts:119

Acceptance Criteria

  • Add HF_ENDPOINT setting to ComfySettings with appropriate default
  • Add huggingFaceEndpoint option to InstallOptions interface
  • Update VirtualEnvironment to pass HF_ENDPOINT to ComfyUI Python process
  • Add UI controls for HF endpoint configuration (following existing mirror UI patterns)
  • Test with common HF mirrors (e.g., https://hf-mirror.com/)
  • Ensure setting persists across app restarts
  • Verify ComfyUI receives and uses the HF_ENDPOINT variable
  • Verification Video: Record a video demonstrating:
    1. Fresh installation of ComfyUI Desktop
    2. Configure HF mirror endpoint in the UI (e.g., https://hf-mirror.com/)
    3. Install and use a custom node that utilizes diffusers/transformers libraries (forcing HF model download)
    4. Show in console/logs that the configured mirror endpoint is actually being used for downloads
    5. Confirm successful model download and node functionality

┆Issue is synchronized with this Notion page by Unito

Originally created by @christian-byrne on GitHub (Jun 16, 2025). Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1196 # Add Hugging Face Endpoint Configuration Support ## Summary Add UI-based configuration support for Hugging Face endpoints (HF_ENDPOINT) to enable users to easily configure mirror endpoints like `hf-mirror.com`, following the existing mirror configuration patterns already established in the codebase. ## Problem Users cannot reliably configure Hugging Face endpoints on Windows Desktop version (see #832). While the app inherits system environment variables, Windows desktop apps launched via shortcuts/Start Menu don't always inherit environment variables set after launch, making the current approach unreliable. ## Proposed Solution Implement HF_ENDPOINT configuration using the **exact same pattern** already established for other mirrors in the codebase: ### Current Mirror System Pattern The app already has a well-established 3-layer mirror configuration system: 1. **Settings Layer**: `Comfy-Desktop.UV.PythonInstallMirror`, `Comfy-Desktop.UV.PypiInstallMirror`, `Comfy-Desktop.UV.TorchInstallMirror` 2. **Interface Layer**: `InstallOptions` interface with `pythonMirror`, `pypiMirror`, `torchMirror` 3. **Implementation Layer**: Environment variable passing in `VirtualEnvironment.runCommand()` ### Implementation Plan Follow the same pattern for HF_ENDPOINT: 1. **Add to comfySettings.ts**: ```typescript 'Comfy-Desktop.HuggingFace.Endpoint': '', ``` 2. **Add to InstallOptions interface** (preload.ts): ```typescript huggingFaceEndpoint?: string; // HF_ENDPOINT for mirrors ``` 3. **Update VirtualEnvironment** to pass HF_ENDPOINT to Python processes: ```typescript ...(this.huggingFaceEndpoint ? { HF_ENDPOINT: this.huggingFaceEndpoint } : {}), ``` ## Benefits - **Consistency**: Uses established patterns already in the codebase - **Reliability**: Bypasses Windows environment variable inheritance issues - **User Experience**: Provides UI-based configuration like other mirrors - **Maintenance**: Leverages existing infrastructure ## References - Related issue: #832 (HF_ENDPOINT environment variable not working on Windows) - Existing mirror configurations in: `src/config/comfySettings.ts:13-15` - Mirror interface patterns in: `src/preload.ts:30-33` - Environment variable handling in: `src/virtualEnvironment.ts:119` ## Acceptance Criteria - [ ] Add HF_ENDPOINT setting to ComfySettings with appropriate default - [ ] Add huggingFaceEndpoint option to InstallOptions interface - [ ] Update VirtualEnvironment to pass HF_ENDPOINT to ComfyUI Python process - [ ] Add UI controls for HF endpoint configuration (following existing mirror UI patterns) - [ ] Test with common HF mirrors (e.g., `https://hf-mirror.com/`) - [ ] Ensure setting persists across app restarts - [ ] Verify ComfyUI receives and uses the HF_ENDPOINT variable - [ ] **Verification Video**: Record a video demonstrating: 1. Fresh installation of ComfyUI Desktop 2. Configure HF mirror endpoint in the UI (e.g., `https://hf-mirror.com/`) 3. Install and use a custom node that utilizes diffusers/transformers libraries (forcing HF model download) 4. Show in console/logs that the configured mirror endpoint is actually being used for downloads 5. Confirm successful model download and node functionality ┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-1196-Add-Hugging-Face-Endpoint-Configuration-Support-2146d73d365081e18f89ceb13bdc4ea9) by [Unito](https://www.unito.io)
bsakaguchi 2026-10-31 22:11:43 +00:00
Author
Owner

@BenraouaneSoufiane commented on GitHub (Jun 17, 2025):

Hello, I suggest resolve it for $1k, the payout is it bank transfer or crypto? can I work on this?

<!-- gh-comment-id:2979832986 --> @BenraouaneSoufiane commented on GitHub (Jun 17, 2025): Hello, I suggest resolve it for $1k, the payout is it bank transfer or crypto? can I work on this?
Author
Owner

@dosubot[bot] commented on GitHub (Sep 17, 2025):

Hi, @christian-byrne. I'm Dosu, and I'm helping the desktop team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You proposed adding UI-based configuration for Hugging Face endpoints to improve reliability on Windows Desktop.
  • The goal is to align this with existing mirror configuration patterns and enhance environment variable handling.
  • This would improve the user experience for setting endpoint configurations.
  • A community member expressed interest in working on this and asked about the $1k bounty payout.
  • The issue remains unresolved with no recent updates.

Next Steps:

  • Please let me know if this issue is still relevant to the latest version of the desktop app by commenting here.
  • If I don’t hear back within 7 days, the issue will be automatically closed.

Thanks for your understanding and contribution!

<!-- gh-comment-id:3303659396 --> @dosubot[bot] commented on GitHub (Sep 17, 2025): Hi, @christian-byrne. I'm [Dosu](https://dosu.dev), and I'm helping the desktop team manage their backlog and am marking this issue as stale. **Issue Summary:** - You proposed adding UI-based configuration for Hugging Face endpoints to improve reliability on Windows Desktop. - The goal is to align this with existing mirror configuration patterns and enhance environment variable handling. - This would improve the user experience for setting endpoint configurations. - A community member expressed interest in working on this and asked about the $1k bounty payout. - The issue remains unresolved with no recent updates. **Next Steps:** - Please let me know if this issue is still relevant to the latest version of the desktop app by commenting here. - If I don’t hear back within 7 days, the issue will be automatically closed. Thanks for your understanding and contribution!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/desktop#335
No description provided.