1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Enable --cuda-malloc by default on torch 2.0 and up.

Add --disable-cuda-malloc to disable it.
This commit is contained in:
comfyanonymous
2023-07-17 14:40:29 -04:00
parent 55d0fca9fa
commit 9871a15cf9
2 changed files with 21 additions and 3 deletions

View File

@@ -40,7 +40,10 @@ parser.add_argument("--extra-model-paths-config", type=str, default=None, metava
parser.add_argument("--output-directory", type=str, default=None, help="Set the ComfyUI output directory.")
parser.add_argument("--auto-launch", action="store_true", help="Automatically launch ComfyUI in the default browser.")
parser.add_argument("--cuda-device", type=int, default=None, metavar="DEVICE_ID", help="Set the id of the cuda device this instance will use.")
parser.add_argument("--cuda-malloc", action="store_true", help="Enable cudaMallocAsync.")
cm_group = parser.add_mutually_exclusive_group()
cm_group.add_argument("--cuda-malloc", action="store_true", help="Enable cudaMallocAsync (enabled by default for torch 2.0 and up).")
cm_group.add_argument("--disable-cuda-malloc", action="store_true", help="Enable cudaMallocAsync.")
parser.add_argument("--dont-upcast-attention", action="store_true", help="Disable upcasting of attention. Can boost speed but increase the chances of black images.")
fp_group = parser.add_mutually_exclusive_group()
@@ -85,4 +88,3 @@ args = parser.parse_args()
if args.windows_standalone_build:
args.auto_launch = True
args.cuda_malloc = True #work around memory issue in nvidia drivers > 531