[GH-ISSUE #895] How to Launch Comfy UI Desktop with Specific GPU (e.g., GPU 1)? #245

Closed
opened 2026-10-31 22:10:31 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @Lionnn107 on GitHub (Feb 13, 2025).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/895

Could you please tell me how to launch Comfy UI Desktop with GPU 1? In the portable version, I did it like this: "set CUDA_VISIBLE_DEVICES=1", but I've been trying to figure it out on the desktop version for two days now, and none of the solutions I found online worked for me.

┆Issue is synchronized with this Notion page by Unito

Originally created by @Lionnn107 on GitHub (Feb 13, 2025). Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/895 Could you please tell me how to launch Comfy UI Desktop with GPU 1? In the portable version, I did it like this: "set CUDA_VISIBLE_DEVICES=1", but I've been trying to figure it out on the desktop version for two days now, and none of the solutions I found online worked for me. ┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-895-How-to-Launch-Comfy-UI-Desktop-with-Specific-GPU-e-g-GPU-1-1996d73d36508141b887f5153c9629d5) by [Unito](https://www.unito.io)
bsakaguchi 2026-10-31 22:10:31 +00:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@dosubot[bot] commented on GitHub (Feb 13, 2025):

Hey @Lionnn107! 👋 I'm here to help you with any bugs, questions, or contributions you have. If you need assistance, feel free to ask!

The ComfyUI Desktop application does not have explicit documentation or command-line arguments for setting a specific GPU directly. However, you can try setting the CUDA_VISIBLE_DEVICES environment variable before launching the application, similar to what you did with the portable version. This environment variable is a standard way to specify which GPU to use in CUDA applications.

Here's how you can do it:

  1. Open a terminal or command prompt.
  2. Set the environment variable: set CUDA_VISIBLE_DEVICES=1 (on Windows) or export CUDA_VISIBLE_DEVICES=1 (on Linux/Mac).
  3. Launch the ComfyUI Desktop application from the same terminal or command prompt.

This method should help the application recognize and use the specified GPU. If this doesn't work, it might be due to how the desktop application is packaged or executed, which could ignore the environment variable settings.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other | Bug Report

<!-- gh-comment-id:2656503005 --> @dosubot[bot] commented on GitHub (Feb 13, 2025): <!-- Greeting --> Hey @Lionnn107! 👋 I'm here to help you with any bugs, questions, or contributions you have. If you need assistance, feel free to ask! <!-- Answer --> The ComfyUI Desktop application does not have explicit documentation or command-line arguments for setting a specific GPU directly. However, you can try setting the `CUDA_VISIBLE_DEVICES` environment variable before launching the application, similar to what you did with the portable version. This environment variable is a standard way to specify which GPU to use in CUDA applications. Here's how you can do it: 1. Open a terminal or command prompt. 2. Set the environment variable: `set CUDA_VISIBLE_DEVICES=1` (on Windows) or `export CUDA_VISIBLE_DEVICES=1` (on Linux/Mac). 3. Launch the ComfyUI Desktop application from the same terminal or command prompt. This method should help the application recognize and use the specified GPU. If this doesn't work, it might be due to how the desktop application is packaged or executed, which could ignore the environment variable settings. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/af3b4903-c79f-4c69-bf2f-65048f71f8d1?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/af3b4903-c79f-4c69-bf2f-65048f71f8d1?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/af3b4903-c79f-4c69-bf2f-65048f71f8d1?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/af3b4903-c79f-4c69-bf2f-65048f71f8d1?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/af3b4903-c79f-4c69-bf2f-65048f71f8d1?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/af3b4903-c79f-4c69-bf2f-65048f71f8d1?feedback_type=other) | [Bug Report](https://app.dosu.dev/response-feedback/af3b4903-c79f-4c69-bf2f-65048f71f8d1?feedback_type=bug_report)</sup>
Author
Owner

@Lionnn107 commented on GitHub (Feb 13, 2025):

Hey @Lionnn107! 👋 I'm here to help you with any bugs, questions, or contributions you have. If you need assistance, feel free to ask!

The ComfyUI Desktop application does not have explicit documentation or command-line arguments for setting a specific GPU directly. However, you can try setting the CUDA_VISIBLE_DEVICES environment variable before launching the application, similar to what you did with the portable version. This environment variable is a standard way to specify which GPU to use in CUDA applications.

Here's how you can do it:

  1. Open a terminal or command prompt.
  2. Set the environment variable: set CUDA_VISIBLE_DEVICES=1 (on Windows) or export CUDA_VISIBLE_DEVICES=1 (on Linux/Mac).
  3. Launch the ComfyUI Desktop application from the same terminal or command prompt.

This method should help the application recognize and use the specified GPU. If this doesn't work, it might be due to how the desktop application is packaged or executed, which could ignore the environment variable settings.

Thank you, this helped me a lot.

<!-- gh-comment-id:2657145465 --> @Lionnn107 commented on GitHub (Feb 13, 2025): > Hey [@Lionnn107](https://github.com/Lionnn107)! 👋 I'm here to help you with any bugs, questions, or contributions you have. If you need assistance, feel free to ask! > > The ComfyUI Desktop application does not have explicit documentation or command-line arguments for setting a specific GPU directly. However, you can try setting the `CUDA_VISIBLE_DEVICES` environment variable before launching the application, similar to what you did with the portable version. This environment variable is a standard way to specify which GPU to use in CUDA applications. > > Here's how you can do it: > > 1. Open a terminal or command prompt. > 2. Set the environment variable: `set CUDA_VISIBLE_DEVICES=1` (on Windows) or `export CUDA_VISIBLE_DEVICES=1` (on Linux/Mac). > 3. Launch the ComfyUI Desktop application from the same terminal or command prompt. > > This method should help the application recognize and use the specified GPU. If this doesn't work, it might be due to how the desktop application is packaged or executed, which could ignore the environment variable settings. > Thank you, this helped me a lot.
Author
Owner

@dosubot[bot] commented on GitHub (May 15, 2025):

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

Issue Summary:

  • You sought help on launching Comfy UI Desktop using a specific GPU (GPU 1).
  • The method "set CUDA_VISIBLE_DEVICES=1" worked for the portable version but not for the desktop version.
  • I suggested setting the CUDA_VISIBLE_DEVICES environment variable before launching the application.
  • You confirmed that this solution was helpful.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the desktop repository by commenting here.
  • If there is no further activity, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:2884343659 --> @dosubot[bot] commented on GitHub (May 15, 2025): Hi, @Lionnn107. I'm [Dosu](https://dosu.dev), and I'm helping the desktop team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You sought help on launching Comfy UI Desktop using a specific GPU (GPU 1). - The method "set CUDA_VISIBLE_DEVICES=1" worked for the portable version but not for the desktop version. - I suggested setting the `CUDA_VISIBLE_DEVICES` environment variable before launching the application. - You confirmed that this solution was helpful. **Next Steps:** - Please let us know if this issue is still relevant to the latest version of the desktop repository by commenting here. - If there is no further activity, this issue will be automatically closed in 7 days. Thank you 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#245
No description provided.