You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the main.py is possible to set the maximum cores and threads used by this application? something like the lines below but with parameters to pass the numbers desired.
if name == "main":
#NOTE: These do not do anything on core ComfyUI, they are for custom nodes.
os.environ['HF_HUB_DISABLE_TELEMETRY'] = '1'
os.environ['DO_NOT_TRACK'] = '1'
# Get the number of available cores and threads
# by default set the 2/3 of cores available and 1/2 of threads by core
import multiprocessing
num_cores = multiprocessing.cpu_count()
num_threads_per_core = int(os.environ.get("OMP_NUM_THREADS", 1))
# Set the number of threads and cores to be used
var_num_cores = max(1, int(num_cores * 2 / 3))
var_num_threads = max(1, int(num_threads_per_core / 2))
os.environ["MKL_NUM_THREADS"] = str(var_num_cores)
os.environ["OMP_NUM_THREADS"] = str(var_num_threads)
print(f"Cores set to: {os.environ['MKL_NUM_THREADS']}")
print(f"Threads set to: {os.environ['OMP_NUM_THREADS']}")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In the main.py is possible to set the maximum cores and threads used by this application? something like the lines below but with parameters to pass the numbers desired.
if name == "main":
#NOTE: These do not do anything on core ComfyUI, they are for custom nodes.
os.environ['HF_HUB_DISABLE_TELEMETRY'] = '1'
os.environ['DO_NOT_TRACK'] = '1'
Beta Was this translation helpful? Give feedback.
All reactions