pydn / ComfyUI-to-Python-Extension

A powerful tool that translates ComfyUI workflows into executable Python code.
MIT License
842 stars 87 forks source link

How to specify the gpu index to run #36

Closed jarheadjoe closed 5 months ago

jarheadjoe commented 5 months ago

import os os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_index)

torch.cuda.set_device(gpu_index)