7
7
8
8
from pytest import fixture
9
9
from comfy_execution .graph_utils import GraphBuilder
10
- from tests .inference .test_execution import ComfyClient
10
+ from tests .inference .test_execution import ComfyClient , run_warmup
11
11
12
12
13
13
@pytest .mark .execution
@@ -24,6 +24,7 @@ def _server(self, args_pytest, request):
24
24
'--listen' , args_pytest ["listen" ],
25
25
'--port' , str (args_pytest ["port" ]),
26
26
'--extra-model-paths-config' , 'tests/inference/extra_model_paths.yaml' ,
27
+ '--cpu' ,
27
28
]
28
29
use_lru , lru_size = request .param
29
30
if use_lru :
@@ -82,6 +83,9 @@ def test_basic_async_execution(self, client: ComfyClient, builder: GraphBuilder)
82
83
83
84
def test_multiple_async_parallel_execution (self , client : ComfyClient , builder : GraphBuilder ):
84
85
"""Test that multiple async nodes execute in parallel."""
86
+ # Warmup execution to ensure server is fully initialized
87
+ run_warmup (client )
88
+
85
89
g = builder
86
90
image = g .node ("StubImage" , content = "BLACK" , height = 512 , width = 512 , batch_size = 1 )
87
91
@@ -148,6 +152,9 @@ def test_async_validate_inputs(self, client: ComfyClient, builder: GraphBuilder)
148
152
149
153
def test_async_lazy_evaluation (self , client : ComfyClient , builder : GraphBuilder ):
150
154
"""Test async nodes with lazy evaluation."""
155
+ # Warmup execution to ensure server is fully initialized
156
+ run_warmup (client , prefix = "warmup_lazy" )
157
+
151
158
g = builder
152
159
input1 = g .node ("StubImage" , content = "BLACK" , height = 512 , width = 512 , batch_size = 1 )
153
160
input2 = g .node ("StubImage" , content = "WHITE" , height = 512 , width = 512 , batch_size = 1 )
@@ -305,6 +312,9 @@ def test_async_with_execution_blocker(self, client: ComfyClient, builder: GraphB
305
312
306
313
def test_async_caching_behavior (self , client : ComfyClient , builder : GraphBuilder ):
307
314
"""Test that async nodes are properly cached."""
315
+ # Warmup execution to ensure server is fully initialized
316
+ run_warmup (client , prefix = "warmup_cache" )
317
+
308
318
g = builder
309
319
image = g .node ("StubImage" , content = "BLACK" , height = 512 , width = 512 , batch_size = 1 )
310
320
sleep_node = g .node ("TestSleep" , value = image .out (0 ), seconds = 0.2 )
@@ -324,6 +334,9 @@ def test_async_caching_behavior(self, client: ComfyClient, builder: GraphBuilder
324
334
325
335
def test_async_with_dynamic_prompts (self , client : ComfyClient , builder : GraphBuilder ):
326
336
"""Test async nodes within dynamically generated prompts."""
337
+ # Warmup execution to ensure server is fully initialized
338
+ run_warmup (client , prefix = "warmup_dynamic" )
339
+
327
340
g = builder
328
341
image1 = g .node ("StubImage" , content = "BLACK" , height = 512 , width = 512 , batch_size = 1 )
329
342
image2 = g .node ("StubImage" , content = "WHITE" , height = 512 , width = 512 , batch_size = 1 )
0 commit comments