Skip to content

feat: add extension registry for dynamic extension loading#233

Open
levi wants to merge 1 commit intoostris:mainfrom
levi:extension-registry
Open

feat: add extension registry for dynamic extension loading#233
levi wants to merge 1 commit intoostris:mainfrom
levi:extension-registry

Conversation

@levi
Copy link

@levi levi commented Dec 10, 2024

I wanted to be able to create custom extensions and load them without having to store them inside the cloned repo directory. This adds two entry points for this -- loading an extension class and loading a process which creates an anonymous extension class to reduce boilerplate.

This PR is more of a suggestion to get feedback. I can add examples, fix formatting, etc. if this is something you want to add to the toolkit.

@levi
Copy link
Author

levi commented Dec 10, 2024

Main feedback in using this so far is that it's a pain trying to extend any existing built in extension without completely copying it to my working directory or modifying ai-toolkit to be an importable python package. The former defeats the initial use case for me (extend SDTrainer to have custom save hook behavior) and the latter is a significant change to the project.

@jaretburkett thoughts on making ai-toolkit importable? Something I've always wanted with the original kohya (my internal implementation is a package). ai-toolkit seems in a perfect spot for it to be both extensible like ComfyUI does with its local directories and as an extensible python package used in a larger training system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant