Skip to content

Commit

Permalink
Merge pull request #100 from crystian/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
crystian authored Aug 1, 2024
2 parents ee96d07 + 54fb818 commit f1e7897
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@author: Crystian
@title: Crystools
@nickname: Crystools
@version: 1.16.4
@version: 1.16.5
@project: "https://github.com/crystian/ComfyUI-Crystools",
@description: Plugins for multiples uses, mainly for debugging, you need them! IG: https://www.instagram.com/crystian.ia
"""
Expand Down
2 changes: 1 addition & 1 deletion core/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.16.4"
version = "1.16.5"
42 changes: 35 additions & 7 deletions general/hardware.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import platform
import re
import cpuinfo
from cpuinfo import DataSource
import psutil
from .gpu import CGPUInfo
from .hdd import getDrivesInfo
Expand Down Expand Up @@ -36,21 +38,47 @@ def __init__(self, switchCPU=False, switchGPU=False, switchHDD=False, switchRAM=
self.switchHDD = switchHDD
self.switchRAM = switchRAM

get_cpu_info = cpuinfo.get_cpu_info()
specName = 'CPU: ' + get_cpu_info.get('brand_raw', "Unknown")
specArch = 'Arch: ' + get_cpu_info.get('arch_string_raw', "Unknown")
specOs = 'OS: ' + str(platform.system()) + ' ' + str(platform.release())
logger.info(f"{specName} - {specArch} - {specOs}")
self.print_sys_info()

self.GPUInfo = CGPUInfo()
self.switchGPU = switchGPU
self.switchVRAM = switchVRAM

def print_sys_info(self):
brand = None
if DataSource.is_windows: # Windows
brand = DataSource.winreg_processor_brand().strip()
elif DataSource.has_proc_cpuinfo(): # Linux
return_code, output = DataSource.cat_proc_cpuinfo()
if return_code == 0 and output is not None:
for line in output.splitlines():
r = re.search(r'model name\s*:\s*(.+)', line)
if r:
brand = r.group(1)
break
elif DataSource.has_sysctl(): # macOS
return_code, output = DataSource.sysctl_machdep_cpu_hw_cpufrequency()
if return_code == 0 and output is not None:
for line in output.splitlines():
r = re.search(r'machdep\.cpu\.brand_string\s*:\s*(.+)', line)
if r:
brand = r.group(1)
break

# fallback to use cpuinfo.get_cpu_info()
if not brand:
brand = cpuinfo.get_cpu_info().get('brand_raw', "Unknown")

specName = 'CPU: ' + brand
specArch = 'Arch: ' + DataSource.arch_string_raw
specOs = 'OS: ' + str(platform.system()) + ' ' + str(platform.release())
logger.info(f"{specName} - {specArch} - {specOs}")

def getHDDsInfo(self):
return getDrivesInfo()
return getDrivesInfo()

def getGPUInfo(self):
return self.GPUInfo.getInfo()
return self.GPUInfo.getInfo()

def getStatus(self):
cpu = -1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui-crystools"
description = "With this suit, you can see the resources monitor, progress bar & time elapsed, metadata and compare between two images, compare between two JSONs, show any value to console/display, pipes, and more!\nThis provides better nodes to load/save images, previews, etc, and see \"hidden\" data without loading a new workflow."
version = "1.16.4"
version = "1.16.5"
license = { file = "LICENSE" }
dependencies = ["deepdiff", "torch", "numpy", "Pillow", "pynvml", "py-cpuinfo"]

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.4
1.16.5

0 comments on commit f1e7897

Please sign in to comment.