mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-25 13:50:15 +08:00
fix history
This commit is contained in:
parent
625134b6a1
commit
497c01fed1
@ -5,6 +5,7 @@ import copy
|
|||||||
import datetime
|
import datetime
|
||||||
import heapq
|
import heapq
|
||||||
import threading
|
import threading
|
||||||
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
import typing
|
import typing
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
@ -46,7 +47,7 @@ def get_good_outputs(t: QueueTuple):
|
|||||||
class HistoryEntry(typing.TypedDict):
|
class HistoryEntry(typing.TypedDict):
|
||||||
prompt: QueueTuple
|
prompt: QueueTuple
|
||||||
outputs: dict
|
outputs: dict
|
||||||
timestamp: float
|
timestamp: int
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -780,7 +781,7 @@ class PromptQueue:
|
|||||||
with self.mutex:
|
with self.mutex:
|
||||||
queue_item = self.currently_running.pop(item_id)
|
queue_item = self.currently_running.pop(item_id)
|
||||||
prompt = queue_item.queue_tuple
|
prompt = queue_item.queue_tuple
|
||||||
self.history[prompt[1]] = {"prompt": prompt, "outputs": {}, "timestamp": datetime.datetime.timestamp()}
|
self.history[prompt[1]] = {"prompt": prompt, "outputs": {}, "timestamp": time.time()}
|
||||||
for o in outputs:
|
for o in outputs:
|
||||||
self.history[prompt[1]]["outputs"][o] = outputs[o]
|
self.history[prompt[1]]["outputs"][o] = outputs[o]
|
||||||
self.server.queue_updated()
|
self.server.queue_updated()
|
||||||
|
|||||||
@ -726,11 +726,14 @@ class PromptServer():
|
|||||||
site = web.TCPSite(runner, address, port)
|
site = web.TCPSite(runner, address, port)
|
||||||
await site.start()
|
await site.start()
|
||||||
|
|
||||||
if address == '':
|
address_to_print = 'localhost'
|
||||||
|
if address == '' or address == '0.0.0.0':
|
||||||
address = '0.0.0.0'
|
address = '0.0.0.0'
|
||||||
|
else:
|
||||||
|
address_to_print = address
|
||||||
if verbose:
|
if verbose:
|
||||||
print("Starting server\n")
|
print("Starting server\n")
|
||||||
print("To see the GUI go to: http://{}:{}".format(address, port))
|
print("To see the GUI go to: http://{}:{}".format(address_to_print, port))
|
||||||
if call_on_start is not None:
|
if call_on_start is not None:
|
||||||
call_on_start(address, port)
|
call_on_start(address, port)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user