Skip to content

Commit 190c1c7

Browse files
committed
Add Z Image tests
1 parent f6cdf46 commit 190c1c7

File tree

2 files changed

+770
-0
lines changed

2 files changed

+770
-0
lines changed

MyApp.Tests/ComfyWorkflowParseTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,5 +301,19 @@ public void Can_parse_4xUpscaler()
301301
Assert.That(workflow.CustomNodes, Is.EquivalentTo(new[] { "ssitu/ComfyUI_UltimateSDUpscale" }));
302302
Assert.That(workflow.PipPackages, Is.EquivalentTo(new[] { "servicestack" }));
303303
}
304+
305+
[Test]
306+
public void Can_parse_z_image_turbo_Workflow()
307+
{
308+
var workflowPath = "./workflows/text-to-image/z_image_turbo.json";
309+
var workflowJson = File.ReadAllText(workflowPath);
310+
var workflowObj = workflowJson.ParseAsObjectDictionary();
311+
var workflow = ComfyWorkflowParser.Parse(workflowObj, "z_image_turbo.json", NodeDefs) ?? throw new Exception($"Could not parse {workflowPath}");
312+
workflow.PrintDump();
313+
ComfyWorkflowParser.ExtractAssetPaths(workflowObj).PrintDump();
314+
var inputNames = workflow.Inputs.Map(x => x.Name);
315+
Assert.That(workflow.Type, Is.EqualTo(ComfyWorkflowType.TextToImage));
316+
Assert.That(inputNames,Is.EquivalentTo("positivePrompt,width,height,batch_size,seed,steps,cfg,sampler_name,scheduler,denoise".Split(',')));
317+
}
304318

305319
}

0 commit comments

Comments
 (0)