main
黄海 1 year ago
parent 3e225f7444
commit b652fbadb3

@ -0,0 +1,82 @@
{
"last_node_id": 2,
"last_link_id": 1,
"nodes": [
{
"id": 2,
"type": "PreviewImage",
"pos": [
205.499643768773,
298.78351573772534
],
"size": [
210,
246
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 1,
"label": "images"
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 1,
"type": "EmptyImage",
"pos": [
-171,
256
],
"size": {
"0": 315,
"1": 130
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
1
],
"shape": 3,
"label": "IMAGE",
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyImage"
},
"widgets_values": [
1,
1,
1,
0
]
}
],
"links": [
[
1,
1,
0,
2,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 KiB

@ -0,0 +1,50 @@
# system_stats
import json
import urllib.parse
import urllib.request
import urllib.parse
import urllib.request
from Util import ConfigUtil
from Util.ComfyUIUtil import *
from Util.CommonUtil import *
def queue_prompt(server_address, client_id, prompt):
p = {"prompt": prompt, "client_id": client_id}
data = json.dumps(p).encode('utf-8')
req = urllib.request.Request("http://{}/prompt".format(server_address), data=data)
try:
urllib.request.urlopen(req)
except Exception as err:
print(err)
return json.loads(urllib.request.urlopen(req).read())
# GET /system_stats
# 系统统计信息接口
# 打开配置文件
config = ConfigUtil.getConfig()
server_address = config.get('comfyui', 'server_address')
req = urllib.request.Request("http://{}/system_stats".format(server_address))
res = json.loads(urllib.request.urlopen(req).read())
vram_total = res['devices'][0]['vram_total']
vram_free = res['devices'][0]['vram_free']
used_vram = 1.0 * (vram_total - vram_free) / vram_total * 100
print(str(used_vram) + "%")
# vram_total # 显存容量25756696576 即24GB
# vram_free # 显存剩余25756696576
# torch_vram_total 16005464064
# torch_vram_free 331041996
# 打开文件并读取内容
file_path = r'../JSON/clearGPU.json'
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
# 如何清空Comfyui的gpu缓存
# https://wailikeji.blog.csdn.net/article/details/140035515
#queue_prompt(server_address, "cleanGpuRam", content)
Loading…
Cancel
Save