Now that most of the large parts are in place its time to tidy up and refactor the API, the biggest change is the removal of the ModelService and the ModelSet, when i first started these made sense as I thought all models would share the same lifetime, however it seems this is not the case, there are many advantages to sharing models across pipelines, caching etc
The Pipeline classes have been extended and act as the old ModelSet, Dependency injection has been removed from the Pipeline class downwards allowing for easier use when not using DI
Diffusers Style API
With the new changes we can now make a Diffusers like API, I will start this in the PR but will complete over the new few versions
var pipeline = StableDiffusionPipeline.CreatePipeline("D:\\Repositories\\stable-diffusion-v1-5");
var promptOptions = new PromptOptions { Prompt = "Photo of a cute dog." };
var result = await pipeline.RunAsync(promptOptions);
var image = result.ToImage();
await image.SaveAsPngAsync("D:\\Results\\Image.png");
Task List
[x] Remove ModelService
[x] Remove ModelSet
[x] Refactor ModelConfig Json
[x] Extend pipeline classes to manage model lifetimes
Breaking Changes
Now that most of the large parts are in place its time to tidy up and refactor the API, the biggest change is the removal of the
ModelService
and theModelSet
, when i first started these made sense as I thought all models would share the same lifetime, however it seems this is not the case, there are many advantages to sharing models across pipelines, caching etcThe
Pipeline
classes have been extended and act as the oldModelSet
, Dependency injection has been removed from the Pipeline class downwards allowing for easier use when not using DIDiffusers Style API
With the new changes we can now make a Diffusers like API, I will start this in the PR but will complete over the new few versions
Task List