mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-13 23:12:35 +08:00
Clean up comments
This commit is contained in:
parent
633243c983
commit
4c27d4ec6f
@ -20,7 +20,7 @@ import urllib.parse
|
|||||||
from comfy.samplers import KSampler
|
from comfy.samplers import KSampler
|
||||||
|
|
||||||
"""
|
"""
|
||||||
These tests are to generate and save images through a range of parameters
|
These tests generate and save images through a range of parameters
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class ComfyGraph:
|
class ComfyGraph:
|
||||||
@ -52,6 +52,8 @@ class ComfyGraph:
|
|||||||
|
|
||||||
|
|
||||||
class ComfyClient:
|
class ComfyClient:
|
||||||
|
# From examples/websockets_api_example.py
|
||||||
|
|
||||||
def connect(self,
|
def connect(self,
|
||||||
listen:str = '127.0.0.1',
|
listen:str = '127.0.0.1',
|
||||||
port:Union[str,int] = 8188,
|
port:Union[str,int] = 8188,
|
||||||
@ -63,7 +65,6 @@ class ComfyClient:
|
|||||||
ws.connect("ws://{}/ws?clientId={}".format(self.server_address, self.client_id))
|
ws.connect("ws://{}/ws?clientId={}".format(self.server_address, self.client_id))
|
||||||
self.ws = ws
|
self.ws = ws
|
||||||
|
|
||||||
# From examples/websockets_api_example.py
|
|
||||||
def queue_prompt(self, prompt):
|
def queue_prompt(self, prompt):
|
||||||
p = {"prompt": prompt, "client_id": self.client_id}
|
p = {"prompt": prompt, "client_id": self.client_id}
|
||||||
data = json.dumps(p).encode('utf-8')
|
data = json.dumps(p).encode('utf-8')
|
||||||
@ -137,7 +138,9 @@ scheduler_list = KSampler.SCHEDULERS
|
|||||||
@pytest.mark.parametrize("scheduler", scheduler_list)
|
@pytest.mark.parametrize("scheduler", scheduler_list)
|
||||||
@pytest.mark.parametrize("prompt", prompt_list)
|
@pytest.mark.parametrize("prompt", prompt_list)
|
||||||
class TestInference:
|
class TestInference:
|
||||||
# Initialize server
|
#
|
||||||
|
# Initialize server and client
|
||||||
|
#
|
||||||
@fixture(scope="class", autouse=True)
|
@fixture(scope="class", autouse=True)
|
||||||
def _server(self, args_pytest):
|
def _server(self, args_pytest):
|
||||||
# Start server
|
# Start server
|
||||||
@ -167,6 +170,9 @@ class TestInference:
|
|||||||
break
|
break
|
||||||
return comfy_client
|
return comfy_client
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client and graph fixtures with server warmup
|
||||||
|
#
|
||||||
# Returns a "_client_graph", which is client-graph pair corresponding to an initialized server
|
# Returns a "_client_graph", which is client-graph pair corresponding to an initialized server
|
||||||
# The "graph" is the default graph
|
# The "graph" is the default graph
|
||||||
@fixture(scope="class", params=comfy_graph_list, autouse=True)
|
@fixture(scope="class", params=comfy_graph_list, autouse=True)
|
||||||
@ -189,9 +195,9 @@ class TestInference:
|
|||||||
client = _client_graph[0]
|
client = _client_graph[0]
|
||||||
yield client
|
yield client
|
||||||
|
|
||||||
# function-scoped fixture for graph to avoid mutating the graph
|
|
||||||
@fixture
|
@fixture
|
||||||
def comfy_graph(self, _client_graph):
|
def comfy_graph(self, _client_graph):
|
||||||
|
# avoid mutating the graph
|
||||||
graph = deepcopy(_client_graph[1])
|
graph = deepcopy(_client_graph[1])
|
||||||
yield graph
|
yield graph
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user