Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Major: API Refactor #107

Merged
merged 13 commits into from
Jan 30, 2024
Merged

Major: API Refactor #107

merged 13 commits into from
Jan 30, 2024

Conversation

saddam213
Copy link
Member

@saddam213 saddam213 commented Jan 28, 2024

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 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

  • Remove ModelService
  • Remove ModelSet
  • Refactor ModelConfig Json
  • Extend pipeline classes to manage model lifetimes
  • Remove dependency injection from Diffusers
  • Diffusers style API
  • Code Examples
  • UI Integration
  • Documentation

@saddam213 saddam213 marked this pull request as ready for review January 30, 2024 05:43
@saddam213 saddam213 merged commit aa87704 into master Jan 30, 2024
@saddam213 saddam213 deleted the API branch January 30, 2024 05:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant