@@ -32,7 +32,7 @@ public ControlNetFeatureExample(StableDiffusionConfig configuration)
3232 public async Task RunAsync ( )
3333 {
3434 // Load Control Image
35- var inputImage = await InputImage . FromFileAsync ( "D:\\ Repositories\\ OnnxStack\\ Assets\\ Samples\\ Img2Img_Start.bmp" ) ;
35+ var inputImage = await OnnxImage . FromFileAsync ( "D:\\ Repositories\\ OnnxStack\\ Assets\\ Samples\\ Img2Img_Start.bmp" ) ;
3636
3737 // Create Annotation pipeline
3838 var annotationPipeline = FeatureExtractorPipeline . CreatePipeline ( "D:\\ Repositories\\ controlnet_onnx\\ annotators\\ depth.onnx" , true ) ;
@@ -41,7 +41,7 @@ public async Task RunAsync()
4141 var controlImage = await annotationPipeline . RunAsync ( inputImage ) ;
4242
4343 // Save Depth Image (Debug Only)
44- await controlImage . Image . SaveAsPngAsync ( Path . Combine ( _outputDirectory , $ "Depth.png") ) ;
44+ await controlImage . SaveAsync ( Path . Combine ( _outputDirectory , $ "Depth.png") ) ;
4545
4646 // Create ControlNet
4747 var controlNet = ControlNetModel . Create ( "D:\\ Repositories\\ controlnet_onnx\\ controlnet\\ depth.onnx" ) ;
@@ -61,11 +61,11 @@ public async Task RunAsync()
6161 var result = await pipeline . RunAsync ( promptOptions , controlNet : controlNet , progressCallback : OutputHelpers . ProgressCallback ) ;
6262
6363 // Create Image from Tensor result
64- var image = result . ToImage ( ) ;
64+ var image = new OnnxImage ( result ) ;
6565
6666 // Save Image File
6767 var outputFilename = Path . Combine ( _outputDirectory , $ "Output.png") ;
68- await image . SaveAsPngAsync ( outputFilename ) ;
68+ await image . SaveAsync ( outputFilename ) ;
6969
7070 //Unload
7171 await annotationPipeline . UnloadAsync ( ) ;
0 commit comments